From 36cc7d91f10e6892db02568335abf469bc62309c Mon Sep 17 00:00:00 2001 From: MarekSpodBiedry <73122968+MarekSpodBiedry@users.noreply.github.com> Date: Sat, 17 Oct 2026 07:46:15 +0200 Subject: [PATCH 001/451] Keep Essential Graphics instance keyframes in the comp so valueAtTime and numKeys see them (#1682) --- crates/engine/src/tests_essential_more.rs | 55 ++++++++++++++++++++++- crates/project/src/essential.rs | 10 +++-- crates/render/src/lib.rs | 9 +++- 3 files changed, 69 insertions(+), 5 deletions(-) diff --git a/crates/engine/src/tests_essential_more.rs b/crates/engine/src/tests_essential_more.rs index a8d8dc808..22b03e8e4 100644 --- a/crates/engine/src/tests_essential_more.rs +++ b/crates/engine/src/tests_essential_more.rs @@ -64,7 +64,7 @@ fn font_and_scale_controls_override_per_instance() { let mut v = vec![]; g.walk("", &mut |_, p| { if let Some(c) = essential::control_of(&p.match_id) { - v.push(essential::Override { control: c, value: p.value.clone() }); + v.push(essential::Override { control: c, value: p.value.clone(), keys: vec![] }); } }); v @@ -102,3 +102,56 @@ fn open_in_essential_graphics_sets_the_primary_comp() { ); assert_eq!(s.execute("essential.list", json!({})).unwrap()["name"], "A"); } + +#[test] +fn instance_keyframes_reach_the_comp_so_expressions_can_look_ahead() { + let mut s = Session::default(); + s.execute("comp.new", json!({"name": "Inner", "width": 32, "height": 32, "frameRate": 30, "duration": 2})).unwrap(); + let inner = s.active_comp_id().unwrap(); + let text = s.execute("layer.newText", json!({"text": "Hi"})).unwrap()["layer"].as_u64().unwrap(); + let ctl = s.execute("essential.addProperty", json!({"layer": text, "path": "transform/opacity"})).unwrap()["controls"][0].as_u64().unwrap(); + let keys = vec![ + effectcraft_keyframe::Keyframe::new(effectcraft_time::Tick::ZERO, KV::Scalar(0.0)), + effectcraft_keyframe::Keyframe::new(effectcraft_time::Tick::from_seconds_f64(1.0), KV::Scalar(100.0)), + ]; + let over = [essential::Override { control: ctl, value: KV::Scalar(25.0), keys: keys.clone() }]; + let p = essential::with_overrides(&s.project, inner, &over).unwrap(); + let pr = p.comp(inner).unwrap().layer(effectcraft_project::LayerId(text)).unwrap().props.prop("transform/opacity").unwrap(); + assert_eq!(pr.keys, keys); + assert_eq!(pr.value, KV::Scalar(25.0)); +} + +#[test] +fn keys_set_on_an_instance_are_passed_to_the_nested_comp_render() { + use effectcraft_project::LayerId; + use effectcraft_time::Tick; + let mut s = Session::default(); + s.execute("comp.new", json!({"name": "Inner", "width": 32, "height": 32, "frameRate": 30, "duration": 2})).unwrap(); + let inner = s.active_comp_id().unwrap(); + let solid = s.execute("layer.newSolid", json!({"name": "BG", "color": "#ffffff"})).unwrap()["layer"].as_u64().unwrap(); + s.execute("essential.addProperty", json!({"layer": solid, "path": "transform/opacity"})).unwrap(); + s.execute("comp.new", json!({"name": "Scene", "width": 32, "height": 32, "frameRate": 30, "duration": 2})).unwrap(); + let scene = s.active_comp_id().unwrap(); + let inst = s.execute("layer.addItem", json!({"item": inner.0, "time": 0.0})).unwrap()["layer"].as_u64().unwrap(); + let path = s.execute("essential.instance", json!({"layer": inst})).unwrap()["controls"][0]["path"].as_str().unwrap().to_string(); + s.execute("prop.addKey", json!({"layer": inst, "path": path, "time": 0.0, "value": 0.0})).unwrap(); + s.execute("prop.addKey", json!({"layer": inst, "path": path, "time": 1.0, "value": 100.0})).unwrap(); + // At 0.25 s the nested comp's opacity carries the instance's keys, so it reads the instance's + // value half a second ahead too (valueAtTime), not only the current one. + let nested_opacity = |s: &Session| { + let comp = s.project.comp(scene).unwrap(); + let layer = comp.layer(LayerId(inst)).unwrap(); + let ctx = effectcraft_render::EvalCtx::new(&s.project, scene, comp, Tick::from_seconds_f64(0.25)); + let over = effectcraft_render::essential_overrides(&ctx, layer); + let p = essential::with_overrides(&s.project, inner, &over).unwrap(); + p.comp(inner).unwrap().layer(LayerId(solid)).unwrap().props.prop("transform/opacity").unwrap().clone() + }; + let pr = nested_opacity(&s); + let ahead = s.project.comp(scene).unwrap().layer(LayerId(inst)).unwrap().props.prop(&path).unwrap().value_at(Tick::from_seconds_f64(0.75)); + assert_eq!(pr.keys.len(), 2); + assert_eq!(pr.value_at(Tick::from_seconds_f64(0.75)), ahead); + assert_ne!(pr.value_at(Tick::from_seconds_f64(0.75)), pr.value_at(Tick::from_seconds_f64(0.25))); + // With Time Remap the instance's layer time is not the nested comp's time: only the value. + s.execute("layer.enableTimeRemap", json!({"layers": [inst]})).unwrap(); + assert!(nested_opacity(&s).keys.is_empty()); +} diff --git a/crates/project/src/essential.rs b/crates/project/src/essential.rs index 3d851f902..5cc21de31 100644 --- a/crates/project/src/essential.rs +++ b/crates/project/src/essential.rs @@ -15,7 +15,7 @@ use serde::{Deserialize, Serialize}; use crate::props::{GroupKind, Node, ParamUi, PropGroup, Property, Uid}; -use crate::{ItemId, ItemKind, Layer, LayerId, LayerSource, Project, Value}; +use crate::{ItemId, ItemKind, Keyframe, Layer, LayerId, LayerSource, Project, Value}; /// Match id of the Essential Properties group on precomp layers. pub const GROUP: &str = "essential"; @@ -652,10 +652,14 @@ pub fn sync_project(before: &Project, after: &mut Project) { pub struct Override { pub control: u64, pub value: Value, + /// The instance property's keyframes, already in the nested comp's time. Empty when the + /// property is not keyed (or its keys can't be mapped); expressions in the comp then see + /// only `value`. + pub keys: Vec, } /// The project as an instance of `comp` renders it: each overridden control's source property -/// set to the instance value (keyframes dropped; its expression, if any, still applies) and +/// set to the instance value and keyframes (its expression, if any, still applies) and /// replaced media swapped in. `None` when nothing applies. pub fn with_overrides(project: &Project, comp: ItemId, overrides: &[Override]) -> Option { let eg = project.comp(comp)?.essential.clone()?; @@ -683,7 +687,7 @@ pub fn with_overrides(project: &Project, comp: ItemId, overrides: &[Override]) - EgKind::Property { .. } => { for (layer, prop) in ctl.kind.targets() { if let Some(pr) = c.layer_mut(layer).and_then(|l| l.props.find_mut(prop)) { - pr.keys.clear(); + pr.keys = o.keys.clone(); pr.value = o.value.clone(); any = true; } diff --git a/crates/render/src/lib.rs b/crates/render/src/lib.rs index cfefd02db..b94cdac2f 100644 --- a/crates/render/src/lib.rs +++ b/crates/render/src/lib.rs @@ -369,12 +369,19 @@ pub fn essential_overrides(ctx: &EvalCtx, layer: &Layer) -> Vec 1e-9 + && matches!(layer.source, LayerSource::Comp { item } if ctx.project.comp(item).is_some_and(|nc| !eval::protected_regions(nc).is_empty())); + let same_time = layer.props.get("timeRemap").is_none() && !responsive; let mut out = vec![]; g.walk("", &mut |_, p| { if over.contains(&p.uid) && let Some(control) = essential::control_of(&p.match_id) { - out.push(essential::Override { control, value: ctx.value(layer, p) }); + // An expression on the instance property replaces its keys. + let keys = if same_time && !p.has_expression() { p.keys.clone() } else { vec![] }; + out.push(essential::Override { control, value: ctx.value(layer, p), keys }); } }); out From c6e91da8bbfd9e5862c00616108aee0e0b6ef7f5 Mon Sep 17 00:00:00 2001 From: MarekSpodBiedry <73122968+MarekSpodBiedry@users.noreply.github.com> Date: Sun, 18 Oct 2026 18:39:52 +0200 Subject: [PATCH 002/451] Map Essential Graphics instance keys into each target layer's time (#1682) --- crates/engine/src/tests_essential_more.rs | 100 ++++++++++++++++++++++ crates/project/src/essential.rs | 37 ++++++-- 2 files changed, 132 insertions(+), 5 deletions(-) diff --git a/crates/engine/src/tests_essential_more.rs b/crates/engine/src/tests_essential_more.rs index 22b03e8e4..32f8ac4a6 100644 --- a/crates/engine/src/tests_essential_more.rs +++ b/crates/engine/src/tests_essential_more.rs @@ -155,3 +155,103 @@ fn keys_set_on_an_instance_are_passed_to_the_nested_comp_render() { s.execute("layer.enableTimeRemap", json!({"layers": [inst]})).unwrap(); assert!(nested_opacity(&s).keys.is_empty()); } + +/// Inner comp with two opacity-exposed solids (the second linked to the first's control), an +/// instance of it in Scene keyed 0 -> 100 over 0..1 s. `timing` sets each solid's start (s) and +/// stretch (%). Returns the pieces the checks below need. +fn keyed_instance(timing: [(f64, f64); 2]) -> (Session, effectcraft_project::ItemId, effectcraft_project::ItemId, [u64; 2], u64) { + use effectcraft_project::LayerId; + use effectcraft_time::Tick; + let mut s = Session::default(); + s.execute("comp.new", json!({"name": "Inner", "width": 32, "height": 32, "frameRate": 30, "duration": 4})).unwrap(); + let inner = s.active_comp_id().unwrap(); + let a = s.execute("layer.newSolid", json!({"name": "A", "color": "#ffffff"})).unwrap()["layer"].as_u64().unwrap(); + let ctl = s.execute("essential.addProperty", json!({"layer": a, "path": "transform/opacity"})).unwrap()["controls"][0].as_u64().unwrap(); + let b = s.execute("layer.newSolid", json!({"name": "B", "color": "#ffffff"})).unwrap()["layer"].as_u64().unwrap(); + s.execute("essential.linkProperty", json!({"control": ctl, "layer": b, "path": "transform/opacity"})).unwrap(); + for (id, (start, stretch)) in [a, b].into_iter().zip(timing) { + let l = std::sync::Arc::make_mut(&mut s.project).comp_mut(inner).unwrap().layer_mut(LayerId(id)).unwrap(); + l.start_time = Tick::from_seconds_f64(start); + l.stretch = stretch; + } + s.execute("comp.new", json!({"name": "Scene", "width": 32, "height": 32, "frameRate": 30, "duration": 4})).unwrap(); + let scene = s.active_comp_id().unwrap(); + let inst = s.execute("layer.addItem", json!({"item": inner.0, "time": 0.0})).unwrap()["layer"].as_u64().unwrap(); + let path = s.execute("essential.instance", json!({"layer": inst})).unwrap()["controls"][0]["path"].as_str().unwrap().to_string(); + s.execute("prop.addKey", json!({"layer": inst, "path": path, "time": 0.0, "value": 0.0})).unwrap(); + s.execute("prop.addKey", json!({"layer": inst, "path": path, "time": 1.0, "value": 100.0})).unwrap(); + (s, scene, inner, [a, b], inst) +} + +/// Opacity of `solid` inside Inner as the instance renders it at nested time `t`, and the +/// overridden property itself (its keys are what `numKeys` / `valueAtTime` read). +fn rendered( + s: &Session, + scene: effectcraft_project::ItemId, + inner: effectcraft_project::ItemId, + inst: u64, + solid: u64, + t: f64, +) -> (f64, effectcraft_project::Property) { + use effectcraft_project::LayerId; + use effectcraft_time::Tick; + let comp = s.project.comp(scene).unwrap(); + let layer = comp.layer(LayerId(inst)).unwrap(); + let ctx = effectcraft_render::EvalCtx::new(&s.project, scene, comp, Tick::from_seconds_f64(t)); + let over = effectcraft_render::essential_overrides(&ctx, layer); + let p = essential::with_overrides(&s.project, inner, &over).unwrap(); + let ic = p.comp(inner).unwrap(); + let il = ic.layer(LayerId(solid)).unwrap(); + let pr = il.props.prop("transform/opacity").unwrap().clone(); + let ictx = effectcraft_render::EvalCtx::new(&p, inner, ic, Tick::from_seconds_f64(t)); + (ictx.value(il, &pr).as_f64(), pr) +} + +#[test] +fn instance_keys_follow_a_nested_layer_that_starts_late() { + use effectcraft_time::Tick; + let (s, scene, inner, [a, _], inst) = keyed_instance([(0.5, 100.0), (0.0, 100.0)]); + // The instance reads 75 at 0.75 s; the layer starting at 0.5 s must too, not 25. + let (v, pr) = rendered(&s, scene, inner, inst, a, 0.75); + assert!((v - 75.0).abs() < 1e-6, "rendered {v}"); + assert_eq!(pr.keys.len(), 2); + // Layer time: the 0 s and 1 s keys sit at -0.5 s and 0.5 s. + assert_eq!(pr.keys[0].time, Tick::from_seconds_f64(-0.5)); + assert_eq!(pr.keys[1].time, Tick::from_seconds_f64(0.5)); + // What valueAtTime reads: layer time 0.5 s is the end key, -0.5 s the start key. + assert_eq!(pr.value_at(Tick::from_seconds_f64(0.5)), KV::Scalar(100.0)); + assert_eq!(pr.value_at(Tick::from_seconds_f64(-0.5)), KV::Scalar(0.0)); +} + +#[test] +fn instance_keys_follow_a_stretched_nested_layer() { + use effectcraft_time::Tick; + let (s, scene, inner, [a, _], inst) = keyed_instance([(0.0, 200.0), (0.0, 100.0)]); + // Stretched to 200 %: nested time 0.5 s is layer time 0.25 s. + let (v, pr) = rendered(&s, scene, inner, inst, a, 0.5); + assert!((v - 50.0).abs() < 1e-6, "rendered {v}"); + assert_eq!(pr.keys.len(), 2); + assert_eq!(pr.keys[1].time, Tick::from_seconds_f64(0.5)); + assert_eq!(pr.value_at(Tick::from_seconds_f64(0.5)), KV::Scalar(100.0)); + // Offset and stretch together: starts at 0.25 s, 50 %: nested 0.5 s is layer time 0.5 s. + let (s, scene, inner, [a, _], inst) = keyed_instance([(0.25, 50.0), (0.0, 100.0)]); + let (v, pr) = rendered(&s, scene, inner, inst, a, 0.5); + assert!((v - 50.0).abs() < 1e-6, "rendered {v}"); + assert_eq!(pr.keys[0].time, Tick::from_seconds_f64(-0.5)); + assert_eq!(pr.keys[1].time, Tick::from_seconds_f64(1.5)); +} + +#[test] +fn one_control_with_targets_of_different_timing_stays_in_step() { + let (s, scene, inner, [a, b], inst) = keyed_instance([(0.5, 100.0), (0.0, 200.0)]); + for t in [0.2, 0.6, 0.75, 0.9] { + let (va, pa) = rendered(&s, scene, inner, inst, a, t); + let (vb, pb) = rendered(&s, scene, inner, inst, b, t); + let want = t * 100.0; + assert!((va - want).abs() < 1e-6, "A at {t}: {va}"); + assert!((vb - want).abs() < 1e-6, "B at {t}: {vb}"); + // Each target carries the keys in its own time. + assert_ne!(pa.keys[0].time, pb.keys[0].time); + assert_ne!(pa.keys[1].time, pb.keys[1].time); + } +} diff --git a/crates/project/src/essential.rs b/crates/project/src/essential.rs index 5cc21de31..021c1a8fc 100644 --- a/crates/project/src/essential.rs +++ b/crates/project/src/essential.rs @@ -16,6 +16,7 @@ use serde::{Deserialize, Serialize}; use crate::props::{GroupKind, Node, ParamUi, PropGroup, Property, Uid}; use crate::{ItemId, ItemKind, Keyframe, Layer, LayerId, LayerSource, Project, Value}; +use effectcraft_time::Tick; /// Match id of the Essential Properties group on precomp layers. pub const GROUP: &str = "essential"; @@ -647,14 +648,35 @@ pub fn sync_project(before: &Project, after: &mut Project) { after.next_id = after.next_id.max(next); } +/// Keys given in comp time, in the time of a layer that starts at `start` and is stretched to +/// `stretch` percent. Empty when the stretch is not a usable factor. +fn keys_in_layer_time(keys: &[Keyframe], start: Tick, stretch: f64) -> Vec { + if stretch.is_finite() && stretch > 0.0 { keys.iter().map(|k| key_in_layer_time(k, start, stretch)).collect() } else { vec![] } +} + +/// A key given in comp time, moved into the layer time of a layer that starts at `start` and is +/// stretched to `stretch` percent (the inverse of `Layer::comp_time`). Ease speeds are per +/// second, so they scale with the time axis; influences are fractions of the segment and stay. +fn key_in_layer_time(k: &Keyframe, start: Tick, stretch: f64) -> Keyframe { + let d = k.time - start; + let mut k = k.clone(); + k.time = if (stretch - 100.0).abs() < 1e-9 { d } else { Tick((d.0 as f64 * 100.0 / stretch) as i64) }; + if (stretch - 100.0).abs() >= 1e-9 { + for e in k.in_ease.iter_mut().chain(k.out_ease.iter_mut()) { + e.speed *= stretch / 100.0; + } + } + k +} + /// One instance override: the control and the value it takes in this instance. #[derive(Clone, Debug, PartialEq)] pub struct Override { pub control: u64, pub value: Value, - /// The instance property's keyframes, already in the nested comp's time. Empty when the - /// property is not keyed (or its keys can't be mapped); expressions in the comp then see - /// only `value`. + /// The instance property's keyframes, in the nested comp's time (`with_overrides` moves them + /// into each target layer's time). Empty when the property is not keyed (or its keys can't + /// be mapped); expressions in the comp then see only `value`. pub keys: Vec, } @@ -686,8 +708,13 @@ pub fn with_overrides(project: &Project, comp: ItemId, overrides: &[Override]) - } EgKind::Property { .. } => { for (layer, prop) in ctl.kind.targets() { - if let Some(pr) = c.layer_mut(layer).and_then(|l| l.props.find_mut(prop)) { - pr.keys = o.keys.clone(); + if let Some(l) = c.layer_mut(layer) { + let (start, stretch) = (l.start_time, l.stretch); + let Some(pr) = l.props.find_mut(prop) else { continue }; + // The keys are in nested comp time; the property reads them in this + // layer's own time (start offset, stretch). Without a usable mapping + // only the value is set. + pr.keys = keys_in_layer_time(&o.keys, start, stretch); pr.value = o.value.clone(); any = true; } From 102dd8be6c77a28848010e9adefd13ea537e9fa2 Mon Sep 17 00:00:00 2001 From: MarekSpodBiedry <73122968+MarekSpodBiedry@users.noreply.github.com> Date: Sun, 18 Oct 2026 18:42:21 +0200 Subject: [PATCH 003/451] Give the multi-target Essential Graphics test distinct key times; group the Tick import --- crates/engine/src/tests_essential_more.rs | 2 +- crates/project/src/essential.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/engine/src/tests_essential_more.rs b/crates/engine/src/tests_essential_more.rs index 32f8ac4a6..720c87e91 100644 --- a/crates/engine/src/tests_essential_more.rs +++ b/crates/engine/src/tests_essential_more.rs @@ -243,7 +243,7 @@ fn instance_keys_follow_a_stretched_nested_layer() { #[test] fn one_control_with_targets_of_different_timing_stays_in_step() { - let (s, scene, inner, [a, b], inst) = keyed_instance([(0.5, 100.0), (0.0, 200.0)]); + let (s, scene, inner, [a, b], inst) = keyed_instance([(0.5, 100.0), (0.25, 200.0)]); for t in [0.2, 0.6, 0.75, 0.9] { let (va, pa) = rendered(&s, scene, inner, inst, a, t); let (vb, pb) = rendered(&s, scene, inner, inst, b, t); diff --git a/crates/project/src/essential.rs b/crates/project/src/essential.rs index 021c1a8fc..cc3b12209 100644 --- a/crates/project/src/essential.rs +++ b/crates/project/src/essential.rs @@ -12,11 +12,11 @@ //! [`sync_project`] keeps the groups in step with the controls (and refreshes the values of //! controls that are not overridden), [`with_overrides`] builds the project an instance renders. +use effectcraft_time::Tick; use serde::{Deserialize, Serialize}; use crate::props::{GroupKind, Node, ParamUi, PropGroup, Property, Uid}; use crate::{ItemId, ItemKind, Keyframe, Layer, LayerId, LayerSource, Project, Value}; -use effectcraft_time::Tick; /// Match id of the Essential Properties group on precomp layers. pub const GROUP: &str = "essential"; From 7c5b0da99b0ea6c3a3202925d22061ea1bdea997 Mon Sep 17 00:00:00 2001 From: arnav-hiwarkar Date: Wed, 21 Oct 2026 21:37:31 +0530 Subject: [PATCH 004/451] Close, New and Open Project free the closed project's memory `Session::replace_project` (`crates/engine/src/lib.rs`), shared by Close, New, Open and the demo project: - forgets the decoded frames and decoders of the closed project's footage, as well as the new project's (the existing #1070 behaviour); - emits `Event::PurgeCaches` after the swap, so the viewers drop the RAM preview of the closed project. Its comp ids can also collide with the new project's. Cache budgets and LRU order are unchanged; only the release path changes. --- crates/engine/src/lib.rs | 10 +++-- crates/engine/src/tests_menu_cmds.rs | 58 ++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 3 deletions(-) diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index cdfc7468e..4d8706bff 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -1160,9 +1160,10 @@ impl Session { self.script_ui.project_epoch = self.script_ui.project_epoch.wrapping_add(1); p.fix_next_id(); upgrade_effects(&mut p); - // The media layer keys decoded frames by path: files of the new project may have changed - // since an earlier project decoded them (#1070). - for it in p.items.values() { + // Let go of what the closed project decoded (frames, decoders, models), and of what the + // new project's files decoded under an earlier project: the media layer keys them by + // path, and the files may have changed since (#1070). + for it in self.project.items.values().chain(p.items.values()) { if let effectcraft_project::ItemKind::Footage(f) = &it.kind { self.forget_decoded(f); } @@ -1174,6 +1175,9 @@ impl Session { self.path = path; self.bump(); self.mark_saved(); + // The viewers' RAM preview shows the closed project's frames, whose comp ids can collide + // with the new project's. + self.events.push(Event::PurgeCaches); let first = self.project.comps().next().map(|(id, _)| *id); if let Some(c) = first { self.open_comp(c); diff --git a/crates/engine/src/tests_menu_cmds.rs b/crates/engine/src/tests_menu_cmds.rs index 6da07dd40..83f3b609c 100644 --- a/crates/engine/src/tests_menu_cmds.rs +++ b/crates/engine/src/tests_menu_cmds.rs @@ -1767,3 +1767,61 @@ fn old_guides_load_as_pixel_guides_and_percent_round_trips() { // A zero-sized comp never divides by zero. assert!(g.px(0, 0).is_finite()); } + +#[test] +fn replacing_project_releases_old_footage() { + // A footage source that records the paths it is told to forget. + struct Recording(std::sync::Mutex>); + impl crate::render::FootageSource for Recording { + fn frame( + &self, + _: effectcraft_project::ItemId, + _: &effectcraft_project::Footage, + _: effectcraft_time::Tick, + ) -> Option> { + None + } + fn forget(&self, path: &str) { + self.0.lock().unwrap().push(path.to_string()); + } + } + let mut s = comp(); + let src = std::sync::Arc::new(Recording(Default::default())); + s.footage = src.clone(); + let recorded = || src.0.lock().unwrap().clone(); + let with_old = |s: &Session| { + let mut p = (*s.project).clone(); + p.add_item("old", Default::default(), None, ItemKind::Footage(effectcraft_project::Footage { path: "/old.mp4".into(), ..Default::default() })); + p + }; + let old = with_old(&s); + s.replace_project(old, None); + s.drain_events(); + src.0.lock().unwrap().clear(); + + // Close Project lets go of the closed project's footage and clears the RAM preview. + s.execute("file.closeProject", json!({})).unwrap(); + assert!(recorded().contains(&"/old.mp4".to_string()), "{:?}", recorded()); + assert!(s.drain_events().contains(&Event::PurgeCaches)); + + // Opening a project forgets the old project's files and the new project's. + let old = with_old(&s); + s.replace_project(old, None); + s.drain_events(); + src.0.lock().unwrap().clear(); + let mut new = effectcraft_project::Project::default(); + new.add_item("new", Default::default(), None, ItemKind::Footage(effectcraft_project::Footage { path: "/new.mp4".into(), ..Default::default() })); + s.replace_project(new, None); + let paths = recorded(); + assert!(paths.contains(&"/old.mp4".to_string()) && paths.contains(&"/new.mp4".to_string()), "{paths:?}"); + assert!(s.drain_events().contains(&Event::PurgeCaches)); + + // New Project does the same. + let old = with_old(&s); + s.replace_project(old, None); + s.drain_events(); + src.0.lock().unwrap().clear(); + s.execute("file.newProject", json!({})).unwrap(); + assert!(recorded().contains(&"/old.mp4".to_string()), "{:?}", recorded()); + assert!(s.drain_events().contains(&Event::PurgeCaches)); +} From 1dcb8273a45ac0bd9a4a3d05f78f53522e00d585 Mon Sep 17 00:00:00 2001 From: arnav-hiwarkar Date: Wed, 21 Oct 2026 21:47:06 +0530 Subject: [PATCH 005/451] Fast Previews: Adaptive Resolution applies while dragging in the Timeline `timeline::show` keeps a per-frame `dragging` flag. While the primary button is down, it sets the existing `property_interacting` for: - dragging the playhead or the timecode; - moving layer bars, or their in and out points; - dragging keys, and the key alt-scale. A click without movement doesn't set it. The existing clear at the start of each frame handles the release, so the first frame after it is sharp. With Fast Previews off (the default) or a fixed resolution, nothing changes. 9 lines of production code. --- crates/ui-egui/src/panels/timeline.rs | 9 +- crates/ui-egui/src/state.rs | 1 + .../ui-egui/tests/ui_timeline_interacting.rs | 115 ++++++++++++++++++ 3 files changed, 124 insertions(+), 1 deletion(-) create mode 100644 crates/ui-egui/tests/ui_timeline_interacting.rs diff --git a/crates/ui-egui/src/panels/timeline.rs b/crates/ui-egui/src/panels/timeline.rs index b34fbd9d3..1d9703ddb 100644 --- a/crates/ui-egui/src/panels/timeline.rs +++ b/crates/ui-egui/src/panels/timeline.rs @@ -1468,6 +1468,7 @@ pub fn show(app: &mut EffectcraftApp, ui: &mut egui::Ui, rect: Rect) { p.line_segment([pos2(graph_x0 - 1.0, top), pos2(graph_x0 - 1.0, rect.max.y)], Stroke::new(1.0, t.app_bg)); let mut actions: Vec<(String, serde_json::Value)> = Vec::new(); + let mut dragging = false; // A drag that moves the frame on screen (Fast Previews). if !ui.input(|i| i.pointer.primary_down()) { ctx.data_mut(|d| d.remove::(switch_drag_id())); } @@ -1495,6 +1496,7 @@ pub fn show(app: &mut EffectcraftApp, ui: &mut egui::Ui, rect: Rect) { app.auto.add("timeline.timecode", tc_rect, &tc); super::toggle_time_display(app, &tc_resp); if tc_resp.dragged() { + dragging = true; let d = tc_resp.drag_delta().x as f64; let f = fr.frame_at(time) + (d * 0.5).round() as i64; let _ = app.session.execute("time.set", json!({"frame": f.max(0)})); @@ -1730,6 +1732,7 @@ pub fn show(app: &mut EffectcraftApp, ui: &mut egui::Ui, rect: Rect) { if ((rresp.is_pointer_button_down_on() && ui.input(|i| i.pointer.primary_down())) || rresp.clicked()) && let Some(pt) = rresp.interact_pointer_pos() { + dragging |= rresp.dragged(); let mut x = pt.x; // Zoomed in, a scrub held past either end of the ruler scrolls the timeline that way // (faster the further), with the CTI at the edge (After Effects). @@ -2360,6 +2363,7 @@ pub fn show(app: &mut EffectcraftApp, ui: &mut egui::Ui, rect: Rect) { continue; } if resp.dragged() { + dragging = true; let acc_id = egui::Id::new(("bar-acc", layer.id.0, kind)); let mut acc: f32 = ctx.data(|d| d.get_temp(acc_id).unwrap_or(0.0)); acc += resp.drag_delta().x; @@ -3149,6 +3153,7 @@ pub fn show(app: &mut EffectcraftApp, ui: &mut egui::Ui, rect: Rect) { let (down, ptr) = ctx.input(|i| (i.pointer.primary_down(), i.pointer.latest_pos())); match ptr.filter(|_| down) { Some(ptr) => { + dragging = true; let frames = (((ptr.x - q.origin_x) as f64 / pps) / fd).round() as i64; if frames != q.applied { q.applied = frames; @@ -3171,6 +3176,7 @@ pub fn show(app: &mut EffectcraftApp, ui: &mut egui::Ui, rect: Rect) { let (down, ptr, shift) = ctx.input(|i| (i.pointer.primary_down(), i.pointer.latest_pos(), i.modifiers.shift)); match ptr.filter(|_| down) { Some(ptr) => { + dragging = true; let mut target = kd.anchor + (ptr.x - kd.origin_x) as f64 / pps; if shift { // The current time and whatever it snaps to (keys, layer ends, markers), but @@ -3474,7 +3480,8 @@ pub fn show(app: &mut EffectcraftApp, ui: &mut egui::Ui, rect: Rect) { } } } - if ui.input(|i| i.pointer.primary_down()) && actions.iter().any(|(id, _)| id == "prop.set") { + dragging |= super::graph_tools::alt_scale_active(&ctx); + if ui.input(|i| i.pointer.primary_down()) && (dragging || actions.iter().any(|(id, _)| id == "prop.set")) { app.ui.viewer.property_interacting = true; ctx.request_repaint(); } diff --git a/crates/ui-egui/src/state.rs b/crates/ui-egui/src/state.rs index 1e2f57204..206c70cf3 100644 --- a/crates/ui-egui/src/state.rs +++ b/crates/ui-egui/src/state.rs @@ -264,6 +264,7 @@ pub struct ViewerState { /// The pointer is dragging in the viewer this frame (Adaptive Resolution). #[serde(skip)] pub interacting: bool, + /// A property scrub (Effect Controls, Timeline) or a Timeline drag of the playhead, keys or layer bars is in progress (Adaptive Resolution); cleared once the primary button is up. #[serde(skip)] pub property_interacting: bool, /// Extended Viewer: the comp-space region the viewer renders this frame (comp frame plus diff --git a/crates/ui-egui/tests/ui_timeline_interacting.rs b/crates/ui-egui/tests/ui_timeline_interacting.rs new file mode 100644 index 000000000..29f86b6ff --- /dev/null +++ b/crates/ui-egui/tests/ui_timeline_interacting.rs @@ -0,0 +1,115 @@ +use effectcraft_engine::Session; +use effectcraft_engine::project::LayerId; +use effectcraft_ui_egui::EffectcraftApp; +use egui::{Event, Pos2, pos2, vec2}; +use egui_kittest::Harness; +use serde_json::json; + +fn harness() -> (Harness<'static, EffectcraftApp>, LayerId, u64) { + let mut session = Session::default(); + session.execute("comp.new", json!({"name": "Keys", "width": 320, "height": 180, "frameRate": 30, "duration": 4})).unwrap(); + session.execute("layer.newSolid", json!({"name": "Box", "color": "#e04020", "width": 80, "height": 80})).unwrap(); + let id = session.active_comp().unwrap().layers[0].id; + for (time, value) in [(0.0, 0.0), (1.0, 100.0)] { + session.execute("prop.addKey", json!({"layer": id.0, "path": "transform/opacity", "time": time, "value": value})).unwrap(); + } + let uid = session.active_comp().unwrap().layer(id).unwrap().props.prop("transform/opacity").unwrap().uid; + session.execute("layer.select", json!({"layers": [id.0]})).unwrap(); + session.execute("view.fastPreviewMode", json!({"mode": "adaptive"})).unwrap(); + let mut harness = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(session)); + harness.run_steps(3); + let context = harness.ctx.clone(); + effectcraft_ui_egui::menus::invoke(harness.state_mut(), &context, "timeline.reveal.opacity", json!({})).unwrap(); + harness.run_steps(4); + (harness, id, uid) +} + +fn rect(harness: &Harness<'_, EffectcraftApp>, id: &str) -> egui::Rect { + let entry = harness.state().auto.find(id).expect("timeline element"); + egui::Rect::from_min_size(pos2(entry.rect[0], entry.rect[1]), vec2(entry.rect[2], entry.rect[3])) +} + +fn keys(harness: &Harness<'_, EffectcraftApp>, uid: u64) -> Vec { + let mut positions: Vec = harness + .state() + .auto + .query(&format!("timeline.key.{uid}.")) + .iter() + .map(|entry| pos2(entry.rect[0] + entry.rect[2] / 2.0, entry.rect[1] + entry.rect[3] / 2.0)) + .collect(); + positions.sort_by(|left, right| left.x.total_cmp(&right.x)); + positions +} + +fn hold(harness: &mut Harness<'_, EffectcraftApp>, from: Pos2, to: Pos2) { + harness.input_mut().events.push(Event::PointerMoved(from)); + harness.step(); + harness.input_mut().events.push(Event::PointerButton { pos: from, button: egui::PointerButton::Primary, pressed: true, modifiers: Default::default() }); + harness.step(); + for step in 1..=10 { + harness.input_mut().events.push(Event::PointerMoved(from + (to - from) * (step as f32 / 10.0))); + harness.step(); + } +} + +fn release(harness: &mut Harness<'_, EffectcraftApp>, at: Pos2) { + harness.input_mut().events.push(Event::PointerButton { pos: at, button: egui::PointerButton::Primary, pressed: false, modifiers: Default::default() }); + harness.run_steps(2); +} + +fn assert_adaptive_during_drag(harness: &Harness<'_, EffectcraftApp>) { + assert!(harness.state().ui.viewer.property_interacting); + assert!(harness.state().viewer_scale(1.0, 1.0) < 1.0); +} + +fn assert_full_resolution_after_release(harness: &Harness<'_, EffectcraftApp>) { + assert!(!harness.state().ui.viewer.property_interacting); + assert_eq!(harness.state().viewer_scale(1.0, 1.0), 1.0); +} + +#[test] +fn playhead_drag_uses_adaptive_resolution() { + let (mut harness, _, _) = harness(); + let ruler = rect(&harness, "timeline.ruler"); + let from = pos2(ruler.min.x + 40.0, ruler.max.y - 3.0); + let to = from + vec2(200.0, 0.0); + hold(&mut harness, from, to); + assert_adaptive_during_drag(&harness); + release(&mut harness, to); + assert_full_resolution_after_release(&harness); +} + +#[test] +fn layer_bar_drag_uses_adaptive_resolution() { + let (mut harness, layer, _) = harness(); + let from = rect(&harness, &format!("timeline.layer.{}.bar", layer.0)).center(); + let to = from + vec2(60.0, 0.0); + hold(&mut harness, from, to); + assert_adaptive_during_drag(&harness); + release(&mut harness, to); + assert_full_resolution_after_release(&harness); +} + +#[test] +fn key_drag_uses_adaptive_resolution() { + let (mut harness, _, uid) = harness(); + let from = keys(&harness, uid)[0]; + let to = from + vec2(60.0, 0.0); + hold(&mut harness, from, to); + assert_adaptive_during_drag(&harness); + release(&mut harness, to); + assert_full_resolution_after_release(&harness); +} + +#[test] +fn timeline_click_keeps_full_resolution() { + let (mut harness, _, _) = harness(); + let point = rect(&harness, "timeline.ruler").center(); + harness.input_mut().events.push(Event::PointerMoved(point)); + harness.step(); + harness.input_mut().events.push(Event::PointerButton { pos: point, button: egui::PointerButton::Primary, pressed: true, modifiers: Default::default() }); + harness.step(); + assert!(!harness.state().ui.viewer.property_interacting); + assert_eq!(harness.state().viewer_scale(1.0, 1.0), 1.0); + release(&mut harness, point); +} From a8ed8ca7749643887394363789b269ea47f78a07 Mon Sep 17 00:00:00 2001 From: jayzed80 Date: Sat, 31 Oct 2026 09:45:18 +0000 Subject: [PATCH 006/451] fix(effects): parse_cube rejects a hostile LUT_3D_SIZE before cubing it --- crates/effects/src/utility.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/crates/effects/src/utility.rs b/crates/effects/src/utility.rs index e41b42e99..17f0a243b 100644 --- a/crates/effects/src/utility.rs +++ b/crates/effects/src/utility.rs @@ -202,9 +202,12 @@ pub fn parse_cube(text: &str) -> Option { _ => rows.push(three(&mut it)?), } } + if lut.n3 > 256 { + return None; + } let need1 = lut.n1; let need3 = lut.n3 * lut.n3 * lut.n3; - if (lut.n1 == 0 && lut.n3 == 0) || lut.n1 == 1 || lut.n3 == 1 || rows.len() != need1 + need3 || lut.n3 > 256 { + if (lut.n1 == 0 && lut.n3 == 0) || lut.n1 == 1 || lut.n3 == 1 || Some(rows.len()) != need1.checked_add(need3) { return None; } lut.d1 = rows[..need1].to_vec(); @@ -464,6 +467,10 @@ mod tests { fn bad_cube_is_passthrough() { assert!(parse_cube("LUT_3D_SIZE 2\n0 0 0\n1 1 1\n").is_none()); assert!(parse_cube("LUT_3D_SIZE 2\n0 0 zz\n").is_none()); + // A hostile size must be rejected, not overflow `n3^3` or `n1 + n3^3`. + assert!(parse_cube("LUT_3D_SIZE 4294967296\n0 0 0\n").is_none()); + assert!(parse_cube(&format!("LUT_3D_SIZE {}\n0 0 0\n", usize::MAX)).is_none()); + assert!(parse_cube(&format!("LUT_1D_SIZE {}\nLUT_3D_SIZE 2\n0 0 0\n", usize::MAX)).is_none()); let img = test_img(); let out = run("ec.utility.applylut", &[("lut", Value::Str("LUT_3D_SIZE 3\n0 0 0\n".into()))], img.clone()); assert_eq!(out.img, img); From 25cf11493aec2e3ba7811e5a7b5c63e2d99a659e Mon Sep 17 00:00:00 2001 From: MarekSpodBiedry <73122968+MarekSpodBiedry@users.noreply.github.com> Date: Sun, 1 Nov 2026 07:39:48 +0100 Subject: [PATCH 007/451] Keep Essential Graphics instance keys out of nested comps that preserve their frame rate (#1682) --- crates/engine/src/tests/essential_more.rs | 10 ++++++++++ crates/render/src/fx_host.rs | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/crates/engine/src/tests/essential_more.rs b/crates/engine/src/tests/essential_more.rs index a417d39ff..b3de8359c 100644 --- a/crates/engine/src/tests/essential_more.rs +++ b/crates/engine/src/tests/essential_more.rs @@ -252,6 +252,16 @@ fn one_control_with_targets_of_different_timing_stays_in_step() { } } +#[test] +fn instance_keys_stay_out_of_a_nested_comp_that_preserves_its_frame_rate() { + let (mut s, scene, inner, [a, _], inst) = keyed_instance([(0.0, 100.0), (0.0, 100.0)]); + std::sync::Arc::make_mut(&mut s.project).comp_mut(inner).unwrap().preserve_frame_rate = true; + // The nested time is floored to the nested comp's frames, so only the instance's value goes in. + let (v, pr) = rendered(&s, scene, inner, inst, a, 0.25); + assert!((v - 25.0).abs() < 1e-6, "rendered {v}"); + assert!(pr.keys.is_empty()); +} + /// #1747: through a collapsed precomp, a Text override and a Font override of the same Source /// Text both apply: the Font merges into the overridden text, as `essential::with_overrides` /// does on the flattened path, instead of one entry replacing the other. diff --git a/crates/render/src/fx_host.rs b/crates/render/src/fx_host.rs index 655c01980..c5983ceca 100644 --- a/crates/render/src/fx_host.rs +++ b/crates/render/src/fx_host.rs @@ -184,7 +184,7 @@ fn effect_param<'a>(layer: &'a Layer, effect_index: usize, id: &str) -> Option<& /// Whether an instance's keys are in the nested comp's time, so they can go into the comp as they /// are: not with Time Remap, Responsive Design - Time (a stretched precomp with protected -/// regions). +/// regions) or a nested comp that preserves its frame rate (its time is floored to its own frames). fn keys_in_nested_time(ctx: &EvalCtx, layer: &Layer) -> bool { if layer.props.get("timeRemap").is_some() { return false; @@ -192,7 +192,7 @@ fn keys_in_nested_time(ctx: &EvalCtx, layer: &Layer) -> bool { let LayerSource::Comp { item } = layer.source else { return true }; let Some(nc) = ctx.project.comp(item) else { return true }; let responsive = (layer.stretch - 100.0).abs() > 1e-9 && !super::eval::protected_regions(nc).is_empty(); - !responsive + !responsive && !nc.preserve_frame_rate } /// The Essential Properties overrides of a precomp layer, evaluated at the context time. From 6c3b49d88ba946dd4fb7d60712cbae724549fd74 Mon Sep 17 00:00:00 2001 From: MarekSpodBiedry <73122968+MarekSpodBiedry@users.noreply.github.com> Date: Wed, 4 Nov 2026 07:54:09 +0100 Subject: [PATCH 008/451] Keep Essential Graphics instance keys out of frame-blended layers and collapsed parent overrides (#1682) --- crates/engine/src/tests/essential_more.rs | 47 +++++++++++++++++++++++ crates/render/src/fx_host.rs | 15 +++++--- 2 files changed, 57 insertions(+), 5 deletions(-) diff --git a/crates/engine/src/tests/essential_more.rs b/crates/engine/src/tests/essential_more.rs index b3de8359c..c87d36eec 100644 --- a/crates/engine/src/tests/essential_more.rs +++ b/crates/engine/src/tests/essential_more.rs @@ -291,3 +291,50 @@ fn collapsed_instance_merges_text_and_font_overrides() { o => panic!("{o:?}"), } } + +#[test] +fn instance_keys_stay_out_of_a_layer_that_blends_frames() { + let (mut s, scene, inner, [a, _], inst) = keyed_instance([(0.0, 100.0), (0.0, 100.0)]); + { + let comp = std::sync::Arc::make_mut(&mut s.project).comp_mut(scene).unwrap(); + comp.enable_frame_blending = true; + comp.layer_mut(effectcraft_project::LayerId(inst)).unwrap().switches.frame_blend = effectcraft_project::FrameBlend::FrameMix; + } + // Frame Mix renders the nested comp at two other times, so only the instance's current value goes in. + let (v, pr) = rendered(&s, scene, inner, inst, a, 0.25); + assert!((v - 25.0).abs() < 1e-6, "rendered {v}"); + assert!(pr.keys.is_empty()); +} + +/// An override from a collapsed parent reaches the nested instance as a value only: the keys the +/// nested instance property carries itself must not be copied onto its own target. +#[test] +fn collapsed_parent_override_replaces_the_nested_instance_keys() { + let mut s = Session::default(); + s.execute("comp.new", json!({"name": "Inner", "width": 32, "height": 32, "frameRate": 30, "duration": 4})).unwrap(); + let a = s.execute("layer.newSolid", json!({"name": "A", "color": "#ffffff"})).unwrap()["layer"].as_u64().unwrap(); + s.execute("essential.addProperty", json!({"layer": a, "path": "transform/opacity"})).unwrap(); + s.execute("comp.new", json!({"name": "Mid", "width": 32, "height": 32, "frameRate": 30, "duration": 4})).unwrap(); + let mid = s.active_comp_id().unwrap(); + let inner = s.project.find_by_name("Inner").unwrap().id; + let nested = s.execute("layer.addItem", json!({"item": inner.0, "time": 0.0})).unwrap()["layer"].as_u64().unwrap(); + let path = s.execute("essential.instance", json!({"layer": nested})).unwrap()["controls"][0]["path"].as_str().unwrap().to_string(); + s.execute("prop.addKey", json!({"layer": nested, "path": path, "time": 0.0, "value": 0.0})).unwrap(); + s.execute("prop.addKey", json!({"layer": nested, "path": path, "time": 1.0, "value": 100.0})).unwrap(); + let ctl = s.execute("essential.addProperty", json!({"layer": nested, "path": path})).unwrap()["controls"][0].as_u64().unwrap(); + s.execute("comp.new", json!({"name": "Top", "width": 32, "height": 32, "frameRate": 30, "duration": 4})).unwrap(); + let top = s.active_comp_id().unwrap(); + let inst = s.execute("layer.addItem", json!({"item": mid.0, "time": 0.0})).unwrap()["layer"].as_u64().unwrap(); + s.execute("layer.setSwitch", json!({"layers": [inst], "switch": "collapse", "value": true})).unwrap(); + s.execute("essential.set", json!({"layer": inst, "control": ctl, "value": 80.0})).unwrap(); + let r = effectcraft_render::Renderer::new(&s.project, &*s.footage, crate::render::RenderOpts::default()); + let ctx = effectcraft_render::EvalCtx::new(&s.project, top, s.project.comp(top).unwrap(), Tick::from_seconds_f64(0.25)); + let layer = ctx.comp.layer(effectcraft_project::LayerId(inst)).unwrap(); + let collapsed = r.collapsed(&ctx, layer).expect("the instance collapses"); + let (_, nctx) = r.collapse_into(&ctx, layer, &collapsed, 1.0).expect("a nested context"); + let nl = nctx.comp.layer(effectcraft_project::LayerId(nested)).unwrap(); + let over = effectcraft_render::essential_overrides(&nctx, nl); + assert_eq!(over.len(), 1); + assert!((over[0].value.as_f64() - 80.0).abs() < 1e-6, "value {:?}", over[0].value); + assert!(over[0].keys.is_empty(), "the nested instance's own keys are stale"); +} diff --git a/crates/render/src/fx_host.rs b/crates/render/src/fx_host.rs index c5983ceca..f15f91c93 100644 --- a/crates/render/src/fx_host.rs +++ b/crates/render/src/fx_host.rs @@ -1,4 +1,5 @@ -use super::{Arc, Buf, EffectHost, EvalCtx, ItemKind, Layer, LayerPixels, LayerSource, Params, Renderer, Tick, three_d}; +use super::frames::frame_blend_mode; +use super::{Arc, Buf, EffectHost, EvalCtx, FrameBlend, ItemKind, Layer, LayerPixels, LayerSource, Params, Renderer, Tick, three_d}; /// Layer parameters and audio for effects (see [`effectcraft_effects::EffectHost`]). What it /// hands out is in effect space (see [`effect_bounds`]): the other layer's for its pixels, the @@ -184,9 +185,11 @@ fn effect_param<'a>(layer: &'a Layer, effect_index: usize, id: &str) -> Option<& /// Whether an instance's keys are in the nested comp's time, so they can go into the comp as they /// are: not with Time Remap, Responsive Design - Time (a stretched precomp with protected -/// regions) or a nested comp that preserves its frame rate (its time is floored to its own frames). +/// regions), a nested comp that preserves its frame rate (its time is floored to its own frames) +/// or a layer with Frame Blending (it renders the nested comp at two other times and mixes them, +/// so keys would pull the next frame's value in early). fn keys_in_nested_time(ctx: &EvalCtx, layer: &Layer) -> bool { - if layer.props.get("timeRemap").is_some() { + if layer.props.get("timeRemap").is_some() || frame_blend_mode(ctx, layer) != FrameBlend::Off { return false; } let LayerSource::Comp { item } = layer.source else { return true }; @@ -206,8 +209,10 @@ pub fn essential_overrides(ctx: &EvalCtx, layer: &Layer) -> Vec Date: Thu, 5 Nov 2026 20:38:37 -0800 Subject: [PATCH 009/451] Plug-in Library: a file URL cannot name a network path A local catalog's file:// URLs were decoded into a path without checking how the path starts. A URL such as file:////server/share/x.wasm, or one whose path holds a backslash or a percent-encoded / or \, could become a network path on Windows, so reading the catalog or a release named in it contacted that host. file_url_path now refuses a decoded path that starts with two separators or holds a backslash, and a percent-encoded / or \, with an error that names the reason. Local paths and drive-letter paths are read as before. The library.refresh params text, docs/plugins.md and docs/publishing-plugins.md say so. --- crates/engine/src/system/library.rs | 80 ++++++++++++++++++++++++----- docs/plugins.md | 3 +- docs/publishing-plugins.md | 4 +- 3 files changed, 72 insertions(+), 15 deletions(-) diff --git a/crates/engine/src/system/library.rs b/crates/engine/src/system/library.rs index 750ed600a..23063957f 100644 --- a/crates/engine/src/system/library.rs +++ b/crates/engine/src/system/library.rs @@ -324,27 +324,44 @@ enum Source { File(PathBuf), } -/// `file:///C:/x` or `file:///home/x` as a path (percent-decoded; no remote hosts). -fn file_url_path(url: &str) -> Option { - let rest = url.strip_prefix("file://")?; +/// `file:///C:/x` or `file:///home/x` as a path (percent-decoded; no remote hosts). A path that +/// starts with two separators or holds a `\` (raw or percent-encoded), or a percent-encoded `/`, +/// is refused: on Windows such a path can name a network share, and reading it contacts that host. +fn file_url_path(url: &str) -> std::result::Result { + let bad = |why: &str| format!("bad file URL `{url}`: {why}"); + let rest = url.strip_prefix("file://").ok_or_else(|| bad("it doesn't start with file://"))?; let rest = rest.strip_prefix("localhost").unwrap_or(rest); if !rest.starts_with('/') { - return None; + return Err(bad("only local files can be read (file:///path)")); } let b = rest.as_bytes(); // `/C:/…` on Windows. - let rest = if b.len() > 2 && b.get(2) == Some(&b':') { rest.get(1..)? } else { rest }; + let rest = + if b.get(1).is_some_and(u8::is_ascii_alphabetic) && b.get(2) == Some(&b':') { rest.get(1..).ok_or_else(|| bad("bad drive letter"))? } else { rest }; let mut out = Vec::with_capacity(rest.len()); let mut bytes = rest.bytes(); while let Some(c) = bytes.next() { if c == b'%' { - let hex = [bytes.next()?, bytes.next()?]; - out.push(u8::from_str_radix(std::str::from_utf8(&hex).ok()?, 16).ok()?); + let hex = [bytes.next(), bytes.next()]; + let [Some(hi), Some(lo)] = hex else { return Err(bad("a % isn't followed by two hex digits")) }; + let byte = + std::str::from_utf8(&[hi, lo]).ok().and_then(|h| u8::from_str_radix(h, 16).ok()).ok_or_else(|| bad("a % isn't followed by two hex digits"))?; + if matches!(byte, b'/' | b'\\') { + return Err(bad("a percent-encoded / or \\ isn't allowed")); + } + out.push(byte); } else { out.push(c); } } - String::from_utf8(out).ok().map(PathBuf::from) + let path = String::from_utf8(out).map_err(|_| bad("the path isn't UTF-8"))?; + if path.contains('\\') { + return Err(bad("use / between folders, not \\")); + } + if path.starts_with("//") { + return Err(bad("network paths can't be read, only local files")); + } + Ok(PathBuf::from(path)) } /// Check `url` against the rules: `https://` on GitHub's hosts; `file://` when the catalog @@ -359,7 +376,7 @@ fn source(url: &str, catalog: Option<&str>) -> std::result::Result Vec { "Refresh Plug-in Catalog", [], None, - "{catalog?: https:// or file:// URL of an index.json (default: the community catalog), wait?}", + "{catalog?: https:// or file:// URL of an index.json (default: the community catalog; file:// takes a local path, not a network path such as //server/share), wait?}", always, refresh ), @@ -1177,10 +1194,47 @@ mod tests { assert_eq!(source("file:///C:/p/x.wasm", None), Ok(Source::File(PathBuf::from("C:/p/x.wasm")))); assert!(source("file://", None).is_err()); // Percent-decoded; no remote hosts. - assert_eq!(file_url_path("file:///C:/My%20Plug-ins/Jos%C3%A9%23.wasm"), Some(PathBuf::from("C:/My Plug-ins/José#.wasm"))); - assert_eq!(file_url_path("file://localhost/home/x.wasm"), Some(PathBuf::from("/home/x.wasm"))); + assert_eq!(file_url_path("file:///C:/My%20Plug-ins/Jos%C3%A9%23.wasm"), Ok(PathBuf::from("C:/My Plug-ins/José#.wasm"))); + assert_eq!(file_url_path("file://localhost/home/x.wasm"), Ok(PathBuf::from("/home/x.wasm"))); for no in ["file://server/share/x.wasm", "file:///bad%2", "file:///bad%zz"] { - assert_eq!(file_url_path(no), None, "{no}"); + assert!(file_url_path(no).is_err(), "{no}"); + } + } + + #[test] + fn file_urls_cannot_name_a_network_path() { + for ok in [ + ("file:///C:/p/x.wasm", "C:/p/x.wasm"), + ("file:///c:/p/x.wasm", "c:/p/x.wasm"), + ("file:///home/me/x.wasm", "/home/me/x.wasm"), + ("file://localhost/C:/p/x.wasm", "C:/p/x.wasm"), + ("file:///home/me/a%20b/x.wasm", "/home/me/a b/x.wasm"), + ("file:///C:/p//x.wasm", "C:/p//x.wasm"), + ] { + assert_eq!(file_url_path(ok.0), Ok(PathBuf::from(ok.1)), "{}", ok.0); + } + for no in [ + // Two separators at the start: `//server/share/…`. + "file:////server/share/x.wasm", + "file://localhost//server/share/x.wasm", + "file://///server/share/x.wasm", + "file:////:x.wasm", + // Backslashes, raw or percent-encoded. + "file:///\\\\server\\share\\x.wasm", + "file:///\\server/share/x.wasm", + "file:///C:\\p\\x.wasm", + "file:///%5C%5Cserver/share/x.wasm", + "file:///%5c%5cserver/share/x.wasm", + "file:///C:/p%5Cx.wasm", + // Percent-encoded slashes. + "file:///%2F%2Fserver/share/x.wasm", + "file:///%2fserver/share/x.wasm", + "file:///C:/p%2Fx.wasm", + ] { + let e = file_url_path(no).expect_err(no); + assert!(e.starts_with("bad file URL"), "{no}: {e}"); + assert!(source(no, None).is_err(), "{no}"); + assert!(source(no, Some("file:///tmp/index.json")).is_err(), "{no}"); } } diff --git a/docs/plugins.md b/docs/plugins.md index 3fd8cf944..d7df3d8b1 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -369,7 +369,8 @@ package can't read files, open the network or crash the app. [`storytold/effectcraft-plugins`](https://github.com/storytold/effectcraft-plugins) repository; packages are added by pull request and reviewed there. The app has no field for another catalog; `library.refresh {catalog}` (for plug-in authors testing an entry) takes an `index.json` - on GitHub or a local file, and the page then says it shows a test catalog until Refresh. + on GitHub or a local file, and the page then says it shows a test catalog until Refresh. A file + URL that names a network path (`file:////server/share/…`) is refused. * **Nothing is downloaded until you ask.** Fetch Catalog (`library.refresh`) reads the catalog; Install (`library.install`) downloads the package's `.wasm`, checks its SHA-256 (and its size, when the catalog gives one) against the catalog and loads it. Downloads use the system's `curl`, diff --git a/docs/publishing-plugins.md b/docs/publishing-plugins.md index bd76c3ab5..0083293b6 100644 --- a/docs/publishing-plugins.md +++ b/docs/publishing-plugins.md @@ -226,7 +226,9 @@ Make a folder with an `index.json` that holds only your package: ``` File URLs are absolute: `file:///home/me/glow-rings/index.json` on Linux and macOS, -`file:///C:/Users/me/glow-rings/index.json` on Windows. Write a space as `%20`. +`file:///C:/Users/me/glow-rings/index.json` on Windows. Write a space as `%20`. Separate folders +with `/`: a file URL that holds a `\` or a percent-encoded `/` or `\`, or names a network path +(`file:////server/share/…`), is refused. Use a separate settings folder, so the test doesn't touch your real installation: From 75fed052e3dcb5cd876729863bc5e292aaca022c Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 5 Nov 2026 21:51:04 -0800 Subject: [PATCH 010/451] Plug-in Library: a package downloads only release assets of its repository A catalog release's url was checked only for its host: any https:// URL on GitHub's hosts was downloaded, from any repository and any path, including a raw file on a branch or a path with dot segments that curl resolves to another repository. library.install, library.update and library.preview now refuse a url that isn't https://github.com///releases/download//. When the package's repo is a https://github.com// URL, the asset must be in that repository (owner and name compared without case). Dot segments, also percent-encoded, empty segments, backslashes, queries and fragments are refused. file:// releases from a local catalog are read as before, and the SHA-256 and size checks are unchanged. A catalog other than the community one is still read only when library.refresh names it (https:// on GitHub's hosts, or a local file://). docs/plugins.md, docs/publishing-plugins.md and the library.install params text describe the rules. --- crates/engine/src/system/library.rs | 98 ++++++++++++++++++++++++++++- crates/host/tests/it/library.rs | 32 ++++++++++ docs/plugins.md | 6 +- docs/publishing-plugins.md | 2 +- 4 files changed, 134 insertions(+), 4 deletions(-) diff --git a/crates/engine/src/system/library.rs b/crates/engine/src/system/library.rs index 750ed600a..0e55c8acb 100644 --- a/crates/engine/src/system/library.rs +++ b/crates/engine/src/system/library.rs @@ -255,6 +255,58 @@ fn release_problem(r: &Release) -> Option { None } +/// An owner or repository name on GitHub: letters, digits, `.`, `-`, `_`, and not `.` or `..`. +fn valid_repo_part(p: &str) -> bool { + !p.is_empty() && p != "." && p != ".." && p.bytes().all(|b| b.is_ascii_alphanumeric() || b"._-".contains(&b)) +} + +/// The rest of `s` after `prefix`, ignoring ASCII case. +fn strip_prefix_ignore_case<'a>(s: &'a str, prefix: &str) -> Option<&'a str> { + let head = s.get(..prefix.len())?; + head.eq_ignore_ascii_case(prefix).then(|| s.get(prefix.len()..)).flatten() +} + +/// `(owner, name)` in lower case of a `https://github.com//` repository URL (an +/// optional trailing `/` or `.git`); `None` for anything else. +fn github_repo(repo: &str) -> Option<(String, String)> { + let rest = strip_prefix_ignore_case(repo.trim(), "https://github.com/")?; + let rest = rest.strip_suffix('/').unwrap_or(rest); + let rest = rest.strip_suffix(".git").unwrap_or(rest); + let mut parts = rest.split('/'); + let (owner, name) = (parts.next()?, parts.next()?); + (parts.next().is_none() && valid_repo_part(owner) && valid_repo_part(name)).then(|| (owner.to_ascii_lowercase(), name.to_ascii_lowercase())) +} + +/// Why an `https://` release URL can't be used, if it can't: it must be a release asset, +/// `https://github.com///releases/download//`, and when the package's +/// `repo` is a GitHub repository URL, `/` must be that repository. +fn release_url_problem(repo: &str, url: &str) -> Option { + let not_asset = || Some(format!("`{url}` isn't a release asset (https://github.com///releases/download//)")); + let Some(rest) = strip_prefix_ignore_case(url, "https://github.com/") else { return not_asset() }; + if rest.contains(['?', '#', '\\']) { + return not_asset(); + } + let parts: Vec<&str> = rest.split('/').collect(); + // `.` and `..` (also percent-encoded) would move the download to another path. + let dot_segment = |p: &&str| { + let p = p.to_ascii_lowercase().replace("%2e", "."); + p == "." || p == ".." + }; + if parts.len() < 6 || parts.iter().any(|p| p.is_empty() || dot_segment(p)) { + return not_asset(); + } + let (Some(owner), Some(name), Some(releases), Some(download)) = (parts.first(), parts.get(1), parts.get(2), parts.get(3)) else { return not_asset() }; + if !valid_repo_part(owner) || !valid_repo_part(name) || *releases != "releases" || *download != "download" { + return not_asset(); + } + match github_repo(repo) { + Some((o, n)) if o != owner.to_ascii_lowercase() || n != name.to_ascii_lowercase() => { + Some(format!("`{url}` isn't a release asset of the package's repository {}", repo.trim())) + } + _ => None, + } +} + /// Read a catalog: packages and releases that are malformed are left out (and reported), so one /// bad entry doesn't hide the others. pub fn parse_catalog(bytes: &[u8]) -> std::result::Result<(Catalog, Vec), String> { @@ -799,7 +851,11 @@ fn pick(s: &Session, c: &str, p: &Value) -> Result<(String, Package, Release)> { ), )); } - source(&rel.url, Some(&url)).map_err(|e| bad(c, e))?; + if let Source::Https(u) = source(&rel.url, Some(&url)).map_err(|e| bad(c, e))? + && let Some(why) = release_url_problem(&pkg.repo, &u) + { + return Err(bad(c, why)); + } Ok((url, pkg, rel)) } @@ -1049,7 +1105,7 @@ pub fn specs() -> Vec { "Install Plug-in", [], None, - "{id, version?, wait?} — downloads the release, checks its SHA-256 against the catalog, loads it", + "{id, version?, wait?} — downloads the release (a GitHub release asset, in the package's repo when it names one), checks its SHA-256 against the catalog, loads it", always, install ), @@ -1132,6 +1188,44 @@ mod tests { assert!(latest_compatible(&Package::default()).is_none()); } + #[test] + fn release_urls_are_assets_of_the_declared_repository() { + let asset = "https://github.com/Me/Glow/releases/download/v1.0.0/glow.wasm"; + for repo in ["https://github.com/me/glow", "https://github.com/Me/Glow/", "https://GitHub.com/me/glow.git", "", "https://gitlab.com/me/glow"] { + assert_eq!(release_url_problem(repo, asset), None, "{repo}"); + } + assert_eq!(release_url_problem("", "https://github.com/a/b/releases/download/tags/v1/x.wasm"), None, "a tag with a slash"); + assert!( + release_url_problem("https://github.com/me/glow", "https://github.com/me/other/releases/download/v1/x.wasm") + .unwrap() + .contains("package's repository") + ); + assert!(release_url_problem("https://github.com/me/glow", "https://github.com/you/glow/releases/download/v1/x.wasm").is_some()); + for no in [ + "https://raw.githubusercontent.com/me/glow/main/x.wasm", + "https://objects.githubusercontent.com/x.wasm", + "https://github.com/me/glow/blob/main/x.wasm", + "https://github.com/me/glow/releases/download/v1", + "https://github.com/me/glow/releases/download//x.wasm", + "https://github.com/me/glow/releases/download/v1/x.wasm?x=1", + "https://github.com/me/glow/releases/download/v1/x.wasm#x", + "https://github.com/me/glow/releases/download/../../../you/evil/releases/download/v1/x.wasm", + "https://github.com/me/glow/releases/download/%2e%2e/%2E./x/y/x.wasm", + "https://github.com/me/glow/releases/download/./v1/x.wasm", + "https://github.com/me/glow/releases/download/v1\\x.wasm", + "https://github.com/m e/glow/releases/download/v1/x.wasm", + "https://github.com/../glow/releases/download/v1/x.wasm", + "https://github.com.evil.com/me/glow/releases/download/v1/x.wasm", + ] { + assert!(release_url_problem("https://github.com/me/glow", no).is_some(), "{no}"); + assert!(release_url_problem("", no).is_some(), "{no}"); + } + assert_eq!(github_repo("https://github.com/Me/Glow.git"), Some(("me".into(), "glow".into()))); + for no in ["https://github.com/me", "https://github.com/me/glow/tree/main", "http://github.com/me/glow", "me/glow"] { + assert_eq!(github_repo(no), None, "{no}"); + } + } + #[test] fn catalogs_leave_out_bad_entries() { let good = "a".repeat(64); diff --git a/crates/host/tests/it/library.rs b/crates/host/tests/it/library.rs index 4cd94ecdd..f5bd613cc 100644 --- a/crates/host/tests/it/library.rs +++ b/crates/host/tests/it/library.rs @@ -156,6 +156,38 @@ fn a_wrong_checksum_or_a_bad_module_installs_nothing() { let _ = std::fs::remove_dir_all(&dir); } +#[test] +fn downloads_are_release_assets_of_the_package_repository() { + let dir = tmp("assets"); + let sum = "0".repeat(64); + let pkg = + |id: &str, repo: &str, url: &str| json!({"id": id, "name": id, "repo": repo, "versions": [{"version": "1", "api": 1, "url": url, "sha256": sum}]}); + let catalog = write_catalog( + &dir, + json!([ + pkg("org.test.other", "https://github.com/me/glow", "https://github.com/someone/else/releases/download/v1/glow.wasm"), + pkg("org.test.raw", "https://github.com/me/glow", "https://raw.githubusercontent.com/me/glow/main/glow.wasm"), + pkg("org.test.page", "", "https://github.com/me/glow/blob/main/glow.wasm"), + pkg("org.test.dots", "https://github.com/me/glow", "https://github.com/me/glow/releases/download/%2e%2e/%2E%2E/x/y/glow.wasm"), + ]), + ); + let mut s = session(&dir); + s.execute("library.refresh", json!({"catalog": catalog, "wait": true})).unwrap(); + for (id, why) in [ + ("org.test.other", "isn't a release asset of the package's repository https://github.com/me/glow"), + ("org.test.raw", "isn't a release asset"), + ("org.test.page", "isn't a release asset"), + ("org.test.dots", "isn't a release asset"), + ] { + for c in ["library.install", "library.preview"] { + let e = s.execute(c, json!({"id": id, "wait": true})).unwrap_err().to_string(); + assert!(e.contains(why), "{c} {id}: {e}"); + } + } + assert!(!dir.join("Plug-ins").join("Library").join("installed.json").exists()); + let _ = std::fs::remove_dir_all(&dir); +} + #[test] fn installed_packages_load_at_start_and_changed_files_are_refused() { let dir = tmp("startup"); diff --git a/docs/plugins.md b/docs/plugins.md index 3fd8cf944..99b91874f 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -374,7 +374,11 @@ package can't read files, open the network or crash the app. Install (`library.install`) downloads the package's `.wasm`, checks its SHA-256 (and its size, when the catalog gives one) against the catalog and loads it. Downloads use the system's `curl`, `https://` only and starting on GitHub's hosts (redirects stay on `https://`; the SHA-256 check - is what guarantees the file). + is what guarantees the file). A package's `url` must be a release asset + (`https://github.com///releases/download/…`), in the package's `repo` when that is + a GitHub repository URL. A catalog other than the community one is read only when + `library.refresh {catalog}` names it: an `index.json` on GitHub's hosts over `https://`, or a + local `file://` path. * **Where it goes.** `/Library///.wasm` (the `Plug-ins` folder next to the settings), listed in `Library/installed.json`. Installed packages load at start-up, each checked against the SHA-256 it was installed with. The catalog last fetched is kept as diff --git a/docs/publishing-plugins.md b/docs/publishing-plugins.md index bd76c3ab5..c94f9e2a8 100644 --- a/docs/publishing-plugins.md +++ b/docs/publishing-plugins.md @@ -193,7 +193,7 @@ Release fields (one per entry in `versions`): | `version` | yes | Dotted numbers only, at most 32 characters: `1.0.0`, `1.2`. No `v` and no suffixes such as `-beta`. | | `api` | yes | The plug-in API the module implements: `1`. | | `minApp` | no | The oldest EffectCraft version the release needs (`0.17.0`). Leave it out if any version with this API works. | -| `url` | yes | The release asset's `https://` URL on GitHub. | +| `url` | yes | The release asset's `https://` URL on GitHub: `https://github.com///releases/download//`. When `repo` is a `https://github.com//` URL, the asset must be in that repository. Install and Preview refuse any other `https://` URL. | | `sha256` | yes | The file's SHA-256, 64 hex digits. | | `size` | no, but reviewed | The file's size in bytes. When it is given, a download of another size is refused. | | `effects` | yes | The effect ids the module registers (its manifest's `id`). EffectCraft uses them to find the package that provides an effect a project needs. | From bad3e7c2320d5f8aa8608d3dc725ed301b3ed366 Mon Sep 17 00:00:00 2001 From: jayzed80 Date: Sat, 31 Oct 2026 09:45:18 +0000 Subject: [PATCH 011/451] fix(effects): parse_cube rejects a hostile LUT_3D_SIZE before cubing it Co-Authored-By: Claude Sonnet 5.5 --- crates/effects/src/utility.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/crates/effects/src/utility.rs b/crates/effects/src/utility.rs index e87c6d3ff..b38ded8db 100644 --- a/crates/effects/src/utility.rs +++ b/crates/effects/src/utility.rs @@ -215,9 +215,12 @@ pub fn parse_cube(text: &str) -> Option { _ => rows.push(three(&mut it)?), } } + if lut.n3 > 256 { + return None; + } let need1 = lut.n1; let need3 = lut.n3 * lut.n3 * lut.n3; - if (lut.n1 == 0 && lut.n3 == 0) || lut.n1 == 1 || lut.n3 == 1 || rows.len() != need1 + need3 || lut.n3 > 256 { + if (lut.n1 == 0 && lut.n3 == 0) || lut.n1 == 1 || lut.n3 == 1 || Some(rows.len()) != need1.checked_add(need3) { return None; } lut.d1 = rows[..need1].to_vec(); @@ -477,6 +480,10 @@ mod tests { fn bad_cube_is_passthrough() { assert!(parse_cube("LUT_3D_SIZE 2\n0 0 0\n1 1 1\n").is_none()); assert!(parse_cube("LUT_3D_SIZE 2\n0 0 zz\n").is_none()); + // A hostile size must be rejected, not overflow `n3^3` or `n1 + n3^3`. + assert!(parse_cube("LUT_3D_SIZE 4294967296\n0 0 0\n").is_none()); + assert!(parse_cube(&format!("LUT_3D_SIZE {}\n0 0 0\n", usize::MAX)).is_none()); + assert!(parse_cube(&format!("LUT_1D_SIZE {}\nLUT_3D_SIZE 2\n0 0 0\n", usize::MAX)).is_none()); let img = test_img(); let out = run("ec.utility.applylut", &[("lut", Value::Str("LUT_3D_SIZE 3\n0 0 0\n".into()))], img.clone()); assert_eq!(out.img, img); From 5dfcadd09bbca14eb53ec52694995eac4199f1be Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 5 Nov 2026 23:24:20 -0800 Subject: [PATCH 012/451] Plug-in Library: a package with an unreadable repo URL downloads nothing When a package names a `repo` that isn't a GitHub repository URL (`https://github.com//`, a trailing `/` or `.git` allowed, or a folder in one, `.../tree//`), Install, Update and Preview now refuse its release URLs with an error naming the package. Before, such a `repo` skipped the repository check and any GitHub release asset was downloaded. A package without a `repo` keeps any repository's release asset. The example catalog's schema now holds `repo` and release `url` to the same forms, and `scripts/validate.sh` checks that every release is an asset of the package's `repo` before it downloads anything. --- crates/engine/src/system/library.rs | 100 ++++++++++++++++---- crates/host/tests/it/library.rs | 6 ++ docs/plugins.md | 6 +- docs/publishing-plugins.md | 4 +- examples/plugin-catalog/schema.json | 8 +- examples/plugin-catalog/scripts/validate.sh | 22 ++++- 6 files changed, 117 insertions(+), 29 deletions(-) diff --git a/crates/engine/src/system/library.rs b/crates/engine/src/system/library.rs index 0e55c8acb..d1eaaf0bd 100644 --- a/crates/engine/src/system/library.rs +++ b/crates/engine/src/system/library.rs @@ -266,20 +266,33 @@ fn strip_prefix_ignore_case<'a>(s: &'a str, prefix: &str) -> Option<&'a str> { head.eq_ignore_ascii_case(prefix).then(|| s.get(prefix.len()..)).flatten() } +/// A `.` or `..` path segment, also percent-encoded. +fn dot_segment(p: &str) -> bool { + let p = p.to_ascii_lowercase().replace("%2e", "."); + p == "." || p == ".." +} + /// `(owner, name)` in lower case of a `https://github.com//` repository URL (an -/// optional trailing `/` or `.git`); `None` for anything else. +/// optional trailing `/` or `.git`) or of a folder in one, `https://github.com///tree//`; +/// `None` for anything else. fn github_repo(repo: &str) -> Option<(String, String)> { let rest = strip_prefix_ignore_case(repo.trim(), "https://github.com/")?; + if rest.contains(['?', '#', '\\']) { + return None; + } let rest = rest.strip_suffix('/').unwrap_or(rest); - let rest = rest.strip_suffix(".git").unwrap_or(rest); - let mut parts = rest.split('/'); - let (owner, name) = (parts.next()?, parts.next()?); - (parts.next().is_none() && valid_repo_part(owner) && valid_repo_part(name)).then(|| (owner.to_ascii_lowercase(), name.to_ascii_lowercase())) + let parts: Vec<&str> = rest.split('/').collect(); + let (owner, name) = match parts.as_slice() { + [owner, name] => (*owner, name.strip_suffix(".git").unwrap_or(name)), + [owner, name, "tree", folder @ ..] if !folder.is_empty() && folder.iter().all(|p| !p.is_empty() && !dot_segment(p)) => (*owner, *name), + _ => return None, + }; + (valid_repo_part(owner) && valid_repo_part(name)).then(|| (owner.to_ascii_lowercase(), name.to_ascii_lowercase())) } /// Why an `https://` release URL can't be used, if it can't: it must be a release asset, -/// `https://github.com///releases/download//`, and when the package's -/// `repo` is a GitHub repository URL, `/` must be that repository. +/// `https://github.com///releases/download//`, and when the package +/// names a `repo`, that must be a GitHub repository URL (see [`github_repo`]) of `/`. fn release_url_problem(repo: &str, url: &str) -> Option { let not_asset = || Some(format!("`{url}` isn't a release asset (https://github.com///releases/download//)")); let Some(rest) = strip_prefix_ignore_case(url, "https://github.com/") else { return not_asset() }; @@ -287,11 +300,9 @@ fn release_url_problem(repo: &str, url: &str) -> Option { return not_asset(); } let parts: Vec<&str> = rest.split('/').collect(); - // `.` and `..` (also percent-encoded) would move the download to another path. - let dot_segment = |p: &&str| { - let p = p.to_ascii_lowercase().replace("%2e", "."); - p == "." || p == ".." - }; + // At least six segments, not exactly six: a tag may contain `/` (`release/v1`), and its assets are + // then at `releases/download/release/v1/`. `.` and `..` (also percent-encoded) would move + // the download to another path. if parts.len() < 6 || parts.iter().any(|p| p.is_empty() || dot_segment(p)) { return not_asset(); } @@ -299,11 +310,16 @@ fn release_url_problem(repo: &str, url: &str) -> Option { if !valid_repo_part(owner) || !valid_repo_part(name) || *releases != "releases" || *download != "download" { return not_asset(); } + let repo = repo.trim(); + if repo.is_empty() { + return None; + } match github_repo(repo) { - Some((o, n)) if o != owner.to_ascii_lowercase() || n != name.to_ascii_lowercase() => { - Some(format!("`{url}` isn't a release asset of the package's repository {}", repo.trim())) - } - _ => None, + Some((o, n)) if o == owner.to_ascii_lowercase() && n == name.to_ascii_lowercase() => None, + Some(_) => Some(format!("`{url}` isn't a release asset of the package's repository {repo}")), + None => Some(format!( + "the package's `repo` {repo} isn't a GitHub repository URL (https://github.com//), so `{url}` can't be checked against it" + )), } } @@ -854,7 +870,7 @@ fn pick(s: &Session, c: &str, p: &Value) -> Result<(String, Package, Release)> { if let Source::Https(u) = source(&rel.url, Some(&url)).map_err(|e| bad(c, e))? && let Some(why) = release_url_problem(&pkg.repo, &u) { - return Err(bad(c, why)); + return Err(bad(c, format!("{}: {why}", pkg.name))); } Ok((url, pkg, rel)) } @@ -1191,7 +1207,7 @@ mod tests { #[test] fn release_urls_are_assets_of_the_declared_repository() { let asset = "https://github.com/Me/Glow/releases/download/v1.0.0/glow.wasm"; - for repo in ["https://github.com/me/glow", "https://github.com/Me/Glow/", "https://GitHub.com/me/glow.git", "", "https://gitlab.com/me/glow"] { + for repo in ["https://github.com/me/glow", "https://github.com/Me/Glow/", "https://GitHub.com/me/glow.git", ""] { assert_eq!(release_url_problem(repo, asset), None, "{repo}"); } assert_eq!(release_url_problem("", "https://github.com/a/b/releases/download/tags/v1/x.wasm"), None, "a tag with a slash"); @@ -1221,11 +1237,57 @@ mod tests { assert!(release_url_problem("", no).is_some(), "{no}"); } assert_eq!(github_repo("https://github.com/Me/Glow.git"), Some(("me".into(), "glow".into()))); - for no in ["https://github.com/me", "https://github.com/me/glow/tree/main", "http://github.com/me/glow", "me/glow"] { + assert_eq!(github_repo("https://github.com/Me/Glow/tree/main/plugins/glow"), Some(("me".into(), "glow".into()))); + for no in ["https://github.com/me", "https://github.com/me/glow/tree", "http://github.com/me/glow", "me/glow"] { assert_eq!(github_repo(no), None, "{no}"); } } + #[test] + fn a_repo_that_isnt_a_github_repository_url_refuses_every_release() { + let asset = "https://github.com/me/glow/releases/download/v1/glow.wasm"; + for repo in [ + "https://github.com/me/glow", + "https://github.com/me/glow/", + "https://github.com/me/glow.git", + "https://github.com/me/glow.git/", + " https://github.com/ME/glow ", + "https://github.com/me/glow/tree/main", + "https://github.com/me/glow/tree/main/plugins/glow/", + "", + " ", + ] { + assert_eq!(release_url_problem(repo, asset), None, "{repo:?}"); + } + let elsewhere = release_url_problem("https://github.com/me/glow/tree/main", "https://github.com/you/evil/releases/download/v1/glow.wasm"); + assert!(elsewhere.as_deref().is_some_and(|w| w.contains("package's repository")), "{elsewhere:?}"); + for repo in [ + "https://github.com/me/glow/tree", + "https://github.com/me/glow/tree/", + "https://github.com/me/glow/tree//x", + "https://github.com/me/glow/tree/main/../../you/evil", + "https://github.com/me/glow/tree/main/%2e%2e", + "https://github.com/me/glow/blob/main/README.md", + "https://github.com/me/glow.git/x", + "https://github.com/me/glow/releases", + "https://github.com/me/glow//", + "https://github.com/me", + "https://github.com/me/", + "http://github.com/me/glow", + "github.com/me/glow", + "me/glow", + "https://www.github.com/me/glow", + "https://gitlab.com/me/glow", + "https://github.com/me/glow?tab=readme", + "https://github.com/me/glow#readme", + "https://github.com/me/gl ow", + "https://github.com/me/..", + ] { + let why = release_url_problem(repo, asset); + assert!(why.as_deref().is_some_and(|w| w.contains("isn't a GitHub repository URL")), "{repo:?}: {why:?}"); + } + } + #[test] fn catalogs_leave_out_bad_entries() { let good = "a".repeat(64); diff --git a/crates/host/tests/it/library.rs b/crates/host/tests/it/library.rs index f5bd613cc..35cbf74a7 100644 --- a/crates/host/tests/it/library.rs +++ b/crates/host/tests/it/library.rs @@ -169,6 +169,9 @@ fn downloads_are_release_assets_of_the_package_repository() { pkg("org.test.raw", "https://github.com/me/glow", "https://raw.githubusercontent.com/me/glow/main/glow.wasm"), pkg("org.test.page", "", "https://github.com/me/glow/blob/main/glow.wasm"), pkg("org.test.dots", "https://github.com/me/glow", "https://github.com/me/glow/releases/download/%2e%2e/%2E%2E/x/y/glow.wasm"), + pkg("org.test.tree", "https://github.com/me/glow/tree/main", "https://github.com/someone/else/releases/download/v1/glow.wasm"), + pkg("org.test.http", "http://github.com/me/glow", "https://github.com/me/glow/releases/download/v1/glow.wasm"), + pkg("org.test.blob", "https://github.com/me/glow/blob/main/README.md", "https://github.com/me/glow/releases/download/v1/glow.wasm"), ]), ); let mut s = session(&dir); @@ -178,6 +181,9 @@ fn downloads_are_release_assets_of_the_package_repository() { ("org.test.raw", "isn't a release asset"), ("org.test.page", "isn't a release asset"), ("org.test.dots", "isn't a release asset"), + ("org.test.tree", "isn't a release asset of the package's repository https://github.com/me/glow/tree/main"), + ("org.test.http", "org.test.http: the package's `repo` http://github.com/me/glow isn't a GitHub repository URL"), + ("org.test.blob", "org.test.blob: the package's `repo` https://github.com/me/glow/blob/main/README.md isn't a GitHub repository URL"), ] { for c in ["library.install", "library.preview"] { let e = s.execute(c, json!({"id": id, "wait": true})).unwrap_err().to_string(); diff --git a/docs/plugins.md b/docs/plugins.md index 99b91874f..5302b0b3c 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -375,8 +375,10 @@ package can't read files, open the network or crash the app. catalog gives one) against the catalog and loads it. Downloads use the system's `curl`, `https://` only and starting on GitHub's hosts (redirects stay on `https://`; the SHA-256 check is what guarantees the file). A package's `url` must be a release asset - (`https://github.com///releases/download/…`), in the package's `repo` when that is - a GitHub repository URL. A catalog other than the community one is read only when + (`https://github.com///releases/download/…`). When the package names a `repo`, the + asset must be in that repository. A `repo` that isn't `https://github.com//` (with + an optional trailing `/` or `.git`) or a folder in one (`https://github.com///tree//…`) + makes Install and Preview refuse every release of the package. A catalog other than the community one is read only when `library.refresh {catalog}` names it: an `index.json` on GitHub's hosts over `https://`, or a local `file://` path. * **Where it goes.** `/Library///.wasm` (the `Plug-ins` folder next to diff --git a/docs/publishing-plugins.md b/docs/publishing-plugins.md index c94f9e2a8..c28554f14 100644 --- a/docs/publishing-plugins.md +++ b/docs/publishing-plugins.md @@ -181,7 +181,7 @@ Package fields: | `author` | no | You, or your group. | | `description` | no, but reviewed | One or two plain sentences that say what the effect does. | | `license` | no, but reviewed | The licence's SPDX id (`MIT`, `Apache-2.0`, `MIT OR Apache-2.0`…). | -| `repo` | no, but reviewed | The public source repository. The details' "Open on GitHub" opens it. | +| `repo` | no, but reviewed | The public source repository, as `https://github.com//` (a trailing `/` or `.git` is allowed), or a folder in it, `https://github.com///tree//`. The details' "Open on GitHub" opens it. When `repo` is given in any other form, Install and Preview refuse every release of the package. | | `tags` | no | Lower-case words for the tag filter (`blur`, `stylize`, `light`, `distort`…). Reuse tags the catalog already has. | | `preview.video` | no | An `https://` link to a short demo video on YouTube, Vimeo or GitHub. "Watch video" opens it in the browser. A link that isn't `https://` (or is longer than 500 characters) is left out. The live preview doesn't need it. | | `versions` | yes | One entry per release, newest or oldest first. | @@ -193,7 +193,7 @@ Release fields (one per entry in `versions`): | `version` | yes | Dotted numbers only, at most 32 characters: `1.0.0`, `1.2`. No `v` and no suffixes such as `-beta`. | | `api` | yes | The plug-in API the module implements: `1`. | | `minApp` | no | The oldest EffectCraft version the release needs (`0.17.0`). Leave it out if any version with this API works. | -| `url` | yes | The release asset's `https://` URL on GitHub: `https://github.com///releases/download//`. When `repo` is a `https://github.com//` URL, the asset must be in that repository. Install and Preview refuse any other `https://` URL. | +| `url` | yes | The release asset's `https://` URL on GitHub: `https://github.com///releases/download//`. When the package has a `repo`, the asset must be in that repository. Install and Preview refuse any other `https://` URL. | | `sha256` | yes | The file's SHA-256, 64 hex digits. | | `size` | no, but reviewed | The file's size in bytes. When it is given, a download of another size is refused. | | `effects` | yes | The effect ids the module registers (its manifest's `id`). EffectCraft uses them to find the package that provides an effect a project needs. | diff --git a/examples/plugin-catalog/schema.json b/examples/plugin-catalog/schema.json index a2d30676b..5fe914d86 100644 --- a/examples/plugin-catalog/schema.json +++ b/examples/plugin-catalog/schema.json @@ -12,9 +12,9 @@ }, "$defs": { "version": {"type": "string", "maxLength": 32, "pattern": "^[0-9]+(\\.[0-9]+)*$"}, - "github_url": { + "release_url": { "type": "string", - "pattern": "^https://(github\\.com|raw\\.githubusercontent\\.com|objects\\.githubusercontent\\.com|release-assets\\.githubusercontent\\.com)/[^\\s]+$" + "pattern": "^(?!.*/(\\.|%2[eE]){1,2}(/|$))https://[Gg][Ii][Tt][Hh][Uu][Bb]\\.[Cc][Oo][Mm]/[A-Za-z0-9._-]+/[A-Za-z0-9._-]+/releases/download/[^/?#\\\\\\s]+(/[^/?#\\\\\\s]+)+$" }, "package": { "type": "object", @@ -26,7 +26,7 @@ "author": {"type": "string"}, "description": {"type": "string"}, "license": {"type": "string"}, - "repo": {"type": "string", "pattern": "^https://"}, + "repo": {"type": "string", "pattern": "^(?!.*/(\\.|%2[eE]){1,2}(/|$))[Hh][Tt][Tt][Pp][Ss]://[Gg][Ii][Tt][Hh][Uu][Bb]\\.[Cc][Oo][Mm]/[A-Za-z0-9._-]+/[A-Za-z0-9._-]+(/tree(/[^/?#\\\\\\s]+)+)?/?$"}, "tags": {"type": "array", "items": {"type": "string"}}, "preview": { "type": "object", @@ -44,7 +44,7 @@ "version": {"$ref": "#/$defs/version"}, "api": {"type": "integer", "minimum": 0, "maximum": 4294967295}, "minApp": {"$ref": "#/$defs/version"}, - "url": {"$ref": "#/$defs/github_url"}, + "url": {"$ref": "#/$defs/release_url"}, "sha256": {"type": "string", "pattern": "^[0-9a-fA-F]{64}$"}, "size": {"type": "integer", "minimum": 1, "maximum": 67108864}, "effects": {"type": "array", "minItems": 1, "items": {"type": "string", "pattern": "^(?!ec\\.)[A-Za-z0-9._-]+$"}} diff --git a/examples/plugin-catalog/scripts/validate.sh b/examples/plugin-catalog/scripts/validate.sh index 40e37de7f..60686330a 100644 --- a/examples/plugin-catalog/scripts/validate.sh +++ b/examples/plugin-catalog/scripts/validate.sh @@ -42,7 +42,25 @@ dups=$(jq -r '.packages[].id' "$catalog" | sort | uniq -d) [ -z "$dups" ] || fail "duplicate package ids: $dups" echo "ok" -echo "== 3. downloads" +echo "== 3. release URLs" +# When a package has a `repo`, every release must be an asset of that repository, as Install and +# Preview require (the loader step installs from file:// copies, which skip this check). +bad=$(jq -r ' + # Only the scheme, host, owner and name compare without case; the `.git` suffix is lower case. + def repo_of: + (capture("^(?[^/]+//[^/]+)/(?[A-Za-z0-9._-]+)/(?[A-Za-z0-9._-]+?)(\\.git)?/?$") + // capture("^(?[^/]+//[^/]+)/(?[A-Za-z0-9._-]+)/(?[A-Za-z0-9._-]+)/tree/[^?#]+$") + | select(.h | ascii_downcase == "https://github.com") | "\(.o)/\(.n)" | ascii_downcase) // "?"; + .packages[] | . as $pkg | ((.repo // "") | gsub("^\\s+|\\s+$"; "")) as $repo + | select($repo != "") | ($repo | repo_of) as $want + | .versions[] | select(.url | startswith("file://") | not) + | ((.url | ascii_downcase | capture("^https://github\\.com/(?[^/]+)/(?[^/]+)/releases/download/") | "\(.o)/\(.n)") // "?") as $got + | select($want == "?" or $got != $want) + | "\($pkg.id) \(.version): \(.url) is not a release asset of \($repo)"' "$catalog") +[ -z "$bad" ] || fail "release URLs outside the package's repo:"$'\n'"$bad" +echo "ok" + +echo "== 4. downloads" # The checked files are what the loader step installs: a copy of the catalog names them by file://. local_catalog=$(jq '.' "$catalog") while IFS=$'\t' read -r p r id version url sha size; do @@ -58,7 +76,7 @@ done < <(jq -r '.packages | to_entries[] | .key as $p | .value as $pkg | $pkg.ve | [$p, .key, $pkg.id, .value.version, .value.url, .value.sha256, (.value.size // "")] | @tsv' "$catalog") echo "ok" -echo "== 4. load with EffectCraft" +echo "== 5. load with EffectCraft" if [ -z "${EFFECTCRAFT_CLI:-}" ]; then echo "skipped (set EFFECTCRAFT_CLI to an effectcraft-cli build)" exit 0 From 400187f9d91b4b2e9b6995f5afb19b4bba053390 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 5 Nov 2026 23:59:53 -0800 Subject: [PATCH 013/451] Plug-in Library: the catalog validator refuses dot and empty folder segments in repo `scripts/validate.sh` now reads a `repo` folder URL (`https://github.com///tree//`) as EffectCraft does: an empty, `.` or `..` segment (also percent-encoded), or a `?`, `#` or `\`, makes the `repo` unreadable, and every release of the package is reported. A `.` or `..` owner or name is refused too. The check now matches the app when the schema step is skipped. --- examples/plugin-catalog/scripts/validate.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/plugin-catalog/scripts/validate.sh b/examples/plugin-catalog/scripts/validate.sh index 60686330a..6e57e05ce 100644 --- a/examples/plugin-catalog/scripts/validate.sh +++ b/examples/plugin-catalog/scripts/validate.sh @@ -46,11 +46,15 @@ echo "== 3. release URLs" # When a package has a `repo`, every release must be an asset of that repository, as Install and # Preview require (the loader step installs from file:// copies, which skip this check). bad=$(jq -r ' + # A path segment EffectCraft refuses: empty, `.` or `..` (also percent-encoded). + def bad_segment: . == "" or (ascii_downcase | gsub("%2e"; ".") | . == "." or . == ".."); # Only the scheme, host, owner and name compare without case; the `.git` suffix is lower case. def repo_of: (capture("^(?[^/]+//[^/]+)/(?[A-Za-z0-9._-]+)/(?[A-Za-z0-9._-]+?)(\\.git)?/?$") - // capture("^(?[^/]+//[^/]+)/(?[A-Za-z0-9._-]+)/(?[A-Za-z0-9._-]+)/tree/[^?#]+$") - | select(.h | ascii_downcase == "https://github.com") | "\(.o)/\(.n)" | ascii_downcase) // "?"; + // (capture("^(?[^/]+//[^/]+)/(?[A-Za-z0-9._-]+)/(?[A-Za-z0-9._-]+)/tree/(?[^?#\\\\]+?)/?$") + | select(.f | split("/") | any(bad_segment) | not)) + | select((.h | ascii_downcase) == "https://github.com" and (.o | bad_segment | not) and (.n | bad_segment | not)) + | "\(.o)/\(.n)" | ascii_downcase) // "?"; .packages[] | . as $pkg | ((.repo // "") | gsub("^\\s+|\\s+$"; "")) as $repo | select($repo != "") | ($repo | repo_of) as $want | .versions[] | select(.url | startswith("file://") | not) From cc90ad0c3b2f36c5ade8b4d9620f6e5afba0bf32 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Fri, 6 Nov 2026 00:32:31 -0800 Subject: [PATCH 014/451] Plug-in Library: the catalog validator checks every remote release URL in full scripts/validate.sh now refuses any release URL other than a local file:// path that isn't a release asset (https://github.com///releases/download// with no query, fragment, backslash, or empty, . or .. segment), for packages without a repo too, as Install and Preview do. docs/plugins.md says the release URL rules don't apply to file:// releases from a local catalog. --- docs/plugins.md | 4 ++- examples/plugin-catalog/scripts/validate.sh | 28 +++++++++++++++------ 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/docs/plugins.md b/docs/plugins.md index 5302b0b3c..cc4f164aa 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -378,7 +378,9 @@ package can't read files, open the network or crash the app. (`https://github.com///releases/download/…`). When the package names a `repo`, the asset must be in that repository. A `repo` that isn't `https://github.com//` (with an optional trailing `/` or `.git`) or a folder in one (`https://github.com///tree//…`) - makes Install and Preview refuse every release of the package. A catalog other than the community one is read only when + makes Install and Preview refuse every `https://` release of the package. These rules don't apply + to a release whose `url` is a local `file://` path, which only a local catalog may name (to test + an entry before its release is published). A catalog other than the community one is read only when `library.refresh {catalog}` names it: an `index.json` on GitHub's hosts over `https://`, or a local `file://` path. * **Where it goes.** `/Library///.wasm` (the `Plug-ins` folder next to diff --git a/examples/plugin-catalog/scripts/validate.sh b/examples/plugin-catalog/scripts/validate.sh index 6e57e05ce..4a0d196fc 100644 --- a/examples/plugin-catalog/scripts/validate.sh +++ b/examples/plugin-catalog/scripts/validate.sh @@ -43,11 +43,24 @@ dups=$(jq -r '.packages[].id' "$catalog" | sort | uniq -d) echo "ok" echo "== 3. release URLs" -# When a package has a `repo`, every release must be an asset of that repository, as Install and -# Preview require (the loader step installs from file:// copies, which skip this check). +# Every release that isn't a local file:// path must be a release asset, and when its package has +# a `repo`, an asset of that repository, as Install and Preview require (the loader step installs +# from file:// copies, which skip this check). bad=$(jq -r ' # A path segment EffectCraft refuses: empty, `.` or `..` (also percent-encoded). def bad_segment: . == "" or (ascii_downcase | gsub("%2e"; ".") | . == "." or . == ".."); + # "owner/name" in lower case of a release asset, + # https://github.com///releases/download// (a tag may contain `/`), with + # no query, fragment, backslash, or empty, `.` or `..` segment; "?" for anything else. + def asset_of: + if startswith("https://") and (.[8:19] | ascii_downcase) == "github.com/" then + .[19:] as $rest + | ($rest | split("/")) as $p + | if ($rest | test("[?#\\\\]")) or ($p | length) < 6 or ($p | any(bad_segment)) + or ($p[0] | test("^[A-Za-z0-9._-]+$") | not) or ($p[1] | test("^[A-Za-z0-9._-]+$") | not) + or $p[2] != "releases" or $p[3] != "download" + then "?" else "\($p[0])/\($p[1])" | ascii_downcase end + else "?" end; # Only the scheme, host, owner and name compare without case; the `.git` suffix is lower case. def repo_of: (capture("^(?[^/]+//[^/]+)/(?[A-Za-z0-9._-]+)/(?[A-Za-z0-9._-]+?)(\\.git)?/?$") @@ -56,12 +69,13 @@ bad=$(jq -r ' | select((.h | ascii_downcase) == "https://github.com" and (.o | bad_segment | not) and (.n | bad_segment | not)) | "\(.o)/\(.n)" | ascii_downcase) // "?"; .packages[] | . as $pkg | ((.repo // "") | gsub("^\\s+|\\s+$"; "")) as $repo - | select($repo != "") | ($repo | repo_of) as $want + | (if $repo == "" then "" else $repo | repo_of end) as $want | .versions[] | select(.url | startswith("file://") | not) - | ((.url | ascii_downcase | capture("^https://github\\.com/(?[^/]+)/(?[^/]+)/releases/download/") | "\(.o)/\(.n)") // "?") as $got - | select($want == "?" or $got != $want) - | "\($pkg.id) \(.version): \(.url) is not a release asset of \($repo)"' "$catalog") -[ -z "$bad" ] || fail "release URLs outside the package's repo:"$'\n'"$bad" + | (.url | asset_of) as $got + | if $got == "?" then "\($pkg.id) \(.version): \(.url) is not a release asset (https://github.com///releases/download//)" + elif $want != "" and ($want == "?" or $got != $want) then "\($pkg.id) \(.version): \(.url) is not a release asset of \($repo)" + else empty end' "$catalog") +[ -z "$bad" ] || fail "release URLs that Install and Preview refuse:"$'\n'"$bad" echo "ok" echo "== 4. downloads" From 36dc209badfdbab2fa99f44e130798e3c35277ef Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Fri, 6 Nov 2026 00:49:16 -0800 Subject: [PATCH 015/451] Plug-in Library: release and repo URLs with white space are refused Install and Preview, the catalog schema and scripts/validate.sh now refuse a release URL or repo folder that contains white space in any segment, the tag and file name included: any Unicode white space character, and U+FEFF. Before, the app accepted a space or tab in a tag, file name or repo folder that the schema refused. --- crates/engine/src/system/library.rs | 19 +++++++++++++++++-- examples/plugin-catalog/schema.json | 4 ++-- examples/plugin-catalog/scripts/validate.sh | 9 ++++++--- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/crates/engine/src/system/library.rs b/crates/engine/src/system/library.rs index d1eaaf0bd..8fb147e53 100644 --- a/crates/engine/src/system/library.rs +++ b/crates/engine/src/system/library.rs @@ -272,12 +272,18 @@ fn dot_segment(p: &str) -> bool { p == "." || p == ".." } +/// A character a release or repository URL may not contain: `?`, `#`, `\`, Unicode white space, +/// or U+FEFF (the catalog schema's `\s` matches it too). +fn bad_url_char(c: char) -> bool { + matches!(c, '?' | '#' | '\\' | '\u{feff}') || c.is_whitespace() +} + /// `(owner, name)` in lower case of a `https://github.com//` repository URL (an /// optional trailing `/` or `.git`) or of a folder in one, `https://github.com///tree//`; /// `None` for anything else. fn github_repo(repo: &str) -> Option<(String, String)> { let rest = strip_prefix_ignore_case(repo.trim(), "https://github.com/")?; - if rest.contains(['?', '#', '\\']) { + if rest.contains(bad_url_char) { return None; } let rest = rest.strip_suffix('/').unwrap_or(rest); @@ -296,7 +302,7 @@ fn github_repo(repo: &str) -> Option<(String, String)> { fn release_url_problem(repo: &str, url: &str) -> Option { let not_asset = || Some(format!("`{url}` isn't a release asset (https://github.com///releases/download//)")); let Some(rest) = strip_prefix_ignore_case(url, "https://github.com/") else { return not_asset() }; - if rest.contains(['?', '#', '\\']) { + if rest.contains(bad_url_char) { return not_asset(); } let parts: Vec<&str> = rest.split('/').collect(); @@ -1230,6 +1236,12 @@ mod tests { "https://github.com/me/glow/releases/download/./v1/x.wasm", "https://github.com/me/glow/releases/download/v1\\x.wasm", "https://github.com/m e/glow/releases/download/v1/x.wasm", + "https://github.com/me/glow/releases/download/v 1/x.wasm", + "https://github.com/me/glow/releases/download/v1/x\t.wasm", + "https://github.com/me/glow/releases/download/v1/x.wasm\n", + "https://github.com/me/glow/releases/download/v1\u{a0}/x.wasm", + "https://github.com/me/glow/releases/download/v1/\u{85}x.wasm", + "https://github.com/me/glow/releases/download/v1/x\u{feff}.wasm", "https://github.com/../glow/releases/download/v1/x.wasm", "https://github.com.evil.com/me/glow/releases/download/v1/x.wasm", ] { @@ -1281,6 +1293,9 @@ mod tests { "https://github.com/me/glow?tab=readme", "https://github.com/me/glow#readme", "https://github.com/me/gl ow", + "https://github.com/me/glow/tree/main/my plug-in", + "https://github.com/me/glow/tree/ma\tin", + "https://github.com/me/glow/tree/main/x\u{feff}", "https://github.com/me/..", ] { let why = release_url_problem(repo, asset); diff --git a/examples/plugin-catalog/schema.json b/examples/plugin-catalog/schema.json index 5fe914d86..c31d57fea 100644 --- a/examples/plugin-catalog/schema.json +++ b/examples/plugin-catalog/schema.json @@ -14,7 +14,7 @@ "version": {"type": "string", "maxLength": 32, "pattern": "^[0-9]+(\\.[0-9]+)*$"}, "release_url": { "type": "string", - "pattern": "^(?!.*/(\\.|%2[eE]){1,2}(/|$))https://[Gg][Ii][Tt][Hh][Uu][Bb]\\.[Cc][Oo][Mm]/[A-Za-z0-9._-]+/[A-Za-z0-9._-]+/releases/download/[^/?#\\\\\\s]+(/[^/?#\\\\\\s]+)+$" + "pattern": "^(?!.*/(\\.|%2[eE]){1,2}(/|$))https://[Gg][Ii][Tt][Hh][Uu][Bb]\\.[Cc][Oo][Mm]/[A-Za-z0-9._-]+/[A-Za-z0-9._-]+/releases/download/[^/?#\\\\\\s\\u0085]+(/[^/?#\\\\\\s\\u0085]+)+$" }, "package": { "type": "object", @@ -26,7 +26,7 @@ "author": {"type": "string"}, "description": {"type": "string"}, "license": {"type": "string"}, - "repo": {"type": "string", "pattern": "^(?!.*/(\\.|%2[eE]){1,2}(/|$))[Hh][Tt][Tt][Pp][Ss]://[Gg][Ii][Tt][Hh][Uu][Bb]\\.[Cc][Oo][Mm]/[A-Za-z0-9._-]+/[A-Za-z0-9._-]+(/tree(/[^/?#\\\\\\s]+)+)?/?$"}, + "repo": {"type": "string", "pattern": "^(?!.*/(\\.|%2[eE]){1,2}(/|$))[Hh][Tt][Tt][Pp][Ss]://[Gg][Ii][Tt][Hh][Uu][Bb]\\.[Cc][Oo][Mm]/[A-Za-z0-9._-]+/[A-Za-z0-9._-]+(/tree(/[^/?#\\\\\\s\\u0085]+)+)?/?$"}, "tags": {"type": "array", "items": {"type": "string"}}, "preview": { "type": "object", diff --git a/examples/plugin-catalog/scripts/validate.sh b/examples/plugin-catalog/scripts/validate.sh index 4a0d196fc..711b69394 100644 --- a/examples/plugin-catalog/scripts/validate.sh +++ b/examples/plugin-catalog/scripts/validate.sh @@ -49,25 +49,28 @@ echo "== 3. release URLs" bad=$(jq -r ' # A path segment EffectCraft refuses: empty, `.` or `..` (also percent-encoded). def bad_segment: . == "" or (ascii_downcase | gsub("%2e"; ".") | . == "." or . == ".."); + # A `?`, `#`, `\` or white space character (Unicode, and U+FEFF), which EffectCraft refuses in a URL. + def bad_char: test("[?#\\\\\t\n\u000b\f\r \u0085   - 

   ]"); # "owner/name" in lower case of a release asset, # https://github.com///releases/download// (a tag may contain `/`), with - # no query, fragment, backslash, or empty, `.` or `..` segment; "?" for anything else. + # no query, fragment, backslash, white space, or empty, `.` or `..` segment; "?" for anything else. def asset_of: if startswith("https://") and (.[8:19] | ascii_downcase) == "github.com/" then .[19:] as $rest | ($rest | split("/")) as $p - | if ($rest | test("[?#\\\\]")) or ($p | length) < 6 or ($p | any(bad_segment)) + | if ($rest | bad_char) or ($p | length) < 6 or ($p | any(bad_segment)) or ($p[0] | test("^[A-Za-z0-9._-]+$") | not) or ($p[1] | test("^[A-Za-z0-9._-]+$") | not) or $p[2] != "releases" or $p[3] != "download" then "?" else "\($p[0])/\($p[1])" | ascii_downcase end else "?" end; # Only the scheme, host, owner and name compare without case; the `.git` suffix is lower case. def repo_of: + if bad_char then "?" else (capture("^(?[^/]+//[^/]+)/(?[A-Za-z0-9._-]+)/(?[A-Za-z0-9._-]+?)(\\.git)?/?$") // (capture("^(?[^/]+//[^/]+)/(?[A-Za-z0-9._-]+)/(?[A-Za-z0-9._-]+)/tree/(?[^?#\\\\]+?)/?$") | select(.f | split("/") | any(bad_segment) | not)) | select((.h | ascii_downcase) == "https://github.com" and (.o | bad_segment | not) and (.n | bad_segment | not)) - | "\(.o)/\(.n)" | ascii_downcase) // "?"; + | "\(.o)/\(.n)" | ascii_downcase) // "?" end; .packages[] | . as $pkg | ((.repo // "") | gsub("^\\s+|\\s+$"; "")) as $repo | (if $repo == "" then "" else $repo | repo_of end) as $want | .versions[] | select(.url | startswith("file://") | not) From 91443ef25ed750afcdc449cd52007faade922fd0 Mon Sep 17 00:00:00 2001 From: vangel76 Date: Fri, 6 Nov 2026 22:20:40 +0100 Subject: [PATCH 016/451] Disk cache: record the source files each frame reads Part of #3184 (step 1): renders now report which footage files they read, each with its identity (size and modification time) as read. Nothing uses the list yet: images, cache keys and cache behaviour are unchanged. - render: `reads` module with `FileStamp`, `ReadFile`, `ReadFiles` (sorted, deduplicated, bounded; marked incomplete when it can't vouch for every file) and the thread-safe `ReadLog`. `Renderer::reads` collects a frame's files; `FootageSource::recording` lets a source note what it reads. `file_stamp` uses the same identity. - Layer cache entries keep the files their buffer was made of and report them on every hit; derived entries (styles, blend space, flattened) keep their base's. Buffers from the disk cache or the browser store don't know their files yet and mark the list incomplete. - Media pool: every file read notes its identity, taken from the file it opens. Decoded frames, opened movies, GIFs, models and EXR channels keep it with the cache entry, so a frame served from memory reports its file without touching the disk. - Viewer frame worker collects each frame's list and carries it to where the disk entry is written (step 2 stores it). Co-Authored-By: Claude Opus 5.5 --- Cargo.lock | 1 + crates/media/Cargo.toml | 4 + crates/media/src/exr_channels.rs | 84 +++++---- crates/media/src/lib.rs | 26 ++- crates/media/src/pool.rs | 198 +++++++++++++-------- crates/media/src/reads.rs | 117 +++++++++++++ crates/media/src/reads/tests.rs | 184 ++++++++++++++++++++ crates/media/src/stream.rs | 15 +- crates/render/src/accel.rs | 20 +-- crates/render/src/cache.rs | 34 ++-- crates/render/src/disk_cache.rs | 15 +- crates/render/src/footage.rs | 17 ++ crates/render/src/fx_host.rs | 2 +- crates/render/src/layers.rs | 38 ++-- crates/render/src/lib.rs | 5 + crates/render/src/pipeline.rs | 164 +++++++++++------- crates/render/src/reads.rs | 230 +++++++++++++++++++++++++ crates/render/src/three_d/adv/scene.rs | 4 +- crates/render/src/three_d/compose.rs | 4 +- crates/ui-egui/src/frames.rs | 53 ++++-- 20 files changed, 968 insertions(+), 247 deletions(-) create mode 100644 crates/media/src/reads.rs create mode 100644 crates/media/src/reads/tests.rs create mode 100644 crates/render/src/reads.rs diff --git a/Cargo.lock b/Cargo.lock index 5b426c8f8..b35796cce 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1741,6 +1741,7 @@ version = "0.21.0" dependencies = [ "craft-docpath", "effectcraft-color", + "effectcraft-effects", "effectcraft-model", "effectcraft-pdf", "effectcraft-project", diff --git a/crates/media/Cargo.toml b/crates/media/Cargo.toml index a4070297b..4947d928a 100644 --- a/crates/media/Cargo.toml +++ b/crates/media/Cargo.toml @@ -36,3 +36,7 @@ rayon = { workspace = true } serde_json = { workspace = true } thiserror = { workspace = true } log = { workspace = true } + +[dev-dependencies] +# (tests render comps that read layers through effects; already a dependency of effectcraft-render) +effectcraft-effects = { workspace = true } diff --git a/crates/media/src/exr_channels.rs b/crates/media/src/exr_channels.rs index c3e7cfc3d..d0acf590f 100644 --- a/crates/media/src/exr_channels.rs +++ b/crates/media/src/exr_channels.rs @@ -17,6 +17,7 @@ use std::sync::{Arc, Mutex, OnceLock, PoisonError}; use effectcraft_raster::channels3d::{BACKGROUND_DEPTH, split_channel}; use effectcraft_raster::{AuxChannels, Image}; +use effectcraft_render::reads::{ReadFile, ReadFiles}; use exr::block::UncompressedBlock; use exr::block::chunk::TileCoordinates; use exr::image::read::image::ReadImage; @@ -477,8 +478,8 @@ fn layered_picture_of(aux: &AuxChannels, op: AlphaOp) -> Option { /// decoded anyway), else of the picture's channels alone (also when the cache has no channels /// for the file: a read that failed, or a broken part the picture doesn't use). `Err(Some(why))` /// when the file is too large to decode, `Err(None)` when it isn't a readable multi-layer EXR. -pub(crate) fn layered_picture(path: &str, bytes: Arc<[u8]>, op: AlphaOp, shared: bool) -> Result> { - if shared && let Some(d) = cache().get(path, Use::Picture, || Some(bytes.clone())) { +pub(crate) fn layered_picture(path: &str, bytes: Arc<[u8]>, file: &ReadFile, op: AlphaOp, shared: bool) -> Result> { + if shared && let Some(d) = cache().get(path, Use::Picture, || read_as(file, bytes.clone())) { return layered_picture_of(&d.aux, op).ok_or(None); } let (d, rgb, a) = picture_only(&bytes).map_err(|r| match r { @@ -499,8 +500,8 @@ pub(crate) fn layered_picture(path: &str, bytes: Arc<[u8]>, op: AlphaOp, shared: /// decoder shows for a file it reads, [`layered_image`]'s rule for one it refuses. `None` when /// the planes can't stand in for the `image` crate's picture (decode with it), or the file is /// not a readable EXR. -pub(crate) fn cached_picture(path: &str, bytes: Arc<[u8]>, op: AlphaOp) -> Option { - let d = cache().get(path, Use::Picture, || Some(bytes))?; +pub(crate) fn cached_picture(path: &str, bytes: Arc<[u8]>, file: &ReadFile, op: AlphaOp) -> Option { + let d = cache().get(path, Use::Picture, || read_as(file, bytes))?; let aux = &d.aux; match d.rgb { Rgb::None => layered_picture_of(aux, op), @@ -536,8 +537,16 @@ const CACHE_FILES: usize = 64; /// rendered at once. The oldest stops being kept when another comes. const HELD_FILES: usize = 4; -/// A file's decode: done once, by the first caller; the others wait for it. -type Slot = Arc>>>; +/// A file's decode: done once, by the first caller; the others wait for it. With the files read +/// for it (see [`crate::reads`]), noted again on every hit. +type Slot = Arc>, ReadFiles)>>; + +/// Bytes the caller already read from `file`, given to the cache as read from it (so the entry +/// keeps the file's identity). +fn read_as(file: &ReadFile, bytes: Arc<[u8]>) -> Option> { + crate::reads::note(file.clone()); + Some(bytes) +} struct Entry { path: String, @@ -554,8 +563,8 @@ impl Entry { fn in_use(&self) -> bool { match self.slot.get() { None => true, - Some(None) => false, - Some(Some(d)) => Arc::strong_count(d) > 1 || Arc::strong_count(&d.aux) > 1, + Some((None, _)) => false, + Some((Some(d), _)) => Arc::strong_count(d) > 1 || Arc::strong_count(&d.aux) > 1, } } } @@ -648,30 +657,18 @@ impl ChannelCache { // is safe because the decode never waits on rayon's global pool (the exr crate // decompresses on a pool of its own and this thread only receives the blocks), so the // decoding thread can't be waiting for this one. - let v = slot - .get_or_init(|| { - decoded_here = true; - self.decodes.fetch_add(1, Ordering::Relaxed); - #[cfg(test)] - count_decode(true); - let _abandon = Abandon { cache: self, slot: &slot }; - let bytes = read()?; - // The planes it will allocate count against the budget while it decodes. - if let Ok(meta) = exr::meta::MetaData::read_from_buffered(std::io::Cursor::new(&bytes[..]), false) - && let Some(need) = planes_bytes(&meta, &|_| true) - { - self.account(&slot, need.min(MAX_DECODE_BYTES)); - } - match decode(&bytes, &|_| true) { - Ok(d) => Some(Arc::new(d)), - Err(Refused::TooLarge(why)) => { - log::warn!("media: {path}: {why}"); - None - } - Err(Refused::Unreadable) => None, - } - }) - .clone(); + let (v, files) = slot.get_or_init(|| { + decoded_here = true; + self.decodes.fetch_add(1, Ordering::Relaxed); + #[cfg(test)] + count_decode(true); + let _abandon = Abandon { cache: self, slot: &slot }; + let (bytes, files) = crate::reads::captured(read); + (bytes.and_then(|bytes| self.decode_file(path, &slot, &bytes)), files) + }); + // The file(s) the decode was made of, read now or for an earlier caller. + crate::reads::note_all(files); + let v = v.clone(); if decoded_here { self.account(&slot, v.as_ref().map_or(0, |d| d.bytes())); } @@ -692,6 +689,24 @@ impl ChannelCache { v } + /// Decode the file at `path` whose bytes are `bytes` for `slot` (see [`ChannelCache::get`]). + fn decode_file(&self, path: &str, slot: &Slot, bytes: &[u8]) -> Option> { + // The planes it will allocate count against the budget while it decodes. + if let Ok(meta) = exr::meta::MetaData::read_from_buffered(std::io::Cursor::new(bytes), false) + && let Some(need) = planes_bytes(&meta, &|_| true) + { + self.account(slot, need.min(MAX_DECODE_BYTES)); + } + match decode(bytes, &|_| true) { + Ok(d) => Some(Arc::new(d)), + Err(Refused::TooLarge(why)) => { + log::warn!("media: {path}: {why}"); + None + } + Err(Refused::Unreadable) => None, + } + } + /// Drop least recently used files not in use until the rest fit the budget, keeping `newest`. fn evict(entries: &mut Vec, budget: usize, newest: &Slot) { while entries.iter().map(|e| e.bytes).sum::() > budget || entries.len() > CACHE_FILES { @@ -996,7 +1011,7 @@ mod tests { let path = "/474-shared-fallback.exr"; assert!(cache().get(path, Use::Channels, || None).is_none(), "a read that failed"); let op = AlphaOp::of(&Footage::default(), FloatCurve::Linear); - let img = layered_picture(path, bytes, op, true).unwrap(); + let img = layered_picture(path, bytes, &ReadFile::new(path, effectcraft_render::reads::FileStamp::Virtual), op, true).unwrap(); assert_eq!(img.get(1, 1), [0.5, 0.5, 0.5, 1.0]); } @@ -1174,7 +1189,8 @@ mod tests { for curve in [FloatCurve::Srgb, FloatCurve::Linear, FloatCurve::Gamma24] { let op = AlphaOp::of(&Footage { alpha, premul_color: [0.2, 0.4, 0.6], ..Default::default() }, curve); let want = crate::convert::dynamic_to_image(&img, op); - let got = cached_picture(&path, bytes.as_slice().into(), op).unwrap(); + let got = cached_picture(&path, bytes.as_slice().into(), &ReadFile::new(path.as_str(), effectcraft_render::reads::FileStamp::Virtual), op) + .unwrap(); assert_eq!((got.width, got.height), (want.width, want.height)); assert_eq!(bits(&got), bits(&want), "file {k} {alpha:?} {curve:?}"); } diff --git a/crates/media/src/lib.rs b/crates/media/src/lib.rs index 31478f111..0b509c45f 100644 --- a/crates/media/src/lib.rs +++ b/crates/media/src/lib.rs @@ -25,6 +25,7 @@ mod layered; pub use layered::vector_doc; mod pool; mod probe; +mod reads; mod stream; mod wav_markers; mod webp_anim; @@ -85,7 +86,15 @@ pub fn is_importable(path: &std::path::Path) -> bool { /// A whole file's bytes, refusing anything that isn't a regular file: a project can name /// `/dev/zero` or a FIFO as footage, and reading those never ends (#2134). pub(crate) fn read_regular_file(path: &std::path::Path) -> std::io::Result> { + read_regular_file_stamped(path).map(|(bytes, _)| bytes) +} + +/// [`read_regular_file`] with the file's identity, from the metadata of the open file (no +/// second look at the path). +pub(crate) fn read_regular_file_stamped(path: &std::path::Path) -> std::io::Result<(Vec, effectcraft_render::reads::FileStamp)> { use std::io::Read; + #[cfg(test)] + count_open(path); let mut file = std::fs::File::open(path)?; let meta = file.metadata()?; if !meta.is_file() { @@ -95,7 +104,22 @@ pub(crate) fn read_regular_file(path: &std::path::Path) -> std::io::Result> = std::sync::Mutex::new(Vec::new()); + +/// Count an open of a file (tests: which files a render touched on disk). +#[cfg(test)] +pub(crate) fn count_open(path: &std::path::Path) { + OPENS.lock().unwrap_or_else(std::sync::PoisonError::into_inner).push(path.to_path_buf()); +} + +/// How many times files under `dir` were opened so far (tests). +#[cfg(test)] +pub(crate) fn opens_under(dir: &std::path::Path) -> usize { + OPENS.lock().unwrap_or_else(std::sync::PoisonError::into_inner).iter().filter(|p| p.starts_with(dir)).count() } pub(crate) fn ext_of(path: &std::path::Path) -> String { diff --git a/crates/media/src/pool.rs b/crates/media/src/pool.rs index b0b2f2539..4b7b05603 100644 --- a/crates/media/src/pool.rs +++ b/crates/media/src/pool.rs @@ -6,6 +6,7 @@ use std::sync::{Arc, Condvar, Mutex, OnceLock}; use effectcraft_project::{AlphaMode, Footage, FootageKind, ItemId}; use effectcraft_raster::{Image, Px}; +use effectcraft_render::reads::{FileStamp, ReadFile, ReadFiles, ReadLog}; use effectcraft_render::{FloatCurve, FootageSource}; use effectcraft_time::{FrameRate, TICKS_PER_SECOND, Tick}; use filmcraft_media::{FrameRequest, SharedSource}; @@ -14,6 +15,7 @@ use image::metadata::Orientation; use crate::convert::{AlphaOp, dynamic_to_image, frame_to_image_in, frame_to_image_scaled, turned}; use crate::downmix::Order; use crate::gif_anim::{self, Anim}; +use crate::reads; use crate::{MediaError, Result}; /// Default frame-cache budget: 1 GiB of decoded frames. @@ -53,6 +55,8 @@ struct Key { struct Entry { img: Arc, + /// The files the frame was decoded from (see [`crate::reads`]). + files: Arc, stamp: u64, bytes: usize, } @@ -106,18 +110,18 @@ struct Lru { } impl Lru { - fn get(&mut self, k: &Key) -> Option> { + fn get(&mut self, k: &Key) -> Option<(Arc, Arc)> { let e = self.map.get_mut(k)?; self.order.remove(&e.stamp); self.clock += 1; e.stamp = self.clock; self.order.insert(e.stamp, k.clone()); - Some(e.img.clone()) + Some((e.img.clone(), e.files.clone())) } - fn insert(&mut self, k: Key, img: Arc, budget: usize) { + fn insert(&mut self, k: Key, img: Arc, files: Arc, budget: usize) { let bytes = img.data.len() * std::mem::size_of::() + 64; self.clock += 1; - if let Some(old) = self.map.insert(k.clone(), Entry { img, stamp: self.clock, bytes }) { + if let Some(old) = self.map.insert(k.clone(), Entry { img, files, stamp: self.clock, bytes }) { self.order.remove(&old.stamp); self.bytes -= old.bytes; } @@ -180,8 +184,9 @@ struct CacheState { } /// A movie/audio source by path ([`Opened`]), opened by the first caller while the others wait -/// for it (`None`: failed to open; not retried until `forget`). -type SourceSlot = Arc>>; +/// for it (`None`: failed to open; not retried until `forget`), with the file's identity as +/// opened. +type SourceSlot = Arc, ReadFile)>>; /// An opened movie/audio source, the turn its picture is shown with and the order its decoded /// audio channels arrive in. @@ -211,7 +216,7 @@ fn channel_order(src: &SharedSource, header: Option<&[u8]>, file: Option<&dyn fi } /// An animated GIF by path, as [`SourceSlot`] (the error message when it failed to load). -type GifSlot = Arc, String>>>; +type GifSlot = Arc, String>, ReadFile)>>; struct Inner { /// Opened movie/audio sources by path. @@ -220,8 +225,9 @@ struct Inner { opened: AtomicU64, /// In-memory files registered with `add_bytes` (web builds, tests). files: Mutex>>, - /// Parsed 3D models by path (`None`: failed to load; not retried until `forget`). - models: Mutex>>>, + /// Parsed 3D models by path (`None`: failed to load; not retried until `forget`), with the + /// files read for them (the model's and the resources it names). + models: Mutex>, Arc)>>, /// Decoded animated GIFs and WebPs by path, loaded by the first caller while the others wait (an /// `Err` is not retried until `forget`). gifs: Mutex, GifSlot>>, @@ -439,11 +445,13 @@ impl MediaPool { } /// The conformed-audio file of `path` at `rate` (named by a hash of the path, size and - /// modification time, so an edited file conforms again, and of `CONFORM_VERSION`). + /// modification time, so an edited file conforms again, and of `CONFORM_VERSION`). Notes + /// `path` as read with that identity (see [`crate::reads`]): its samples come from it. pub fn conformed_path(&self, path: &str, rate: u32) -> Option { use std::hash::{Hash, Hasher}; let folder = lock(&self.inner.conform).clone()?; let meta = std::fs::metadata(path).ok()?; + reads::note(ReadFile::new(path, FileStamp::of_metadata(&meta))); let mut h = std::collections::hash_map::DefaultHasher::new(); (CONFORM_VERSION, path, meta.len(), meta.modified().ok()).hash(&mut h); Some(folder.join(format!("{:016x}_{rate}.ecaf", h.finish()))) @@ -612,16 +620,20 @@ impl Inner { /// A 3D model file and its sibling resources (buffers, textures, MTL files), parsed once. fn model(&self, path: &str) -> Option> { - if let Some(m) = lock(&self.models).get(path) { - return m.clone(); + let found = lock(&self.models).get(path).cloned(); + if let Some((m, files)) = found { + reads::note_all(&files); + return m; } - let loaded = self.read(path).map_err(|e| e.to_string()).and_then(|bytes| { - // Files the model names are read only when local or on the model's own network share. - let resolve = |uri: &str| -> Option> { - let p = craft_docpath::resolve_absolute(uri, Some(std::path::Path::new(path))).ok()?; - self.read(&p.to_string_lossy()).ok().map(|b| b.to_vec()) - }; - effectcraft_model::load(path, &bytes, &resolve).map_err(|e| e.to_string()) + let (loaded, files) = reads::captured(|| { + self.read(path).map_err(|e| e.to_string()).and_then(|bytes| { + // Files the model names are read only when local or on the model's own network share. + let resolve = |uri: &str| -> Option> { + let p = craft_docpath::resolve_absolute(uri, Some(std::path::Path::new(path))).ok()?; + self.read(&p.to_string_lossy()).ok().map(|b| b.to_vec()) + }; + effectcraft_model::load(path, &bytes, &resolve).map_err(|e| e.to_string()) + }) }); let m = match loaded { Ok(m) => Some(Arc::new(m)), @@ -630,14 +642,29 @@ impl Inner { None } }; - lock(&self.models).entry(path.to_string()).or_insert(m).clone() + let (m, files) = lock(&self.models).entry(path.to_string()).or_insert((m, Arc::new(files))).clone(); + reads::note_all(&files); + m } + /// The bytes of the file at `path`, noted as read (see [`crate::reads`]). fn read(&self, path: &str) -> Result> { - if let Some(b) = lock(&self.files).get(path) { - return Ok(b.clone()); + let (bytes, file) = self.read_file(path); + reads::note(file); + bytes + } + + /// The bytes of the file at `path` and its identity as read ([`FileStamp::Missing`] when it + /// can't be read), not noted. + fn read_file(&self, path: &str) -> (Result>, ReadFile) { + let in_memory = lock(&self.files).get(path).cloned(); + if let Some(b) = in_memory { + return (Ok(b), ReadFile::new(path, FileStamp::Virtual)); + } + match crate::read_regular_file_stamped(std::path::Path::new(path)) { + Ok((bytes, stamp)) => (Ok(bytes.into()), ReadFile::new(path, stamp)), + Err(e) => (Err(MediaError::Io(format!("{path}: {e}"))), ReadFile::new(path, FileStamp::Missing)), } - crate::read_regular_file(std::path::Path::new(path)).map(Into::into).map_err(|e| MediaError::Io(format!("{path}: {e}"))) } /// The opened movie/audio source for `path` ([`Opened`]). The first caller opens it, outside @@ -645,35 +672,42 @@ impl Inner { /// files are decoded whole); callers asking for the same file meanwhile wait for that instead /// of opening it again: a preview's frame workers, audio feeder, conform and waveform threads /// each decoded a long FLAC in full at once (#408). + /// Each call notes the file as read (see [`crate::reads`]), with its identity as opened. fn opened(&self, path: &Arc) -> Option { let slot = lock(&self.sources).entry(path.clone()).or_default().clone(); - slot.get_or_init(|| { - self.opened.fetch_add(1, Ordering::Relaxed); - // Files on disk are read in place (the index, then samples on demand) rather than - // whole; in-memory files (`add_bytes`) and wasm32 builds open from bytes. - let in_memory = lock(&self.files).contains_key(&**path); - let file = std::path::Path::new(&**path); - let in_place = if in_memory { None } else { crate::stream::open_source(file) }; - let in_place = in_place.map(|src| { - let (header, reader) = (crate::stream::movie_header(file), crate::stream::file_reader(file)); - src.map(|src| Opened::new(src, header.as_deref(), reader.as_deref())) + let (opened, file) = slot.get_or_init(|| self.open(path)); + reads::note(file.clone()); + opened.clone() + } + + /// Open the movie/audio file at `path` (see [`Inner::opened`]), with its identity as opened. + fn open(&self, path: &Arc) -> (Option, ReadFile) { + self.opened.fetch_add(1, Ordering::Relaxed); + // Files on disk are read in place (the index, then samples on demand) rather than + // whole; in-memory files (`add_bytes`) and wasm32 builds open from bytes. + let in_memory = lock(&self.files).contains_key(&**path); + let file = std::path::Path::new(&**path); + let in_place = if in_memory { None } else { crate::stream::open_source(file) }; + let in_place = in_place.map(|(src, stamp)| { + let (header, reader) = (crate::stream::movie_header(file), crate::stream::file_reader(file)); + (src.map(|src| Opened::new(src, header.as_deref(), reader.as_deref())), ReadFile::new(path.clone(), stamp)) + }); + let (opened, read) = in_place.unwrap_or_else(|| { + let (bytes, read) = self.read_file(path); + let opened = bytes.and_then(|bytes| { + let name = std::path::Path::new(&**path).file_name().map(|n| n.to_string_lossy().to_string()).unwrap_or_default(); + let src = filmcraft_codecs::open_bytes(&name, bytes.clone()).map_err(MediaError::from)?; + Ok(Opened::new(src, Some(&bytes), Some(&filmcraft_media::reader::MemReader(bytes.clone())))) }); - let opened = in_place.unwrap_or_else(|| { - self.read(path).and_then(|bytes| { - let name = std::path::Path::new(&**path).file_name().map(|n| n.to_string_lossy().to_string()).unwrap_or_default(); - let src = filmcraft_codecs::open_bytes(&name, bytes.clone()).map_err(MediaError::from)?; - Ok(Opened::new(src, Some(&bytes), Some(&filmcraft_media::reader::MemReader(bytes.clone())))) - }) - }); - match opened { - Ok(s) => Some(s), - Err(e) => { - self.note_problem(path, "", &e); - None - } + (opened, read) + }); + match opened { + Ok(s) => (Some(s), read), + Err(e) => { + self.note_problem(path, "", &e); + (None, read) } - }) - .clone() + } } /// Remember why the movie at `path` cannot be shown (`codec` is the footage's, when known) @@ -694,13 +728,15 @@ impl Inner { /// map's lock; callers asking for the same file meanwhile wait for that. fn gif(&self, path: &Arc) -> Result> { let slot = lock(&self.gifs).entry(path.clone()).or_default().clone(); - let loaded = slot.get_or_init(|| { - let loaded = self.read(path).and_then(|bytes| Anim::load(&bytes)); - loaded.map(Arc::new).map_err(|e| { + let (loaded, file) = slot.get_or_init(|| { + let (bytes, file) = self.read_file(path); + let loaded = bytes.and_then(|bytes| Anim::load(&bytes)).map(Arc::new).map_err(|e| { log::warn!("media: cannot decode {path}: {e}"); e.to_string() - }) + }); + (loaded, file) }); + reads::note(file.clone()); loaded.clone().map_err(|e| MediaError::Decode(format!("{path}: {e}"))) } @@ -783,19 +819,15 @@ impl Inner { let mut c = lock(&self.cache); // sequential playback of a movie: read the next frame ahead if playback && movie { - let prev = c.last.insert(loc.key.path.clone(), loc.key.frame); - if prev == Some(loc.key.frame - 1) && self.read_ahead.load(Ordering::Relaxed) { - let next_t = t + footage.frame_rate.frame_duration(); - let mut next = Self::locate(footage, next_t, float); - next.key.size = loc.key.size; - if next.key != loc.key && !c.lru.map.contains_key(&next.key) && !c.inflight.contains(&next.key) { - self.prefetch(footage, next_t, size, float); - } - } + self.prefetch_next(&mut c, &loc, footage, t, size, float); } + // (Each exit notes the files the frame came from, see `crate::reads`; a cached frame + // notes those it was decoded from, without touching them.) loop { - if let Some(img) = c.lru.get(&loc.key) { + if let Some((img, files)) = c.lru.get(&loc.key) { self.hits.fetch_add(1, Ordering::Relaxed); + drop(c); + reads::note_all(&files); return Ok(img); } if !c.inflight.contains(&loc.key) { @@ -808,7 +840,9 @@ impl Inner { if rayon::current_thread_index().is_some() { self.misses.fetch_add(1, Ordering::Relaxed); drop(c); - return Ok(Arc::new(self.decode(&loc, footage)?)); + let (img, files) = reads::captured(|| self.decode(&loc, footage)); + reads::note_all(&files); + return Ok(Arc::new(img?)); } c = self.done.wait(c).unwrap_or_else(std::sync::PoisonError::into_inner); } @@ -816,11 +850,26 @@ impl Inner { c.inflight.insert(loc.key.clone()); drop(c); let _guard = Inflight { inner: self, key: loc.key.clone() }; - let img = Arc::new(self.decode(&loc, footage)?); - lock(&self.cache).lru.insert(loc.key, img.clone(), self.budget()); + let (img, files) = reads::captured(|| self.decode(&loc, footage)); + reads::note_all(&files); + let img = Arc::new(img?); + lock(&self.cache).lru.insert(loc.key, img.clone(), Arc::new(files), self.budget()); Ok(img) } + /// Sequential playback of a movie (`loc`, at `t`): read the frame after it ahead. + fn prefetch_next(self: &Arc, c: &mut CacheState, loc: &Loc, footage: &Footage, t: Tick, size: Option<(u32, u32)>, float: FloatCurve) { + let prev = c.last.insert(loc.key.path.clone(), loc.key.frame); + if prev == Some(loc.key.frame - 1) && self.read_ahead.load(Ordering::Relaxed) { + let next_t = t + footage.frame_rate.frame_duration(); + let mut next = Self::locate(footage, next_t, float); + next.key.size = loc.key.size; + if next.key != loc.key && !c.lru.map.contains_key(&next.key) && !c.inflight.contains(&next.key) { + self.prefetch(footage, next_t, size, float); + } + } + } + #[cfg(not(target_arch = "wasm32"))] fn prefetch(self: &Arc, footage: &Footage, t: Tick, size: Option<(u32, u32)>, float: FloatCurve) { let (me, f) = (self.clone(), footage.clone()); @@ -862,7 +911,9 @@ impl Inner { if &**path == PLACEHOLDER { return Ok(colour_bars(footage.width, footage.height)); } - let bytes = self.read(path)?; + let (bytes, file) = self.read_file(path); + reads::note(file.clone()); + let bytes = bytes?; if let Some(img) = crate::dpx::decode(path, &bytes)? { return Ok(dynamic_to_image(&img, op)); } @@ -880,7 +931,7 @@ impl Inner { let shared = lock(&self.aux_footage).contains(&footage.path); if shared && path.to_ascii_lowercase().ends_with(".exr") - && let Some(img) = crate::exr_channels::cached_picture(path, bytes.clone(), op) + && let Some(img) = crate::exr_channels::cached_picture(path, bytes.clone(), &file, op) { return Ok(img); } @@ -889,7 +940,7 @@ impl Inner { match crate::probe::load_oriented(&bytes, crate::still_format(path, &bytes)) { Ok(img) => Ok(dynamic_to_image(&img, op)), // A multi-layer OpenEXR file without an unnamed RGB layer: its colour layer. - Err(e) => crate::exr_channels::layered_picture(path, bytes, op, shared) + Err(e) => crate::exr_channels::layered_picture(path, bytes, &file, op, shared) .map_err(|why| MediaError::Decode(format!("{path}: {}", why.unwrap_or_else(|| e.to_string())))), } } @@ -957,6 +1008,13 @@ impl FootageSource for MediaPool { fn cancellable(&self, cancel: &Arc, f: &mut dyn FnMut()) { filmcraft_media::cancel::with_cancel(cancel, f) } + /// Every read of a file notes it (see [`crate::reads`]): a frame's image file or sequence + /// frame, a movie, a model and the files it names, an EXR's channels, a movie's audio. A + /// frame (or other entry) served from memory notes the files it was made of, as they were + /// when read, without reading them again. A missing sequence frame (colour bars) reads none. + fn recording(&self, reads: &ReadLog, f: &mut dyn FnMut()) { + reads::recording(reads, f) + } fn frame(&self, item: ItemId, footage: &Footage, t: Tick) -> Option> { self.frame_sized(item, footage, t, None, FloatCurve::Srgb) } @@ -1207,13 +1265,13 @@ mod tests { let k = |i| Key { path: "a".into(), frame: i, interp: 0, matte: [0; 3], size: (0, 0), nominal: (0, 0) }; let budget = 3 * (4096 + 64); for i in 0..10 { - c.insert(k(i), img(), budget); + c.insert(k(i), img(), Arc::default(), budget); } assert_eq!(c.map.len(), 3); assert!(c.get(&k(9)).is_some() && c.get(&k(6)).is_none()); // touching 7 makes 8 the oldest c.get(&k(7)); - c.insert(k(10), img(), budget); + c.insert(k(10), img(), Arc::default(), budget); assert!(c.get(&k(7)).is_some() && c.get(&k(8)).is_none()); assert_eq!(c.spare.len(), MAX_SPARE); assert_eq!(c.take_spare(256).len(), 256); diff --git a/crates/media/src/reads.rs b/crates/media/src/reads.rs new file mode 100644 index 000000000..29b2fafac --- /dev/null +++ b/crates/media/src/reads.rs @@ -0,0 +1,117 @@ +//! Which files the [`MediaPool`](crate::MediaPool) reads for a render +//! ([`FootageSource::recording`](effectcraft_render::FootageSource::recording)). +//! +//! Every read of a file notes it, with the identity it had when read, in the innermost scope open +//! on this thread. The pool's caches (decoded frames, opened movies, GIFs, models, EXR channels) +//! keep what their entries were made of and note it again on each hit, so a frame served from +//! memory reports its file without touching the disk. +//! +//! The scopes are per thread: a read noted while a render's scope is open on the thread belongs +//! to that render. A thread waiting inside a decode can run another job meanwhile (rayon); that +//! job's reads go to its own scope when it opens one, and otherwise to the scope below it, which +//! then lists a file more than it read (never fewer). + +use std::cell::RefCell; + +use effectcraft_render::reads::{ReadFile, ReadFiles, ReadLog}; + +/// Scopes nested deeper than this are not opened (a thread that keeps taking jobs while it waits +/// cannot pile them up without bound): their reads go to the scope below, and they come back +/// incomplete. +const MAX_DEPTH: usize = 64; + +thread_local! { + /// The open scopes on this thread, innermost last, each with the files noted in it. + static SCOPES: RefCell> = const { RefCell::new(Vec::new()) }; +} + +/// Note `file` in the innermost open scope on this thread (nothing when none is open). +pub(crate) fn note(file: ReadFile) { + let _ = SCOPES.try_with(|s| { + if let Ok(mut s) = s.try_borrow_mut() + && let Some(top) = s.last_mut() + { + top.add(file); + } + }); +} + +/// Note every file of `files` in the innermost open scope on this thread. +pub(crate) fn note_all(files: &ReadFiles) { + if files.is_empty() && files.is_complete() { + return; + } + let _ = SCOPES.try_with(|s| { + if let Ok(mut s) = s.try_borrow_mut() + && let Some(top) = s.last_mut() + { + top.extend(files); + } + }); +} + +/// Closes the scope it opened, also when what runs inside panics: its files go to `out`. +struct Scope<'a> { + out: Out<'a>, + opened: bool, +} + +enum Out<'a> { + /// A render's log ([`recording`]). + Log(&'a ReadLog), + /// The caller's ([`captured`]). + Files(&'a mut ReadFiles), +} + +impl Scope<'_> { + fn open(out: Out<'_>) -> Scope<'_> { + let opened = SCOPES + .try_with(|s| match s.try_borrow_mut() { + Ok(mut s) if s.len() < MAX_DEPTH => { + s.push(ReadFiles::default()); + true + } + _ => false, + }) + .unwrap_or(false); + Scope { out, opened } + } +} + +impl Drop for Scope<'_> { + fn drop(&mut self) { + let files = if self.opened { SCOPES.try_with(|s| s.try_borrow_mut().ok().and_then(|mut s| s.pop())).ok().flatten() } else { None }; + // A scope that could not open saw nothing: what it made can't name its files. + let files = files.unwrap_or_else(|| { + let mut f = ReadFiles::default(); + f.mark_incomplete(); + f + }); + match &mut self.out { + Out::Log(log) => log.note_all(&files), + Out::Files(out) => out.extend(&files), + } + } +} + +/// Run `f` with the files it reads on this thread noted in `log` +/// ([`FootageSource::recording`](effectcraft_render::FootageSource::recording)). +pub(crate) fn recording(log: &ReadLog, f: &mut dyn FnMut()) { + let _scope = Scope::open(Out::Log(log)); + f(); +} + +/// Run `f` and return what it returns with the files it read on this thread (to keep with a +/// cache entry made of them). They are not noted in the enclosing scope: the caller notes them, +/// as it does on each later hit of the entry. +pub(crate) fn captured(f: impl FnOnce() -> T) -> (T, ReadFiles) { + let mut files = ReadFiles::default(); + let out = { + let _scope = Scope::open(Out::Files(&mut files)); + f() + }; + (out, files) +} + +#[cfg(test)] +mod tests; diff --git a/crates/media/src/reads/tests.rs b/crates/media/src/reads/tests.rs new file mode 100644 index 000000000..f9079820f --- /dev/null +++ b/crates/media/src/reads/tests.rs @@ -0,0 +1,184 @@ +//! The files a render reads, as the media pool reports them (#3184): exactly the files the frame +//! was made of, also when its pixels come from memory. + +use std::path::{Path, PathBuf}; + +use effectcraft_color::Label; +use effectcraft_project::build::{self, Ids}; +use effectcraft_project::{Comp, Footage, FootageKind, ItemId, ItemKind, Layer, LayerSource, Project, Solid, Value}; +use effectcraft_render::reads::{FileStamp, ReadFiles, ReadLog}; +use effectcraft_render::{LayerCache, RenderOpts, Renderer}; +use effectcraft_time::FrameRate; + +use crate::MediaPool; + +const RATE: FrameRate = FrameRate::FPS_30; +const SIZE: (u32, u32) = (16, 8); + +/// A fresh folder for test `name` (on the build drive, not the system temp folder). +fn folder(name: &str) -> PathBuf { + let dir = Path::new(env!("CARGO_MANIFEST_DIR")).join(format!("../../target/test-reads-{name}-{}", std::process::id())); + let _ = std::fs::remove_dir_all(&dir); + std::fs::create_dir_all(&dir).unwrap(); + dir +} + +/// A PNG at `path`, a flat grey of `level`. +fn png(path: &Path, level: u8) -> String { + image::RgbaImage::from_pixel(SIZE.0, SIZE.1, image::Rgba([level, level, level, 255])).save(path).unwrap(); + path.to_string_lossy().to_string() +} + +/// An image sequence of `n` PNG frames in `dir`. +fn sequence(dir: &Path, n: usize) -> Footage { + let files: Vec = (0..n).map(|i| png(&dir.join(format!("seq_{i:04}.png")), 20 + i as u8 * 10)).collect(); + let mut f = Footage { kind: FootageKind::Sequence, sequence: files, frame_rate: RATE, ..crate::probe(dir.join("seq_0000.png")).unwrap() }; + f.sync_sequence_duration(); + f +} + +/// A still footage item of `path`. +fn still(path: &Path, level: u8) -> Footage { + png(path, level); + crate::probe(path).unwrap() +} + +fn comp() -> Comp { + Comp::new(SIZE.0, SIZE.1, RATE, RATE.tick_of(10)) +} + +fn footage_layer(p: &mut Project, comp: &Comp, name: &str, f: Footage) -> Layer { + let item = p.add_item(name, Label::Aqua, None, ItemKind::Footage(f)); + build::layer(p, comp, name, LayerSource::Footage { item }, SIZE, Some(comp.duration)) +} + +fn add_comp(p: &mut Project, name: &str, mut comp: Comp, layers: Vec) -> ItemId { + comp.layers = layers.into(); + p.add_item(name, Label::Sandstone, None, ItemKind::Comp(comp.into())) +} + +/// Render frame `frame` of `comp` with `pool` and `cache`: the picture's top-left pixel and the +/// files the render reports. +fn render(p: &Project, pool: &MediaPool, cache: &LayerCache, comp: ItemId, frame: i64) -> ([f32; 4], ReadFiles) { + let log = ReadLog::new(); + let mut r = Renderer::new(p, pool, RenderOpts::default()); + r.cache = Some(cache); + r.reads = Some(&log); + let img = r.comp_frame(comp, RATE.tick_of(frame)); + (img.get(0, 0), log.into_files()) +} + +fn paths(files: &ReadFiles) -> Vec { + files.files().iter().map(|f| f.path.to_string()).collect() +} + +/// Every listed file has the identity it has on disk now. +fn assert_stamps_match_disk(files: &ReadFiles) { + for f in files.files() { + assert_eq!(Some(f.stamp), FileStamp::native(&f.path), "{}", f.path); + } +} + +/// (a) One frame of a comp with an image-sequence layer reads that frame's file and nothing else +/// of the sequence; a large sequence in the project that no layer uses adds nothing, not even a +/// look at its files. +#[test] +fn a_sequence_frame_reports_only_its_own_file() { + let dir = folder("sequence"); + let unused_dir = dir.join("unused"); + let mut p = Project::default(); + let c = comp(); + let seq = sequence(&dir, 5); + let (frame_2, frame_4) = (seq.sequence[2].clone(), seq.sequence[4].clone()); + let layer = footage_layer(&mut p, &c, "Seq", seq); + // 5000 frames nobody shows (they don't even exist). + let unused = Footage { + kind: FootageKind::Sequence, + sequence: (0..5000).map(|i| unused_dir.join(format!("big_{i:05}.exr")).to_string_lossy().to_string()).collect(), + frame_rate: RATE, + width: SIZE.0, + height: SIZE.1, + has_video: true, + ..Default::default() + }; + p.add_item("Unused", Label::Aqua, None, ItemKind::Footage(unused)); + let cid = add_comp(&mut p, "C", c, vec![layer]); + let (pool, cache) = (MediaPool::new(), LayerCache::default()); + let opened = crate::opens_under(&dir); + let (px, files) = render(&p, &pool, &cache, cid, 2); + assert!((px[0] - 40.0 / 255.0).abs() < 0.01, "frame 2 shows: {px:?}"); + assert_eq!(paths(&files), [frame_2]); + assert!(files.is_complete()); + assert_stamps_match_disk(&files); + assert_eq!(crate::opens_under(&dir) - opened, 1, "one file opened: the frame's"); + assert_eq!(crate::opens_under(&unused_dir), 0, "the unused sequence was not looked at"); + // Another frame reads its own file. + let (_, files) = render(&p, &pool, &cache, cid, 4); + assert_eq!(paths(&files), [frame_4]); + let _ = std::fs::remove_dir_all(&dir); +} + +/// (b) A precomp reports the files of what it draws, and an effect that reads another layer +/// reports that layer's files (the layer itself is hidden: its pixels come only through the +/// effect). +#[test] +fn precomps_and_layers_read_by_effects_report_their_files() { + let dir = folder("nested"); + let mut p = Project::default(); + let c = comp(); + let seq = sequence(&dir, 4); + let nested_frame = seq.sequence[3].clone(); + let inner_layer = footage_layer(&mut p, &c, "Seq", seq); + let inner = add_comp(&mut p, "Inner", c.clone(), vec![inner_layer]); + let pre = build::layer(&mut p, &c, "Inner", LayerSource::Comp { item: inner }, SIZE, Some(c.duration)); + let matte_path = dir.join("matte.png"); + let mut matte = footage_layer(&mut p, &c, "Matte", still(&matte_path, 255)); + matte.switches.video = false; + let sid = p.add_item("S", Label::Red, None, ItemKind::Solid(Solid { color: [1.0, 0.0, 0.0], width: SIZE.0, height: SIZE.1, pixel_aspect: 1.0 })); + let mut solid = build::layer(&mut p, &c, "S", LayerSource::Solid { item: sid }, SIZE, Some(c.duration)); + let spec = effectcraft_effects::find("ec.channel.setmatte").unwrap(); + let mut next = p.next_id; + let mut fx = effectcraft_effects::instantiate(spec, &mut Ids(&mut next), spec.name, [SIZE.0 as f64, SIZE.1 as f64]); + p.next_id = next; + fx.prop_mut("takeMatteFromLayer").unwrap().value = Value::Layer(Some(matte.id.0)); + solid.props.sub_mut("effects").unwrap().children.push(fx.into()); + let cid = add_comp(&mut p, "Outer", c, vec![solid, matte, pre]); + let (pool, cache) = (MediaPool::new(), LayerCache::default()); + let (_, files) = render(&p, &pool, &cache, cid, 3); + let mut want = vec![matte_path.to_string_lossy().to_string(), nested_frame]; + want.sort(); + assert_eq!(paths(&files), want); + assert!(files.is_complete()); + assert_stamps_match_disk(&files); + let _ = std::fs::remove_dir_all(&dir); +} + +/// (c) A frame rendered again comes from memory (the sequence frame from the media pool, the +/// still layer from the layer cache) and reports the same files, with the identities they had +/// when read, without opening anything: here the files are even gone by then. +#[test] +fn a_frame_served_from_memory_reports_its_files_without_touching_them() { + let dir = folder("memory"); + let mut p = Project::default(); + let c = comp(); + // The sequence at half opacity over the still: both show. + let mut seq = footage_layer(&mut p, &c, "Seq", sequence(&dir, 3)); + seq.props.prop_mut("transform/opacity").unwrap().value = Value::Scalar(50.0); + let plate = footage_layer(&mut p, &c, "Plate", still(&dir.join("plate.png"), 128)); + let cid = add_comp(&mut p, "C", c, vec![seq, plate]); + let (pool, cache) = (MediaPool::new(), LayerCache::default()); + let (px, first) = render(&p, &pool, &cache, cid, 1); + assert_eq!(first.len(), 2, "{:?}", paths(&first)); + assert_stamps_match_disk(&first); + std::fs::remove_dir_all(&dir).unwrap(); + let opened = crate::opens_under(&dir); + let hits = cache.stats().hits; + let (again_px, again) = render(&p, &pool, &cache, cid, 1); + assert_eq!(again_px, px, "the same picture"); + assert_eq!(again, first, "the same files, as they were when read"); + assert!(cache.stats().hits > hits, "the still layer came from the layer cache"); + // The media pool alone (a new layer cache) reports them too. + let (_, from_pool) = render(&p, &pool, &LayerCache::default(), cid, 1); + assert_eq!(from_pool, first); + assert_eq!(crate::opens_under(&dir), opened, "nothing was opened on disk"); +} diff --git a/crates/media/src/stream.rs b/crates/media/src/stream.rs index 80db21fc4..99b1cb774 100644 --- a/crates/media/src/stream.rs +++ b/crates/media/src/stream.rs @@ -9,6 +9,7 @@ use std::path::Path; +use effectcraft_render::reads::FileStamp; use filmcraft_media::SharedSource; use crate::Result; @@ -19,17 +20,21 @@ use crate::Result; pub(crate) struct FileReader { file: std::fs::File, len: u64, + /// The file's identity when it was opened. + stamp: FileStamp, } #[cfg(any(unix, windows))] impl FileReader { pub(crate) fn open(path: &Path) -> std::io::Result { + #[cfg(test)] + crate::count_open(path); let file = std::fs::File::open(path)?; let m = file.metadata()?; if !m.is_file() { return Err(std::io::Error::new(std::io::ErrorKind::InvalidInput, format!("{} is not a file", path.display()))); } - Ok(Self { file, len: m.len() }) + Ok(Self { file, len: m.len(), stamp: FileStamp::of_metadata(&m) }) } } @@ -72,16 +77,18 @@ fn name_of(path: &Path) -> String { /// Open a movie/audio file for the media pool, reading only what its container needs; files the /// reader openers don't handle are read whole and opened from memory, exactly as before. `None` /// when the file can't be opened in place (the caller reads it whole, which reports the error). +/// With the file's identity as opened. #[cfg(any(unix, windows))] -pub(crate) fn open_source(path: &Path) -> Option> { +pub(crate) fn open_source(path: &Path) -> Option<(Result, FileStamp)> { let reader = FileReader::open(path).ok()?; + let stamp = reader.stamp; let reader: filmcraft_media::SharedReader = std::sync::Arc::new(reader); let opened = filmcraft_media::reader::open_reader(&name_of(path), reader, &filmcraft_codecs::reader_openers(), &filmcraft_codecs::openers()); - Some(opened.map_err(Into::into)) + Some((opened.map_err(Into::into), stamp)) } #[cfg(not(any(unix, windows)))] -pub(crate) fn open_source(_path: &Path) -> Option> { +pub(crate) fn open_source(_path: &Path) -> Option<(Result, FileStamp)> { None } diff --git a/crates/render/src/accel.rs b/crates/render/src/accel.rs index f545a62ee..eecf05580 100644 --- a/crates/render/src/accel.rs +++ b/crates/render/src/accel.rs @@ -224,7 +224,7 @@ impl<'a> Renderer<'a> { LayerSource::Footage { item } => { let item = ctx.media_item(layer, *item); let ItemKind::Footage(f) = &self.project.item(item)?.kind else { return None }; - let a = self.footage.aux(item, f, ctx.source_time(layer))?; + let a = self.read(|| self.footage.aux(item, f, ctx.source_time(layer)))?; // Aux pixels per layer pixel (the layer is the footage at its nominal size). The // planes are only copied when that changes the scale. let scale = a.width as f64 / f.width as f64; @@ -349,20 +349,16 @@ impl<'a> Renderer<'a> { pub fn adjustment_footprint(&self, ctx: &EvalCtx, layer: &Layer) -> Option> { // Cached, so an accelerator sees the same buffer (and uploads it once) every frame. let key = self.cache.and_then(|_| cache::footprint_key(ctx, layer, self.raster_scale(ctx, layer), self.opts.draft, self.mb_on(ctx, layer))); - if let (Some(c), Some(k)) = (self.cache, key) - && let Some(b) = c.get(k) - { + if let Some((b, _)) = self.cached(key) { return Some(b); } - let mut foot = self.source(ctx, layer)?; - let _ = masks::apply(ctx, layer, &mut foot, self.mask_blur(ctx, layer)); - let foot = Arc::new(foot); + let (foot, files) = self.recorded(key, |r| { + let mut foot = r.source(ctx, layer)?; + let _ = masks::apply(ctx, layer, &mut foot, r.mask_blur(ctx, layer)); + Some(foot) + }); // The buffer the cache keeps (another worker's, if it kept one first). - let foot = match (self.cache_to_keep(), key) { - (Some(c), Some(k)) => c.insert(k, foot), - _ => foot, - }; - Some(foot) + Some(self.keep(key, Arc::new(foot?), &files)) } /// Draw one 2D layer into `canvas` on the CPU (any kind: adjustment, wireframe, styled…). diff --git a/crates/render/src/cache.rs b/crates/render/src/cache.rs index cf1a84e82..79b948b89 100644 --- a/crates/render/src/cache.rs +++ b/crates/render/src/cache.rs @@ -25,6 +25,7 @@ use effectcraft_effects::Buf; use effectcraft_project::{FootageKind, ItemKind, Layer, LayerSource, Node, PropGroup}; use crate::eval::EvalCtx; +use crate::reads::ReadFiles; mod dependencies; @@ -43,6 +44,8 @@ pub struct LayerCache { struct Entry { buf: Arc, + /// The source files the buffer was made of (see [`crate::reads`]). + files: Arc, bytes: usize, last_use: u64, } @@ -147,16 +150,19 @@ impl LayerCache { Some((st.clone(), salted(*salt))) } - pub fn get(&self, key: u64) -> Option> { + /// The buffer kept under `key` and the source files it was made of (see [`crate::reads`]). + /// A buffer from the disk cache or another store doesn't know its files: its list is + /// incomplete. + pub fn get(&self, key: u64) -> Option<(Arc, Arc)> { let mut g = self.inner.lock().ok()?; g.clock += 1; let now = g.clock; match g.map.get_mut(&key) { Some(e) => { e.last_use = now; - let b = e.buf.clone(); + let found = (e.buf.clone(), e.files.clone()); g.hits += 1; - Some(b) + Some(found) } None => { g.misses += 1; @@ -168,7 +174,10 @@ impl LayerCache { // Disk cache: a hit comes back into memory. let (dc, dk) = self.disk_key(key)?; let buf = dc.get_layer(dk)?; - Some(self.insert_mem(key, buf)) + let mut files = ReadFiles::default(); + files.mark_incomplete(); + let files = Arc::new(files); + Some((self.insert_mem(key, buf, files.clone()), files)) } } } @@ -178,8 +187,9 @@ impl LayerCache { /// together each rendered every layer; sharing the first buffer, the GPU compositor uploads /// and packs it once instead of once per worker, which ran it out of memory). Renders don't /// wait for each other: on the frame workers' shared thread pool a wait can end up under - /// the very work it waits for. - pub fn insert(&self, key: u64, buf: Arc) -> Arc { + /// the very work it waits for. `files`: the source files `buf` was made of (see + /// [`crate::reads`]). + pub fn insert(&self, key: u64, buf: Arc, files: Arc) -> Arc { if self.gated() { return buf; } @@ -193,12 +203,12 @@ impl LayerCache { dc.put_layer(dk, &buf); } } - self.insert_mem(key, buf) + self.insert_mem(key, buf, files) } /// See [`LayerCache::insert`]: the buffer kept under `key` (`buf`, unless one was kept first /// or `buf` is too large to keep). - fn insert_mem(&self, key: u64, buf: Arc) -> Arc { + fn insert_mem(&self, key: u64, buf: Arc, files: Arc) -> Arc { let bytes = buf.img.data.len() * std::mem::size_of::(); let Ok(mut g) = self.inner.lock() else { return buf }; if bytes > g.budget / 4 { @@ -210,7 +220,7 @@ impl LayerCache { e.last_use = now; return e.buf.clone(); } - g.map.insert(key, Entry { buf: buf.clone(), bytes, last_use: now }); + g.map.insert(key, Entry { buf: buf.clone(), files, bytes, last_use: now }); g.bytes += bytes; if g.bytes > g.budget { // Evict least-recently used entries down to 3/4 of the budget. @@ -786,8 +796,8 @@ mod shared_insert_tests { let cache = LayerCache::default(); let buf = || Arc::new(Buf { img: Image::new(4, 4), offset: [0.0; 2], scale: 1.0 }); let (a, b) = (buf(), buf()); - assert!(Arc::ptr_eq(&cache.insert(3, a.clone()), &a)); - assert!(Arc::ptr_eq(&cache.insert(3, b), &a), "the later render gets the first buffer"); - assert!(Arc::ptr_eq(&cache.get(3).unwrap(), &a)); + assert!(Arc::ptr_eq(&cache.insert(3, a.clone(), Default::default()), &a)); + assert!(Arc::ptr_eq(&cache.insert(3, b, Default::default()), &a), "the later render gets the first buffer"); + assert!(Arc::ptr_eq(&cache.get(3).unwrap().0, &a)); } } diff --git a/crates/render/src/disk_cache.rs b/crates/render/src/disk_cache.rs index 427198ad2..03832643b 100644 --- a/crates/render/src/disk_cache.rs +++ b/crates/render/src/disk_cache.rs @@ -1055,18 +1055,17 @@ fn hash_debug(h: &mut Hash128, v: &impl std::fmt::Debug) { /// Size and content hash of a path that has no native metadata (the browser file table). pub type VirtualFileId<'a> = &'a (dyn Fn(&str) -> Option<(u64, u64)> + Send + Sync); -/// A file's size and modification time (so edited footage gets new keys). When the path has no -/// native metadata, `virtual_id` supplies a durable size and content hash instead. +/// A file's size and modification time (so edited footage gets new keys): the identity a render +/// records for the files it reads ([`crate::reads::FileStamp`]). When the path has no native +/// metadata, `virtual_id` supplies a durable size and content hash instead. fn file_stamp(h: &mut Hash128, path: &str, virtual_id: Option>) { if path.is_empty() { return; } - if let Ok(md) = std::fs::metadata(path) { - h.write_u64(md.len()); - if let Ok(t) = md.modified() - && let Ok(d) = t.duration_since(std::time::UNIX_EPOCH) - { - h.write_u64(d.as_nanos() as u64); + if let Some(crate::reads::FileStamp::Native { len, modified }) = crate::reads::FileStamp::native(path) { + h.write_u64(len); + if let Some(t) = modified { + h.write_u64(t); } return; } diff --git a/crates/render/src/footage.rs b/crates/render/src/footage.rs index 4c90967d3..04957b34e 100644 --- a/crates/render/src/footage.rs +++ b/crates/render/src/footage.rs @@ -1,4 +1,5 @@ use super::{Arc, AtomicBool, Footage, Image, ItemId, ItemKind, Ordering, Tick}; +use crate::reads::ReadLog; /// How a [`FootageSource`] hands over float footage (OpenEXR, float TIFF), whose values are /// linear light: encoded with a curve, as the compositor takes footage, or as stored. Other @@ -92,6 +93,15 @@ pub trait FootageSource: Send + Sync { fn called_off(&self) -> bool { false } + /// Run `f`, which reads from this source on this thread, noting in `reads` every source file + /// those reads use, with its identity as read (see [`crate::reads`]): the file a frame was + /// decoded from, also when it comes from the source's own memory cache (without reading the + /// file again). Sources that can't tell which files they read keep the default, which marks + /// `reads` incomplete. + fn recording(&self, reads: &ReadLog, f: &mut dyn FnMut()) { + reads.mark_incomplete(); + f() + } /// Why `footage` shows no picture although its file is there: a read of it failed because /// no decoder handles its codec, profile, chroma format or bit depth, or the stream is damaged /// (e.g. "H.264 (High 4:2:2) isn't supported by the built-in decoder: ..."). `None` while it @@ -194,6 +204,9 @@ impl FootageSource for CancellableFootage<'_> { fn called_off(&self) -> bool { self.cancel.load(Ordering::Relaxed) || self.inner.called_off() } + fn recording(&self, reads: &ReadLog, f: &mut dyn FnMut()) { + self.inner.recording(reads, f) + } fn problem(&self, footage: &Footage) -> Option { self.inner.problem(footage) } @@ -214,4 +227,8 @@ impl FootageSource for NoFootage { fn frame(&self, _: ItemId, _: &Footage, _: Tick) -> Option> { None } + /// Reads no files. + fn recording(&self, _: &ReadLog, f: &mut dyn FnMut()) { + f() + } } diff --git a/crates/render/src/fx_host.rs b/crates/render/src/fx_host.rs index 65bafe002..9b1700df8 100644 --- a/crates/render/src/fx_host.rs +++ b/crates/render/src/fx_host.rs @@ -104,7 +104,7 @@ impl EffectHost for FxHost<'_, '_, '_> { return None; } let st = other.layer_time(Tick::from_seconds_f64(start)); - self.r.footage.audio(item, f, st, frames, rate) + self.r.read(|| self.r.footage.audio(item, f, st, frames, rate)) } fn self_at(&self, layer_time: f64, effects: usize) -> Option { diff --git a/crates/render/src/layers.rs b/crates/render/src/layers.rs index d105c6f13..b551d1c1b 100644 --- a/crates/render/src/layers.rs +++ b/crates/render/src/layers.rs @@ -37,18 +37,17 @@ impl Shutter { impl<'a> Renderer<'a> { /// The layer with its styles: exterior passes and body (cached per pass). pub(crate) fn styled(&self, ctx: &EvalCtx, layer: &Layer, mut timing: Option<&mut LayerTiming>) -> Option { - let (content, ckey) = self.content_buf_timed(ctx, layer, timing.as_deref_mut())?; + let (content, ckey, files) = self.content_buf_timed(ctx, layer, timing.as_deref_mut())?; if !styles::active(ctx, layer) { - return Some(StyledLayer { passes: vec![], body: content.clone(), content, key: ckey, ckey, plain: true }); + return Some(StyledLayer { passes: vec![], body: content.clone(), content, key: ckey, ckey, plain: true, files }); } let modes = styles::pass_modes(ctx, layer); let key = ckey.map(|k| cache::styles_key(ctx, layer, k)); - if let (Some(c), Some(k)) = (self.cache, key) - && let Some(body) = c.get(k) - { - let passes: Option> = modes.iter().enumerate().map(|(i, m)| c.get(cache::derive(k, i as u64 + 1)).map(|b| (b, *m))).collect(); + if let Some((body, _)) = self.cached(key) { + let passes: Option> = + modes.iter().enumerate().map(|(i, m)| self.cached(key.map(|k| cache::derive(k, i as u64 + 1))).map(|(b, _)| (b, *m))).collect(); if let Some(passes) = passes { - return Some(StyledLayer { passes, body, content, key, ckey, plain: false }); + return Some(StyledLayer { passes, body, content, key, ckey, plain: false, files }); } } let t0 = web_time::Instant::now(); @@ -59,16 +58,12 @@ impl<'a> Renderer<'a> { t.cached = false; t.effects.push(("layerStyles".into(), t0.elapsed().as_secs_f64() * 1e3)); } - let mut body = Arc::new(st.body); - let mut passes: Vec<_> = st.passes.into_iter().map(|(b, m)| (Arc::new(b), m)).collect(); - // The buffers the cache keeps (another worker's, if it kept them first). - if let (Some(c), Some(k)) = (self.cache_to_keep(), key) { - body = c.insert(k, body); - for (i, (b, _)) in passes.iter_mut().enumerate() { - *b = c.insert(cache::derive(k, i as u64 + 1), b.clone()); - } - } - Some(StyledLayer { passes, body, content, key, ckey, plain: false }) + // The buffers the cache keeps (another worker's, if it kept them first), made of the + // content's files. + let body = self.keep(key, Arc::new(st.body), &files); + let passes: Vec<_> = + st.passes.into_iter().enumerate().map(|(i, (b, m))| (self.keep(key.map(|k| cache::derive(k, i as u64 + 1)), Arc::new(b), &files), m)).collect(); + Some(StyledLayer { passes, body, content, key, ckey, plain: false, files }) } /// The styled layer's buffers in the blending space. @@ -76,9 +71,10 @@ impl<'a> Renderer<'a> { if self.pipe.to_blend().is_none() { return st; } - let body = self.to_blend(st.body, st.key); - let content = if st.plain { body.clone() } else { self.to_blend(st.content, st.ckey) }; - let passes = st.passes.into_iter().enumerate().map(|(i, (b, m))| (self.to_blend(b, st.key.map(|k| cache::derive(k, i as u64 + 1))), m)).collect(); + let body = self.to_blend(st.body, st.key, &st.files); + let content = if st.plain { body.clone() } else { self.to_blend(st.content, st.ckey, &st.files) }; + let passes = + st.passes.into_iter().enumerate().map(|(i, (b, m))| (self.to_blend(b, st.key.map(|k| cache::derive(k, i as u64 + 1)), &st.files), m)).collect(); StyledLayer { passes, body, content, ..st } } @@ -582,6 +578,8 @@ pub struct StyledLayer { ckey: Option, /// No layer styles: composite `body` the usual way. pub plain: bool, + /// The source files the layer's buffers were made of (see [`crate::reads`]). + pub(crate) files: Arc, } /// Where a layer buffer lands (see [`Renderer::placement`]). diff --git a/crates/render/src/lib.rs b/crates/render/src/lib.rs index dbd948320..e09794de2 100644 --- a/crates/render/src/lib.rs +++ b/crates/render/src/lib.rs @@ -17,6 +17,7 @@ use color::Region; pub mod eval; pub mod masks; pub mod passes; +pub mod reads; pub mod shapes; pub mod styles; pub mod text; @@ -69,6 +70,10 @@ pub struct Renderer<'a> { pub opts: RenderOpts, /// Processed-layer cache shared across frames (see [`cache`]). `None` renders everything. pub cache: Option<&'a LayerCache>, + /// Where the source files this render reads are noted (see [`reads`]): the frame's own, + /// from the footage source and from the buffers the layer cache serves. `None` records + /// nothing for the frame (buffers kept in the layer cache still record theirs). + pub reads: Option<&'a reads::ReadLog>, /// Optional per-layer timing sink (`frame --bench` / perf readouts). pub profile: Option<&'a std::sync::Mutex>>, /// GPU backend used when [`RenderOpts::backend`] asks for it. diff --git a/crates/render/src/pipeline.rs b/crates/render/src/pipeline.rs index e84348fdf..3564c17f9 100644 --- a/crates/render/src/pipeline.rs +++ b/crates/render/src/pipeline.rs @@ -3,6 +3,7 @@ use super::footage::{FootageSource, is_vector_footage}; use super::frames::{blend_frames, cineon_frame, content_bounds, field_frame, frame_blend_mode, frame_position, frame_size, interpret_pixels, roi_inside}; use super::fx_host::{FxHost, essential_overrides}; use super::opts::{Collapse3d, LayerTiming, MAX_THROUGH, RenderOpts, Through}; +use super::reads::{ReadFiles, ReadLog}; use super::{ Arc, AutoKey, AutoPick, BlendMode, Buf, Comp, EffectCtx, EffectEnv, EvalCtx, Footage, FootageKind, FrameBlend, FrameRate, GroupKind, Image, ItemId, ItemKind, Layer, LayerCache, LayerSource, Params, Project, Quality, Region, Renderer, Tick, cache, color, masks, shapes, styles, text, three_d, vec2, @@ -108,6 +109,7 @@ impl<'a> Renderer<'a> { expr: None, opts, cache: None, + reads: None, profile: None, accel: None, depth: 0, @@ -129,6 +131,52 @@ impl<'a> Renderer<'a> { self.cache.filter(|_| !self.footage.called_off()) } + /// `read`, a read of this render's footage source, with the files it uses noted in + /// [`Renderer::reads`] (see [`FootageSource::recording`]). + pub(crate) fn read(&self, read: impl FnOnce() -> Option) -> Option { + let Some(log) = self.reads else { return read() }; + let (mut read, mut out) = (Some(read), None); + self.footage.recording(log, &mut || out = read.take().and_then(|f| f())); + out + } + + /// The buffer the layer cache keeps under `key`, with the files it was made of noted in + /// [`Renderer::reads`]. + pub(crate) fn cached(&self, key: Option) -> Option<(Arc, Arc)> { + let (buf, files) = self.cache?.get(key?)?; + if let Some(log) = self.reads { + log.note_all(&files); + } + Some((buf, files)) + } + + /// Keep `buf`, made of `files`, under `key` (see [`Renderer::recorded`]): the buffer the cache + /// keeps (another worker's, if it kept one first), or `buf` when nothing is kept. + pub(crate) fn keep(&self, key: Option, buf: Arc, files: &Arc) -> Arc { + match (self.cache_to_keep(), key) { + (Some(c), Some(k)) => c.insert(k, buf, files.clone()), + _ => buf, + } + } + + /// Run `make`, which makes a buffer to keep under `key` in the layer cache, on this renderer + /// with its reads noted apart: what `make` returns and the files it read (from the footage + /// source, or the files of cached buffers it used), which go to [`Renderer::reads`] too. A + /// cached buffer then reports the files it was made of whichever render uses it. Without a + /// cache or a key, `make` runs on this renderer as it is (no files: nothing is kept). + pub(crate) fn recorded(&self, key: Option, make: impl FnOnce(&Renderer<'_>) -> T) -> (T, Arc) { + if key.is_none() || self.cache.is_none() { + return (make(self), Arc::default()); + } + let log = ReadLog::new(); + let out = make(&Renderer { reads: Some(&log), ..*self }); + let files = log.into_files(); + if let Some(own) = self.reads { + own.note_all(&files); + } + (out, Arc::new(files)) + } + /// A layer's Quality switch, limited by the precomp layers above it when /// [`RenderOpts::nested_switches`] is on. pub fn quality(&self, layer: &Layer) -> Quality { @@ -760,7 +808,7 @@ impl<'a> Renderer<'a> { // Continuously rasterised vector footage: drawn at the on-screen scale. if layer.switches.collapse && is_vector_footage(f) { let k = self.raster_scale(ctx, layer); - if let Some(img) = self.footage.vector_frame(item, f, k) { + if let Some(img) = self.read(|| self.footage.vector_frame(item, f, k)) { let mut buf = Buf { img: (*img).clone(), offset: [0.0; 2], scale: k }; if let Some(c) = self.pipe.media_in(f) { color::convert(&mut buf.img, &c); @@ -831,7 +879,7 @@ impl<'a> Renderer<'a> { if f.fields != effectcraft_project::FieldOrder::Off && matches!(f.kind, FootageKind::Video | FootageKind::Sequence) { let field_rate = FrameRate::new(f.frame_rate.num * 2, f.frame_rate.den); let i = field_rate.frame_at(t).max(0); - let img = cineon_frame(self.footage.frame_with(item, f, f.frame_rate.tick_of(i / 2), None, self.pipe.float_curve(f))?, f); + let img = cineon_frame(self.read(|| self.footage.frame_with(item, f, f.frame_rate.tick_of(i / 2), None, self.pipe.float_curve(f)))?, f); let dominant_upper = f.fields == effectcraft_project::FieldOrder::UpperFirst; // Upper field = even lines (0, 2, …). let parity = if (i % 2 == 0) == dominant_upper { 0 } else { 1 }; @@ -865,24 +913,22 @@ impl<'a> Renderer<'a> { } h.finish() }); - if let (Some(c), Some(k)) = (self.cache, key) - && let Some(b) = c.get(k) - { + if let Some((b, _)) = self.cached(key) { return Some(Arc::new(b.img.clone())); } // Log scans are converted before they blend: the conversion is not linear. - let a = self.footage.frame_with(item, f, f.frame_rate.tick_of(i), None, float).map(|a| cineon_frame(a, f)); - let b = self.footage.frame_with(item, f, f.frame_rate.tick_of(i + 1), None, float).map(|b| cineon_frame(b, f)); + let ((a, b), files) = self.recorded(key, |r| { + let frame = |i| r.read(|| r.footage.frame_with(item, f, f.frame_rate.tick_of(i), None, float)).map(|a| cineon_frame(a, f)); + (frame(i), frame(i + 1)) + }); if let (Some(a), Some(b)) = (a, b) { let img = blend_frames(mode, &a, &b, w as f32); - if let (Some(c), Some(k)) = (self.cache_to_keep(), key) { - c.insert(k, Arc::new(Buf { img: img.clone(), offset: [0.0; 2], scale: 1.0 })); - } + self.keep(key, Arc::new(Buf { img: img.clone(), offset: [0.0; 2], scale: 1.0 }), &files); return Some(Arc::new(img)); } } } - self.footage.frame_with(item, f, t, size, float).map(|img| cineon_frame(img, f)) + self.read(|| self.footage.frame_with(item, f, t, size, float)).map(|img| cineon_frame(img, f)) } /// Source → masks, clamped/quantised to the project depth. @@ -902,52 +948,40 @@ impl<'a> Renderer<'a> { /// Fully processed layer buffer (source → masks → effects → layer styles, flattened). /// Served from the layer cache when the layer's content key matches. pub fn layer_buf(&self, ctx: &EvalCtx, layer: &Layer) -> Option> { - self.layer_buf_keyed(ctx, layer).map(|(b, _)| b) + self.layer_buf_keyed(ctx, layer).map(|(b, _, _)| b) } /// [`Self::layer_buf`] in the blending space (linear with Blend Colors Using 1.0 Gamma). pub fn blend_layer_buf(&self, ctx: &EvalCtx, layer: &Layer) -> Option> { - let (b, k) = self.layer_buf_keyed(ctx, layer)?; - Some(self.to_blend(b, k)) + let (b, k, files) = self.layer_buf_keyed(ctx, layer)?; + Some(self.to_blend(b, k, &files)) } - /// A buffer converted to the blending space (cached under a key derived from `key`). - pub(crate) fn to_blend(&self, b: Arc, key: Option) -> Arc { + /// A buffer converted to the blending space (cached under a key derived from `key`, with + /// `files`, the source files `b` was made of). + pub(crate) fn to_blend(&self, b: Arc, key: Option, files: &Arc) -> Arc { let Some(c) = self.pipe.to_blend() else { return b }; let key = key.map(|k| cache::derive(k, 0x1ea7)); - if let (Some(cache), Some(k)) = (self.cache, key) - && let Some(x) = cache.get(k) - { + if let Some((x, _)) = self.cached(key) { return x; } let mut nb = (*b).clone(); color::convert(&mut nb.img, &c); - let nb = Arc::new(nb); - // The buffer the cache keeps (another worker's, if it kept one first). - match (self.cache_to_keep(), key) { - (Some(cache), Some(k)) => cache.insert(k, nb), - _ => nb, - } + self.keep(key, Arc::new(nb), files) } - fn layer_buf_keyed(&self, ctx: &EvalCtx, layer: &Layer) -> Option<(Arc, Option)> { + /// The flattened layer buffer, its cache key and the source files it was made of. + fn layer_buf_keyed(&self, ctx: &EvalCtx, layer: &Layer) -> Option<(Arc, Option, Arc)> { let st = self.styled(ctx, layer, None)?; if st.passes.is_empty() { - return Some((st.body, st.key)); + return Some((st.body, st.key, st.files)); } let key = st.key.map(|k| cache::derive(k, 0xf1a7)); - if let (Some(c), Some(k)) = (self.cache, key) - && let Some(b) = c.get(k) - { - return Some((b, key)); + if let Some((b, files)) = self.cached(key) { + return Some((b, key, files)); } let flat = Arc::new(styles::Styled { passes: st.passes.iter().map(|(b, m)| ((**b).clone(), *m)).collect(), body: (*st.body).clone() }.flatten()); - // The buffer the cache keeps (another worker's, if it kept one first). - let flat = match (self.cache_to_keep(), key) { - (Some(c), Some(k)) => c.insert(k, flat), - _ => flat, - }; - Some((flat, key)) + Some((self.keep(key, flat, &st.files), key, st.files)) } /// A layer's source pixels at the context time, before masks, effects and the transform @@ -983,28 +1017,29 @@ impl<'a> Renderer<'a> { /// Layer pixels after source → masks → effects (no layer styles). pub fn content_buf(&self, ctx: &EvalCtx, layer: &Layer) -> Option> { - self.content_buf_timed(ctx, layer, None).map(|(b, _)| b) + self.content_buf_timed(ctx, layer, None).map(|(b, _, _)| b) } - pub(crate) fn content_buf_timed(&self, ctx: &EvalCtx, layer: &Layer, mut timing: Option<&mut LayerTiming>) -> Option<(Arc, Option)> { + /// [`Self::content_buf`], its cache key and the source files it was made of. + pub(crate) fn content_buf_timed( + &self, + ctx: &EvalCtx, + layer: &Layer, + mut timing: Option<&mut LayerTiming>, + ) -> Option<(Arc, Option, Arc)> { let key = self.cache.and_then(|_| cache::layer_key(ctx, layer, self.raster_scale(ctx, layer), self.opts.draft, self.mb_on(ctx, layer))); let key = self.content_key(ctx, layer, key); - if let (Some(c), Some(k)) = (self.cache, key) - && let Some(b) = c.get(k) - { + if let Some((b, files)) = self.cached(key) { if let Some(t) = timing.as_deref_mut() { t.cached = true; } - return Some((b, key)); + return Some((b, key, files)); } - let buf = self.masked_source(ctx, layer)?; - let buf = Arc::new(self.apply_effects_timed(ctx, layer, buf, false, usize::MAX, timing.map(|t| &mut t.effects))); - // The buffer the cache keeps (another worker's, if it kept one first). - let buf = match (self.cache_to_keep(), key) { - (Some(c), Some(k)) => c.insert(k, buf), - _ => buf, - }; - Some((buf, key)) + let (buf, files) = self.recorded(key, |r| { + let buf = r.masked_source(ctx, layer)?; + Some(r.apply_effects_timed(ctx, layer, buf, false, usize::MAX, timing.map(|t| &mut t.effects))) + }); + Some((self.keep(key, Arc::new(buf?), &files), key, files)) } /// A layer's input at the context time: source → masks → its first `effects` effects @@ -1014,23 +1049,18 @@ impl<'a> Renderer<'a> { pub fn layer_input(&self, ctx: &EvalCtx, layer: &Layer, effects: usize) -> Option> { let key = self.cache.and_then(|_| cache::input_key(ctx, layer, self.raster_scale(ctx, layer), self.opts.draft, self.mb_on(ctx, layer), effects)); let key = self.content_key(ctx, layer, key); - if let (Some(c), Some(k)) = (self.cache, key) - && let Some(b) = c.get(k) - { + if let Some((b, _)) = self.cached(key) { return Some(b); } - let mut buf = self.masked_source(ctx, layer)?; - let origin = ctx.effect_bounds(layer).1; - buf.rebase(origin); - if effects > 0 { - buf = self.effect_space_stack(ctx, layer, buf, EffectStack { adjustment: false, limit: effects, origin }, None); - } - let buf = Arc::new(buf); - // The buffer the cache keeps (another worker's, if it kept one first). - let buf = match (self.cache_to_keep(), key) { - (Some(c), Some(k)) => c.insert(k, buf), - _ => buf, - }; - Some(buf) + let (buf, files) = self.recorded(key, |r| { + let mut buf = r.masked_source(ctx, layer)?; + let origin = ctx.effect_bounds(layer).1; + buf.rebase(origin); + if effects > 0 { + buf = r.effect_space_stack(ctx, layer, buf, EffectStack { adjustment: false, limit: effects, origin }, None); + } + Some(buf) + }); + Some(self.keep(key, Arc::new(buf?), &files)) } } diff --git a/crates/render/src/reads.rs b/crates/render/src/reads.rs new file mode 100644 index 000000000..d5648cca6 --- /dev/null +++ b/crates/render/src/reads.rs @@ -0,0 +1,230 @@ +//! The source files a render read: which footage files its pixels came from, each with its +//! identity (size and modification time) as it was when it was read. +//! +//! A [`FootageSource`](crate::FootageSource) that knows which files it opens notes them while +//! [`FootageSource::recording`](crate::FootageSource::recording) runs; the renderer collects them +//! in a [`ReadLog`] ([`Renderer::reads`](crate::Renderer::reads)). Buffers in the layer cache keep +//! the files they were made of, so a frame served from memory reports the same files as the +//! render that made it, without touching the disk. +//! +//! The list is what a cache entry on disk has to check before it is used: a handful of files per +//! frame, never every file of every footage item. + +use std::sync::{Arc, Mutex, PoisonError}; + +/// The identity of a file as a render read it (see [`file_stamp`](crate::disk_cache) for the +/// same identity in content keys). +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] +pub enum FileStamp { + /// A file on disk: its size in bytes and its modification time (nanoseconds since the Unix + /// epoch; `None` where the file system has none). + Native { len: u64, modified: Option }, + /// Bytes given from memory instead of the file system (the browser's file table): their + /// identity is the size and content hash a + /// [`VirtualFileId`](crate::disk_cache::VirtualFileId) gives for the path. + Virtual, + /// The file could not be read (missing, not a regular file, no permission). What was made + /// without it changes once it can be read again. + Missing, +} + +impl FileStamp { + /// The identity of a file from metadata the caller already has (of an open file). + pub fn of_metadata(md: &std::fs::Metadata) -> FileStamp { + let modified = md.modified().ok().and_then(|t| t.duration_since(std::time::UNIX_EPOCH).ok()).map(|d| d.as_nanos() as u64); + FileStamp::Native { len: md.len(), modified } + } + + /// The identity of the file at `path` now: one `metadata` call. `None` when the file system + /// can't describe it (missing, or a path served from memory). + pub fn native(path: &str) -> Option { + std::fs::metadata(path).ok().map(|md| FileStamp::of_metadata(&md)) + } +} + +/// One file a render read. +#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] +pub struct ReadFile { + pub path: Arc, + pub stamp: FileStamp, +} + +impl ReadFile { + pub fn new(path: impl Into>, stamp: FileStamp) -> ReadFile { + ReadFile { path: path.into(), stamp } + } +} + +/// At most this many files are listed per render or cached buffer; more mark the list +/// incomplete (a comp reading more files than this for one frame is not checked file by file). +pub const MAX_READ_FILES: usize = 4096; + +/// The files a render (or one cached buffer) read, each once, sorted by path. +/// +/// Incomplete when it can't say for sure: a footage source that doesn't tell what it reads, a +/// buffer from a store that doesn't keep its files, more than [`MAX_READ_FILES`] files, or one +/// file read with two identities (it changed during the render). A cache entry whose list is +/// incomplete can't be checked against the files, so it must not outlive the session. +#[derive(Clone, Debug, Default, PartialEq, Eq, Hash)] +pub struct ReadFiles { + files: Vec, + incomplete: bool, +} + +impl ReadFiles { + /// Note a file read (once per path). + pub fn add(&mut self, file: ReadFile) { + match self.files.binary_search_by(|f| f.path.cmp(&file.path)) { + Ok(i) => { + if self.files.get(i).is_some_and(|f| f.stamp != file.stamp) { + self.incomplete = true; + } + } + Err(i) => { + if self.files.len() >= MAX_READ_FILES { + self.incomplete = true; + } else { + self.files.insert(i, file); + } + } + } + } + + /// Note every file of `other` (and whether it is incomplete). + pub fn extend(&mut self, other: &ReadFiles) { + self.incomplete |= other.incomplete; + for f in &other.files { + self.add(f.clone()); + } + } + + /// Some files read may be missing from the list (see [`ReadFiles`]). + pub fn mark_incomplete(&mut self) { + self.incomplete = true; + } + + /// Whether the list names every file read. + pub fn is_complete(&self) -> bool { + !self.incomplete + } + + /// The files, sorted by path. + pub fn files(&self) -> &[ReadFile] { + &self.files + } + + /// The identity `path` was read with. + pub fn get(&self, path: &str) -> Option { + let i = self.files.binary_search_by(|f| (*f.path).cmp(path)).ok()?; + self.files.get(i).map(|f| f.stamp) + } + + pub fn len(&self) -> usize { + self.files.len() + } + + pub fn is_empty(&self) -> bool { + self.files.is_empty() + } +} + +impl FromIterator for ReadFiles { + fn from_iter>(iter: I) -> Self { + let mut out = ReadFiles::default(); + for f in iter { + out.add(f); + } + out + } +} + +/// Collects the files a render reads, from any thread (the layers of a frame render in +/// parallel). +#[derive(Debug, Default)] +pub struct ReadLog { + files: Mutex, +} + +impl ReadLog { + pub fn new() -> ReadLog { + ReadLog::default() + } + + fn lock(&self) -> std::sync::MutexGuard<'_, ReadFiles> { + self.files.lock().unwrap_or_else(PoisonError::into_inner) + } + + /// Note a file read. + pub fn note(&self, file: ReadFile) { + self.lock().add(file); + } + + /// Note every file of `files` (and whether it is incomplete). + pub fn note_all(&self, files: &ReadFiles) { + if files.is_empty() && files.is_complete() { + return; + } + self.lock().extend(files); + } + + /// Some files read can't be listed (see [`ReadFiles`]). + pub fn mark_incomplete(&self) { + self.lock().mark_incomplete(); + } + + /// The files noted so far. + pub fn files(&self) -> ReadFiles { + self.lock().clone() + } + + /// The files noted. + pub fn into_files(self) -> ReadFiles { + self.files.into_inner().unwrap_or_else(PoisonError::into_inner) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + fn file(path: &str, len: u64) -> ReadFile { + ReadFile::new(path, FileStamp::Native { len, modified: Some(7) }) + } + + #[test] + fn files_are_listed_once_sorted_by_path() { + let files: ReadFiles = [file("/b", 1), file("/a", 2), file("/b", 1)].into_iter().collect(); + assert_eq!(files.files().iter().map(|f| &*f.path).collect::>(), ["/a", "/b"]); + assert!(files.is_complete()); + assert_eq!(files.get("/a"), Some(FileStamp::Native { len: 2, modified: Some(7) })); + assert_eq!(files.get("/c"), None); + } + + /// A file read twice with different identities changed during the render: the list can't + /// vouch for what was made of it. + #[test] + fn a_file_read_with_two_identities_makes_the_list_incomplete() { + let files: ReadFiles = [file("/a", 1), file("/a", 2)].into_iter().collect(); + assert_eq!(files.len(), 1); + assert!(!files.is_complete()); + } + + #[test] + fn the_list_is_bounded() { + let files: ReadFiles = (0..MAX_READ_FILES + 3).map(|i| file(&format!("/f{i:06}"), 1)).collect(); + assert_eq!(files.len(), MAX_READ_FILES); + assert!(!files.is_complete(), "files past the bound make the list incomplete, never silently short"); + } + + #[test] + fn incompleteness_carries_over() { + let mut part = ReadFiles::default(); + part.mark_incomplete(); + let log = ReadLog::new(); + log.note(file("/a", 1)); + log.note_all(&part); + let all = log.into_files(); + assert_eq!(all.len(), 1); + assert!(!all.is_complete()); + } +} diff --git a/crates/render/src/three_d/adv/scene.rs b/crates/render/src/three_d/adv/scene.rs index 22507069e..b706826de 100644 --- a/crates/render/src/three_d/adv/scene.rs +++ b/crates/render/src/three_d/adv/scene.rs @@ -487,7 +487,7 @@ fn model_layer(r: &Renderer, ctx: &EvalCtx, layer: &Layer, b: &mut Builder) { LayerSource::Model { item } => { let Some(it) = r.project.item(*item) else { return }; let ItemKind::Footage(f) = &it.kind else { return }; - let Some(m) = r.footage.model(*item, f) else { return }; + let Some(m) = r.read(|| r.footage.model(*item, f)) else { return }; let unit = geo.map_or(1.0, |g| ctx.f(layer, g, "unitScale", 1.0)); let clip = geo.map_or(0, |g| ctx.e(layer, g, "animation")) as usize; let clip = clip.checked_sub(1).filter(|c| *c < m.animations.len()); @@ -700,7 +700,7 @@ fn card_layer(r: &Renderer, ctx: &EvalCtx, layer: &Layer, b: &mut Builder) { let world = b.outer * ctx.world_matrix(layer); if crate::text::per_char_3d(ctx, layer) { for (buf, m) in crate::text::per_char_planes(ctx, layer, r.opts.scale) { - let buf = r.to_blend(Arc::new(buf), None); + let buf = r.to_blend(Arc::new(buf), None, &Arc::default()); card(b, &buf, world * m, mat); } return; diff --git a/crates/render/src/three_d/compose.rs b/crates/render/src/three_d/compose.rs index a5a7c170e..361f427c3 100644 --- a/crates/render/src/three_d/compose.rs +++ b/crates/render/src/three_d/compose.rs @@ -205,7 +205,9 @@ pub(crate) fn prepare_all<'a>(r: &Renderer, ctx: &EvalCtx<'_>, layer: &'a Layer, if crate::text::per_char_3d(ctx, layer) { return crate::text::per_char_planes(ctx, layer, r.opts.scale) .into_iter() - .filter_map(|(buf, m)| prepare_with(r, ctx, layer, order, out, in_run, PlaneInput { buf: r.to_blend(Arc::new(buf), None), local: m })) + .filter_map(|(buf, m)| { + prepare_with(r, ctx, layer, order, out, in_run, PlaneInput { buf: r.to_blend(Arc::new(buf), None, &Arc::default()), local: m }) + }) .collect(); } prepare(r, ctx, layer, order, out, in_run).into_iter().collect() diff --git a/crates/ui-egui/src/frames.rs b/crates/ui-egui/src/frames.rs index 001790116..d76624ab3 100644 --- a/crates/ui-egui/src/frames.rs +++ b/crates/ui-egui/src/frames.rs @@ -34,6 +34,7 @@ use std::sync::{Arc, Mutex}; use effectcraft_engine::project::{Comp, Heard, ItemId, ItemKind, LayerSource, Node, Project, PropGroup}; use effectcraft_engine::render::disk_cache::{self, DiskCache}; +use effectcraft_engine::render::reads::{ReadFiles, ReadLog}; use effectcraft_engine::render::{CancellableFootage, ExprHost, FootageSource, LayerCache, RenderOpts, Renderer}; use effectcraft_engine::time::Tick; use effectcraft_gpu::{DisplayFrame, FrameError, Gpu}; @@ -1465,7 +1466,9 @@ impl Frames { let gpu_here = job.src.gpu.is_some() && job.src.gpu_display && !(remote.gpu() && comp_has_effects(&job.src.project, job.comp)); if gpu_here { let t0 = web_time::Instant::now(); - if let Some(img) = w.render_gpu(&job) { + // (A frame kept on the GPU is not written to the disk cache: its files are not + // needed.) + if let Some((img, _files)) = w.render_gpu(&job) { w.finish(&job, img, t0); continue; } @@ -1617,10 +1620,11 @@ impl Worker { } }); let disk_hit = from_disk.is_some(); - let ci = match from_disk { - Some(f) => f, + // `files`: the source files the rendered frame was made of (see `render::reads`). + let (ci, files) = match from_disk { + Some(f) => (f, None), None => match self.render_guarded(&job).filter(|_| !job.cancel.load(Ordering::Relaxed)) { - Some(ci) => ci, + Some((ci, files)) => (ci, Some(files)), // Called off (frames it read may be missing) or failed: not cached, and not // "in progress" forever: the viewer asks for it again. None => { @@ -1633,6 +1637,16 @@ impl Worker { // and compression. Persistence still runs on this worker, using the same snapshot. self.finish(&job, ci.clone(), t0); if !disk_hit && let Some((dc, k)) = &disk { + // (#3184: the entry is to keep `files`, checked before it is used again.) + if let Some(files) = &files { + log::trace!( + "frame {} of comp {}: {} source files{}", + job.key.frame, + job.key.comp, + files.len(), + if files.is_complete() { "" } else { " (incomplete)" } + ); + } let written = match &ci { FrameImage::Cpu(img) => { let rgba: Vec = img.pixels.iter().flat_map(|c| c.to_array()).collect(); @@ -1689,9 +1703,13 @@ impl Worker { } /// [`Worker::render_job`], again on the CPU if it panicked (the panic hook has logged it); - /// `None` if that panicked too. - fn render_guarded(&self, job: &Job) -> Option { - let attempt = |gpu: bool| std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| self.render_job(job, gpu))).ok(); + /// `None` if that panicked too. With the source files the frame was made of. + fn render_guarded(&self, job: &Job) -> Option<(FrameImage, ReadFiles)> { + let attempt = |gpu: bool| { + let files = ReadLog::new(); + let img = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| self.render_job(job, gpu, &files))).ok()?; + Some((img, files.into_files())) + }; let img = attempt(true).or_else(|| { log::error!("a frame render panicked (frame {})", job.key.frame); job.src.gpu.as_ref().and_then(|_| attempt(false)) @@ -1731,16 +1749,19 @@ impl Worker { !self.gpu_retired.load(Ordering::Acquire) && self.cache.lock().is_ok_and(|c| c.gpu_ready()) } - /// The frame on the GPU, kept there for the viewer, if the compositor can do it alone. - fn render_gpu(&self, job: &Job) -> Option { + /// The frame on the GPU, kept there for the viewer, if the compositor can do it alone, with + /// the source files it was made of. + fn render_gpu(&self, job: &Job) -> Option<(FrameImage, ReadFiles)> { if !self.gpu_ready() { return None; } let g = job.src.gpu.as_ref()?; let footage = job.footage(); + let files = ReadLog::new(); let mut r = Renderer::new(&job.src.project, &footage, job.opts); r.expr = job.src.expr.as_deref(); r.cache = Some(&job.src.layer_cache); + r.reads = Some(&files); r.accel = Some(g as &dyn effectcraft_engine::render::Accelerator); r.active_accel()?; let f = g.within_memory(|| g.render_display(&r, job.comp, job.t)); @@ -1750,7 +1771,7 @@ impl Worker { if f.is_some() { self.gpu_succeeded(); } - f.map(|f| FrameImage::Gpu(Arc::new(f))) + f.map(|f| (FrameImage::Gpu(Arc::new(f)), files.into_files())) } Err(e) => { self.gpu_attempt_failed(g, &e); @@ -1759,11 +1780,13 @@ impl Worker { } } - /// Render a frame; `gpu: false` keeps it off the GPU compositor. - fn render_job(&self, job: &Job, gpu: bool) -> FrameImage { + /// Render a frame; `gpu: false` keeps it off the GPU compositor. The source files it reads + /// are noted in `files` (a GPU attempt that falls back to the CPU notes both renders'). + fn render_job(&self, job: &Job, gpu: bool, files: &ReadLog) -> FrameImage { let footage = job.footage(); let mut r = Renderer::new(&job.src.project, &footage, job.opts); r.expr = job.src.expr.as_deref(); + r.reads = Some(files); let gpu_allowed = gpu && self.gpu_ready(); // A failed GPU attempt may have populated intermediate entries before its scope // reported failure. The CPU retry must compute its own pixels from the snapshot. @@ -1789,7 +1812,7 @@ impl Worker { // Time the GPU's work, not just its recording. g.wait(); if g.context().check_health().is_err() { - return self.render_job(job, false); + return self.render_job(job, false, files); } p.record(key, true, t0.elapsed().as_secs_f64() * 1000.0); } @@ -1802,7 +1825,7 @@ impl Worker { } Err(e) => { self.gpu_attempt_failed(g, &e); - return self.render_job(job, false); + return self.render_job(job, false, files); } } } @@ -1822,7 +1845,7 @@ impl Worker { } Err(e) => { self.gpu_attempt_failed(g, &e); - self.render_job(job, false) + self.render_job(job, false, files) } }; } From 2de2406bccb1e1f5836230927f0482f1e08b3e0d Mon Sep 17 00:00:00 2001 From: vangel76 Date: Fri, 6 Nov 2026 22:30:26 +0100 Subject: [PATCH 017/451] Automation: confined footage passes on the files it reads Part of #3184: ConfinedFootage forwards FootageSource::recording to the source it wraps, so renders of an automation session list their files instead of coming back incomplete. The read tests also render through the viewer's CancellableFootage wrapper. Co-Authored-By: Claude Opus 5.5 --- crates/automation/src/confine.rs | 5 +++++ crates/media/src/reads/tests.rs | 11 +++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/crates/automation/src/confine.rs b/crates/automation/src/confine.rs index 6d8ce2819..c24f62acb 100644 --- a/crates/automation/src/confine.rs +++ b/crates/automation/src/confine.rs @@ -401,6 +401,11 @@ impl FootageSource for ConfinedFootage { fn called_off(&self) -> bool { self.inner.called_off() } + /// The files read inside the roots, as the inner source notes them (footage outside reads + /// nothing). + fn recording(&self, reads: &effectcraft_engine::render::reads::ReadLog, f: &mut dyn FnMut()) { + self.inner.recording(reads, f) + } } /// The session's file reads, only inside the read roots: what a project or an imported file diff --git a/crates/media/src/reads/tests.rs b/crates/media/src/reads/tests.rs index f9079820f..8fee7d211 100644 --- a/crates/media/src/reads/tests.rs +++ b/crates/media/src/reads/tests.rs @@ -112,9 +112,16 @@ fn a_sequence_frame_reports_only_its_own_file() { assert_stamps_match_disk(&files); assert_eq!(crate::opens_under(&dir) - opened, 1, "one file opened: the frame's"); assert_eq!(crate::opens_under(&unused_dir), 0, "the unused sequence was not looked at"); - // Another frame reads its own file. - let (_, files) = render(&p, &pool, &cache, cid, 4); + // Another frame reads its own file, also through the viewer's wrapper of the pool. + let viewer = effectcraft_render::CancellableFootage { inner: &pool, cancel: Default::default() }; + let log = ReadLog::new(); + let mut r = Renderer::new(&p, &viewer, RenderOpts::default()); + r.cache = Some(&cache); + r.reads = Some(&log); + r.comp_frame(cid, RATE.tick_of(4)); + let files = log.into_files(); assert_eq!(paths(&files), [frame_4]); + assert!(files.is_complete()); let _ = std::fs::remove_dir_all(&dir); } From 99b65562de0c7c1c8127788a630440f09375fc3e Mon Sep 17 00:00:00 2001 From: vangel76 Date: Fri, 6 Nov 2026 23:19:09 +0100 Subject: [PATCH 018/451] Disk cache: frame entries keep their source files, comp key from memory Part of #3184 (step 2). Fixes #3175: opening a comp no longer stamps every footage file of the project before its first frame can show. - The comp's content key (`disk_cache::comp_content_key`) is taken from the project in memory alone: no footage or proxy file is stamped, no `VirtualFileId` is asked. `comp_content_key_with` is gone; `frame_key` hashes a new entry version, so entries of the earlier format are never looked up again (LRU evicts them). - Frame entries (formats 2 and 3) store the files the frame read (`EntryFiles`: size and modification time as read; size and content hash through `VirtualFileId` for files from memory; missing files), then the pixels. Formats 0 and 1 read as misses and are deleted. - Check on hit: `get_frame`/`get_frame_f16` look only at the listed files (one metadata call each) on the frame worker. A changed, back or unreadable file, or a damaged entry, is a miss: the entry is deleted and the frame rendered and stored again. - A frame whose file list is incomplete is shown but not stored. The RAM preview keeps each frame's files, so `persist_missing` writes only frames with a complete list. - Remote frame worker: `FrameServer` records each frame's reads (`take_files`); the web worker stores them with the entry and the page checks them through the file table before using it. The browser's media epoch existed only for the old key and is removed. Export does not use frame entries. - The cache indicator still only asks whether an entry exists. Tests: entry format round trip and damage, the check per file, and in the viewer: a changed file re-renders exactly its frames (and a reopen reads the rest from disk); a frame checks only its own files in a project with a large unused sequence and the key looks at no file; missing, unreadable files and damaged entries never serve a stale frame. Co-Authored-By: Claude Opus 5.5 --- apps/effectcraft-web/src/app.rs | 2 +- apps/effectcraft-web/src/diskcache.rs | 16 +- apps/effectcraft-web/src/frames.rs | 7 +- apps/effectcraft-web/src/store.rs | 17 +- crates/engine/src/background/remote.rs | 27 +- crates/engine/src/background/remote/tests.rs | 68 +++ crates/render/src/disk_cache.rs | 431 ++++++++++++------ crates/render/src/disk_cache/entry_files.rs | 257 +++++++++++ crates/render/src/reads.rs | 2 +- crates/ui-egui/src/frames.rs | 251 +++++----- crates/ui-egui/src/frames/tests.rs | 318 ++++++++++++- crates/ui-egui/tests/it/ui_web_gpu_storage.rs | 9 +- docs/web.md | 8 +- 13 files changed, 1092 insertions(+), 321 deletions(-) create mode 100644 crates/render/src/disk_cache/entry_files.rs diff --git a/apps/effectcraft-web/src/app.rs b/apps/effectcraft-web/src/app.rs index 2882b16cf..99e71117f 100644 --- a/apps/effectcraft-web/src/app.rs +++ b/apps/effectcraft-web/src/app.rs @@ -329,7 +329,7 @@ pub async fn start(canvas_id: String) -> Result<(), JsValue> { if n > 0 { app.frames.set_remote(Some(Arc::new(frames::WebFrames::start(n, !query_flag("nogpuworkers"))))); } - app.frames.set_virtual_media(files::STORE.media_epoch(), Arc::new(|path| files::STORE.file_identity(path))); + app.frames.set_virtual_id(Arc::new(|path| files::STORE.file_identity(path))); let (tx, rx) = std::sync::mpsc::channel(); api::set_sender(tx); app = app.with_control(rx); diff --git a/apps/effectcraft-web/src/diskcache.rs b/apps/effectcraft-web/src/diskcache.rs index ef9d46f8c..5ac655cb0 100644 --- a/apps/effectcraft-web/src/diskcache.rs +++ b/apps/effectcraft-web/src/diskcache.rs @@ -4,14 +4,17 @@ //! //! - **Writes** happen in the frame workers: a render request carries the frame's disk-cache key //! (`effectcraft_engine::remote::FrameMsg::Render`), the worker posts the frame, then writes -//! the sealed entry (`disk_cache::frame_entry`: LZ4, checksum) with a synchronous access -//! handle into a temporary file moved into place (`js/host.js` `cacheWrite`), and reports -//! `FrameReply::Stored`. +//! the sealed entry (`disk_cache::frame_entry`: the source files the frame read, LZ4, +//! checksum) with a synchronous access handle into a temporary file moved into place +//! (`js/host.js` `cacheWrite`), and reports `FrameReply::Stored`. A frame whose files can't +//! all be named is not stored. //! - **The index** lives here, on the page ([`DiskIndex`], shared with the desktop's cache): //! rebuilt at startup from the folder listing (oldest files first), updated by the workers' //! `Stored` replies and by reads; eviction deletes the least recently used files. //! - **Reads** are asynchronous: a frame whose key is indexed is read and decoded here instead -//! of rendering it (`crate::frames`); a damaged or missing file is a miss and is forgotten. +//! of rendering it (`crate::frames`), if the files its entry lists still have the size and +//! content hash it was made of (the file table's identities); a damaged or missing entry, or +//! one whose files changed, is a miss and is deleted. //! //! - **Layer buffers** too (`layers/<32 hex>.ecc`): a layer lookup happens in the middle of a //! synchronous render, where the browser's file system can't be read, so the frame workers @@ -187,11 +190,12 @@ pub fn note_miss() { } /// Read and decode a cached frame; `None` (forgotten and deleted) when the file is missing or -/// damaged. +/// damaged, or the source files it was made of changed since. pub async fn read(key: u128) -> Option { let name = disk_cache::entry_name(key); let bytes = JsFuture::from(cache_read(&name)).await.ok().and_then(|b| b.dyn_into::().ok()).map(|b| b.to_vec()); - let frame = bytes.as_deref().and_then(disk_cache::read_frame_entry); + let identity = |path: &str| crate::files::STORE.file_identity(path); + let frame = bytes.as_deref().and_then(|b| disk_cache::read_frame_entry(b, Some(&identity))); ST.with(|s| { let mut s = s.borrow_mut(); if frame.is_some() { diff --git a/apps/effectcraft-web/src/frames.rs b/apps/effectcraft-web/src/frames.rs index 69089e308..0159fe23b 100644 --- a/apps/effectcraft-web/src/frames.rs +++ b/apps/effectcraft-web/src/frames.rs @@ -473,10 +473,13 @@ pub async fn worker_frame(json: String) { g.settled().await; replies = SERVER.with(|c| c.borrow_mut().as_mut().map(|s| s.resume()).unwrap_or_default()); } + // The source files the frame read, kept with its entry (checked by the page before use); a + // frame whose files can't all be named is not stored (#3184). + let (files, virtual_id) = SERVER.with(|c| c.borrow_mut().as_mut().map(|s| (s.take_files(), s.virtual_id().cloned())).unwrap_or_default()); for (r, px) in replies { post_reply(&r, px.as_deref()); - if let (FrameReply::Frame { width, height, .. }, Some(px), Some(key)) = (&r, &px, &disk) { - let entry = effectcraft_engine::render::disk_cache::frame_entry(*width, *height, px); + if let (FrameReply::Frame { width, height, .. }, Some(px), Some(key), Some(files)) = (&r, &px, &disk, &files) { + let Some(entry) = effectcraft_engine::render::disk_cache::frame_entry(*width, *height, px, files, virtual_id.as_deref()) else { continue }; let name = format!("{key}.ecc"); match JsFuture::from(crate::diskcache::cache_write(&name, js_sys::Uint8Array::from(&entry[..]))).await { Ok(n) => post_reply(&FrameReply::Stored { key: key.clone(), bytes: n.as_f64().unwrap_or(entry.len() as f64) as u64, layer: false }, None), diff --git a/apps/effectcraft-web/src/store.rs b/apps/effectcraft-web/src/store.rs index 0cc877948..abda69a77 100644 --- a/apps/effectcraft-web/src/store.rs +++ b/apps/effectcraft-web/src/store.rs @@ -20,7 +20,6 @@ use std::collections::BTreeMap; use std::path::{Path, PathBuf}; -use std::sync::atomic::{AtomicU64, Ordering}; use std::sync::{Arc, Mutex, OnceLock}; use effectcraft_engine::config::{ConfigStore, FileOps}; @@ -187,13 +186,11 @@ pub struct Store { pub on_change: OnceLock, /// Clock in milliseconds since the Unix epoch (tests pin it). pub clock: OnceLock f64>, - /// Bumped when a virtual file is written. Preview cache lookups key on it; they do not hash. - media_epoch: Arc, } impl Default for Store { fn default() -> Self { - Self { mirror: Mutex::default(), on_change: OnceLock::new(), clock: OnceLock::new(), media_epoch: Arc::new(AtomicU64::new(0)) } + Self { mirror: Mutex::default(), on_change: OnceLock::new(), clock: OnceLock::new() } } } @@ -218,22 +215,12 @@ impl Store { pub fn put_file(&self, path: &str, data: Arc<[u8]>, persist: bool) { let now = self.now(); let key = file_key(path); - let replaced = self.lock().get(&key).is_none_or(|e| !Arc::ptr_eq(&e.data, &data)); self.lock().put(&key, data, now, persist); - if replaced { - self.media_epoch.fetch_add(1, Ordering::Relaxed); - } if persist { self.changed(); } } - /// The generation preview cache lookups key on. It changes when [`Self::put_file`] writes - /// a different blob, and it is not a content hash. - pub fn media_epoch(&self) -> Arc { - self.media_epoch.clone() - } - /// Size and content hash of the file under `path`. The hash is stored on the entry so a /// later key does not walk the bytes again. pub fn file_identity(&self, path: &str) -> Option<(u64, u64)> { @@ -541,11 +528,9 @@ mod tests { assert_ne!(a, b); assert_eq!(&data[..], b"blue"); assert_eq!(s.file_versioned("/collision.png").map(|f| f.1), Some(b), "reading doesn't change it"); - let epoch = s.media_epoch().load(Ordering::Relaxed); let id = s.file_identity("/collision.png").expect("identity"); assert_eq!(id, (4, content_hash(b"blue"))); assert_eq!(s.file_identity("/collision.png"), Some(id), "the hash is kept on the entry"); - assert!(epoch >= 2, "each new blob bumps the generation the preview keys on"); } /// A write that failed is flushed again with the key's latest state (#215). diff --git a/crates/engine/src/background/remote.rs b/crates/engine/src/background/remote.rs index 27f9396e1..ca11d8220 100644 --- a/crates/engine/src/background/remote.rs +++ b/crates/engine/src/background/remote.rs @@ -20,8 +20,10 @@ //! calls [`FrameServer::resume`] for the next. Backend Auto picks CPU or GPU per comp from //! the frames' total times ([`effectcraft_render::AutoPick`]). //! - Disk cache: a render request may carry the frame's disk-cache key ([`FrameMsg::Render`] -//! `disk`); the transport stores the finished frame under it (the browser: in the Origin -//! Private File System) and reports [`FrameReply::Stored`]. +//! `disk`); the transport stores the finished frame under it with the source files it read +//! ([`FrameServer::take_files`], `disk_cache::frame_entry`; the browser: in the Origin Private +//! File System) and reports [`FrameReply::Stored`]. A frame whose files can't all be named is +//! not stored. The page checks an entry's files before it uses it (#3184). //! - Layer buffers on disk: with `layers`, the server's layer cache is backed by a //! [`PrefetchStore`] ([`FrameServer::set_layer_store`]): before the request the transport //! fetches the entries named in `prefetch` (recent misses that are on disk, chosen by the @@ -37,6 +39,7 @@ use std::sync::Arc; use effectcraft_project::{ItemId, Project}; +use effectcraft_render::reads::{ReadFiles, ReadLog}; use effectcraft_render::{Accelerator, AutoKey, Backend, ExprHost, FootageSource, Image, LayerCache, LayerStore, PrefetchStore, RenderOpts, Renderer}; use effectcraft_time::Tick; use serde::{Deserialize, Serialize}; @@ -265,6 +268,8 @@ pub struct FrameServer { salt: u64, /// Size and content hash for footage paths with no native metadata (the browser file table). virtual_id: Option Option<(u64, u64)> + Send + Sync>>, + /// The source files the last finished frame read ([`FrameServer::take_files`]). + files: Option, } /// A frame whose readbacks are in flight. @@ -297,6 +302,7 @@ impl FrameServer { layer_store: None, salt: 0, virtual_id: None, + files: None, } } @@ -306,6 +312,18 @@ impl FrameServer { self.virtual_id = id; } + /// The source files the frame of the last [`FrameReply::Frame`] read, with their identities + /// as read: what its disk entry keeps (`disk_cache::frame_entry`). Taken once. + pub fn take_files(&mut self) -> Option { + self.files.take() + } + + /// The identity of footage paths with no native metadata (the browser file table), to store + /// with a frame's disk entry. + pub fn virtual_id(&self) -> Option<&Arc Option<(u64, u64)> + Send + Sync>> { + self.virtual_id.as_ref() + } + /// The store behind the layer cache when a request asks for `layers` (the browser: the /// disk cache's layer buffers, fetched before the request). pub fn set_layer_store(&mut self, store: Option>) { @@ -432,12 +450,16 @@ impl FrameServer { /// Run the next pass of the frame in progress; its reply once it is done. pub fn resume(&mut self) -> Vec<(FrameReply, Option>)> { let Some(mut pr) = self.pending.take() else { return vec![] }; + self.files = None; pr.passes += 1; let accel = self.accel.clone().filter(|_| pr.opts.backend != Backend::Cpu); let give_up = pr.passes > MAX_PASSES; + // (each pass renders the whole frame: the last one's files are the frame's) + let reads = ReadLog::new(); let mut r = Renderer::new(&pr.project, self.footage.as_ref(), pr.opts); r.expr = self.expr.as_deref(); r.cache = Some(&self.cache); + r.reads = Some(&reads); if !give_up { r.accel = accel.as_deref(); } @@ -451,6 +473,7 @@ impl FrameServer { } let ms = pr.t0.elapsed().as_secs_f64() * 1000.0; let gpu = r.accel.is_some() && r.active_accel().is_some(); + self.files = Some(reads.files()); let hex = |v: Vec| v.into_iter().map(|k| format!("{k:032x}")).collect::>(); let (layer_misses, layer_hits) = match &self.layer_store { Some(st) => (hex(st.take_misses()), hex(st.take_hits())), diff --git a/crates/engine/src/background/remote/tests.rs b/crates/engine/src/background/remote/tests.rs index e2db10b8e..7a7a59f3f 100644 --- a/crates/engine/src/background/remote/tests.rs +++ b/crates/engine/src/background/remote/tests.rs @@ -375,3 +375,71 @@ fn every_frame_begin_has_a_frame_end() { assert!(matches!(w.handle(req(6, s.revision, comp, cpu))[0].0, FrameReply::Frame { id: 6, .. })); assert_eq!(load(), (3, 3)); } + +/// Footage that reads one file from memory (the browser's file table) for every frame. +struct OneVirtualFile { + /// Tell which files it reads (else every render's list is incomplete). + records: bool, +} + +impl FootageSource for OneVirtualFile { + fn frame(&self, _: ItemId, _: &effectcraft_project::Footage, _: Tick) -> Option> { + Some(Arc::new(Image::filled(4, 4, [1.0, 0.5, 0.0, 1.0]))) + } + fn recording(&self, reads: &ReadLog, f: &mut dyn FnMut()) { + if self.records { + reads.note(effectcraft_render::reads::ReadFile::new("/clip.png", effectcraft_render::reads::FileStamp::Virtual)); + } else { + reads.mark_incomplete(); + } + f() + } +} + +/// The worker hands the transport the files each frame read, so its disk entry keeps them; the +/// page reads the entry back only while those files are unchanged. A frame whose files can't +/// all be named is not stored (#3184). +#[test] +fn the_worker_reports_the_files_of_each_frame_for_its_disk_entry() { + use effectcraft_project::{Comp, Footage, ItemKind, LayerSource, Project, build}; + use effectcraft_render::disk_cache::{frame_entry, read_frame_entry}; + use effectcraft_time::FrameRate; + let mut p = Project::default(); + let f = Footage { path: "/clip.png".into(), width: 4, height: 4, duration: Tick::from_seconds_f64(1.0), has_video: true, ..Default::default() }; + let fid = p.add_item("clip.png", effectcraft_color::Label::None, None, ItemKind::Footage(f)); + let mut comp = Comp::new(4, 4, FrameRate::FPS_30, Tick::from_seconds_f64(1.0)); + comp.layers = vec![build::layer(&mut p, &comp, "clip", LayerSource::Footage { item: fid }, (4, 4), None)].into(); + let cid = p.add_item("C", effectcraft_color::Label::None, None, ItemKind::Comp(comp.into())); + let id = |mark: u64| move |path: &str| (path == "/clip.png").then_some((10, mark)); + let (one, two) = (id(1), id(2)); + for records in [true, false] { + let mut w = FrameServer::new(Arc::new(OneVirtualFile { records }), None); + w.set_virtual_id(Some(Arc::new(one))); + let mut m = Mirror::default(); + assert!(w.handle(round(&m.sync(1, &p).unwrap())).is_empty()); + assert!(w.take_files().is_none(), "no frame yet"); + let out = w.handle(round(&FrameMsg::Render { + id: 1, + revision: 1, + comp: cid, + time: Tick::ZERO, + opts: Box::default(), + disk: Some(format!("{:032x}", 5u128)), + layers: false, + prefetch: vec![], + })); + let (FrameReply::Frame { width, height, .. }, Some(px)) = &out[0] else { panic!("{:?}", out[0].0) }; + let files = w.take_files().expect("the frame's files"); + assert!(w.take_files().is_none(), "taken once"); + let vid = w.virtual_id().cloned(); + let entry = frame_entry(*width, *height, px, &files, vid.as_deref()); + if !records { + assert!(!files.is_complete() && entry.is_none(), "an incomplete list is not stored"); + continue; + } + assert_eq!(files.files().iter().map(|f| &*f.path).collect::>(), ["/clip.png"]); + let entry = entry.expect("stored"); + assert_eq!(read_frame_entry(&entry, Some(&one)).map(|f| f.rgba), Some(px.clone())); + assert!(read_frame_entry(&entry, Some(&two)).is_none(), "the file was replaced: a miss"); + } +} diff --git a/crates/render/src/disk_cache.rs b/crates/render/src/disk_cache.rs index 03832643b..0a91f11ac 100644 --- a/crates/render/src/disk_cache.rs +++ b/crates/render/src/disk_cache.rs @@ -2,13 +2,18 @@ //! and layer cache entries kept on disk between sessions, like After Effects' disk cache. //! //! * Entries are files keyed by a 128-bit content hash (`/v1//<2 hex>/<32 hex>.ecc`): -//! frames by the hash of the composition's content (the comp and everything it uses, footage -//! files' size and modification time included) plus frame, scale and view; layer buffers by -//! the layer cache's content key salted with the project's footage fingerprint. A changed -//! project therefore never reads stale pixels: its keys simply change. +//! frames by the hash of the composition's content as it is in memory (the comp and everything +//! it uses, footage items with their settings and paths; no file is looked at) plus frame, +//! scale and view; layer buffers by the layer cache's content key salted with the project's +//! footage fingerprint. A changed project therefore never reads stale pixels: its keys simply +//! change. +//! * A frame entry keeps the source files the frame was made of, each with the size and +//! modification time it was read with ([`EntryFiles`], #3184). An entry is used only while +//! those files are unchanged: a handful of `metadata` calls when the frame is read, never a +//! scan of the project's files. A frame whose files can't all be named is not stored. //! * Payloads are LZ4-compressed (`lz4_flex`, MIT): frames as 8-bit premultiplied RGBA (or, for //! 32 bpc viewer frames, half-float RGBA with the bytes shuffled into planes; the entry -//! header's format byte tells them apart, 8-bit entries keep format 0), layer +//! header's format byte tells them apart: 2 and 3, both with their source files first), layer //! buffers as `f32` RGBA with the bytes shuffled into planes (exact, so cached and fresh //! renders are bit-identical), Roto Brush / Object Matte segmentations as //! `FrameSeg::to_bytes` (keyed by their content-keyed chain key and scale, so they are @@ -32,6 +37,11 @@ use std::sync::{Arc, Condvar, Mutex}; use effectcraft_effects::Buf; use effectcraft_raster::Image; +use crate::reads::ReadFiles; + +mod entry_files; +pub use entry_files::{EntryFile, EntryFiles, EntryStamp}; + /// File format version (part of the folder layout). const VERSION: &str = "v1"; const MAGIC: &[u8; 4] = b"ECDC"; @@ -87,9 +97,13 @@ pub struct FrameF16 { pub rgba: Vec, } -/// The entry header's format byte of frame entries. +/// The entry header's format byte: layer buffers and segmentations (and 8-bit frames before +/// #3184). const FORMAT_RGBA8: u8 = 0; -const FORMAT_F16: u8 = 1; +/// Frame entries: their source files ([`EntryFiles`]), then 8-bit or half-float pixels. The +/// formats before them (0: 8-bit, 1: half float, without files) read as misses and are deleted. +const FORMAT_RGBA8_FILES: u8 = 2; +const FORMAT_F16_FILES: u8 = 3; /// Counters for tests, the Info panel and `cache.diskStats`. #[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] @@ -286,6 +300,8 @@ pub struct DiskCache { evictions: AtomicU64, dropped: AtomicU64, failed: AtomicU64, + /// Source files looked at to check frame entries ([`DiskCache::file_checks`]). + file_checks: AtomicU64, tmp_counter: AtomicU64, queue: Arc<(Mutex, Condvar)>, /// Layer buffers that took less than this to render are not written (ms). @@ -362,6 +378,7 @@ impl DiskCache { evictions: AtomicU64::new(0), dropped: AtomicU64::new(0), failed: AtomicU64::new(0), + file_checks: AtomicU64::new(0), tmp_counter: AtomicU64::new(0), queue: Arc::new(( Mutex::new(Queue { @@ -541,36 +558,82 @@ impl DiskCache { /// An entry's payload and its header's format byte. fn read_entry(&self, kind: Kind, key: u128) -> Option<(u8, Vec)> { + let entry = self.load(kind, key); + match &entry { + Some(_) => self.hit(kind, key), + None => _ = self.misses.fetch_add(1, Ordering::Relaxed), + } + entry + } + + /// An entry's payload and format byte, without counting it as a hit or miss. A damaged file + /// is deleted; a missing one forgotten. + fn load(&self, kind: Kind, key: u128) -> Option<(u8, Vec)> { if !self.contains(kind, key) { - self.misses.fetch_add(1, Ordering::Relaxed); return None; } let path = self.path(kind, key); let data = std::fs::read(&path).ok(); - let ok = data.as_deref().and_then(|d| verify(d, kind).map(|p| (d[5], p))); - match ok { - Some((format, payload)) => { - let payload = (format, payload.to_vec()); - self.hits.fetch_add(1, Ordering::Relaxed); - if let Ok(mut g) = self.index.lock() { - g.touch(kind, key); - } - // Persist the recency for the next session (best effort). - if let Ok(f) = std::fs::File::options().append(true).open(&path) { - let _ = f.set_modified(std::time::SystemTime::now()); - } - Some(payload) - } - None => { - self.misses.fetch_add(1, Ordering::Relaxed); - // Gone (another process evicted it) or damaged: forget it. - if data.is_some() { - let _ = std::fs::remove_file(&path); - } - self.forget(kind, key); - None + let ok = data.as_deref().and_then(|d| Some((*d.get(5)?, verify(d, kind)?.to_vec()))); + if ok.is_none() { + // Gone (another process evicted it) or damaged: forget it. + if data.is_some() { + let _ = std::fs::remove_file(&path); } + self.forget(kind, key); } + ok + } + + /// Count a hit: the entry becomes the most recently used, also for the next session. + fn hit(&self, kind: Kind, key: u128) { + self.hits.fetch_add(1, Ordering::Relaxed); + if let Ok(mut g) = self.index.lock() { + g.touch(kind, key); + } + // Persist the recency for the next session (best effort). + if let Ok(f) = std::fs::File::options().append(true).open(self.path(kind, key)) { + let _ = f.set_modified(std::time::SystemTime::now()); + } + } + + /// A frame entry of `format` whose source files are unchanged, decoded by `decode`, with + /// those files. An entry whose files changed, of the format before #3184, or damaged, is a + /// miss and is deleted (the frame renders again and is stored anew). An entry of the other + /// current format (8-bit and half-float frames have keys of their own) is a miss and stays. + fn get_checked(&self, key: u128, format: u8, virtual_id: Option>, decode: impl FnOnce(&[u8]) -> Option) -> Option<(T, ReadFiles)> { + let miss = || { + self.misses.fetch_add(1, Ordering::Relaxed); + None + }; + let Some((found, payload)) = self.load(Kind::Frame, key) else { return miss() }; + if found != format { + if found != FORMAT_RGBA8_FILES && found != FORMAT_F16_FILES { + self.discard(Kind::Frame, key); + } + return miss(); + } + let Some((files, pixels)) = EntryFiles::decode(&payload) else { + self.discard(Kind::Frame, key); + return miss(); + }; + self.file_checks.fetch_add(files.len() as u64, Ordering::Relaxed); + if !files.unchanged(virtual_id) { + self.discard(Kind::Frame, key); + return miss(); + } + let Some(frame) = decode(pixels) else { + self.discard(Kind::Frame, key); + return miss(); + }; + self.hit(Kind::Frame, key); + Some((frame, files.to_read_files())) + } + + /// Source files looked at so far to check frame entries before using them (one per file a + /// read frame lists; tests). + pub fn file_checks(&self) -> u64 { + self.file_checks.load(Ordering::Relaxed) } /// A valid file whose payload does not decode: delete it, as a damaged one. @@ -682,50 +745,45 @@ impl DiskCache { // ------------------------------------------------------------ typed entries - /// An 8-bit frame (`None` for a half-float entry of that key, which [`DiskCache::get_frame_f16`] - /// reads). - pub fn get_frame(&self, key: u128) -> Option { - let (format, p) = self.read_entry(Kind::Frame, key)?; - if format != FORMAT_RGBA8 { - return None; - } - decode_frame(&p) + /// An 8-bit frame whose source files are unchanged (see [`DiskCache::get_checked`]), with + /// those files; `None` for a half-float entry of that key, which + /// [`DiskCache::get_frame_f16`] reads. `virtual_id` names files served from memory. + pub fn get_frame(&self, key: u128, virtual_id: Option>) -> Option<(Frame8, ReadFiles)> { + self.get_checked(key, FORMAT_RGBA8_FILES, virtual_id, decode_frame) } - /// A half-float frame (32 bpc viewer frames). A damaged one is deleted. - pub fn get_frame_f16(&self, key: u128) -> Option { - let (format, p) = self.read_entry(Kind::Frame, key)?; - if format != FORMAT_F16 { - return None; - } - let f = decode_frame_f16(&p); - if f.is_none() { - self.discard(Kind::Frame, key); - } - f + /// A half-float frame (32 bpc viewer frames), as [`DiskCache::get_frame`]. + pub fn get_frame_f16(&self, key: u128, virtual_id: Option>) -> Option<(FrameF16, ReadFiles)> { + self.get_checked(key, FORMAT_F16_FILES, virtual_id, decode_frame_f16) } - /// Queue a half-float frame for writing (`width * height * 4` binary16 values). `true` when - /// it is on disk or queued; `false` when refused (wrong size, a full queue). - pub fn put_frame_f16(&self, key: u128, width: u32, height: u32, rgba: &[u16]) -> bool { + /// Queue a half-float frame for writing (`width * height * 4` binary16 values) with the + /// source files it was made of. `true` when it is on disk or queued; `false` when refused + /// (wrong size, a full queue, files that can't be checked later: see [`EntryFiles::of`]). + pub fn put_frame_f16(&self, key: u128, width: u32, height: u32, rgba: &[u16], files: &ReadFiles, virtual_id: Option>) -> bool { if rgba.len() as u64 != width as u64 * height as u64 * 4 { return false; } - self.contains(Kind::Frame, key) || self.enqueue_format(Kind::Frame, key, FORMAT_F16, encode_frame_f16(width, height, rgba)) + let Some(files) = EntryFiles::of(files, virtual_id) else { return false }; + self.contains(Kind::Frame, key) || self.enqueue_format(Kind::Frame, key, FORMAT_F16_FILES, with_files(&files, encode_frame_f16(width, height, rgba))) } - /// Write a half-float frame synchronously (tests). - pub fn put_frame_f16_now(&self, key: u128, width: u32, height: u32, rgba: &[u16]) { - self.write_format(Kind::Frame, key, FORMAT_F16, &encode_frame_f16(width, height, rgba)); + /// Write a half-float frame synchronously (tests); a list that can't be stored is not. + pub fn put_frame_f16_now(&self, key: u128, width: u32, height: u32, rgba: &[u16], files: &ReadFiles) { + if let Some(files) = EntryFiles::of(files, None) { + self.write_format(Kind::Frame, key, FORMAT_F16_FILES, &with_files(&files, encode_frame_f16(width, height, rgba))); + } } - /// Queue a frame for writing (8-bit premultiplied RGBA, `width * height * 4` bytes). `true` - /// when it is on disk or queued; `false` when refused (wrong size, a full queue). - pub fn put_frame(&self, key: u128, width: u32, height: u32, rgba: &[u8]) -> bool { - if rgba.len() != width as usize * height as usize * 4 { + /// Queue a frame for writing (8-bit premultiplied RGBA, `width * height * 4` bytes) with the + /// source files it was made of. `true` when it is on disk or queued; `false` when refused + /// (wrong size, a full queue, files that can't be checked later: see [`EntryFiles::of`]). + pub fn put_frame(&self, key: u128, width: u32, height: u32, rgba: &[u8], files: &ReadFiles, virtual_id: Option>) -> bool { + if rgba.len() as u64 != width as u64 * height as u64 * 4 { return false; } - self.contains(Kind::Frame, key) || self.enqueue(Kind::Frame, key, encode_frame(width, height, rgba)) + let Some(files) = EntryFiles::of(files, virtual_id) else { return false }; + self.contains(Kind::Frame, key) || self.enqueue_format(Kind::Frame, key, FORMAT_RGBA8_FILES, with_files(&files, encode_frame(width, height, rgba))) } pub fn get_layer(&self, key: u128) -> Option { @@ -794,12 +852,22 @@ impl DiskCache { true } - /// Write a frame synchronously (tests). - pub fn put_frame_now(&self, key: u128, width: u32, height: u32, rgba: &[u8]) { - self.write_now(Kind::Frame, key, &encode_frame(width, height, rgba)); + /// Write a frame synchronously (tests); a list that can't be stored is not. + pub fn put_frame_now(&self, key: u128, width: u32, height: u32, rgba: &[u8], files: &ReadFiles) { + if let Some(files) = EntryFiles::of(files, None) { + self.write_format(Kind::Frame, key, FORMAT_RGBA8_FILES, &with_files(&files, encode_frame(width, height, rgba))); + } } } +/// A frame entry's payload: its source files, then its pixels. +fn with_files(files: &EntryFiles, pixels: Vec) -> Vec { + let mut out = Vec::with_capacity(pixels.len() + 64); + files.encode(&mut out); + out.extend_from_slice(&pixels); + out +} + #[cfg(not(target_arch = "wasm32"))] fn writer(dc: std::sync::Weak, q: Arc<(Mutex, Condvar)>) { let (m, cv) = &*q; @@ -860,15 +928,29 @@ fn seal_format(kind: Kind, format: u8, payload: &[u8]) -> Vec { data } -/// A sealed frame entry ([`seal`] of the encoded frame): what the browser's frame workers -/// write to the Origin Private File System. -pub fn frame_entry(width: u32, height: u32, rgba: &[u8]) -> Vec { - seal(Kind::Frame, &encode_frame(width, height, rgba)) +/// A sealed 8-bit frame entry with the source files it was made of: what the browser's frame +/// workers write to the Origin Private File System. `None` when the frame must not be stored +/// (its files can't be checked later, see [`EntryFiles::of`]; or a wrong size). +pub fn frame_entry(width: u32, height: u32, rgba: &[u8], files: &ReadFiles, virtual_id: Option>) -> Option> { + if rgba.len() as u64 != width as u64 * height as u64 * 4 { + return None; + } + let files = EntryFiles::of(files, virtual_id)?; + Some(seal_format(Kind::Frame, FORMAT_RGBA8_FILES, &with_files(&files, encode_frame(width, height, rgba)))) } -/// A frame from a sealed entry's bytes (`None` when damaged). -pub fn read_frame_entry(data: &[u8]) -> Option { - decode_frame(verify(data, Kind::Frame)?) +/// The frame of a sealed entry's bytes, if its source files are unchanged. `None` when damaged, +/// of another format, or made of files that changed since: a miss, to be rendered again. +pub fn read_frame_entry(data: &[u8], virtual_id: Option>) -> Option { + let payload = verify(data, Kind::Frame)?; + if data.get(5) != Some(&FORMAT_RGBA8_FILES) { + return None; + } + let (files, pixels) = EntryFiles::decode(payload)?; + if !files.unchanged(virtual_id) { + return None; + } + decode_frame(pixels) } /// A sealed layer-buffer entry: what the browser's frame workers write to the Origin Private @@ -1055,9 +1137,9 @@ fn hash_debug(h: &mut Hash128, v: &impl std::fmt::Debug) { /// Size and content hash of a path that has no native metadata (the browser file table). pub type VirtualFileId<'a> = &'a (dyn Fn(&str) -> Option<(u64, u64)> + Send + Sync); -/// A file's size and modification time (so edited footage gets new keys): the identity a render -/// records for the files it reads ([`crate::reads::FileStamp`]). When the path has no native -/// metadata, `virtual_id` supplies a durable size and content hash instead. +/// A file's size and modification time (so edited footage gets a new layer salt): the identity a +/// render records for the files it reads ([`crate::reads::FileStamp`]). When the path has no +/// native metadata, `virtual_id` supplies a durable size and content hash instead. fn file_stamp(h: &mut Hash128, path: &str, virtual_id: Option>) { if path.is_empty() { return; @@ -1126,26 +1208,18 @@ pub fn footage_salt_with(project: &effectcraft_project::Project, virtual_id: Opt (v as u64) ^ ((v >> 64) as u64) } -/// Content key of a composition's pixels: project render settings, the comp and everything it -/// uses (nested comps, footage, solids, their proxies and Use Proxy switches, footage and proxy -/// files' size and time). With expressions in play (which can read any comp) the whole project -/// counts. Switches that don't change pixels (Audio, Lock, Shy, Hide Shy Layers) don't count, and -/// neither do markers unless an expression mentions them. +/// Content key of a composition's pixels, from the project in memory alone (no file is looked +/// at: the frame entries check their own source files when read, see [`EntryFiles`]): project +/// render settings, the comp and everything it uses (nested comps, footage items with their +/// settings and paths, solids, their proxies and Use Proxy switches). With expressions in play +/// (which can read any comp) the whole project counts. Switches that don't change pixels (Audio, +/// Lock, Shy, Hide Shy Layers) don't count, and neither do markers unless an expression mentions +/// them. pub fn comp_content_key(project: &effectcraft_project::Project, comp: effectcraft_project::ItemId) -> u128 { - comp_content_key_with(project, comp, None) + comp_content_key_for_renderer(project, comp, RENDER_VERSION) } -/// [`comp_content_key`] with [`VirtualFileId`] for paths `std::fs::metadata` cannot describe. -pub fn comp_content_key_with(project: &effectcraft_project::Project, comp: effectcraft_project::ItemId, virtual_id: Option>) -> u128 { - comp_content_key_for_renderer(project, comp, virtual_id, RENDER_VERSION) -} - -fn comp_content_key_for_renderer( - project: &effectcraft_project::Project, - comp: effectcraft_project::ItemId, - virtual_id: Option>, - renderer: &str, -) -> u128 { +fn comp_content_key_for_renderer(project: &effectcraft_project::Project, comp: effectcraft_project::ItemId, renderer: &str) -> u128 { use effectcraft_project::{ItemKind, LayerSource}; let mut h = Hash128::default(); h.write(renderer.as_bytes()); @@ -1192,21 +1266,21 @@ fn comp_content_key_for_renderer( } k => hash_debug(&mut h, k), } - if let ItemKind::Footage(f) = &it.kind { - footage_stamp(&mut h, f, virtual_id); - } hash_debug(&mut h, &it.proxy); - if let Some(px) = &it.proxy { - footage_stamp(&mut h, &px.footage, virtual_id); - } } h.write_u64(comp.0); h.finish() } +/// Frame entries with their source files (#3184), part of every frame key: entries of the +/// earlier format (keyed by footage stamps instead) are never looked up again; least recently +/// used, they are evicted. +const FRAME_ENTRY_VERSION: &[u8] = b"frame-entry-files-1"; + /// Disk key of one viewer frame. pub fn frame_key(content: u128, frame: i64, scale_milli: u32, view: u64) -> u128 { let mut h = Hash128::default(); + h.write(FRAME_ENTRY_VERSION); h.write(&content.to_le_bytes()); h.write_u64(frame as u64); h.write_u64(scale_milli as u64); @@ -1230,18 +1304,18 @@ mod tests { fn link_frame_serves_a_frame_under_a_new_key() { let dc = DiskCache::open(tmpdir("link"), 1 << 30).unwrap(); let rgba: Vec = (0..16).collect(); - dc.put_frame_now(1, 2, 2, &rgba); + dc.put_frame_now(1, 2, 2, &rgba, &ReadFiles::default()); assert!(dc.link_frame(1, 2)); - assert_eq!(dc.get_frame(2).map(|f| f.rgba), Some(rgba.clone())); + assert_eq!(dc.get_frame(2, None).map(|f| f.0).map(|f| f.rgba), Some(rgba.clone())); assert!(!dc.link_frame(1, 2), "already there"); assert!(!dc.link_frame(3, 4), "nothing to link"); assert!(!dc.contains(Kind::Frame, 4)); - dc.put_frame_now(5, 2, 2, &[7; 16]); + dc.put_frame_now(5, 2, 2, &[7; 16], &ReadFiles::default()); assert!(!dc.link_frame(5, 2), "an existing entry stays"); - assert_eq!(dc.get_frame(2).map(|f| f.rgba), Some(rgba.clone())); + assert_eq!(dc.get_frame(2, None).map(|f| f.0).map(|f| f.rgba), Some(rgba.clone())); let _ = std::fs::remove_file(dc.path(Kind::Frame, 1)); dc.forget(Kind::Frame, 1); - assert_eq!(dc.get_frame(2).map(|f| f.rgba), Some(rgba), "the link outlives the original"); + assert_eq!(dc.get_frame(2, None).map(|f| f.0).map(|f| f.rgba), Some(rgba), "the link outlives the original"); } fn buf(seed: u32, w: u32, h: u32) -> Buf { @@ -1276,11 +1350,21 @@ mod tests { #[test] fn frame_entries_round_trip_and_names_parse() { let rgba: Vec = (0..4 * 6 * 3).map(|i| (i * 7 % 256) as u8).collect(); - let e = frame_entry(6, 3, &rgba); - assert_eq!(read_frame_entry(&e), Some(Frame8 { width: 6, height: 3, rgba: rgba.clone() })); + let files: ReadFiles = [crate::reads::ReadFile::new("/v.png", crate::reads::FileStamp::Virtual)].into_iter().collect(); + let (one, two) = (|_: &str| Some((4, 1)), |_: &str| Some((4, 2))); + assert!(frame_entry(6, 3, &rgba, &files, None).is_none(), "a file from memory needs its identity"); + assert!(frame_entry(6, 3, &rgba[1..], &files, Some(&one)).is_none(), "a wrong size"); + let e = frame_entry(6, 3, &rgba, &files, Some(&one)).unwrap(); + assert_eq!(read_frame_entry(&e, Some(&one)), Some(Frame8 { width: 6, height: 3, rgba: rgba.clone() })); + assert!(read_frame_entry(&e, Some(&two)).is_none(), "the file changed"); + let mut incomplete = files.clone(); + incomplete.mark_incomplete(); + assert!(frame_entry(6, 3, &rgba, &incomplete, Some(&one)).is_none(), "an incomplete list is not stored"); let mut bad = e.clone(); bad[20] ^= 1; - assert!(read_frame_entry(&bad).is_none()); + assert!(read_frame_entry(&bad, Some(&one)).is_none()); + // An entry of the format before #3184 (pixels without files) is never read. + assert!(read_frame_entry(&seal(Kind::Frame, &encode_frame(6, 3, &rgba)), Some(&one)).is_none()); let key = 0x0123_4567_89ab_cdef_0011_2233_4455_6677u128; assert_eq!(parse_entry_name(&entry_name(key)), Some(key)); assert_eq!(parse_entry_name("abc.ecc"), None); @@ -1297,27 +1381,27 @@ mod tests { let (w, h) = (7u32, 5u32); // 4.0, 16.0, -0.25, 65504 and a spread of bit patterns. let rgba: Vec = (0..w * h * 4).map(|i| [0x4400, 0x4c00, 0xb400, 0x7bff][i as usize % 4] ^ ((i * 37) as u16 & 0x03ff)).collect(); - dc.put_frame_f16_now(1, w, h, &rgba); - assert_eq!(dc.get_frame_f16(1), Some(FrameF16 { width: w, height: h, rgba: rgba.clone() })); - assert!(dc.get_frame(1).is_none(), "not an 8-bit frame"); - dc.put_frame_now(2, 2, 2, &[9; 16]); - assert!(dc.get_frame_f16(2).is_none() && dc.contains(Kind::Frame, 2), "an 8-bit entry stays valid"); - assert_eq!(dc.get_frame(2).unwrap().rgba, vec![9; 16]); + dc.put_frame_f16_now(1, w, h, &rgba, &ReadFiles::default()); + assert_eq!(dc.get_frame_f16(1, None).map(|f| f.0), Some(FrameF16 { width: w, height: h, rgba: rgba.clone() })); + assert!(dc.get_frame(1, None).map(|f| f.0).is_none(), "not an 8-bit frame"); + dc.put_frame_now(2, 2, 2, &[9; 16], &ReadFiles::default()); + assert!(dc.get_frame_f16(2, None).map(|f| f.0).is_none() && dc.contains(Kind::Frame, 2), "an 8-bit entry stays valid"); + assert_eq!(dc.get_frame(2, None).map(|f| f.0).unwrap().rgba, vec![9; 16]); assert!(dc.stats().bytes > 0); // Reopened, still there (format byte persisted). drop(dc); let dc = DiskCache::open(&dir, 1 << 30).unwrap(); - assert_eq!(dc.get_frame_f16(1).unwrap().rgba, rgba); + assert_eq!(dc.get_frame_f16(1, None).map(|f| f.0).unwrap().rgba, rgba); // A sealed entry with a payload of the wrong size: deleted on read. let p = dc.path(Kind::Frame, 3); std::fs::create_dir_all(p.parent().unwrap()).unwrap(); - std::fs::write(&p, seal_format(Kind::Frame, FORMAT_F16, &encode_frame_f16(w, h + 1, &rgba[..])[..])).unwrap(); + std::fs::write(&p, seal_format(Kind::Frame, FORMAT_F16_FILES, &with_files(&EntryFiles::default(), encode_frame_f16(w, h + 1, &rgba[..])))).unwrap(); dc.rescan(); assert!(dc.contains(Kind::Frame, 3)); - assert!(dc.get_frame_f16(3).is_none()); + assert!(dc.get_frame_f16(3, None).map(|f| f.0).is_none()); assert!(!dc.contains(Kind::Frame, 3) && !p.exists()); // Wrong lengths are not written. - dc.put_frame_f16(4, w, h, &rgba[1..]); + dc.put_frame_f16(4, w, h, &rgba[1..], &ReadFiles::default(), None); dc.flush(); assert!(!dc.contains(Kind::Frame, 4)); let _ = std::fs::remove_dir_all(&dir); @@ -1367,14 +1451,14 @@ mod tests { assert_eq!(back.img, b.img); assert_eq!((back.offset, back.scale), (b.offset, b.scale)); let rgba: Vec = (0..20 * 10 * 4).map(|i| (i % 251) as u8).collect(); - assert!(dc.put_frame(7, 20, 10, &rgba)); - assert!(!dc.put_frame(8, 2, 2, &[0; 3]), "a wrong-size frame is refused"); + assert!(dc.put_frame(7, 20, 10, &rgba, &ReadFiles::default(), None)); + assert!(!dc.put_frame(8, 2, 2, &[0; 3], &ReadFiles::default(), None), "a wrong-size frame is refused"); dc.flush(); - assert_eq!(dc.get_frame(7).unwrap().rgba, rgba); + assert_eq!(dc.get_frame(7, None).map(|f| f.0).unwrap().rgba, rgba); let st = dc.stats(); assert_eq!((st.entries, st.hits, st.misses, st.writes), (2, 2, 1, 2)); // Wrong kind is a miss. - assert!(dc.get_frame(42).is_none()); + assert!(dc.get_frame(42, None).map(|f| f.0).is_none()); } /// Music doesn't change a comp's disk keys (adding it to the timeline kept no blue frame); @@ -1416,7 +1500,7 @@ mod tests { } let rgba = vec![7u8; 32 * 32 * 4]; for k in 0..300 { - dc.put_frame(k, 32, 32, &rgba); + dc.put_frame(k, 32, 32, &rgba, &ReadFiles::default(), None); } dc.flush(); assert!((0..300).all(|k| dc.contains(Kind::Frame, k)), "every frame written"); @@ -1431,17 +1515,17 @@ mod tests { let comp = Comp::new(2, 2, FrameRate::FPS_30, Tick::from_seconds_f64(1.0)); let id = project.add_item("Cached composition", effectcraft_color::Label::None, None, ItemKind::Comp(comp.into())); let key = frame_key(comp_content_key(&project, id), 0, 1000, 0); - let previous_key = frame_key(comp_content_key_for_renderer(&project, id, None, "effectcraft-render-5"), 0, 1000, 0); + let previous_key = frame_key(comp_content_key_for_renderer(&project, id, "effectcraft-render-5"), 0, 1000, 0); let dir = tmpdir("previous-renderer"); { let cache = DiskCache::open(&dir, 1 << 30).unwrap(); - cache.put_frame_now(previous_key, 2, 2, &[9; 16]); + cache.put_frame_now(previous_key, 2, 2, &[9; 16], &ReadFiles::default()); } let cache = DiskCache::open(&dir, 1 << 30).unwrap(); - assert_eq!(cache.get_frame(previous_key).unwrap().rgba, vec![9; 16]); - assert!(cache.get_frame(key).is_none()); - cache.put_frame_now(key, 2, 2, &[17; 16]); - assert_eq!(cache.get_frame(key).unwrap().rgba, vec![17; 16]); + assert_eq!(cache.get_frame(previous_key, None).map(|f| f.0).unwrap().rgba, vec![9; 16]); + assert!(cache.get_frame(key, None).map(|f| f.0).is_none()); + cache.put_frame_now(key, 2, 2, &[17; 16], &ReadFiles::default()); + assert_eq!(cache.get_frame(key, None).map(|f| f.0).unwrap().rgba, vec![17; 16]); } #[test] @@ -1450,15 +1534,15 @@ mod tests { { let dc = DiskCache::open(&dir, 1 << 30).unwrap(); dc.put_layer_now(1, &buf(1, 8, 8)); - dc.put_frame_now(2, 2, 2, &[9; 16]); + dc.put_frame_now(2, 2, 2, &[9; 16], &ReadFiles::default()); } let dc = DiskCache::open(&dir, 1 << 30).unwrap(); assert_eq!(dc.stats().entries, 2); assert!(dc.contains(Kind::Layer, 1) && dc.contains(Kind::Frame, 2)); - assert_eq!(dc.get_frame(2).unwrap().rgba, vec![9; 16]); + assert_eq!(dc.get_frame(2, None).map(|f| f.0).unwrap().rgba, vec![9; 16]); dc.clear(); assert_eq!(dc.stats().entries, 0); - assert!(dc.get_frame(2).is_none()); + assert!(dc.get_frame(2, None).map(|f| f.0).is_none()); let again = DiskCache::open(&dir, 1 << 30).unwrap(); assert_eq!(again.stats().entries, 0); } @@ -1569,13 +1653,13 @@ mod tests { fn damaged_files_are_misses() { let dir = tmpdir("damaged"); let dc = DiskCache::open(&dir, 1 << 30).unwrap(); - dc.put_frame_now(5, 4, 4, &[1; 64]); + dc.put_frame_now(5, 4, 4, &[1; 64], &ReadFiles::default()); let p = dc.path(Kind::Frame, 5); let mut d = std::fs::read(&p).unwrap(); let n = d.len(); d[n / 2] ^= 0xff; std::fs::write(&p, d).unwrap(); - assert!(dc.get_frame(5).is_none()); + assert!(dc.get_frame(5, None).map(|f| f.0).is_none()); assert!(!dc.contains(Kind::Frame, 5)); assert!(!p.exists()); } @@ -1633,9 +1717,11 @@ mod tests { assert_ne!(footage_salt_with(&p, Some(&one)), footage_salt_with(&p, Some(&two)), "read audio counts"); } - /// A path with no native metadata takes its key from the caller's size and content hash (#1253). + /// A path with no native metadata takes the layer salt from the caller's size and content hash + /// (#1253). The comp key is from memory: replaced bytes are caught by the frame entries' + /// check instead (#3184). #[test] - fn virtual_file_bytes_change_content_keys() { + fn virtual_file_bytes_change_the_salt_not_the_comp_key() { use effectcraft_project::build; use effectcraft_project::{Comp, Footage, ItemKind, LayerSource, Project}; use effectcraft_time::{FrameRate, Tick}; @@ -1651,10 +1737,81 @@ mod tests { let (one, two) = (id(1), id(2)); let a = footage_salt_with(&p, Some(&one)); let b = footage_salt_with(&p, Some(&two)); - let ka = comp_content_key_with(&p, cid, Some(&one)); - let kb = comp_content_key_with(&p, cid, Some(&two)); assert_ne!(a, b, "replaced virtual media must not reuse the salt"); - assert_ne!(ka, kb, "replaced virtual media must not reuse the frame key"); - assert_eq!(comp_content_key(&p, cid), comp_content_key_with(&p, cid, None)); + // The frame entry of replaced virtual media is a miss. + let dc = DiskCache::open(tmpdir("virtual"), 1 << 30).unwrap(); + let k = frame_key(comp_content_key(&p, cid), 0, 1000, 0); + let files: ReadFiles = [crate::reads::ReadFile::new("/virtual.mov", crate::reads::FileStamp::Virtual)].into_iter().collect(); + assert!(dc.put_frame(k, 1, 1, &[1, 2, 3, 4], &files, Some(&one))); + dc.flush(); + assert!(dc.get_frame(k, Some(&one)).is_some_and(|(_, f)| f == files)); + assert!(dc.get_frame(k, Some(&two)).is_none() && !dc.contains(Kind::Frame, k), "replaced: a miss, deleted"); + } + + /// A frame entry is used only while the files it lists are what it was made of: a new size, + /// a new time, a missing file that is back, a file replaced by a folder are misses, and the + /// entry is deleted so the frame is rendered and stored again. Only the listed files are + /// looked at. Entries of the format before #3184 are misses and deleted. + #[test] + fn frame_entries_check_their_files() { + use crate::reads::{FileStamp, ReadFile}; + let dir = tmpdir("check"); + let src = dir.join("src"); + std::fs::create_dir_all(&src).unwrap(); + let file = |name: &str, bytes: &[u8]| { + let p = src.join(name); + std::fs::write(&p, bytes).unwrap(); + p.to_string_lossy().to_string() + }; + let (a, b) = (file("a.png", b"aa"), file("b.png", b"bb")); + let gone = src.join("gone.png").to_string_lossy().to_string(); + let read = |paths: &[&str]| -> ReadFiles { paths.iter().map(|p| ReadFile::new(*p, FileStamp::native(p).unwrap_or(FileStamp::Missing))).collect() }; + let dc = DiskCache::open(&dir, 1 << 30).unwrap(); + dc.put_frame_now(1, 1, 1, &[1; 4], &read(&[&a])); + dc.put_frame_now(2, 1, 1, &[2; 4], &read(&[&b, &gone])); + dc.put_frame_now(3, 1, 1, &[3; 4], &read(&[&b])); + assert_eq!(dc.get_frame(1, None).map(|f| f.1), Some(read(&[&a]))); + assert_eq!(dc.file_checks(), 1, "only the file of that frame"); + // a.png gets a new size: frame 1 is a miss and deleted, the others stay. + std::fs::write(&a, b"aaa").unwrap(); + assert!(dc.get_frame(1, None).is_none() && !dc.contains(Kind::Frame, 1)); + assert!(dc.get_frame(2, None).is_some() && dc.get_frame(3, None).is_some()); + // b.png gets a new time only. + let t = std::fs::metadata(&b).unwrap().modified().unwrap() + std::time::Duration::from_secs(7); + std::fs::File::options().append(true).open(&b).unwrap().set_modified(t).unwrap(); + assert!(dc.get_frame(3, None).is_none() && !dc.contains(Kind::Frame, 3)); + assert!(dc.get_frame(2, None).is_none(), "b.png is listed there too"); + // A missing file that is back. + dc.put_frame_now(4, 1, 1, &[4; 4], &read(&[&gone])); + assert!(dc.get_frame(4, None).is_some(), "missing, still missing"); + file("gone.png", b"g"); + assert!(dc.get_frame(4, None).is_none() && !dc.contains(Kind::Frame, 4), "back"); + // A file replaced by a folder (unreadable). + let c = file("c.png", b"cc"); + dc.put_frame_now(5, 1, 1, &[5; 4], &read(&[&c])); + std::fs::remove_file(&c).unwrap(); + std::fs::create_dir(&c).unwrap(); + assert!(dc.get_frame(5, None).is_none() && !dc.contains(Kind::Frame, 5)); + // Written again after the miss: a hit with the new identity. + let fresh = file("d.png", b"dd"); + dc.put_frame_now(1, 1, 1, &[9; 4], &read(&[&fresh])); + assert_eq!(dc.get_frame(1, None).map(|f| f.0.rgba), Some(vec![9; 4])); + // The format before #3184 (no files): a miss, deleted. + dc.write_format(Kind::Frame, 6, FORMAT_RGBA8, &encode_frame(1, 1, &[6; 4])); + assert!(dc.contains(Kind::Frame, 6)); + assert!(dc.get_frame(6, None).is_none() && !dc.contains(Kind::Frame, 6)); + // A valid checksum over a damaged files section: a miss, deleted. + let mut payload = vec![]; + payload.extend_from_slice(&3u32.to_le_bytes()); + payload.extend_from_slice(&encode_frame(1, 1, &[7; 4])); + dc.write_format(Kind::Frame, 7, FORMAT_RGBA8_FILES, &payload); + assert!(dc.get_frame(7, None).is_none() && !dc.contains(Kind::Frame, 7)); + // Frames whose files can't all be named are not stored. + let mut incomplete = read(&[&fresh]); + incomplete.mark_incomplete(); + assert!(!dc.put_frame(8, 1, 1, &[8; 4], &incomplete, None)); + dc.flush(); + assert!(!dc.contains(Kind::Frame, 8)); + let _ = std::fs::remove_dir_all(&dir); } } diff --git a/crates/render/src/disk_cache/entry_files.rs b/crates/render/src/disk_cache/entry_files.rs new file mode 100644 index 000000000..fae8cab8f --- /dev/null +++ b/crates/render/src/disk_cache/entry_files.rs @@ -0,0 +1,257 @@ +//! The source files a frame entry on disk was made of (#3184): stored with the pixels, checked +//! when the entry is used. Only the files that frame read are looked at, never every file of the +//! project. +//! +//! Layout (little endian), before the frame's pixel payload: +//! `u32 count`, then per file `u32 path length`, the path (UTF-8), a tag byte and its fields: +//! `0` a file on disk (`u64 size`, `u8 has time`, `u64 time`), `1` bytes from the browser's file +//! table (`u64 size`, `u64 content hash`), `2` a file that could not be read. + +use std::sync::Arc; + +use super::VirtualFileId; +use crate::reads::{FileStamp, MAX_READ_FILES, ReadFile, ReadFiles}; + +/// Longest path an entry stores (bytes): a longer one is not a path this app opened. +const MAX_PATH_BYTES: usize = 1 << 16; + +/// A file's identity as a frame entry keeps it. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum EntryStamp { + /// Size and modification time (nanoseconds since the Unix epoch) on disk. + Native { len: u64, modified: Option }, + /// Size and content hash from the [`VirtualFileId`] hook (the browser's file table). + Virtual { len: u64, hash: u64 }, + /// It could not be read when the frame was made: it still must not be readable. + Missing, +} + +/// One file of a frame entry. +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct EntryFile { + pub path: Arc, + pub stamp: EntryStamp, +} + +/// Every file a frame entry was made of. +#[derive(Clone, Debug, Default, PartialEq, Eq)] +pub struct EntryFiles(Vec); + +impl EntryFiles { + /// The list to store for a frame that read `files`: `None` when the frame can't be checked + /// against its files later (the list is incomplete, or a file from memory has no identity), + /// so the frame must not be stored. Native stamps are the ones the files were read with, + /// never a fresh look at the disk (a file changed during the render keeps the old one). + pub fn of(files: &ReadFiles, virtual_id: Option>) -> Option { + if !files.is_complete() { + return None; + } + let mut out = Vec::with_capacity(files.len()); + for f in files.files() { + let stamp = match f.stamp { + FileStamp::Native { len, modified } => EntryStamp::Native { len, modified }, + FileStamp::Virtual => { + let (len, hash) = virtual_id.and_then(|id| id(&f.path))?; + EntryStamp::Virtual { len, hash } + } + FileStamp::Missing => EntryStamp::Missing, + }; + out.push(EntryFile { path: f.path.clone(), stamp }); + } + Some(EntryFiles(out)) + } + + pub fn files(&self) -> &[EntryFile] { + &self.0 + } + + pub fn len(&self) -> usize { + self.0.len() + } + + pub fn is_empty(&self) -> bool { + self.0.is_empty() + } + + /// The files as a render reports them (to keep with the frame in memory). + pub fn to_read_files(&self) -> ReadFiles { + self.0 + .iter() + .map(|f| { + let stamp = match f.stamp { + EntryStamp::Native { len, modified } => FileStamp::Native { len, modified }, + EntryStamp::Virtual { .. } => FileStamp::Virtual, + EntryStamp::Missing => FileStamp::Missing, + }; + ReadFile::new(f.path.clone(), stamp) + }) + .collect() + } + + /// Whether every file still is what the frame was made of: one `metadata` call per file + /// (and the hook for files from memory). + pub fn unchanged(&self, virtual_id: Option>) -> bool { + self.0.iter().all(|f| file_unchanged(f, virtual_id)) + } + + pub(super) fn encode(&self, out: &mut Vec) { + out.extend_from_slice(&(self.0.len() as u32).to_le_bytes()); + for f in &self.0 { + out.extend_from_slice(&(f.path.len() as u32).to_le_bytes()); + out.extend_from_slice(f.path.as_bytes()); + match f.stamp { + EntryStamp::Native { len, modified } => { + out.push(0); + out.extend_from_slice(&len.to_le_bytes()); + out.push(u8::from(modified.is_some())); + out.extend_from_slice(&modified.unwrap_or(0).to_le_bytes()); + } + EntryStamp::Virtual { len, hash } => { + out.push(1); + out.extend_from_slice(&len.to_le_bytes()); + out.extend_from_slice(&hash.to_le_bytes()); + } + EntryStamp::Missing => out.push(2), + } + } + } + + /// The list at the start of `p` and what follows it; `None` when it is damaged. + pub(super) fn decode(p: &[u8]) -> Option<(EntryFiles, &[u8])> { + let mut r = Reader(p); + let n = r.u32()? as usize; + if n > MAX_READ_FILES { + return None; + } + let mut out = Vec::with_capacity(n); + for _ in 0..n { + let len = r.u32()? as usize; + if len > MAX_PATH_BYTES { + return None; + } + let path: Arc = std::str::from_utf8(r.take(len)?).ok()?.into(); + let stamp = match r.u8()? { + 0 => { + let len = r.u64()?; + let has = r.u8()?; + let t = r.u64()?; + match has { + 0 => EntryStamp::Native { len, modified: None }, + 1 => EntryStamp::Native { len, modified: Some(t) }, + _ => return None, + } + } + 1 => EntryStamp::Virtual { len: r.u64()?, hash: r.u64()? }, + 2 => EntryStamp::Missing, + _ => return None, + }; + out.push(EntryFile { path, stamp }); + } + Some((EntryFiles(out), r.0)) + } +} + +fn file_unchanged(f: &EntryFile, virtual_id: Option>) -> bool { + let from_memory = || virtual_id.and_then(|id| id(&f.path)); + match f.stamp { + EntryStamp::Native { len, modified } => FileStamp::native(&f.path) == Some(FileStamp::Native { len, modified }), + EntryStamp::Virtual { len, hash } => from_memory() == Some((len, hash)), + // (a folder at the path is still not a file to read) + EntryStamp::Missing => !std::fs::metadata(&*f.path).is_ok_and(|m| m.is_file()) && from_memory().is_none(), + } +} + +/// Reads little-endian fields off the front of a byte slice. +struct Reader<'a>(&'a [u8]); + +impl<'a> Reader<'a> { + fn take(&mut self, n: usize) -> Option<&'a [u8]> { + let head = self.0.get(..n)?; + self.0 = self.0.get(n..)?; + Some(head) + } + fn u8(&mut self) -> Option { + self.take(1)?.first().copied() + } + fn u32(&mut self) -> Option { + Some(u32::from_le_bytes(self.take(4)?.try_into().ok()?)) + } + fn u64(&mut self) -> Option { + Some(u64::from_le_bytes(self.take(8)?.try_into().ok()?)) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + fn files() -> ReadFiles { + [ + ReadFile::new("/a.png", FileStamp::Native { len: 3, modified: Some(9) }), + ReadFile::new("/b.png", FileStamp::Native { len: 4, modified: None }), + ReadFile::new("/c.png", FileStamp::Missing), + ReadFile::new("/v.mov", FileStamp::Virtual), + ] + .into_iter() + .collect() + } + + #[test] + fn lists_round_trip_and_damage_is_caught() { + let id = |p: &str| (p == "/v.mov").then_some((8, 77)); + let list = EntryFiles::of(&files(), Some(&id)).unwrap(); + assert_eq!(list.files()[3].stamp, EntryStamp::Virtual { len: 8, hash: 77 }); + let mut bytes = vec![]; + list.encode(&mut bytes); + bytes.extend_from_slice(b"rest"); + let (back, rest) = EntryFiles::decode(&bytes).unwrap(); + assert_eq!((back, rest), (list.clone(), &b"rest"[..])); + assert_eq!(list.to_read_files(), files()); + // Every truncation is caught (never a panic, never a shorter list). + let mut plain = vec![]; + list.encode(&mut plain); + for n in 0..plain.len() { + assert!(EntryFiles::decode(&plain[..n]).is_none(), "cut at {n}"); + } + // Bad tags and counts. + let mut bad = plain.clone(); + bad[0..4].copy_from_slice(&u32::MAX.to_le_bytes()); + assert!(EntryFiles::decode(&bad).is_none()); + } + + #[test] + fn frames_that_cant_be_checked_are_not_stored() { + let mut incomplete = files(); + incomplete.mark_incomplete(); + let id = |_: &str| Some((1, 1)); + assert!(EntryFiles::of(&incomplete, Some(&id)).is_none(), "an incomplete list"); + assert!(EntryFiles::of(&files(), None).is_none(), "a file from memory without the hook"); + assert!(EntryFiles::of(&ReadFiles::default(), None).is_some_and(|l| l.is_empty()), "a frame that reads no file"); + } + + #[test] + fn the_check_looks_at_the_listed_files() { + let dir = std::env::temp_dir().join(format!("effectcraft-entry-files-{}", std::process::id())); + let _ = std::fs::remove_dir_all(&dir); + std::fs::create_dir_all(&dir).unwrap(); + let p = dir.join("f.bin"); + std::fs::write(&p, b"abc").unwrap(); + let path = p.to_string_lossy().to_string(); + let gone = dir.join("gone.bin").to_string_lossy().to_string(); + let stamp = FileStamp::native(&path).unwrap(); + let read: ReadFiles = [ReadFile::new(path.as_str(), stamp), ReadFile::new(gone.as_str(), FileStamp::Missing)].into_iter().collect(); + let list = EntryFiles::of(&read, None).unwrap(); + assert!(list.unchanged(None)); + std::fs::write(&p, b"abcd").unwrap(); + assert!(!list.unchanged(None), "a new size"); + std::fs::write(&gone, b"x").unwrap(); + let list = EntryFiles::of(&[ReadFile::new(gone.as_str(), FileStamp::Missing)].into_iter().collect(), None).unwrap(); + assert!(!list.unchanged(None), "a missing file that is back"); + let v: ReadFiles = [ReadFile::new("/v", FileStamp::Virtual)].into_iter().collect(); + let one = |_: &str| Some((1, 1)); + let two = |_: &str| Some((1, 2)); + let list = EntryFiles::of(&v, Some(&one)).unwrap(); + assert!(list.unchanged(Some(&one)) && !list.unchanged(Some(&two)) && !list.unchanged(None)); + let _ = std::fs::remove_dir_all(&dir); + } +} diff --git a/crates/render/src/reads.rs b/crates/render/src/reads.rs index d5648cca6..162c04862 100644 --- a/crates/render/src/reads.rs +++ b/crates/render/src/reads.rs @@ -13,7 +13,7 @@ use std::sync::{Arc, Mutex, PoisonError}; /// The identity of a file as a render read it (see [`file_stamp`](crate::disk_cache) for the -/// same identity in content keys). +/// same identity in the layer-cache salt; frame entries store it, see `disk_cache::EntryFiles`). #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] pub enum FileStamp { /// A file on disk: its size in bytes and its modification time (nanoseconds since the Unix diff --git a/crates/ui-egui/src/frames.rs b/crates/ui-egui/src/frames.rs index d76624ab3..faacd9b23 100644 --- a/crates/ui-egui/src/frames.rs +++ b/crates/ui-egui/src/frames.rs @@ -15,9 +15,12 @@ //! egui frames, within a time budget. //! //! With the disk cache on (Settings ▸ Media & Disk Cache), every CPU-rendered frame is also -//! written to disk under a content key (the comp's content hash, frame, scale, view and render -//! options), and a job first looks there: frames survive restarts and project reopenings. The -//! timeline shows disk-only frames as a blue cache bar. +//! written to disk under a content key (the comp's content hash from the project in memory, +//! frame, scale, view and render options) with the source files it read, and a job first looks +//! there: frames survive restarts and project reopenings. An entry is used only while the files +//! it lists are unchanged, checked by the frame worker when it reads the entry (a frame whose +//! files can't all be named is shown but not stored). The timeline shows disk-only frames as a +//! blue cache bar (present entries; their files are checked only when a frame is used). //! //! With Mercury GPU Acceleration (a [`Gpu`] on egui-wgpu's device and the project's renderer set //! to the GPU) frames stay on the GPU: the compositor writes an RGBA8 texture that the viewer @@ -29,7 +32,7 @@ //! cache keeps them as half-float entries. use std::collections::{BTreeSet, HashMap, HashSet, VecDeque}; -use std::sync::atomic::{AtomicBool, AtomicU64, Ordering}; +use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::{Arc, Mutex}; use effectcraft_engine::project::{Comp, Heard, ItemId, ItemKind, LayerSource, Node, Project, PropGroup}; @@ -157,8 +160,18 @@ impl Playhead { } } +/// A frame in the RAM preview and the source files it was made of (`None`: unknown, a frame +/// rendered elsewhere or kept on the GPU), so it can be written to the disk cache later +/// ([`Frames::persist_missing`]). +struct Cached { + img: FrameImage, + /// (the browser's frames are stored by its frame workers, not from here) + #[cfg_attr(target_arch = "wasm32", allow(dead_code))] + files: Option>, +} + struct Cache { - map: HashMap, + map: HashMap, order: VecDeque, bytes: usize, /// Bytes of GPU frames (also counted in `bytes`). @@ -175,10 +188,16 @@ struct Cache { } impl Cache { + /// A frame without its source files (tests). + #[cfg(test)] fn insert(&mut self, k: FrameKey, img: FrameImage) { + self.insert_with(k, img, None); + } + /// [`Cache::insert`] with the source files the frame was made of. + fn insert_with(&mut self, k: FrameKey, img: FrameImage, files: Option>) { let (sz, gpu) = (img.bytes(), img.is_gpu()); - if let Some(old) = self.map.insert(k, img) { - self.forget(&old); + if let Some(old) = self.map.insert(k, Cached { img, files }) { + self.forget(&old.img); } else { self.order.push_back(k); } @@ -216,7 +235,7 @@ impl Cache { /// than the one on screen first (a zoom or resolution change). fn evict_gpu(&mut self) { while self.gpu_bytes > self.gpu_budget { - let is_gpu = |k: &FrameKey| self.map.get(k).is_some_and(FrameImage::is_gpu); + let is_gpu = |k: &FrameKey| self.map.get(k).is_some_and(|c| c.img.is_gpu()); let other_scale = self.order.iter().position(|k| Some(k.scale) != self.scale && is_gpu(k)); let Some(i) = other_scale.or_else(|| self.order.iter().position(is_gpu)) else { break }; if let Some(old) = self.order.remove(i) { @@ -254,7 +273,7 @@ impl Cache { } fn remove(&mut self, k: &FrameKey) { if let Some(i) = self.map.remove(k) { - self.forget(&i); + self.forget(&i.img); } } /// Shown again: last in line for eviction. @@ -317,10 +336,10 @@ pub struct RenderSource { /// ([`Frames::identity`]). type Identity = (u64, Option>); -/// Content keys of (project revision, comp, virtual-file generation). The generation is one -/// counter bumped when a browser file is replaced, so a lookup stays a map read. Hashing the -/// new bytes happens only when that generation misses. -type ContentKeys = Arc>>; +/// Disk-cache content keys ([`disk_cache::comp_content_key`]) of (project revision, comp). They +/// come from the project in memory alone: the files a frame read are checked by its entry +/// when it is read (#3184). +type ContentKeys = Arc>>; #[cfg(not(target_arch = "wasm32"))] #[derive(Default)] @@ -329,16 +348,16 @@ struct ContentKeyJobs { pending: VecDeque<(Arc, u64, u64)>, } -fn content_key(keys: &ContentKeys, project: &Project, revision: u64, comp: u64, epoch: u64, virtual_id: Option>) -> u128 { - if let Some(k) = keys.lock().ok().and_then(|m| m.get(&(revision, comp, epoch)).copied()) { +fn content_key(keys: &ContentKeys, project: &Project, revision: u64, comp: u64) -> u128 { + if let Some(k) = keys.lock().ok().and_then(|m| m.get(&(revision, comp)).copied()) { return k; } - let k = disk_cache::comp_content_key_with(project, ItemId(comp), virtual_id); + let k = disk_cache::comp_content_key(project, ItemId(comp)); if let Ok(mut m) = keys.lock() { if m.len() > 256 { m.clear(); } - m.insert((revision, comp, epoch), k); + m.insert((revision, comp), k); } k } @@ -424,18 +443,28 @@ pub fn opts_hash(o: &RenderOpts) -> u64 { } /// Disk key of a viewer frame (render options included: region of interest, draft…). -fn frame_disk_key( - keys: &ContentKeys, - project: &Project, - key: &FrameKey, - opts_hash: u64, - epoch: u64, - virtual_id: Option>, -) -> u128 { - let content = content_key(keys, project, key.revision, key.comp, epoch, virtual_id); +fn frame_disk_key(keys: &ContentKeys, project: &Project, key: &FrameKey, opts_hash: u64) -> u128 { + let content = content_key(keys, project, key.revision, key.comp); disk_cache::frame_key(content, key.frame, key.scale, key.view ^ opts_hash) } +/// Queue `img` for the disk cache under `dk` with the source files it was made of. `false` when +/// refused: a GPU frame (no CPU pixels), files that can't be checked when the entry is read +/// (an incomplete list, #3184: the frame is shown, not stored), a full queue. +fn put_disk_frame(dc: &DiskCache, dk: u128, img: &FrameImage, files: &ReadFiles, virtual_id: Option>) -> bool { + if !files.is_complete() { + return false; + } + match img { + FrameImage::Cpu(img) => { + let rgba: Vec = img.pixels.iter().flat_map(|c| c.to_array()).collect(); + dc.put_frame(dk, img.size[0] as u32, img.size[1] as u32, &rgba, files, virtual_id) + } + FrameImage::CpuF16(f) => dc.put_frame_f16(dk, f.width, f.height, f.bits(), files, virtual_id), + FrameImage::Gpu(_) => false, + } +} + /// A frame for a [`RemoteFrames`] renderer. pub struct RemoteJob { pub project: Arc, @@ -513,9 +542,8 @@ pub struct Frames { /// Render time of the last viewer (urgent) frame in ms, for the Info panel / perf readout. pub last_ms: Arc>, content_keys: ContentKeys, - /// Bumped when a virtual file is replaced. Lookups key on it instead of statting footage. - virtual_epoch: Arc, - /// Size and content hash for paths with no native metadata. Called only on a cache miss. + /// Size and content hash for paths with no native metadata (the browser's file table): to + /// store and check the files of disk entries. virtual_id: Option Option<(u64, u64)> + Send + Sync>>, #[cfg(not(target_arch = "wasm32"))] content_key_jobs: Arc>, @@ -603,7 +631,6 @@ impl Default for Frames { ctx: None, last_ms: Arc::new(Mutex::new(0.0)), content_keys: Arc::default(), - virtual_epoch: Arc::new(AtomicU64::new(0)), virtual_id: None, #[cfg(not(target_arch = "wasm32"))] content_key_jobs: Arc::default(), @@ -755,7 +782,7 @@ impl Frames { pub fn retire_gpu(&self) { self.gpu_retired.store(true, Ordering::Release); if let Ok(mut cache) = self.cache.lock() { - let keys: Vec<_> = cache.map.iter().filter_map(|(key, image)| image.is_gpu().then_some(*key)).collect(); + let keys: Vec<_> = cache.map.iter().filter_map(|(key, c)| c.img.is_gpu().then_some(*key)).collect(); for key in keys { cache.remove(&key); } @@ -790,7 +817,7 @@ impl Frames { /// The cached frame, which becomes the most recently used. pub fn get(&self, k: &FrameKey) -> Option { let mut c = self.cache.lock().ok()?; - let img = c.map.get(k).cloned()?; + let img = c.map.get(k).map(|c| c.img.clone())?; c.touch(k); Some(img) } @@ -826,7 +853,7 @@ impl Frames { }) .max_by_key(|k| k.revision) .copied()?; - let img = c.map.get(&newest).cloned()?; + let img = c.map.get(&newest).map(|c| c.img.clone())?; c.touch(&newest); Some((newest, img)) } @@ -969,7 +996,6 @@ impl Frames { if src.disk.is_none() && remote.is_none() { return vec![]; } - let epoch = self.virtual_epoch.load(Ordering::Relaxed); #[cfg(not(target_arch = "wasm32"))] { self.note_disk_series(base.comp, base.scale, base.view ^ opts_hash(opts)); @@ -977,7 +1003,7 @@ impl Frames { } #[cfg(not(target_arch = "wasm32"))] let content = { - let known = self.content_keys.lock().unwrap_or_else(std::sync::PoisonError::into_inner).get(&(base.revision, base.comp, epoch)).copied(); + let known = self.content_keys.lock().unwrap_or_else(std::sync::PoisonError::into_inner).get(&(base.revision, base.comp)).copied(); let Some(content) = known else { self.request_content_key(src.project.clone(), base.revision, base.comp); return vec![]; @@ -985,7 +1011,7 @@ impl Frames { content }; #[cfg(target_arch = "wasm32")] - let content = content_key(&self.content_keys, &src.project, base.revision, base.comp, epoch, self.virtual_id.as_deref()); + let content = content_key(&self.content_keys, &src.project, base.revision, base.comp); let ram: HashSet = self.cached_frames(base).into_iter().collect(); let oh = opts_hash(opts); (start..end).filter(|f| !ram.contains(f)).filter(|f| contains(disk_cache::frame_key(content, *f, base.scale, base.view ^ oh))).collect() @@ -996,20 +1022,20 @@ impl Frames { /// are converted on the frame pool, each queued once. `true` while there may be more to /// write (a content key being computed, frames being converted): call again soon, since a /// refused write is only retried by a later call. Disk keys hash `opts` the way the worker - /// writes them (`base.opts` also carries the Roto Brush model stamp). + /// writes them (`base.opts` also carries the Roto Brush model stamp). Only frames that know + /// every source file they were made of are written (an entry is checked against them). #[cfg(not(target_arch = "wasm32"))] pub fn persist_missing(&self, src: &RenderSource, base: &FrameKey, opts: &RenderOpts) -> bool { let Some(dc) = src.disk.clone() else { return false }; let oh = opts_hash(opts); self.note_disk_series(base.comp, base.scale, base.view ^ oh); self.carry_disk(src); - let epoch = self.virtual_epoch.load(Ordering::Relaxed); - let known = self.content_keys.lock().unwrap_or_else(std::sync::PoisonError::into_inner).get(&(base.revision, base.comp, epoch)).copied(); + let known = self.content_keys.lock().unwrap_or_else(std::sync::PoisonError::into_inner).get(&(base.revision, base.comp)).copied(); let Some(content) = known else { self.request_content_key(src.project.clone(), base.revision, base.comp); return true; }; - let (missing, converting): (Vec<(u128, FrameImage)>, bool) = { + let (missing, converting): (Vec<(u128, FrameImage, Arc)>, bool) = { let (Ok(c), Ok(mut queued), Ok(mut written)) = (self.cache.lock(), self.persisted.lock(), self.written.lock()) else { return false }; if queued.len() > 100_000 { queued.clear(); @@ -1022,14 +1048,14 @@ impl Frames { .map .iter() .filter(|(k, _)| k.same_series(base)) - .filter_map(|(k, img)| { - // (GPU frames have no CPU pixels to write) - if img.is_gpu() { - return None; - } + .filter_map(|(k, c)| { + // (GPU frames have no CPU pixels to write; a frame that can't name its files + // can't be checked when read) + let files = c.files.as_ref().filter(|f| f.is_complete() && !c.img.is_gpu())?; let dk = disk_cache::frame_key(content, k.frame, k.scale, k.view ^ oh); let tries = written.1.get(&dk).copied().unwrap_or(0); - (tries < 2 && !dc.contains(disk_cache::Kind::Frame, dk) && !dc.frame_pending(dk) && queued.insert(dk)).then(|| (dk, img.clone())) + (tries < 2 && !dc.contains(disk_cache::Kind::Frame, dk) && !dc.frame_pending(dk) && queued.insert(dk)) + .then(|| (dk, c.img.clone(), files.clone())) }) .collect(); (missing, !queued.is_empty()) @@ -1037,19 +1063,12 @@ impl Frames { if missing.is_empty() { return converting; } - let (persisted, written) = (self.persisted.clone(), self.written.clone()); + let (persisted, written, virtual_id) = (self.persisted.clone(), self.written.clone(), self.virtual_id.clone()); let work = move || { - for (dk, img) in missing { + for (dk, img, files) in missing { // (accepted: the disk cache tracks it until written, and it counts as a try; // refused by a full queue: retried, without counting) - let accepted = match &img { - FrameImage::Cpu(img) => { - let rgba: Vec = img.pixels.iter().flat_map(|c| c.to_array()).collect(); - dc.put_frame(dk, img.size[0] as u32, img.size[1] as u32, &rgba) - } - FrameImage::CpuF16(f) => dc.put_frame_f16(dk, f.width, f.height, f.bits()), - FrameImage::Gpu(_) => false, - }; + let accepted = put_disk_frame(&dc, dk, &img, &files, virtual_id.as_deref()); if accepted && let Ok(mut w) = written.lock() { let n = w.1.entry(dk).or_default(); *n = n.saturating_add(1); @@ -1092,7 +1111,6 @@ impl Frames { return; } let (carries, scheduled, series, ctx) = (self.disk_carries.clone(), self.carry_scheduled.clone(), self.disk_series.clone(), self.ctx.clone()); - let virtual_id = self.virtual_id.clone(); let work = move || { let mut linked = false; loop { @@ -1112,7 +1130,7 @@ impl Frames { let Some(series) = series.lock().ok().and_then(|m| m.get(&c.comp).cloned()) else { return false }; let comp = ItemId(c.comp); let n = c.to.comp(comp).map_or(0, |k| k.frame_rate.frame_at(k.duration)).clamp(0, 100_000); - let key = |p: &Project| disk_cache::comp_content_key_with(p, comp, virtual_id.as_deref()); + let key = |p: &Project| disk_cache::comp_content_key(p, comp); let (a, b) = (key(&c.from), key(&c.to)); if a == b { return false; @@ -1154,7 +1172,6 @@ impl Frames { jobs.running = true; drop(jobs); let (jobs, keys, ctx) = (self.content_key_jobs.clone(), self.content_keys.clone(), self.ctx.clone()); - let (epoch, id) = (self.virtual_epoch.clone(), self.virtual_id.clone()); let work = move || loop { let next = { let mut jobs = jobs.lock().unwrap_or_else(std::sync::PoisonError::into_inner); @@ -1165,9 +1182,7 @@ impl Frames { next }; let Some((project, revision, comp)) = next else { return }; - let epoch = epoch.load(Ordering::Relaxed); - let id = id.clone(); - if std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| content_key(&keys, &project, revision, comp, epoch, id.as_deref()))).is_err() { + if std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| content_key(&keys, &project, revision, comp))).is_err() { log::error!("could not compute a preview disk-cache key; the cache indicator will retry"); } if let Some(ctx) = &ctx { @@ -1206,9 +1221,8 @@ impl Frames { c.gpu_pressure = None; c.gpu_adjusted = None; } - // Disk keys hash the footage files' size and time, but are remembered per revision; a - // file reloaded from disk without a new revision (a re-rendered image sequence) must be - // keyed again, or the disk cache serves the frames from before. + // (the disk keys of a revision don't depend on files: a file changed on disk is caught + // when its frames' entries are read; they are forgotten with the frames all the same) if let Ok(mut k) = self.content_keys.lock() { k.clear(); } @@ -1395,20 +1409,15 @@ impl Frames { ctx: self.ctx.clone(), last: self.last_ms.clone(), content_keys: self.content_keys.clone(), - virtual_epoch: self.virtual_epoch.clone(), virtual_id: self.virtual_id.clone(), gpu_retired: self.gpu_retired.clone(), } } - /// Browser file table: `epoch` bumps on each replacement, and `id` is the size and content - /// hash used when a content key is rebuilt. Neither runs on a cache hit. - pub fn set_virtual_media(&mut self, epoch: Arc, id: Arc Option<(u64, u64)> + Send + Sync>) { - self.virtual_epoch = epoch; + /// Browser file table: `id` gives the size and content hash of a path served from memory, + /// stored with the disk entries of the frames that read it and checked when they are read. + pub fn set_virtual_id(&mut self, id: Arc Option<(u64, u64)> + Send + Sync>) { self.virtual_id = Some(id); - if let Ok(mut keys) = self.content_keys.lock() { - keys.clear(); - } } /// Render frames with `remote` from now on (`None`: on this thread again). @@ -1469,7 +1478,7 @@ impl Frames { // (A frame kept on the GPU is not written to the disk cache: its files are not // needed.) if let Some((img, _files)) = w.render_gpu(&job) { - w.finish(&job, img, t0); + w.finish(&job, img, None, t0); continue; } } @@ -1481,8 +1490,7 @@ impl Frames { let fw = self.worker(); let busy = self.remote_busy.clone(); let t0 = web_time::Instant::now(); - let epoch = w.virtual_epoch.load(Ordering::Relaxed); - let disk_key = remote.disk().then(|| frame_disk_key(&w.content_keys, &job.src.project, &key, opts_hash(&job.opts), epoch, w.virtual_id.as_deref())); + let disk_key = remote.disk().then(|| frame_disk_key(&w.content_keys, &job.src.project, &key, opts_hash(&job.opts))); let rj = RemoteJob { project: job.src.project.clone(), revision: key.revision, comp: job.comp, t: job.t, opts: job.opts, disk_key }; remote.start( rj, @@ -1493,7 +1501,7 @@ impl Frames { match r { Ok(f) => { let img = egui::ColorImage::from_rgba_premultiplied([f.width as usize, f.height as usize], &f.rgba); - fw.finish_key(key, urgent, FrameImage::Cpu(Arc::new(img)), t0); + fw.finish_key(key, urgent, FrameImage::Cpu(Arc::new(img)), None, t0); } Err(e) => { // Not rendered (a stale revision, a lost worker): the viewer asks again. @@ -1539,7 +1547,6 @@ struct Worker { ctx: Option, last: Arc>, content_keys: ContentKeys, - virtual_epoch: Arc, virtual_id: Option Option<(u64, u64)> + Send + Sync>>, gpu_retired: Arc, } @@ -1602,29 +1609,14 @@ impl Worker { job }; let t0 = web_time::Instant::now(); - let epoch = self.virtual_epoch.load(Ordering::Relaxed); - let disk = job - .src - .disk - .as_ref() - .map(|dc| (dc.clone(), frame_disk_key(content_keys, &job.src.project, &job.key, opts_hash(&job.opts), epoch, self.virtual_id.as_deref()))); - // Half-float frames (32 bpc) have entries of their own (their key has the options). - let from_disk = disk.as_ref().and_then(|(dc, k)| { - if job.opts.skip_hdr_step { - let f = dc.get_frame_f16(*k)?; - let encoding = effectcraft_engine::viewer::FrameEncoding::of(&job.src.project.settings, true); - Some(FrameImage::CpuF16(Arc::new(F16Frame::from_bits(f.width, f.height, f.rgba, encoding)))) - } else { - let f = dc.get_frame(*k)?; - Some(FrameImage::Cpu(Arc::new(egui::ColorImage::from_rgba_premultiplied([f.width as usize, f.height as usize], &f.rgba)))) - } - }); + let disk = job.src.disk.as_ref().map(|dc| (dc.clone(), frame_disk_key(content_keys, &job.src.project, &job.key, opts_hash(&job.opts)))); + let from_disk = disk.as_ref().and_then(|(dc, k)| self.disk_frame(dc, *k, &job)); let disk_hit = from_disk.is_some(); - // `files`: the source files the rendered frame was made of (see `render::reads`). + // `files`: the source files the frame was made of (see `render::reads`). let (ci, files) = match from_disk { - Some(f) => (f, None), + Some(hit) => hit, None => match self.render_guarded(&job).filter(|_| !job.cancel.load(Ordering::Relaxed)) { - Some((ci, files)) => (ci, Some(files)), + Some(rendered) => rendered, // Called off (frames it read may be missing) or failed: not cached, and not // "in progress" forever: the viewer asks for it again. None => { @@ -1633,52 +1625,51 @@ impl Worker { } }, }; + let files = Arc::new(files); // Publish the shared frame and wake the viewer before optional RGBA conversion // and compression. Persistence still runs on this worker, using the same snapshot. - self.finish(&job, ci.clone(), t0); - if !disk_hit && let Some((dc, k)) = &disk { - // (#3184: the entry is to keep `files`, checked before it is used again.) - if let Some(files) = &files { - log::trace!( - "frame {} of comp {}: {} source files{}", - job.key.frame, - job.key.comp, - files.len(), - if files.is_complete() { "" } else { " (incomplete)" } - ); - } - let written = match &ci { - FrameImage::Cpu(img) => { - let rgba: Vec = img.pixels.iter().flat_map(|c| c.to_array()).collect(); - dc.put_frame(*k, img.size[0] as u32, img.size[1] as u32, &rgba); - true - } - FrameImage::CpuF16(f) => { - dc.put_frame_f16(*k, f.width, f.height, f.bits()); - true - } - FrameImage::Gpu(_) => false, - }; - if written && let Some(ctx) = &self.ctx { - ctx.request_repaint(); - } + self.finish(&job, ci.clone(), Some(files.clone()), t0); + if !disk_hit + && let Some((dc, k)) = &disk + && put_disk_frame(dc, *k, &ci, &files, self.virtual_id.as_deref()) + && let Some(ctx) = &self.ctx + { + ctx.request_repaint(); } true } - /// Store a finished frame and release its job. - fn finish(&self, job: &Job, img: FrameImage, t0: web_time::Instant) { - self.finish_key(job.key, job.urgent, img, t0); + /// The frame of `job` from the disk cache (key `k`), if its entry is there and the source + /// files it lists are unchanged (checked here, on the frame worker: a few `metadata` calls + /// for that frame's files). An entry whose files changed is deleted: the frame renders again + /// and its new entry replaces it. + fn disk_frame(&self, dc: &DiskCache, k: u128, job: &Job) -> Option<(FrameImage, ReadFiles)> { + let virtual_id = self.virtual_id.as_deref(); + // Half-float frames (32 bpc) have entries of their own (their key has the options). + if job.opts.skip_hdr_step { + let (f, files) = dc.get_frame_f16(k, virtual_id)?; + let encoding = effectcraft_engine::viewer::FrameEncoding::of(&job.src.project.settings, true); + Some((FrameImage::CpuF16(Arc::new(F16Frame::from_bits(f.width, f.height, f.rgba, encoding))), files)) + } else { + let (f, files) = dc.get_frame(k, virtual_id)?; + Some((FrameImage::Cpu(Arc::new(egui::ColorImage::from_rgba_premultiplied([f.width as usize, f.height as usize], &f.rgba))), files)) + } } - fn finish_key(&self, key: FrameKey, urgent: bool, img: FrameImage, t0: web_time::Instant) { + /// Store a finished frame (with the source files it was made of, when known) and release its + /// job. + fn finish(&self, job: &Job, img: FrameImage, files: Option>, t0: web_time::Instant) { + self.finish_key(job.key, job.urgent, img, files, t0); + } + + fn finish_key(&self, key: FrameKey, urgent: bool, img: FrameImage, files: Option>, t0: web_time::Instant) { if urgent && let Ok(mut l) = self.last.lock() { *l = t0.elapsed().as_secs_f64() * 1000.0; } if let Ok(mut c) = self.cache.lock() && (!img.is_gpu() || !self.gpu_retired.load(Ordering::Acquire)) { - c.insert(key, img); + c.insert_with(key, img, files); } self.release(key, urgent); } diff --git a/crates/ui-egui/src/frames/tests.rs b/crates/ui-egui/src/frames/tests.rs index df7b3900c..596f3054a 100644 --- a/crates/ui-egui/src/frames/tests.rs +++ b/crates/ui-egui/src/frames/tests.rs @@ -60,7 +60,7 @@ fn disk_fixture(stored_frames: &[i64]) -> (Frames, RenderSource, FrameKey, Rende disk.keys.lock().unwrap().extend(stored_frames.iter().map(|frame| disk_cache::frame_key(content, *frame, base.scale, base.view ^ opts_hash(&opts)))); let mut frames = Frames::default(); frames.set_remote(Some(disk.clone())); - frames.content_keys.lock().unwrap().insert((base.revision, base.comp, 0), content); + frames.content_keys.lock().unwrap().insert((base.revision, base.comp), content); let source = RenderSource { project: session.project.clone(), footage: session.footage.clone(), @@ -126,7 +126,7 @@ fn disk_indicator_does_not_hash_on_ui_thread_and_coalesces_edits() { assert_eq!(frames.content_key_jobs.lock().unwrap().pending.len(), 1); release.send(()).unwrap(); let until = Instant::now() + Duration::from_secs(3); - while !frames.content_keys.lock().unwrap().contains_key(&(base.revision, base.comp, 0)) { + while !frames.content_keys.lock().unwrap().contains_key(&(base.revision, base.comp)) { assert!(Instant::now() < until); std::thread::sleep(Duration::from_millis(1)); } @@ -153,7 +153,7 @@ fn disk_indicator_range_tracks_live_membership() { let mut revised = base; revised.revision += 1; - frames.content_keys.lock().unwrap().insert((revised.revision, revised.comp, 0), 5678); + frames.content_keys.lock().unwrap().insert((revised.revision, revised.comp), 5678); assert!(frames.disk_frames(&src, &revised, 10..13, &opts).is_empty()); let changed = FrameKey { scale: base.scale + 1, ..base }; @@ -211,7 +211,7 @@ fn retirement_reaches_existing_workers_and_keeps_cpu_frames_and_completion_live( let next = key(1, 1, 0); frames.inflight.lock().unwrap().insert(next); frames.queue.lock().unwrap().running.insert(next); - worker.finish_key(next, false, img(), web_time::Instant::now()); + worker.finish_key(next, false, img(), None, web_time::Instant::now()); assert!(frames.is_cached(&next), "CPU retry can still publish"); assert_eq!(frames.inflight(), 0); assert!(frames.queue.lock().unwrap().running.is_empty()); @@ -996,7 +996,7 @@ fn the_frames_an_edit_keeps_match_a_fresh_render() { // The work area is a preview and render range: setting it (B, N) keeps every frame, on // disk too. let n = s.project.comp(comp).map(|c| c.frame_rate.frame_at(c.duration)).unwrap(); - let disk = |s: &Session| effectcraft_engine::render::disk_cache::comp_content_key_with(&s.project, comp, None); + let disk = |s: &Session| effectcraft_engine::render::disk_cache::comp_content_key(&s.project, comp); let d0 = disk(&s); let work_area = |start: f64, end: f64| json!({"cmd": "comp.workArea", "params": {"comp": comp.0, "start": start, "end": end}}); assert_eq!(kept(&mut s, comp, work_area(1.0, 4.0)), (0..n).collect::>()); @@ -1616,19 +1616,12 @@ fn ram_frames_missing_on_disk_are_written_as(half: bool) { FrameKey { revision: 1, content: f.content_of(&src.project, 1, cid), comp: cid.0, opts: opts_hash(&RenderOpts::default()) ^ 1, ..key(0, 0, 0) }; for fr in 0..10 { let frame = if half { FrameImage::CpuF16(Arc::new(F16Frame::from_image(&effectcraft_engine::render::Image::new(8, 8), SRGB))) } else { img() }; - f.cache.lock().unwrap().insert(FrameKey { frame: fr, ..series }, frame); + f.cache.lock().unwrap().insert_with(FrameKey { frame: fr, ..series }, frame, Some(Arc::default())); } let on_disk = |fr: i64| { disk.contains( disk_cache::Kind::Frame, - frame_disk_key( - &f.content_keys, - &src.project, - &FrameKey { frame: fr, ..series }, - opts_hash(&RenderOpts::default()), - f.virtual_epoch.load(Ordering::Relaxed), - None, - ), + frame_disk_key(&f.content_keys, &src.project, &FrameKey { frame: fr, ..series }, opts_hash(&RenderOpts::default())), ) }; let persist = || { @@ -1681,7 +1674,7 @@ fn ram_frames_missing_on_disk_are_written_as(half: bool) { fn audio_edits_keep_the_frames_until_something_draws_the_audio() { use effectcraft_engine::Session; use effectcraft_engine::project::{Footage, GroupKind, LayerId, Value, build}; - use effectcraft_engine::render::disk_cache::comp_content_key_with; + use effectcraft_engine::render::disk_cache::comp_content_key; use serde_json::json; let mut s = Session::default(); let cid = ItemId(s.execute("comp.new", json!({"name": "A", "width": 8, "height": 8, "duration": 4, "frameRate": 30})).unwrap()["comp"].as_u64().unwrap()); @@ -1736,7 +1729,7 @@ fn audio_edits_keep_the_frames_until_something_draws_the_audio() { let mut p1 = p0.clone(); edit(Arc::make_mut(&mut p1)); let id1 = f.content_of(&p1, 2, view); - (f.cached_frames(&k(id1, 0)), comp_content_key_with(&p0, view, None) == comp_content_key_with(&p1, view, None)) + (f.cached_frames(&k(id1, 0)), comp_content_key(&p0, view) == comp_content_key(&p1, view)) }; let all: Vec = (0..120).collect(); let edits: [(&str, &dyn Fn(&mut Project)); 3] = [("levels", &levels), ("audio effect", &backwards), ("audio switch", &mute)]; @@ -1933,9 +1926,9 @@ fn disk_frames_outlive_an_edit_that_cant_change_them() { disk: Some(disk.clone()), }; // Every frame of `p0` on disk, none in RAM. - let content0 = disk_cache::comp_content_key_with(&p0, cid, None); + let content0 = disk_cache::comp_content_key(&p0, cid); for f in 0..30 { - disk.put_frame_now(disk_cache::frame_key(content0, f, 1000, oh), 1, 1, &[1, 2, 3, 255]); + disk.put_frame_now(disk_cache::frame_key(content0, f, 1000, oh), 1, 1, &[1, 2, 3, 255], &ReadFiles::default()); } let rename: fn(&mut Project, ItemId, LayerId) = |p, c, l| p.comp_mut(c).unwrap().layer_mut(l).unwrap().name = "Renamed".into(); let trim: fn(&mut Project, ItemId, LayerId) = |p, c, l| { @@ -2041,7 +2034,7 @@ fn a_keyframe_edit_reaches_only_the_keys_around_it() { fn music_volume_keeps_the_frames_with_expressions_that_dont_read_audio() { use effectcraft_engine::Session; use effectcraft_engine::project::{Expression, Footage, FootageKind, LayerId, Value, build}; - use effectcraft_engine::render::disk_cache::comp_content_key_with; + use effectcraft_engine::render::disk_cache::comp_content_key; use serde_json::json; let mut s = Session::default(); let cid = ItemId(s.execute("comp.new", json!({"name": "A", "width": 8, "height": 8, "duration": 4, "frameRate": 30})).unwrap()["comp"].as_u64().unwrap()); @@ -2069,7 +2062,7 @@ fn music_volume_keeps_the_frames_with_expressions_that_dont_read_audio() { let mut p1 = p0.clone(); Arc::make_mut(&mut p1).comp_mut(cid).unwrap().layer_mut(music_id).unwrap().props.prop_mut("audio/levels").unwrap().value = Value::Vec2([-6.0, -6.0]); let id1 = f.content_of(&p1, 2, cid); - (f.cached_frames(&k(id1, 0)).len(), comp_content_key_with(&p0, cid, None) == comp_content_key_with(&p1, cid, None)) + (f.cached_frames(&k(id1, 0)).len(), comp_content_key(&p0, cid) == comp_content_key(&p1, cid)) }; assert_eq!(kept("wiggle(2, 20)"), (120, true), "a wiggle reads no audio"); let (frames, disk) = kept("value + thisComp.layer(\"Music\")(\"Audio\")(\"Audio Levels\")[0]"); @@ -2449,3 +2442,288 @@ fn a_keyframe_edit_beside_muted_keys_reaches_the_keys_that_play() { assert!(same(i), "kept frame {i} renders differently after the edit"); } } + +/// Disk-cache frame entries that keep the source files they were made of (#3184): a sequence +/// comp in a folder of its own, with a large unused sequence in the project. +mod frame_files { + use super::*; + use effectcraft_engine::project::{Footage, FootageKind, build}; + use effectcraft_engine::time::FrameRate; + use std::path::{Path, PathBuf}; + use std::sync::atomic::AtomicUsize; + + const RATE: FrameRate = FrameRate::FPS_30; + const FRAMES: i64 = 5; + + /// A fresh folder for test `name` (on the build drive, not the system temp folder). + fn folder(name: &str) -> PathBuf { + let dir = Path::new(env!("CARGO_MANIFEST_DIR")).join(format!("../../target/test-frame-files-{name}-{}", std::process::id())); + let _ = std::fs::remove_dir_all(&dir); + std::fs::create_dir_all(&dir).unwrap(); + dir + } + + /// A flat grey PNG of `level` at `path`. + fn png(path: &Path, level: u8) -> String { + image::RgbaImage::from_pixel(16, 8, image::Rgba([level, level, level, 255])).save(path).unwrap(); + path.to_string_lossy().to_string() + } + + /// The grey level of sequence frame `i` as first written. + fn level(i: i64) -> u8 { + 20 + i as u8 * 30 + } + + /// A project with a comp showing a sequence of [`FRAMES`] PNGs (in `dir/seq`) and, unused, a + /// sequence of 5000 frames that don't even exist. The files of the shown sequence. + fn project(dir: &Path) -> (Arc, ItemId, Vec) { + let seq_dir = dir.join("seq"); + std::fs::create_dir_all(&seq_dir).unwrap(); + let files: Vec = (0..FRAMES).map(|i| png(&seq_dir.join(format!("f_{i:04}.png")), level(i))).collect(); + let mut seq = Footage { kind: FootageKind::Sequence, sequence: files.clone(), frame_rate: RATE, ..effectcraft_media::probe(&files[0]).unwrap() }; + seq.sync_sequence_duration(); + let unused = Footage { + kind: FootageKind::Sequence, + sequence: (0..5000).map(|i| dir.join("unused").join(format!("big_{i:05}.exr")).to_string_lossy().to_string()).collect(), + frame_rate: RATE, + width: 16, + height: 8, + has_video: true, + ..Default::default() + }; + let mut p = Project::default(); + p.add_item("Unused", effectcraft_engine::color::Label::Aqua, None, ItemKind::Footage(unused)); + let item = p.add_item("Seq", effectcraft_engine::color::Label::Aqua, None, ItemKind::Footage(seq)); + let mut comp = Comp::new(16, 8, RATE, RATE.tick_of(FRAMES)); + comp.layers = vec![build::layer(&mut p, &comp, "Seq", LayerSource::Footage { item }, (16, 8), Some(comp.duration))].into(); + let cid = p.add_item("C", effectcraft_engine::color::Label::None, None, ItemKind::Comp(comp.into())); + (Arc::new(p), cid, files) + } + + /// A session over the disk cache in `dir`: a new preview cache, media pool, layer cache and + /// disk cache instance (as after reopening the project), counting the calls of the hook for + /// files served from memory. + struct Session { + frames: Frames, + src: RenderSource, + disk: Arc, + hook_calls: Arc, + } + + fn session(p: &Arc, dir: &Path) -> Session { + let disk = DiskCache::open(dir.join("cache"), 1 << 30).unwrap(); + let hook_calls = Arc::new(AtomicUsize::new(0)); + let mut frames = Frames::default(); + let calls = hook_calls.clone(); + frames.set_virtual_id(Arc::new(move |_| { + calls.fetch_add(1, Ordering::Relaxed); + None + })); + let src = RenderSource { + project: p.clone(), + footage: Arc::new(effectcraft_media::MediaPool::new()), + expr: None, + layer_cache: Arc::default(), + gpu: None, + gpu_display: false, + disk: Some(disk.clone()), + }; + Session { frames, src, disk, hook_calls } + } + + impl Session { + fn key(&self, cid: ItemId, frame: i64) -> FrameKey { + FrameKey { + revision: 1, + content: self.frames.content_of(&self.src.project, 1, cid), + comp: cid.0, + frame, + scale: 1000, + view: 0, + opts: opts_hash(&RenderOpts::default()), + } + } + + /// Show `frames` of `cid` (rendered or read from disk); the grey level of each, once + /// their disk writes are done. + fn show(&self, cid: ItemId, frames: &[i64]) -> Vec { + for &f in frames { + self.frames.request(&self.src, self.key(cid, f), cid, RATE.tick_of(f), RenderOpts::default()); + } + wait_for_renders(&self.frames); + // (the worker queues the write after it has released the frame) + for _ in 0..400 { + self.disk.flush(); + if frames.iter().all(|f| self.disk.contains(disk_cache::Kind::Frame, self.disk_key(cid, *f))) { + break; + } + std::thread::sleep(std::time::Duration::from_millis(5)); + } + frames + .iter() + .map(|f| match self.frames.get(&self.key(cid, *f)) { + Some(FrameImage::Cpu(c)) => c.pixels[0].r(), + _ => panic!("frame {f}: an 8-bit CPU frame"), + }) + .collect() + } + + fn disk_key(&self, cid: ItemId, frame: i64) -> u128 { + frame_disk_key(&self.frames.content_keys, &self.src.project, &self.key(cid, frame), opts_hash(&RenderOpts::default())) + } + + /// (disk hits, disk misses) so far. + fn hits(&self) -> (u64, u64) { + let s = self.disk.stats(); + (s.hits, s.misses) + } + } + + fn close(a: u8, b: u8) -> bool { + a.abs_diff(b) <= 2 + } + + /// Give `path` a modification time `secs` later, contents and size unchanged. + fn touch(path: &str, secs: u64) { + let t = std::fs::metadata(path).unwrap().modified().unwrap() + std::time::Duration::from_secs(secs); + std::fs::File::options().append(true).open(path).unwrap().set_modified(t).unwrap(); + } + + /// Correct: a source file of the sequence changes (new contents and size; or only a new + /// time): exactly the frames that read it render again and their entries are replaced; the + /// others come from disk, also after reopening. + #[test] + fn a_changed_source_file_re_renders_exactly_its_frames() { + let dir = folder("correct"); + let (p, cid, files) = project(&dir); + let all: Vec = (0..FRAMES).collect(); + let first = session(&p, &dir); + let shown = first.show(cid, &all); + assert!(all.iter().all(|f| close(shown[*f as usize], level(*f))), "{shown:?}"); + assert_eq!(first.hits(), (0, FRAMES as u64), "rendered, nothing on disk yet"); + assert_eq!(first.disk.stats().entries, FRAMES as usize, "every frame stored"); + drop(first); + // Frame 2's file gets new pixels (and size), frame 3's only a new time. + png(Path::new(&files[2]), 250); + touch(&files[3], 30); + let second = session(&p, &dir); + let shown = second.show(cid, &all); + assert!(close(shown[2], 250), "frame 2 shows its new file: {shown:?}"); + assert!([0, 1, 3, 4].iter().all(|f| close(shown[*f as usize], level(*f))), "{shown:?}"); + assert_eq!(second.hits(), (3, 2), "frames 0, 1 and 4 from disk; 2 and 3 rendered again"); + assert_eq!(second.disk.file_checks(), FRAMES as u64, "one file checked per frame read"); + assert_eq!(second.disk.stats().entries, FRAMES as usize, "the entries of 2 and 3 were replaced"); + drop(second); + // Reopened: every frame from disk, the replaced ones with their new pixels. + let third = session(&p, &dir); + let shown = third.show(cid, &all); + assert_eq!(third.hits(), (FRAMES as u64, 0)); + assert!(close(shown[2], 250) && close(shown[3], level(3)), "{shown:?}"); + let _ = std::fs::remove_dir_all(&dir); + } + + /// No scan: opening a comp of a project that also holds a large sequence, and showing a + /// frame, looks only at the files that frame reads; the comp's key looks at no file (it + /// stays the same when its files change, and never asks for the identity of a path). + #[test] + fn showing_a_frame_checks_only_the_files_it_reads() { + let dir = folder("no-scan"); + let (p, cid, files) = project(&dir); + let key = disk_cache::comp_content_key(&p, cid); + png(Path::new(&files[1]), 99); + touch(&files[2], 5); + assert_eq!(disk_cache::comp_content_key(&p, cid), key, "the key looks at no file"); + let first = session(&p, &dir); + first.show(cid, &[2]); + drop(first); + let again = session(&p, &dir); + // (the indicator's key is computed off the UI thread first) + let mut blue = vec![]; + for _ in 0..400 { + blue = again.frames.disk_frames(&again.src, &again.key(cid, 0), 0..FRAMES, &RenderOpts::default()); + if !blue.is_empty() { + break; + } + std::thread::sleep(std::time::Duration::from_millis(5)); + } + assert_eq!(blue, vec![2], "the blue bar: present entries, no file looked at"); + assert_eq!(again.disk.file_checks(), 0, "the indicator checks no file"); + let shown = again.show(cid, &[2]); + assert!(close(shown[0], level(2)), "{shown:?}"); + assert_eq!(again.hits(), (1, 0)); + assert_eq!(again.disk.file_checks(), 1, "only the file frame 2 read"); + assert_eq!(again.hook_calls.load(Ordering::Relaxed), 0, "no path of the unused sequence was asked about"); + let _ = std::fs::remove_dir_all(&dir); + } + + /// The frame entry files under the cache folder. + fn entries(dir: &Path) -> Vec { + let mut out = vec![]; + let mut stack = vec![dir.join("cache")]; + while let Some(d) = stack.pop() { + for e in std::fs::read_dir(&d).into_iter().flatten().flatten() { + let p = e.path(); + if p.is_dir() { + stack.push(p); + } else if p.extension().is_some_and(|x| x == "ecc") && p.to_string_lossy().contains("frames") { + out.push(p); + } + } + } + out + } + + /// Safe: a missing source file, an unreadable one (a folder in its place) and a damaged + /// cache entry never serve the frame from before; each is rendered again and stored anew. + #[test] + fn missing_or_unreadable_files_and_damaged_entries_never_serve_a_stale_frame() { + let dir = folder("safe"); + let (p, cid, files) = project(&dir); + let first = session(&p, &dir); + first.show(cid, &[0]); + assert_eq!(first.disk.stats().entries, 1); + drop(first); + // Missing: not served; the frame is rendered without it. + std::fs::remove_file(&files[0]).unwrap(); + let missing = session(&p, &dir); + let shown = missing.show(cid, &[0]); + assert!(!close(shown[0], level(0)), "the frame from before was served: {shown:?}"); + assert_eq!(missing.hits(), (0, 1)); + drop(missing); + // Back, with other pixels: the entry made while it was missing is not served either. + png(Path::new(&files[0]), 180); + let back = session(&p, &dir); + let shown = back.show(cid, &[0]); + assert!(close(shown[0], 180), "{shown:?}"); + assert_eq!(back.hits(), (0, 1)); + drop(back); + // Unreadable (a folder in its place). + std::fs::remove_file(&files[0]).unwrap(); + std::fs::create_dir(&files[0]).unwrap(); + let unreadable = session(&p, &dir); + let shown = unreadable.show(cid, &[0]); + assert!(!close(shown[0], 180), "the frame from before was served: {shown:?}"); + assert_eq!(unreadable.hits(), (0, 1)); + drop(unreadable); + std::fs::remove_dir(&files[0]).unwrap(); + png(Path::new(&files[0]), 120); + let fresh = session(&p, &dir); + assert!(close(fresh.show(cid, &[0])[0], 120)); + drop(fresh); + // A damaged entry: a miss, rendered, stored again, then served. + let found = entries(&dir); + assert_eq!(found.len(), 1, "{found:?}"); + let mut bytes = std::fs::read(&found[0]).unwrap(); + let n = bytes.len() / 2; + bytes[n] ^= 0x5a; + std::fs::write(&found[0], bytes).unwrap(); + let damaged = session(&p, &dir); + assert!(close(damaged.show(cid, &[0])[0], 120)); + assert_eq!(damaged.hits(), (0, 1)); + drop(damaged); + let healed = session(&p, &dir); + assert!(close(healed.show(cid, &[0])[0], 120)); + assert_eq!(healed.hits(), (1, 0), "the rewritten entry is used"); + let _ = std::fs::remove_dir_all(&dir); + } +} diff --git a/crates/ui-egui/tests/it/ui_web_gpu_storage.rs b/crates/ui-egui/tests/it/ui_web_gpu_storage.rs index b015da41b..694d98507 100644 --- a/crates/ui-egui/tests/it/ui_web_gpu_storage.rs +++ b/crates/ui-egui/tests/it/ui_web_gpu_storage.rs @@ -61,7 +61,7 @@ impl RemoteFrames for GpuWorker { fn start(&self, job: RemoteJob, done: RemoteDone) { // The page reads a hit from the disk cache instead of asking the worker. if let Some(k) = job.disk_key - && let Some(f) = self.disk.lock().unwrap().get(&k).and_then(|e| disk_cache::read_frame_entry(e)) + && let Some(f) = self.disk.lock().unwrap().get(&k).and_then(|e| disk_cache::read_frame_entry(e, None)) { return done(Ok(RemoteFrame { width: f.width, height: f.height, rgba: f.rgba, ms: 0.0 })); } @@ -91,8 +91,11 @@ impl RemoteFrames for GpuWorker { match out.into_iter().next() { Some((FrameReply::Frame { width, height, ms, passes, gpu, .. }, Some(rgba))) => { self.rendered.lock().unwrap().push((passes, gpu)); - if let Some(k) = job.disk_key { - self.disk.lock().unwrap().insert(k, disk_cache::frame_entry(width, height, &rgba)); + if let Some(k) = job.disk_key + && let Some(files) = server.take_files() + && let Some(entry) = disk_cache::frame_entry(width, height, &rgba, &files, None) + { + self.disk.lock().unwrap().insert(k, entry); } done(Ok(RemoteFrame { width, height, rgba, ms })) } diff --git a/docs/web.md b/docs/web.md index 1cdecab00..832aa86fe 100644 --- a/docs/web.md +++ b/docs/web.md @@ -332,9 +332,11 @@ pixels. Settings ▸ Disk ▸ Disk Cache works in the browser, backed by the **Origin Private File System** (`src/diskcache.rs`): viewer frames are kept under `effectcraft-cache/v1/frames/<32 hex>.ecc` -between visits, in the desktop cache's format (`disk_cache::frame_entry`: 8-bit premultiplied -RGBA, LZ4, a checksum), keyed by the same content hash (the comp and everything it uses, frame, -scale, view, render options). +between visits, in the desktop cache's format (`disk_cache::frame_entry`: the source files the +frame read with their size and content hash, then 8-bit premultiplied RGBA, LZ4, a checksum), +keyed by the same content hash (the comp and everything it uses as held in memory, frame, scale, +view, render options). The page reads an entry only while the files it lists are unchanged; a +frame whose files can't all be named is not stored. - A render request to a frame worker carries the frame's disk key; the worker posts the frame, then writes the entry with a **synchronous access handle** into a temporary file moved into From 726d78d1c090e6b8eb353a57014f75a726f446b7 Mon Sep 17 00:00:00 2001 From: vangel76 Date: Sat, 7 Nov 2026 00:12:07 +0100 Subject: [PATCH 019/451] Disk cache: layer entries keep their source files, no footage salt Part of #3184 (step 3 of 4). Layer buffers on disk (and in the browser's layer store) now carry the files they were made of, like frame entries since step 2, and are checked against exactly those files when used. The project-wide footage salt is gone: nothing stamps every footage file any more. - Layer entry format 4: the buffer's EntryFiles, then the pixels. A hit checks only the listed files (metadata, or the VirtualFileId hook for files from memory; Missing must still be missing); a change, a damaged entry or the old format 0 is a miss and the entry is deleted, so the re-rendered buffer replaces it. A hit reports its file list, so frames made of buffers from disk are complete and get stored again. - Buffers whose files can't all be named are not written. - Layer disk keys: layer_disk_key = hash of the layer entry version, the renderer version and the layer cache key (which names the footage items with their paths and settings, from memory). - PrefetchStore checks on use; an entry made of changed files is dropped and forgotten, so the new buffer is queued over it. FrameServer passes its virtual-file hook to its layer cache. - Removed: footage_salt(_with), file_stamp, footage_stamp, set_disk_salt, set_store_salt, Session::refresh_disk_salt, poll_disk_salt, footage_fingerprint, disk_salt, disk_salt_background, disk_salt_job, DiskSaltJob, the UI's per-frame poll, the salt in FrameServer and in the availability worker (with its cache_enabled plumbing). The disk cache is attached as soon as it is configured. - Docs: architecture.md, web.md. Tests: layer entries check their files (size, time, missing/back, folder, damaged, old format, incomplete); virtual files; prefetch store; media tests with a real pool across restarts (only the changed file is read, projects with the same item ids never share an entry, missing, unreadable and damaged never serve stale buffers); engine tests that the cache is attached at once and edits do no file work (#1926, #3106). Co-Authored-By: Claude Opus 5.5 --- apps/effectcraft-web/src/diskcache.rs | 8 +- apps/effectcraft/src/main.rs | 3 - crates/engine/src/background/remote.rs | 25 +- crates/engine/src/background/remote/tests.rs | 3 +- crates/engine/src/footage/availability.rs | 43 +- crates/engine/src/footage/footage_check.rs | 2 +- crates/engine/src/footage/footage_reload.rs | 31 +- crates/engine/src/lib.rs | 13 +- crates/engine/src/session.rs | 2 +- crates/engine/src/session/edit.rs | 117 ----- .../engine/src/settings/session_settings.rs | 9 +- crates/engine/src/tests/disk_cache.rs | 143 ++----- crates/engine/src/tests/sequence.rs | 21 +- crates/media/src/reads/tests.rs | 199 +++++++++ crates/render/src/cache.rs | 251 +++++++---- crates/render/src/disk_cache.rs | 400 ++++++++++-------- crates/render/src/reads.rs | 4 +- crates/ui-egui/src/app/frame.rs | 4 - .../ui-egui/tests/it/ui_unreadable_footage.rs | 3 +- docs/architecture.md | 11 +- docs/web.md | 5 +- 21 files changed, 710 insertions(+), 587 deletions(-) diff --git a/apps/effectcraft-web/src/diskcache.rs b/apps/effectcraft-web/src/diskcache.rs index 5ac655cb0..72e9a9e11 100644 --- a/apps/effectcraft-web/src/diskcache.rs +++ b/apps/effectcraft-web/src/diskcache.rs @@ -21,9 +21,11 @@ //! back their layer caches with a `PrefetchStore`. They report each frame's layer-cache //! misses; before the next request the page names the recent misses that are on disk //! ([`layer_prefetch`], `disk_cache::LayerPrefetch`), and the worker reads those entries -//! into memory before rendering, so the lookups find them. Slow buffers are written by the -//! worker after its frame and indexed here like frames (one least-recently-used order for -//! both kinds). +//! into memory before rendering, so the lookups find them; an entry is used only while the +//! files it lists (the file table's size and content hash) are unchanged, and a buffer whose +//! files can't all be named is not written (#3184). Slow buffers are written by the worker +//! after its frame and indexed here like frames (one least-recently-used order for both +//! kinds). use std::cell::RefCell; diff --git a/apps/effectcraft/src/main.rs b/apps/effectcraft/src/main.rs index 07d327a21..5350addbe 100644 --- a/apps/effectcraft/src/main.rs +++ b/apps/effectcraft/src/main.rs @@ -276,9 +276,6 @@ fn main() -> eframe::Result { // written on background threads (M13.14). session.check_footage_on_open = true; session.autosave.background = true; - // The disk cache's footage stamps too: an imported or opened project with thousands of - // sequence frames on a network share took half a minute to stamp. - session.disk_salt_background = true; // Settings, shortcut presets and the crash-recovery sentinel live in the platform // config directory. Agent-driven runs (`--control`) skip crash recovery. if let Some(dir) = effectcraft_host::config_dir() { diff --git a/crates/engine/src/background/remote.rs b/crates/engine/src/background/remote.rs index ca11d8220..153bb324b 100644 --- a/crates/engine/src/background/remote.rs +++ b/crates/engine/src/background/remote.rs @@ -27,8 +27,9 @@ //! - Layer buffers on disk: with `layers`, the server's layer cache is backed by a //! [`PrefetchStore`] ([`FrameServer::set_layer_store`]): before the request the transport //! fetches the entries named in `prefetch` (recent misses that are on disk, chosen by the -//! page, `disk_cache::LayerPrefetch`), so the lookups in the middle of the render find them; -//! the reply lists the layer keys that missed and those served from the store +//! page, `disk_cache::LayerPrefetch`), so the lookups in the middle of the render find them +//! (each entry keeps the source files its buffer was made of and is used only while they are +//! unchanged, #3184); the reply lists the layer keys that missed and those served from the store //! ([`FrameReply::Frame`] `layer_misses` / `layer_hits`), and slow buffers queue up for the //! transport to write after the frame ([`PrefetchStore::take_writes`], reported as //! [`FrameReply::Stored`] with `layer`). @@ -180,7 +181,7 @@ pub enum FrameReply { passes: u32, #[serde(default)] gpu: bool, - /// Layer-cache lookups that missed the store (salted keys, 32 hex digits). + /// Layer-cache lookups that missed the store (disk keys, 32 hex digits). #[serde(default, rename = "layerMisses", skip_serializing_if = "Vec::is_empty")] layer_misses: Vec, /// Layer buffers served from the store (fetched from disk). @@ -263,9 +264,8 @@ pub struct FrameServer { revision: Option, /// The frame being rendered in passes. pending: Option, - /// The disk cache's layer buffers (see the module docs) and the project's salt. + /// The disk cache's layer buffers (see the module docs). layer_store: Option>, - salt: u64, /// Size and content hash for footage paths with no native metadata (the browser file table). virtual_id: Option Option<(u64, u64)> + Send + Sync>>, /// The source files the last finished frame read ([`FrameServer::take_files`]). @@ -300,15 +300,15 @@ impl FrameServer { revision: None, pending: None, layer_store: None, - salt: 0, virtual_id: None, files: None, } } - /// Identity of virtual footage files, used when native metadata cannot describe the path. - /// Called from `FrameServer::load`, not from the UI thread's cache lookup. + /// Identity of virtual footage files, used when native metadata cannot describe the path: + /// what the disk entries of frames and layer buffers keep for them and are checked against. pub fn set_virtual_id(&mut self, id: Option Option<(u64, u64)> + Send + Sync>>) { + self.cache.set_virtual_id(id.clone()); self.virtual_id = id; } @@ -334,11 +334,6 @@ impl FrameServer { self.layer_store.as_ref() } - /// The salt of the replica's layer keys on disk (keys are `(salt, key)`). - pub fn salt(&self) -> u64 { - self.salt - } - /// Render with `accel` when the request's backend asks for it (the worker's GPU). Its miss /// gate keeps placeholder buffers of unfinished passes out of the layer cache. pub fn set_accel(&mut self, accel: Option>) { @@ -365,8 +360,6 @@ impl FrameServer { fn load(&mut self, revision: u64) -> Result<(), String> { let p = Project::from_json(&self.doc.to_string()).map_err(|e| e.to_string())?; - self.salt = effectcraft_render::disk_cache::footage_salt_with(&p, self.virtual_id.as_deref()); - self.cache.set_store_salt(self.salt); self.project = Some(Arc::new(p)); self.revision = Some(revision); Ok(()) @@ -410,7 +403,7 @@ impl FrameServer { } FrameMsg::Render { id, revision, comp, time, opts, layers, .. } => { let store = self.layer_store.clone().filter(|_| layers); - self.cache.set_store(store.map(|s| (s as Arc, self.salt))); + self.cache.set_store(store.map(|s| s as Arc)); let fail = |error: String, stale: bool| vec![(FrameReply::Failed { id, error, stale }, None)]; if self.revision != Some(revision) { return fail(format!("the replica is at {:?}, not {revision}", self.revision), true); diff --git a/crates/engine/src/background/remote/tests.rs b/crates/engine/src/background/remote/tests.rs index 7a7a59f3f..c35d7a717 100644 --- a/crates/engine/src/background/remote/tests.rs +++ b/crates/engine/src/background/remote/tests.rs @@ -69,7 +69,8 @@ fn layer_buffers_go_through_the_disk_store() { assert!(!layer_misses.is_empty() && layer_hits.is_empty()); let writes = store_a.take_writes(); assert!(!writes.is_empty()); - assert!(writes.iter().all(|(k, _)| (*k >> 64) as u64 == a.salt()), "keys are salted per project"); + // Sealed with the files each buffer was made of (none here: the demo reads no footage). + assert!(writes.iter().all(|(_, e)| effectcraft_render::disk_cache::read_layer_entry(e).is_some_and(|(_, f)| f.is_empty()))); let mut index = DiskIndex::default(); let mut disk = std::collections::HashMap::new(); for (k, e) in writes { diff --git a/crates/engine/src/footage/availability.rs b/crates/engine/src/footage/availability.rs index 7ad2bc03f..75e2a1e1c 100644 --- a/crates/engine/src/footage/availability.rs +++ b/crates/engine/src/footage/availability.rs @@ -215,20 +215,18 @@ impl Scanner { } } -/// A disk observation prepared entirely by the existing worker, including the potentially -/// expensive sequence stamps used for disk-cache keys. The UI only swaps a current snapshot. +/// A disk observation prepared entirely by the existing worker. The UI only swaps a current +/// snapshot (the disk cache needs nothing: its entries check their own files when read, #3184). pub(crate) struct Update { before: Arc, after: Arc, paths: BTreeSet, newly_missing: usize, - cache_enabled: bool, - salt: Option<(u64, u64)>, } -/// Prepare a replacement only when availability changed. Project cloning and optional disk -/// salt computation belong on the worker; apply later rejects an outdated project snapshot. -pub(crate) fn prepare(project: &Arc, sources: &[Source], missing: &[bool], cache_enabled: bool) -> Option { +/// Prepare a replacement only when availability changed. Project cloning belongs on the +/// worker; apply later rejects an outdated project snapshot. +pub(crate) fn prepare(project: &Arc, sources: &[Source], missing: &[bool]) -> Option { let mut after = project.clone(); let mut paths = BTreeSet::new(); let mut newly_missing = 0; @@ -245,22 +243,17 @@ pub(crate) fn prepare(project: &Arc, sources: &[Source], missing: &[boo if paths.is_empty() { return None; } - let salt = cache_enabled.then(|| (Session::footage_fingerprint(&after), crate::render::disk_cache::footage_salt(&after))); - Some(Update { before: project.clone(), after, paths, newly_missing, cache_enabled, salt }) + Some(Update { before: project.clone(), after, paths, newly_missing }) } impl Update { - /// False means a newer project or cache configuration needs a fresh observation. + /// False means a newer project needs a fresh observation. pub fn apply(self, s: &mut Session) -> bool { - if !Arc::ptr_eq(&s.project, &self.before) || s.disk_cache.is_some() != self.cache_enabled { + if !Arc::ptr_eq(&s.project, &self.before) { return false; } let dirty = s.is_dirty(); s.project = self.after; - if let Some((fingerprint, salt)) = self.salt { - s.disk_salt = Some((fingerprint, salt)); - s.layer_cache.set_disk_salt(salt); - } s.bump(); if !dirty { s.mark_saved(); @@ -371,7 +364,7 @@ mod tests { fn stale_observation_cannot_mark_a_replacement_missing() { let (mut s, id) = session(Arc::new(Disk::default())); let old = sources(&s); - let update = prepare(&s.project, &old, &[true, true], false).unwrap(); + let update = prepare(&s.project, &old, &[true, true]).unwrap(); if let ItemKind::Footage(f) = &mut Arc::make_mut(&mut s.project).item_mut(id).unwrap().kind { f.path = "/new.png".into(); } @@ -398,9 +391,12 @@ mod tests { assert_eq!(disk.looks.load(Ordering::Relaxed), 2, "one file per source, no scan of an unmounted folder"); } + /// An availability change does no disk-cache work (#3184): the cache stays attached and + /// no file is looked at for it, on the worker or when the UI applies the observation (it + /// used to stamp every footage file for a new layer salt). #[test] - fn applying_prepared_cache_salt_does_not_restat_files_on_the_ui_thread() { - let dir = std::env::temp_dir().join(format!("ec-availability-salt-{}", std::process::id())); + fn applying_an_availability_change_does_no_disk_cache_work() { + let dir = std::env::temp_dir().join(format!("ec-availability-cache-{}", std::process::id())); std::fs::create_dir_all(&dir).unwrap(); let file = dir.join("plate.png"); std::fs::write(&file, b"plate").unwrap(); @@ -413,16 +409,13 @@ mod tests { ); let cache = crate::render::disk_cache::DiskCache::open(dir.join("cache"), 1 << 20).unwrap(); s.disk_cache = Some(cache.clone()); - s.layer_cache.set_disk(Some((cache, 0))); + s.layer_cache.set_disk(Some(cache.clone())); s.mark_saved(); - let update = prepare(&s.project, &sources(&s), &[false], true).unwrap(); - let expected = update.salt.unwrap().1; - // The filesystem can change again after the worker's observation. Applying it must - // retain that observation's salt, rather than scan the disk a second time on the UI. + let update = prepare(&s.project, &sources(&s), &[false]).unwrap(); std::fs::remove_file(file).unwrap(); - assert_ne!(crate::render::disk_cache::footage_salt(&update.after), expected); assert!(update.apply(&mut s)); - assert_eq!(s.disk_salt.map(|(_, salt)| salt), Some(expected)); + assert!(s.layer_cache.disk().is_some_and(|d| Arc::ptr_eq(&d, &cache)), "still attached"); + assert_eq!(cache.file_checks(), 0, "no file looked at for the disk cache"); assert!(!s.is_dirty()); drop(s); std::fs::remove_dir_all(dir).unwrap(); diff --git a/crates/engine/src/footage/footage_check.rs b/crates/engine/src/footage/footage_check.rs index 9e941a6ed..42401d195 100644 --- a/crates/engine/src/footage/footage_check.rs +++ b/crates/engine/src/footage/footage_check.rs @@ -272,7 +272,7 @@ mod tests { let id = source.id; let mut recovered = source.footage.clone(); recovered.path = "/new/project/plate.png".into(); - let observed = super::super::availability::prepare(&s.project, std::slice::from_ref(&source), &[true], false).unwrap(); + let observed = super::super::availability::prepare(&s.project, std::slice::from_ref(&source), &[true]).unwrap(); assert!(observed.apply(&mut s)); assert!(matches!(&s.project.item(id).unwrap().kind, ItemKind::Footage(f) if f.missing)); let result = apply(&mut s, vec![(source, Found::Moved(Box::new(recovered)))]); diff --git a/crates/engine/src/footage/footage_reload.rs b/crates/engine/src/footage/footage_reload.rs index 7065620af..4232e1d11 100644 --- a/crates/engine/src/footage/footage_reload.rs +++ b/crates/engine/src/footage/footage_reload.rs @@ -76,7 +76,6 @@ pub struct Watched { reload: BTreeSet, sources: Arc>, project: Option>, - cache_enabled: bool, reload_mode: String, stored_paths: crate::doc_path::StoredPaths, } @@ -85,8 +84,7 @@ impl PartialEq for Watched { /// Compare watched inputs, excluding unrelated project edits whose latest Arc is refreshed /// separately without waking the worker or restarting partial sequence scans. fn eq(&self, other: &Self) -> bool { - self.cache_enabled == other.cache_enabled - && self.stored_paths == other.stored_paths + self.stored_paths == other.stored_paths && self.reload_mode == other.reload_mode && self.reload == other.reload && (Arc::ptr_eq(&self.sources, &other.sources) || self.sources == other.sources) @@ -100,7 +98,6 @@ pub fn watched(s: &Session) -> Watched { reload: automatic_paths(s), sources: Arc::new(if s.check_footage_on_open { availability::sources(s) } else { Vec::new() }), project: Some(s.project.clone()), - cache_enabled: s.disk_cache.is_some(), reload_mode: s.prefs.import.auto_reload_footage.clone(), stored_paths: s.stored_paths.clone(), } @@ -139,10 +136,10 @@ pub struct Scan { } impl Scan { - /// Prepare availability and cache state before the session applies the observation. + /// Prepare the availability change before the session applies the observation. /// Automatic callers construct this result on the worker; explicit commands run inline. fn new(watched: Watched, observation: Observation, policy: ReloadPolicy) -> Self { - let update = watched.project.as_ref().and_then(|p| availability::prepare(p, &watched.sources, &observation.missing, watched.cache_enabled)); + let update = watched.project.as_ref().and_then(|p| availability::prepare(p, &watched.sources, &observation.missing)); Self { watched, observation, update, policy } } @@ -281,7 +278,7 @@ fn reload(s: &mut Session, ids: &[ItemId], undoable: bool) -> crate::Result<(usi } let n = updates.len(); apply_reloads(s, updates, undoable)?; - forget(s, &paths); + forget_media(s, &paths); Ok((n, failed)) } @@ -320,14 +317,8 @@ fn apply_reloads(s: &mut Session, updates: Vec<(ItemId, Footage)>, undoable: boo Ok(()) } -/// Make the media layer and the layer cache let go of `paths`, so renders read them again. -fn forget(s: &mut Session, paths: &BTreeSet) { - forget_media(s, paths); - s.refresh_disk_salt(true); -} - -/// Invalidate decoded and rendered buffers without probing the disk for a new salt. -/// Availability updates already carry their worker-computed salt; content reload refreshes it. +/// Make the media layer and the layer cache let go of `paths`, so renders read them again. The +/// disk cache needs nothing: its entries check the files they were made of when read (#3184). pub(crate) fn forget_media(s: &mut Session, paths: &BTreeSet) { for p in paths { s.footage.forget(p); @@ -374,7 +365,7 @@ pub fn apply_stamps(s: &mut Session, now: Vec<(String, Option)>) -> crate return Ok(json!({"files": 0, "reloaded": 0})); } // Changed frames of image sequences (their items keep their metadata). - forget(s, &changed); + forget_media(s, &changed); let files = changed.len(); s.toast(if reloaded > 0 { format!("Reloaded {reloaded} footage item(s) changed on disk") @@ -391,7 +382,6 @@ pub(crate) fn command(s: &mut Session, _: &Value) -> crate::Result { reload: reload_paths(s), sources: Arc::new(availability::sources(s)), project: Some(s.project.clone()), - cache_enabled: s.disk_cache.is_some(), reload_mode: s.prefs.import.auto_reload_footage.clone(), stored_paths: s.stored_paths.clone(), }; @@ -452,12 +442,7 @@ impl Watcher { pub fn update(&mut self, s: &Session) { let same_sources = availability::sources_match(s, &self.paths.sources); let same_data = self.paths.project.as_ref().is_some_and(|before| data_paths(before).eq(data_paths(&s.project))); - if same_sources - && same_data - && self.paths.stored_paths == s.stored_paths - && self.paths.reload_mode == s.prefs.import.auto_reload_footage - && self.paths.cache_enabled == s.disk_cache.is_some() - { + if same_sources && same_data && self.paths.stored_paths == s.stored_paths && self.paths.reload_mode == s.prefs.import.auto_reload_footage { let project = Some(s.project.clone()); self.paths.project = project.clone(); self.pending.lock().unwrap_or_else(PoisonError::into_inner).paths.project = project; diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index e50b15d04..69d1f9e1b 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -97,7 +97,7 @@ pub use error::{EngineError, Result}; pub use event::Event; pub use fonts::{FontRow, font_features, font_menu, font_preview, font_styles, text_families}; pub use services::{FsServices, Importer, Services}; -pub use session::{DiskSaltJob, upgrade_effects}; +pub use session::upgrade_effects; pub struct Session { pub project: Arc, @@ -254,14 +254,6 @@ pub struct Session { /// Each footage file's size and modification time when last seen (Settings ▸ Import ▸ /// Reload Footage Changed on Disk, [`footage_reload`]). pub footage_stamps: std::collections::HashMap, - /// The disk cache's footage salt and the footage it was taken for ([`Session::refresh_disk_salt`]). - pub disk_salt: Option<(u64, u64)>, - /// Take the disk cache's footage salt on a worker thread ([`Session::refresh_disk_salt`]): - /// frontends with an event loop (the desktop app) turn this on and call - /// [`Session::poll_disk_salt`] each frame; headless sessions take it at once. - pub disk_salt_background: bool, - /// The footage salt being taken in the background. - pub disk_salt_job: Option, /// The footage files effects read the channels of, as last given to the footage source /// ([`Session::refresh_aux_footage`]); `None` = not given yet. pub aux_footage: Option>, @@ -391,9 +383,6 @@ impl Default for Session { check_footage_on_open: false, stored_paths: Default::default(), footage_stamps: Default::default(), - disk_salt: None, - disk_salt_background: false, - disk_salt_job: None, aux_footage: None, script_calls: ScriptCalls::default(), } diff --git a/crates/engine/src/session.rs b/crates/engine/src/session.rs index 31ed40c1d..18b0ff4cf 100644 --- a/crates/engine/src/session.rs +++ b/crates/engine/src/session.rs @@ -10,4 +10,4 @@ mod dispatch; mod edit; mod render; -pub use edit::{DiskSaltJob, upgrade_effects}; +pub use edit::upgrade_effects; diff --git a/crates/engine/src/session/edit.rs b/crates/engine/src/session/edit.rs index 28813e2ec..67a8e4dcb 100644 --- a/crates/engine/src/session/edit.rs +++ b/crates/engine/src/session/edit.rs @@ -97,114 +97,10 @@ impl Session { if Arc::ptr_eq(&self.project, &self.saved_project) { self.saved_revision = self.revision; } - self.refresh_disk_salt(false); self.refresh_aux_footage(); self.events.push(Event::ProjectChanged { revision: self.revision }); } - /// Salt the disk cache's layer keys with the project's footage files - /// ([`effectcraft_render::disk_cache::footage_salt`]) and attach the disk cache to the layer - /// cache with it. Taking it reads the size and time of every file, every frame of an image - /// sequence included, so it is taken again only when the footage items changed, or with - /// `force` (a project opened, footage reloaded, the disk cache attached), not at every edit: - /// with a few large sequences that cost each keystroke in a text field over half a second - /// (#1926). - /// - /// With [`Session::disk_salt_background`] the files are read on a worker thread: an imported - /// or opened project with thousands of sequence frames on a network share took half a minute - /// to stamp, all of it on the UI thread. Until [`Session::poll_disk_salt`] picks the salt up, - /// renders use the memory cache only (keys under the old salt may name other files, or - /// another project's items) and this returns `None`. - pub fn refresh_disk_salt(&mut self, force: bool) -> Option { - let Some(dc) = self.disk_cache.clone() else { - self.disk_salt = None; - self.disk_salt_job = None; - return None; - }; - self.poll_disk_salt(); - let footage = Self::footage_fingerprint(&self.project); - if !force { - if let Some((seen, salt)) = self.disk_salt - && seen == footage - { - return Some(salt); - } - if self.disk_salt_job.as_ref().is_some_and(|j| j.footage == footage) { - return None; - } - } - if self.disk_salt_background && !cfg!(target_arch = "wasm32") { - let project = self.project.clone(); - let slot: Arc>> = Arc::default(); - let out = slot.clone(); - let spawned = std::thread::Builder::new().name("ec-disk-salt".into()).spawn(move || { - let salt = effectcraft_render::disk_cache::footage_salt(&project); - if let Ok(mut s) = out.lock() { - *s = Some(salt); - } - }); - // Without a thread the salt is taken here, as before. - if let Ok(thread) = spawned { - self.disk_salt = None; - self.disk_salt_job = Some(DiskSaltJob { footage, slot, thread }); - self.layer_cache.set_disk(None); - return None; - } - } - self.disk_salt_job = None; - let salt = effectcraft_render::disk_cache::footage_salt(&self.project); - self.disk_salt = Some((footage, salt)); - self.layer_cache.set_disk(Some((dc, salt))); - Some(salt) - } - - /// Pick up a footage salt taken in the background ([`Session::refresh_disk_salt`]) and attach - /// the disk cache with it. Returns whether one is still being taken (frontends call this each - /// frame while it is). - pub fn poll_disk_salt(&mut self) -> bool { - let Some(job) = &self.disk_salt_job else { return false }; - // (looked at first: a worker that has finished has left its salt in the slot) - let finished = job.thread.is_finished(); - let salt = job.slot.lock().ok().and_then(|mut s| s.take()); - let footage = job.footage; - match salt { - Some(salt) => { - self.disk_salt_job = None; - if let Some(dc) = self.disk_cache.clone() { - self.disk_salt = Some((footage, salt)); - self.layer_cache.set_disk(Some((dc, salt))); - } - false - } - None if finished => { - // The worker stopped without a salt: the disk cache stays off until the next - // edit takes it again. - log::warn!("disk cache: the footage files could not be stamped; the disk cache is off until the next edit"); - self.disk_salt_job = None; - false - } - None => true, - } - } - - /// In-memory identity of the footage settings represented by a disk salt. Workers use the - /// same fingerprint when preparing availability changes without disk access on the UI. - pub(crate) fn footage_fingerprint(project: &effectcraft_project::Project) -> u64 { - use std::hash::{Hash, Hasher}; - let mut h = std::collections::hash_map::DefaultHasher::new(); - for (id, item) in &project.items { - if let effectcraft_project::ItemKind::Footage(f) = &item.kind { - id.hash(&mut h); - format!("{f:?}").hash(&mut h); - } - if let Some(proxy) = &item.proxy { - id.hash(&mut h); - format!("{proxy:?}").hash(&mut h); - } - } - h.finish() - } - /// Set a comp's Resolution. As in After Effects it is saved with the project (which becomes /// modified) but is no undo step, and it changes no pixels: the comp's cached frames stay /// valid ([`effectcraft_project::Comp::same_pixels`]). @@ -322,11 +218,6 @@ impl Session { } self.layer_cache.clear(); self.project = Arc::new(p); - // Its files may have changed since they were last stamped. - self.disk_salt = None; - // A salt still being taken is for the old project's files: dropped, so that the next refresh - // stamps the new project anew (a matching fingerprint would otherwise keep the stale job). - self.disk_salt_job = None; // The set of footage effects read the channels of is sent again, even when it is empty. self.aux_footage = None; self.history = History::default(); @@ -389,11 +280,3 @@ pub fn upgrade_effects(p: &mut Project) { p.next_id = next; p.schema = effectcraft_project::SCHEMA_VERSION; } - -/// A footage salt being taken on a worker thread ([`Session::refresh_disk_salt`]). -pub struct DiskSaltJob { - /// The footage it is taken for ([`Session::footage_fingerprint`]). - footage: u64, - slot: Arc>>, - thread: std::thread::JoinHandle<()>, -} diff --git a/crates/engine/src/settings/session_settings.rs b/crates/engine/src/settings/session_settings.rs index 056616201..b479963ed 100644 --- a/crates/engine/src/settings/session_settings.rs +++ b/crates/engine/src/settings/session_settings.rs @@ -137,10 +137,6 @@ impl Session { // over the store of a roto test running beside it. Serialise them with the roto tests. #[cfg(test)] crate::tests::roto::hold_roto_cache_test_lock(); - // Another setting changed (the disk cache stays as it is): its salt still holds, and - // stamping every footage file again would cost each settings change seconds with large - // sequences. - let kept = self.disk_cache.as_ref().is_some_and(|c| c.folder() == folder.as_path()); let dc = match &self.disk_cache { Some(c) if c.folder() == folder.as_path() => { c.set_max_bytes(max); @@ -165,8 +161,9 @@ impl Session { self.disk_cache = Some(dc.clone()); // The reserve applies from the start (a new folder's watcher is idle). self.poll_disk_space(); - // Attaches the disk cache to the layer cache once the footage salt is known. - self.refresh_disk_salt(!kept); + // Used at once (no file is looked at first: each entry checks the source files it lists + // when it is read, #3184). + self.layer_cache.set_disk(Some(dc.clone())); // Roto Brush / Object Matte segmentations persist there too (held weakly: switching the // disk cache off drops it). let store: std::sync::Arc = dc.clone(); diff --git a/crates/engine/src/tests/disk_cache.rs b/crates/engine/src/tests/disk_cache.rs index 4805d68fe..e2b1544b3 100644 --- a/crates/engine/src/tests/disk_cache.rs +++ b/crates/engine/src/tests/disk_cache.rs @@ -76,11 +76,13 @@ fn disk_cache_settings_persistence_and_invalidation() { assert!(s2.layer_cache.disk().is_none()); } +/// The comp key comes from the project in memory: a footage file that changes on disk doesn't +/// change it (the entries check their own files, #3184); edits that change pixels do. #[test] -fn footage_changes_change_the_salt() { - let dir = folder("salt"); +fn comp_content_keys_come_from_memory() { + let dir = folder("keys"); let mut s = session(&dir); - let foot = std::env::temp_dir().join(format!("effectcraft-salt-{}.png", std::process::id())); + let foot = std::env::temp_dir().join(format!("effectcraft-keys-{}.png", std::process::id())); std::fs::write(&foot, b"one").unwrap(); s.edit("add", None, |p, _| { let f = effectcraft_project::Footage { @@ -108,12 +110,10 @@ fn footage_changes_change_the_salt() { Ok(()) }) .unwrap(); - let a = effectcraft_render::disk_cache::footage_salt(&s.project); - std::fs::write(&foot, b"two, longer").unwrap(); - let b = effectcraft_render::disk_cache::footage_salt(&s.project); - assert_ne!(a, b); let cid = project(&mut s); let k1 = effectcraft_render::disk_cache::comp_content_key(&s.project, cid); + std::fs::write(&foot, b"two, longer").unwrap(); + assert_eq!(effectcraft_render::disk_cache::comp_content_key(&s.project, cid), k1, "no file is looked at"); s.execute("prop.set", json!({"layer": "#1", "path": "transform/opacity", "value": 50})).unwrap(); let k2 = effectcraft_render::disk_cache::comp_content_key(&s.project, cid); assert_ne!(k1, k2); @@ -137,66 +137,51 @@ fn footage_changes_change_the_salt() { assert_ne!(set_proxy(&mut s, false), k3); } -/// The desktop app stamps footage files for the disk cache's salt on a worker thread: importing an -/// After Effects project with thousands of sequence frames on a network share stamped them all -/// inside the import's edit, freezing the UI for half a minute. Until the salt lands the disk -/// cache sits out (keys under the old salt may name other files); a newer footage change -/// supersedes a salt still being taken; a settings change keeps the salt. +/// No salt and no scan (#3184, replacing the background footage salt of #3106): the disk cache +/// is attached to the layer cache as soon as it is switched on, and stays attached through +/// edits that add footage (a large image sequence included), settings changes and opening a +/// project, none of which looks at a single file for it. The first render may use it at once. #[test] -fn footage_salt_is_taken_off_the_ui_thread_and_the_disk_cache_waits_for_it() { - let dir = folder("bg-salt"); +fn the_disk_cache_is_attached_at_once_and_edits_do_no_file_work() { + let dir = folder("attach"); let mut s = session(&dir); - s.disk_salt_background = true; - let at = |n: &str| std::env::temp_dir().join(format!("effectcraft-bg-salt-{}-{n}.png", std::process::id())); - let add = |s: &mut Session, path: &std::path::Path| { - let f = effectcraft_project::Footage { - path: path.to_string_lossy().to_string(), - kind: effectcraft_project::FootageKind::Still, - width: 1, - height: 1, - has_video: true, - ..Default::default() - }; - s.edit("add", None, |p, _| { - p.add_item("f.png", effectcraft_color::Label::None, None, effectcraft_project::ItemKind::Footage(f)); - Ok(()) - }) - .unwrap(); + let dc = s.disk_cache.clone().unwrap(); + let attached = |s: &Session| s.layer_cache.disk().is_some_and(|d| std::sync::Arc::ptr_eq(&d, &dc)); + assert!(attached(&s), "attached at once"); + // A sequence of 5000 frames that don't even exist. + let seq_dir = std::env::temp_dir().join(format!("effectcraft-no-scan-{}", std::process::id())); + let f = effectcraft_project::Footage { + path: seq_dir.join("f_00000.exr").to_string_lossy().to_string(), + kind: effectcraft_project::FootageKind::Sequence, + sequence: (0..5000).map(|i| seq_dir.join(format!("f_{i:05}.exr")).to_string_lossy().to_string()).collect(), + width: 8, + height: 8, + has_video: true, + ..Default::default() }; - let wait = |s: &mut Session| { - let t0 = std::time::Instant::now(); - while s.poll_disk_salt() { - assert!(t0.elapsed().as_secs() < 20, "the salt never landed"); - std::thread::sleep(std::time::Duration::from_millis(5)); - } - }; - assert!(s.layer_cache.disk().is_some(), "attached with its salt"); - std::fs::write(at("a"), b"one").unwrap(); - add(&mut s, &at("a")); - // The edit returned before the files were stamped, and the disk cache waits for the salt. - assert!(s.disk_salt.is_none() && s.layer_cache.disk().is_none()); - // Edits that leave the footage alone don't start over (and may pick up the salt meanwhile). - s.execute("comp.new", json!({"name": "C", "width": 8, "height": 8, "frameRate": 30, "duration": 1})).unwrap(); - let r = s.refresh_disk_salt(false); - assert!(r.is_none() || r == Some(effectcraft_render::disk_cache::footage_salt(&s.project)), "{r:?}"); - // New footage while it is taken: the salt for the newest footage lands. - std::fs::write(at("b"), b"two").unwrap(); - add(&mut s, &at("b")); - wait(&mut s); - let salt = effectcraft_render::disk_cache::footage_salt(&s.project); - assert_eq!(s.disk_salt.map(|(_, salt)| salt), Some(salt)); - assert_eq!(s.refresh_disk_salt(false), Some(salt)); - assert!(s.layer_cache.disk().is_some(), "attached again"); - // Another setting keeps the salt and the disk cache attached. + s.edit("add", None, |p, _| { + p.add_item("seq", effectcraft_color::Label::None, None, effectcraft_project::ItemKind::Footage(f)); + Ok(()) + }) + .unwrap(); + assert!(attached(&s), "an import keeps it attached"); + let cid = project(&mut s); + s.execute("prop.set", json!({"layer": "#1", "path": "transform/opacity", "value": 50})).unwrap(); s.execute_checked("prefs.set", json!({"key": "disk.diskCacheMaxGb", "value": 30})).unwrap(); - assert!(s.layer_cache.disk().is_some() && s.disk_salt.map(|(_, salt)| salt) == Some(salt)); - // Turned off and on again: stamped anew, in the background. + assert!(attached(&s), "edits and other settings keep it attached"); + let same = (*s.project).clone(); + s.replace_project(same, None); + assert!(attached(&s), "opening a project keeps it attached"); + // The first render uses it: a solid reads no file, so nothing is checked either. + s.render(cid, s.time(), RenderOpts::default()); + dc.flush(); + assert!(dc.stats().entries > 0, "written by the first render"); + assert_eq!(dc.file_checks(), 0, "no file looked at for the disk cache"); + // Switched off and on: attached again at once. s.execute_checked("prefs.set", json!({"key": "disk.diskCacheEnabled", "value": false})).unwrap(); + assert!(s.layer_cache.disk().is_none()); s.execute_checked("prefs.set", json!({"key": "disk.diskCacheEnabled", "value": true})).unwrap(); - wait(&mut s); - assert_eq!(s.refresh_disk_salt(false), Some(salt)); - let _ = std::fs::remove_file(at("a")); - let _ = std::fs::remove_file(at("b")); + assert!(s.layer_cache.disk().is_some()); } /// Marker edits keep the disk key (the sound of a playing preview must not wait for frames to @@ -257,39 +242,3 @@ fn protected_markers_with_a_duration_change_the_content_key() { s.execute("markers.set", json!({"comp": inner.0, "index": index, "duration": 2.0})).unwrap(); assert_ne!(key(&s), k1, "its duration"); } - -/// A project opened while a footage salt is still being taken must not keep that salt when it -/// names the same footage: its files may have changed since the worker read them. -#[test] -fn opening_a_project_drops_the_footage_salt_being_taken() { - let dir = folder("bg-salt-open"); - let mut s = session(&dir); - s.disk_salt_background = true; - let path = std::env::temp_dir().join(format!("effectcraft-bg-salt-open-{}.png", std::process::id())); - std::fs::write(&path, b"one").unwrap(); - let f = effectcraft_project::Footage { - path: path.to_string_lossy().to_string(), - kind: effectcraft_project::FootageKind::Still, - width: 1, - height: 1, - has_video: true, - ..Default::default() - }; - s.edit("add", None, |p, _| { - p.add_item("f.png", effectcraft_color::Label::None, None, effectcraft_project::ItemKind::Footage(f)); - Ok(()) - }) - .unwrap(); - // The file changes after the edit started the salt, before the same footage is opened again. - std::fs::write(&path, b"a longer content").unwrap(); - let same = (*s.project).clone(); - s.replace_project(same, None); - let t0 = std::time::Instant::now(); - while s.poll_disk_salt() { - assert!(t0.elapsed().as_secs() < 20, "the salt never landed"); - std::thread::sleep(std::time::Duration::from_millis(5)); - } - let now = effectcraft_render::disk_cache::footage_salt(&s.project); - assert_eq!(s.disk_salt.map(|(_, salt)| salt), Some(now), "the salt reflects the file as it is now"); - let _ = std::fs::remove_file(&path); -} diff --git a/crates/engine/src/tests/sequence.rs b/crates/engine/src/tests/sequence.rs index cf6968e3f..2189a36a8 100644 --- a/crates/engine/src/tests/sequence.rs +++ b/crates/engine/src/tests/sequence.rs @@ -268,30 +268,31 @@ fn dpx_and_cineon_runs_import_as_sequences() { assert_eq!(got, [("plate.[0001-0003].dpx".to_string(), 3), ("scan_[01-02].cin".to_string(), 2)], "{r}"); } -/// #1926: an edit that leaves the footage alone doesn't stamp every frame of its image sequences -/// again for the disk cache's salt (with large sequences each keystroke in a text field took over -/// half a second); Reload Footage does, and so does new footage. +/// #1926, #3184: an edit does no file work at all for the disk cache (it used to stamp every +/// frame of the project's image sequences for a salt; with large sequences each keystroke in a +/// text field took over half a second): the cache stays attached and no file is looked at, after +/// edits, after a frame of the sequence was rewritten, after Reload Footage and new footage. +/// Entries check the files they list when they are read instead. #[test] -fn edits_keep_the_disk_salt_and_reload_stamps_the_files_again() { +fn edits_do_no_disk_cache_file_work() { let dir = folder(&RUN); - let cache = std::env::temp_dir().join(format!("ec-seq-salt-{}", std::process::id())); + let cache = std::env::temp_dir().join(format!("ec-seq-nofiles-{}", std::process::id())); let _ = std::fs::remove_dir_all(&cache); let mut s = session(); s.execute_checked("prefs.set", json!({"values": {"disk.diskCacheFolder": cache.to_string_lossy(), "disk.diskCacheEnabled": true}})).unwrap(); + let dc = s.disk_cache.clone().expect("a disk cache"); + let attached = |s: &Session| s.layer_cache.disk().is_some_and(|d| std::sync::Arc::ptr_eq(&d, &dc)); s.execute("comp.new", json!({"name": "C", "width": 64, "height": 32, "frameRate": 30, "duration": 1})).unwrap(); let r = s.execute("file.import", json!({"paths": [at(&dir, "shot_0002.png")], "sequence": true, "addToComp": true})).unwrap(); let item = r["items"][0].clone(); - let salt = s.refresh_disk_salt(false).expect("a disk cache"); // A frame rewritten in place: same footage settings, another size on disk. std::fs::write(at(&dir, "shot_0004.png"), b"a new render of this frame").unwrap(); s.execute("layer.newText", json!({"text": "title"})).unwrap(); s.execute("layer.setText", json!({"text": "title 2"})).unwrap(); - assert_eq!(s.refresh_disk_salt(false), Some(salt), "edits don't stamp the files again"); s.execute("file.reloadFootage", json!({"items": [item]})).unwrap(); - let reloaded = s.refresh_disk_salt(false).unwrap(); - assert_ne!(reloaded, salt, "Reload Footage stamps them again"); std::fs::write(at(&dir, "extra.png"), b"").unwrap(); s.execute("file.import", json!({"paths": [at(&dir, "extra.png")]})).unwrap(); - assert_ne!(s.refresh_disk_salt(false), Some(reloaded), "new footage counts"); + assert!(attached(&s), "attached all along"); + assert_eq!(dc.file_checks(), 0, "no file looked at for the disk cache"); let _ = std::fs::remove_dir_all(&cache); } diff --git a/crates/media/src/reads/tests.rs b/crates/media/src/reads/tests.rs index 8fee7d211..5dae8415a 100644 --- a/crates/media/src/reads/tests.rs +++ b/crates/media/src/reads/tests.rs @@ -189,3 +189,202 @@ fn a_frame_served_from_memory_reports_its_files_without_touching_them() { assert_eq!(from_pool, first); assert_eq!(crate::opens_under(&dir), opened, "nothing was opened on disk"); } + +// ---------------------------------------------------------------- layer entries on disk (#3184) + +use std::sync::Arc; + +use effectcraft_render::disk_cache::{DiskCache, Kind}; + +/// A "session": a new media pool and layer cache over the disk cache in `cache` (opened anew, +/// as after a restart), writing every layer buffer however quick to render. +fn session(cache: &Path) -> (MediaPool, LayerCache, Arc) { + let dc = DiskCache::open(cache, 1 << 30).unwrap(); + dc.set_min_layer_ms(0); + let lc = LayerCache::default(); + lc.set_disk(Some(dc.clone())); + (MediaPool::new(), lc, dc) +} + +/// Give `path` a later modification time, so a rewrite within the clock's resolution counts. +fn touch_later(path: &Path) { + let t = std::fs::metadata(path).unwrap().modified().unwrap() + std::time::Duration::from_secs(7); + std::fs::File::options().append(true).open(path).unwrap().set_modified(t).unwrap(); +} + +/// Two still plates (the upper one at half opacity, so both show), and a 5000-frame sequence +/// in the project that no layer uses (its files don't even exist). +fn plates(dir: &Path) -> (Project, ItemId, PathBuf) { + let mut p = Project::default(); + let c = comp(); + let a = dir.join("a.png"); + let mut top = footage_layer(&mut p, &c, "A", still(&a, 60)); + top.props.prop_mut("transform/opacity").unwrap().value = Value::Scalar(50.0); + let bottom = footage_layer(&mut p, &c, "B", still(&dir.join("b.png"), 200)); + let unused = dir.join("unused"); + let seq = Footage { + kind: FootageKind::Sequence, + sequence: (0..5000).map(|i| unused.join(format!("big_{i:05}.exr")).to_string_lossy().to_string()).collect(), + frame_rate: RATE, + width: SIZE.0, + height: SIZE.1, + has_video: true, + ..Default::default() + }; + p.add_item("Unused", Label::Aqua, None, ItemKind::Footage(seq)); + let cid = add_comp(&mut p, "C", c, vec![top, bottom]); + (p, cid, a) +} + +/// Correct and no scan: after a restart, only the layer buffer whose source file changed is +/// rendered again (only that file is opened); the other comes from disk with its file list, so +/// the frame's list is complete again (its frame entry can be stored). The disk cache checks +/// exactly the files its entries list, never the unused sequence. The re-rendered buffer +/// replaces its entry: the next restart opens nothing. +#[test] +fn a_changed_file_renders_only_the_layer_buffers_that_read_it_again() { + let dir = folder("layer-disk"); + let (src, cache) = (dir.join("src"), dir.join("cache")); + std::fs::create_dir_all(&src).unwrap(); + let (p, cid, a) = plates(&src); + let (pool, lc, dc) = session(&cache); + let (px, files) = render(&p, &pool, &lc, cid, 0); + assert!(files.is_complete() && files.len() == 2, "{:?}", paths(&files)); + dc.flush(); + let entries = dc.keys(Kind::Layer).len(); + assert!(entries >= 2, "both plates' buffers are on disk: {entries}"); + drop((pool, lc, dc)); + + // Restart without a change: everything from disk, nothing opened, a complete list. + let (pool, lc, dc) = session(&cache); + let opened = crate::opens_under(&src); + let (again, files_again) = render(&p, &pool, &lc, cid, 0); + assert_eq!(again, px); + assert_eq!(files_again, files, "the files of the entries, as they were read"); + assert!(files_again.is_complete(), "a frame made of buffers from disk can be stored"); + assert_eq!(crate::opens_under(&src), opened, "nothing opened"); + let checks = dc.file_checks(); + assert!(checks >= 2 && checks as usize <= entries, "one check per entry used: {checks} of {entries}"); + drop((pool, lc, dc)); + + // a.png gets new pixels: only the top plate renders again. + png(&a, 120); + touch_later(&a); + let (pool, lc, dc) = session(&cache); + let opened = crate::opens_under(&src); + let (changed, files_changed) = render(&p, &pool, &lc, cid, 0); + assert_ne!(changed, px, "the new pixels show"); + assert_eq!(crate::opens_under(&src) - opened, 1, "only the changed file is read"); + assert!(files_changed.is_complete() && files_changed.len() == 2); + assert_stamps_match_disk(&files_changed); + assert!(dc.file_checks() as usize <= entries, "only listed files are checked"); + assert_eq!(crate::opens_under(&src.join("unused")), 0); + dc.flush(); + drop((pool, lc, dc)); + + // Its entry was replaced: the next restart opens nothing and shows the new pixels. + let (pool, lc, _dc) = session(&cache); + let opened = crate::opens_under(&src); + let (last, _) = render(&p, &pool, &lc, cid, 0); + assert_eq!(last, changed); + assert_eq!(crate::opens_under(&src), opened, "both from disk"); + let _ = std::fs::remove_dir_all(&dir); +} + +/// Two projects whose footage items have the same ids but name different files never share a +/// layer entry: the layer key names the item's path and settings. +#[test] +fn projects_with_the_same_item_ids_never_share_a_layer_entry() { + let dir = folder("layer-disk-projects"); + let (src, cache) = (dir.join("src"), dir.join("cache")); + std::fs::create_dir_all(&src).unwrap(); + let mut p = Project::default(); + let c = comp(); + let layer = footage_layer(&mut p, &c, "Plate", still(&src.join("one.png"), 40)); + let LayerSource::Footage { item } = layer.source else { panic!("a footage layer") }; + let cid = add_comp(&mut p, "C", c, vec![layer]); + let mut other = p.clone(); + other.item_mut(item).unwrap().kind = ItemKind::Footage(still(&src.join("two.png"), 220)); + let (pool, lc, dc) = session(&cache); + let (one, _) = render(&p, &pool, &lc, cid, 0); + dc.flush(); + drop((pool, lc, dc)); + let (pool, lc, dc) = session(&cache); + let hits = dc.stats().hits; + let (two, files) = render(&other, &pool, &lc, cid, 0); + assert!((two[0] - 220.0 / 255.0).abs() < 0.01, "the other project's own file shows: {two:?}"); + assert_ne!(two, one); + assert_eq!(dc.stats().hits, hits, "no entry of the first project is used"); + assert_eq!(paths(&files), [src.join("two.png").to_string_lossy().to_string()]); + let _ = std::fs::remove_dir_all(&dir); +} + +/// Safe: a damaged layer entry, a source file that is missing, one replaced by something +/// unreadable (a folder), and one back with other pixels never serve a stale buffer after a +/// restart; the damaged entry is rendered again, replaced and then used. +#[test] +fn missing_unreadable_files_and_damaged_layer_entries_never_serve_stale_buffers() { + let dir = folder("layer-disk-safe"); + let (src, cache) = (dir.join("src"), dir.join("cache")); + std::fs::create_dir_all(&src).unwrap(); + let mut p = Project::default(); + let c = comp(); + let path = src.join("plate.png"); + let layer = footage_layer(&mut p, &c, "Plate", still(&path, 90)); + let cid = add_comp(&mut p, "C", c, vec![layer]); + let (pool, lc, dc) = session(&cache); + let (shown, _) = render(&p, &pool, &lc, cid, 0); + assert!(shown[3] > 0.99, "the plate shows: {shown:?}"); + dc.flush(); + drop((pool, lc, dc)); + + // A damaged entry: a miss, deleted, rendered again and stored anew. + let layers = cache.join("v1").join(Kind::Layer.dir()); + for shard in std::fs::read_dir(&layers).unwrap().flatten() { + for f in std::fs::read_dir(shard.path()).unwrap().flatten() { + let mut d = std::fs::read(f.path()).unwrap(); + let n = d.len() / 2; + d[n] ^= 0x5a; + std::fs::write(f.path(), d).unwrap(); + } + } + let (pool, lc, dc) = session(&cache); + let opened = crate::opens_under(&src); + let (again, files) = render(&p, &pool, &lc, cid, 0); + assert_eq!(again, shown); + assert_eq!(crate::opens_under(&src) - opened, 1, "read again, not served from the damaged entry"); + assert!(files.is_complete()); + dc.flush(); + drop((pool, lc, dc)); + let (pool, lc, dc) = session(&cache); + let hits = dc.stats().hits; + assert_eq!(render(&p, &pool, &lc, cid, 0).0, shown); + assert!(dc.stats().hits > hits, "the rewritten entry is used"); + drop((pool, lc, dc)); + + // The file is gone: not the old plate. + std::fs::remove_file(&path).unwrap(); + let (pool, lc, dc) = session(&cache); + let hits = dc.stats().hits; + let (gone, files) = render(&p, &pool, &lc, cid, 0); + assert!(gone[3] < 0.01, "a missing file shows nothing, never the cached plate: {gone:?}"); + assert_eq!(dc.stats().hits, hits); + assert!(files.files().iter().all(|f| f.stamp == FileStamp::Missing), "{files:?}"); + dc.flush(); + drop((pool, lc, dc)); + + // Something unreadable at its path (a folder): still not the old plate. + std::fs::create_dir(&path).unwrap(); + let (pool, lc, _dc) = session(&cache); + let (unreadable, _) = render(&p, &pool, &lc, cid, 0); + assert!(unreadable[3] < 0.01, "{unreadable:?}"); + std::fs::remove_dir(&path).unwrap(); + + // Back with other pixels: those show, not the entry made of the old file. + png(&path, 240); + touch_later(&path); + let (pool, lc, _dc) = session(&cache); + let (back, _) = render(&p, &pool, &lc, cid, 0); + assert!((back[0] - 240.0 / 255.0).abs() < 0.01, "{back:?}"); + let _ = std::fs::remove_dir_all(&dir); +} diff --git a/crates/render/src/cache.rs b/crates/render/src/cache.rs index 79b948b89..22c0ebf7f 100644 --- a/crates/render/src/cache.rs +++ b/crates/render/src/cache.rs @@ -24,6 +24,7 @@ use std::sync::{Arc, Mutex}; use effectcraft_effects::Buf; use effectcraft_project::{FootageKind, ItemKind, Layer, LayerSource, Node, PropGroup}; +use crate::disk_cache::{EntryFiles, SharedVirtualFileId, VirtualFileId, layer_disk_key}; use crate::eval::EvalCtx; use crate::reads::ReadFiles; @@ -31,13 +32,17 @@ mod dependencies; /// Thread-safe, memory-budgeted cache of processed layer buffers, optionally backed by the /// persistent [`DiskCache`](crate::disk_cache::DiskCache): a memory miss reads the disk, and -/// buffers that were slow to render are written there (keys salted per project, see -/// [`LayerCache::set_disk`]). +/// buffers that were slow to render are written there with the source files they were made of +/// (keys: [`crate::disk_cache::layer_disk_key`]; an entry is used only while its files are +/// unchanged, #3184). pub struct LayerCache { inner: Mutex, - disk: Mutex, u64)>>, + disk: Mutex>>, /// Another persistent store when there is no disk cache (the browser's, [`PrefetchStore`]). - store: Mutex, u64)>>, + store: Mutex>>, + /// Size and content hash of files served from memory (the browser file table), to store + /// and check the source files of persistent entries. + virtual_id: Mutex>, /// While set, inserts are dropped (see [`LayerCache::set_gate`]). gate: Mutex>>, } @@ -83,6 +88,7 @@ impl LayerCache { inner: Mutex::new(Inner { map: HashMap::new(), bytes: 0, budget, clock: 0, hits: 0, misses: 0, missed_at: HashMap::new() }), disk: Mutex::new(None), store: Mutex::new(None), + virtual_id: Mutex::new(None), gate: Mutex::new(None), } } @@ -101,58 +107,49 @@ impl LayerCache { self.gate.lock().ok().and_then(|g| g.as_ref().map(|g| g.load(std::sync::atomic::Ordering::Relaxed))).unwrap_or(false) } - /// Attach (or detach) the disk cache. `salt` separates projects and footage versions (see - /// `footage_salt`); keys on disk are `(salt, key)`. - pub fn set_disk(&self, disk: Option<(Arc, u64)>) { + /// Attach (or detach) the disk cache. It is used at once: its entries check their own + /// source files when read, so nothing has to be looked at first. + pub fn set_disk(&self, disk: Option>) { if let Ok(mut d) = self.disk.lock() { *d = disk; } } - /// Change the disk salt (after footage changed) keeping the attached disk cache. - pub fn set_disk_salt(&self, salt: u64) { - if let Ok(mut d) = self.disk.lock() - && let Some((_, s)) = d.as_mut() - { - *s = salt; - } - } - pub fn disk(&self) -> Option> { - self.disk.lock().ok()?.as_ref().map(|d| d.0.clone()) + self.disk.lock().ok()?.clone() } /// Attach (or detach) a [`LayerStore`] used when no disk cache is attached (the browser's - /// Origin Private File System through a [`PrefetchStore`]); `salt` as in - /// [`LayerCache::set_disk`]. - pub fn set_store(&self, store: Option<(Arc, u64)>) { + /// Origin Private File System through a [`PrefetchStore`]). + pub fn set_store(&self, store: Option>) { if let Ok(mut s) = self.store.lock() { *s = store; } } - /// Change the store's salt (a new project or footage), keeping the store. - pub fn set_store_salt(&self, salt: u64) { - if let Ok(mut d) = self.store.lock() - && let Some((_, s)) = d.as_mut() - { - *s = salt; + /// Size and content hash of files served from memory (the browser file table): what a + /// persistent entry keeps for them and checks them against. + pub fn set_virtual_id(&self, id: Option) { + if let Ok(mut v) = self.virtual_id.lock() { + *v = id; } } - fn disk_key(&self, key: u64) -> Option<(Arc, u128)> { - let salted = |salt: u64| ((salt as u128) << 64) | key as u128; - if let Some((dc, salt)) = self.disk.lock().ok()?.as_ref() { - return Some((dc.clone() as Arc, salted(*salt))); + fn virtual_id(&self) -> Option { + self.virtual_id.lock().ok()?.clone() + } + + /// The persistent store behind the memory: the disk cache, else the other store. + fn persistent(&self) -> Option> { + if let Some(dc) = self.disk.lock().ok()?.as_ref() { + return Some(dc.clone() as Arc); } - let s = self.store.lock().ok()?; - let (st, salt) = s.as_ref()?; - Some((st.clone(), salted(*salt))) + self.store.lock().ok()?.clone() } /// The buffer kept under `key` and the source files it was made of (see [`crate::reads`]). - /// A buffer from the disk cache or another store doesn't know its files: its list is - /// incomplete. + /// A buffer from the disk cache or another store comes with the files its entry lists, after + /// they were found unchanged. pub fn get(&self, key: u64) -> Option<(Arc, Arc)> { let mut g = self.inner.lock().ok()?; g.clock += 1; @@ -172,10 +169,9 @@ impl LayerCache { g.missed_at.insert(key, web_time::Instant::now()); drop(g); // Disk cache: a hit comes back into memory. - let (dc, dk) = self.disk_key(key)?; - let buf = dc.get_layer(dk)?; - let mut files = ReadFiles::default(); - files.mark_incomplete(); + let store = self.persistent()?; + let id = self.virtual_id(); + let (buf, files) = store.get_layer(layer_disk_key(key), id.as_deref())?; let files = Arc::new(files); Some((self.insert_mem(key, buf, files.clone()), files)) } @@ -188,7 +184,7 @@ impl LayerCache { /// and packs it once instead of once per worker, which ran it out of memory). Renders don't /// wait for each other: on the frame workers' shared thread pool a wait can end up under /// the very work it waits for. `files`: the source files `buf` was made of (see - /// [`crate::reads`]). + /// [`crate::reads`]); a buffer whose files can't all be named stays in memory. pub fn insert(&self, key: u64, buf: Arc, files: Arc) -> Arc { if self.gated() { return buf; @@ -197,10 +193,12 @@ impl LayerCache { return kept; } let started = self.inner.lock().ok().and_then(|mut g| g.missed_at.remove(&key)); - if let Some((dc, dk)) = self.disk_key(key) { - let slow = started.is_some_and(|t| t.elapsed().as_secs_f64() * 1e3 >= dc.min_layer_ms() as f64); - if slow { - dc.put_layer(dk, &buf); + if let Some(store) = self.persistent() { + let slow = started.is_some_and(|t| t.elapsed().as_secs_f64() * 1e3 >= store.min_layer_ms() as f64); + let id = self.virtual_id(); + // (an incomplete list, or a file from memory without its identity: not stored) + if slow && let Some(entry) = EntryFiles::of(&files, id.as_deref()) { + store.put_layer(layer_disk_key(key), &buf, &entry); } } self.insert_mem(key, buf, files) @@ -274,12 +272,16 @@ impl LayerCache { } } -/// Persistent storage of layer buffers behind a [`LayerCache`] (keys salted per project). +/// Persistent storage of layer buffers behind a [`LayerCache`] (keys: +/// [`crate::disk_cache::layer_disk_key`]). Every entry keeps the source files its buffer was made +/// of and is used only while they are unchanged (#3184). pub trait LayerStore: Send + Sync { - /// A stored buffer (synchronous: mid-render). - fn get_layer(&self, key: u128) -> Option>; - /// Keep a buffer that was slow to render. - fn put_layer(&self, key: u128, buf: &Buf); + /// A stored buffer whose source files are unchanged, with those files (synchronous: + /// mid-render). An entry whose files changed, or damaged, is a miss and is dropped, so the + /// buffer rendered again replaces it. `virtual_id` names files served from memory. + fn get_layer(&self, key: u128, virtual_id: Option>) -> Option<(Arc, ReadFiles)>; + /// Keep a buffer that was slow to render, with the source files it was made of. + fn put_layer(&self, key: u128, buf: &Buf, files: &EntryFiles); /// Buffers faster to render than this (ms) are not stored. fn min_layer_ms(&self) -> u64 { 0 @@ -291,9 +293,10 @@ pub const PREFETCH_MIN_LAYER_MS: u64 = 20; /// A [`LayerStore`] over storage that can't be read in the middle of a render (the browser's /// Origin Private File System, read asynchronously). Lookups are served from buffers fetched -/// before the frame ([`PrefetchStore::provide`]); the keys a render looked up and didn't find -/// are recorded ([`PrefetchStore::take_misses`]) so the transport can fetch them before the next -/// frame; buffers to store queue up as sealed entries ([`PrefetchStore::take_writes`]) for the +/// before the frame ([`PrefetchStore::provide`]), once the files their entries list are found +/// unchanged; the keys a render looked up and didn't find are recorded +/// ([`PrefetchStore::take_misses`]) so the transport can fetch them before the next frame; +/// buffers to store queue up as sealed entries ([`PrefetchStore::take_writes`]) for the /// transport to write after the frame. Fetched buffers are kept least recently used first, up /// to a byte budget. pub struct PrefetchStore { @@ -302,9 +305,20 @@ pub struct PrefetchStore { min_ms: u64, } +/// A fetched entry: the buffer, the source files it was made of, its last use. +struct Fetched { + buf: Arc, + files: Arc, + used: u64, +} + +fn buf_bytes(b: &Buf) -> usize { + b.img.data.len().saturating_mul(std::mem::size_of::()) +} + #[derive(Default)] struct Prefetched { - ready: HashMap, u64)>, + ready: HashMap, bytes: usize, clock: u64, misses: Vec, @@ -314,6 +328,20 @@ struct Prefetched { known: std::collections::HashSet, } +impl Prefetched { + fn note_miss(&mut self, key: u128) { + if !self.misses.contains(&key) && self.misses.len() < 1024 { + self.misses.push(key); + } + } + + fn remove(&mut self, key: u128) { + if let Some(f) = self.ready.remove(&key) { + self.bytes = self.bytes.saturating_sub(buf_bytes(&f.buf)); + } + } +} + impl Default for PrefetchStore { fn default() -> Self { PrefetchStore::new(256 << 20) @@ -337,23 +365,21 @@ impl PrefetchStore { } /// A fetched entry (sealed bytes, [`crate::disk_cache::layer_entry`]) for `key`; `false` - /// when damaged. + /// when damaged or of another format. Its files are checked when the buffer is used. pub fn provide(&self, key: u128, entry: &[u8]) -> bool { - let Some(buf) = crate::disk_cache::read_layer_entry(entry) else { return false }; - let bytes = buf.img.data.len() * std::mem::size_of::(); + let Some((buf, files)) = crate::disk_cache::read_layer_entry(entry) else { return false }; + let buf = Arc::new(buf); + let bytes = buf_bytes(&buf); let Ok(mut s) = self.st.lock() else { return false }; s.clock += 1; - let now = s.clock; - if let Some((old, _)) = s.ready.insert(key, (Arc::new(buf), now)) { - s.bytes -= old.img.data.len() * std::mem::size_of::(); - } - s.bytes += bytes; + let used = s.clock; + s.remove(key); + s.ready.insert(key, Fetched { buf, files: Arc::new(files), used }); + s.bytes = s.bytes.saturating_add(bytes); s.known.insert(key); while s.bytes > self.budget { - let Some((&k, _)) = s.ready.iter().min_by_key(|(_, (_, t))| *t) else { break }; - if let Some((b, _)) = s.ready.remove(&k) { - s.bytes -= b.img.data.len() * std::mem::size_of::(); - } + let Some(oldest) = s.ready.iter().min_by_key(|(_, f)| f.used).map(|(k, _)| *k) else { break }; + s.remove(oldest); } true } @@ -382,32 +408,44 @@ impl PrefetchStore { } impl LayerStore for PrefetchStore { - fn get_layer(&self, key: u128) -> Option> { + fn get_layer(&self, key: u128, virtual_id: Option>) -> Option<(Arc, ReadFiles)> { + let found = { + let mut s = self.st.lock().ok()?; + s.clock += 1; + let now = s.clock; + match s.ready.get_mut(&key) { + Some(f) => { + f.used = now; + Some((f.buf.clone(), f.files.clone())) + } + None => { + s.note_miss(key); + None + } + } + }; + let (buf, files) = found?; + // (looked at without the lock: one call of the hook, or one `metadata`, per file) + let unchanged = files.unchanged(virtual_id); let mut s = self.st.lock().ok()?; - s.clock += 1; - let now = s.clock; - match s.ready.get_mut(&key) { - Some((b, t)) => { - *t = now; - let b = b.clone(); - if !s.hits.contains(&key) { - s.hits.push(key); - } - Some(b) - } - None => { - if !s.misses.contains(&key) && s.misses.len() < 1024 { - s.misses.push(key); - } - None - } + if !unchanged { + // Made of files that changed since: forgotten, so the buffer rendered again is + // written over its entry. + s.remove(key); + s.known.remove(&key); + s.note_miss(key); + return None; } + if !s.hits.contains(&key) { + s.hits.push(key); + } + Some((buf, files.to_read_files())) } - fn put_layer(&self, key: u128, buf: &Buf) { + fn put_layer(&self, key: u128, buf: &Buf, files: &EntryFiles) { let Ok(mut s) = self.st.lock() else { return }; if s.known.insert(key) { - s.writes.push((key, crate::disk_cache::layer_entry(buf))); + s.writes.push((key, crate::disk_cache::layer_entry(buf, files))); } } @@ -800,4 +838,47 @@ mod shared_insert_tests { assert!(Arc::ptr_eq(&cache.insert(3, b, Default::default()), &a), "the later render gets the first buffer"); assert!(Arc::ptr_eq(&cache.get(3).unwrap().0, &a)); } + + /// The browser's store (#3184): a fetched entry is used only while the files it lists are + /// unchanged (here from memory, through the hook), and comes with them; one made of files + /// that changed is dropped and counts as a miss, so the buffer rendered again is queued over + /// it. A buffer whose files can't all be named is not queued at all. + #[test] + fn the_prefetch_store_checks_the_files_of_its_entries() { + use super::{LayerStore, PrefetchStore}; + use crate::disk_cache::{EntryFiles, layer_disk_key, layer_entry}; + use crate::reads::{FileStamp, ReadFile, ReadFiles}; + let buf = || Buf { img: Image::new(2, 2), offset: [0.0; 2], scale: 1.0 }; + let files: ReadFiles = [ReadFile::new("/v.png", FileStamp::Virtual)].into_iter().collect(); + let (one, two) = (|_: &str| Some((3, 1)), |_: &str| Some((3, 2))); + let entry = layer_entry(&buf(), &EntryFiles::of(&files, Some(&one)).unwrap()); + let store = PrefetchStore::new(1 << 20).with_min_ms(0); + assert!(store.provide(5, &entry)); + assert!(!store.provide(6, b"damaged")); + let (_, got) = store.get_layer(5, Some(&one)).unwrap(); + assert_eq!(got, files); + assert_eq!(store.take_hits(), [5]); + // The file changed: a miss, forgotten, and the new buffer is queued over it. + assert!(store.get_layer(5, Some(&two)).is_none()); + assert!(!store.has(5)); + assert_eq!(store.take_misses(), [5]); + store.put_layer(5, &buf(), &EntryFiles::of(&files, Some(&two)).unwrap()); + assert_eq!(store.take_writes().len(), 1, "written over the changed entry"); + // Through the layer cache: a hit reports its files; incomplete lists are not queued. + let cache = LayerCache::default(); + let store = Arc::new(PrefetchStore::new(1 << 20).with_min_ms(0)); + cache.set_store(Some(store.clone())); + cache.set_virtual_id(Some(Arc::new(one))); + assert!(store.provide(layer_disk_key(9), &entry)); + let (_, from_store) = cache.get(9).unwrap(); + assert!(*from_store == files && from_store.is_complete()); + let mut incomplete = files.clone(); + incomplete.mark_incomplete(); + assert!(cache.get(10).is_none()); + cache.insert(10, Arc::new(buf()), Arc::new(incomplete)); + assert!(cache.get(11).is_none()); + cache.insert(11, Arc::new(buf()), Arc::new(files.clone())); + let written: Vec = store.take_writes().into_iter().map(|w| w.0).collect(); + assert_eq!(written, [layer_disk_key(11)], "only the buffer whose files are all named"); + } } diff --git a/crates/render/src/disk_cache.rs b/crates/render/src/disk_cache.rs index 0a91f11ac..93c949ff2 100644 --- a/crates/render/src/disk_cache.rs +++ b/crates/render/src/disk_cache.rs @@ -4,18 +4,19 @@ //! * Entries are files keyed by a 128-bit content hash (`/v1//<2 hex>/<32 hex>.ecc`): //! frames by the hash of the composition's content as it is in memory (the comp and everything //! it uses, footage items with their settings and paths; no file is looked at) plus frame, -//! scale and view; layer buffers by the layer cache's content key salted with the project's -//! footage fingerprint. A changed project therefore never reads stale pixels: its keys simply +//! scale and view; layer buffers by the layer cache's content key (which names the footage +//! items a buffer uses with their settings and paths) and the renderer version +//! ([`layer_disk_key`]). A changed project therefore never reads stale pixels: its keys simply //! change. -//! * A frame entry keeps the source files the frame was made of, each with the size and +//! * Frame and layer entries keep the source files they were made of, each with the size and //! modification time it was read with ([`EntryFiles`], #3184). An entry is used only while -//! those files are unchanged: a handful of `metadata` calls when the frame is read, never a -//! scan of the project's files. A frame whose files can't all be named is not stored. +//! those files are unchanged: a handful of `metadata` calls when it is read, never a scan of +//! the project's files. A frame or buffer whose files can't all be named is not stored. //! * Payloads are LZ4-compressed (`lz4_flex`, MIT): frames as 8-bit premultiplied RGBA (or, for //! 32 bpc viewer frames, half-float RGBA with the bytes shuffled into planes; the entry //! header's format byte tells them apart: 2 and 3, both with their source files first), layer -//! buffers as `f32` RGBA with the bytes shuffled into planes (exact, so cached and fresh -//! renders are bit-identical), Roto Brush / Object Matte segmentations as +//! buffers (format 4, their source files first) as `f32` RGBA with the bytes shuffled into +//! planes (exact, so cached and fresh renders are bit-identical), Roto Brush / Object Matte segmentations as //! `FrameSeg::to_bytes` (keyed by their content-keyed chain key and scale, so they are //! reused whenever the same frames, settings and prompt come back, also after a restart). Every file ends in a checksum; damaged files read as misses and //! are deleted. @@ -97,13 +98,16 @@ pub struct FrameF16 { pub rgba: Vec, } -/// The entry header's format byte: layer buffers and segmentations (and 8-bit frames before +/// The entry header's format byte: segmentations (and 8-bit frames and layer buffers before /// #3184). const FORMAT_RGBA8: u8 = 0; /// Frame entries: their source files ([`EntryFiles`]), then 8-bit or half-float pixels. The /// formats before them (0: 8-bit, 1: half float, without files) read as misses and are deleted. const FORMAT_RGBA8_FILES: u8 = 2; const FORMAT_F16_FILES: u8 = 3; +/// Layer entries: their source files ([`EntryFiles`]), then the buffer. The format before it +/// (0, without files) reads as a miss and is deleted. +const FORMAT_LAYER_FILES: u8 = 4; /// Counters for tests, the Info panel and `cache.diskStats`. #[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] @@ -234,7 +238,7 @@ pub struct LayerPrefetch { const PREFETCH_RECENT: usize = 512; impl LayerPrefetch { - /// A frame's layer-cache misses (salted keys). + /// A frame's layer-cache misses (disk keys, [`layer_disk_key`]). pub fn note_misses(&mut self, keys: impl IntoIterator) { for k in keys { self.recent.retain(|x| *x != k); @@ -300,7 +304,7 @@ pub struct DiskCache { evictions: AtomicU64, dropped: AtomicU64, failed: AtomicU64, - /// Source files looked at to check frame entries ([`DiskCache::file_checks`]). + /// Source files looked at to check frame and layer entries ([`DiskCache::file_checks`]). file_checks: AtomicU64, tmp_counter: AtomicU64, queue: Arc<(Mutex, Condvar)>, @@ -597,41 +601,50 @@ impl DiskCache { } } - /// A frame entry of `format` whose source files are unchanged, decoded by `decode`, with - /// those files. An entry whose files changed, of the format before #3184, or damaged, is a - /// miss and is deleted (the frame renders again and is stored anew). An entry of the other - /// current format (8-bit and half-float frames have keys of their own) is a miss and stays. - fn get_checked(&self, key: u128, format: u8, virtual_id: Option>, decode: impl FnOnce(&[u8]) -> Option) -> Option<(T, ReadFiles)> { + /// An entry of `kind` and `format` whose source files are unchanged, decoded by `decode`, + /// with those files. An entry whose files changed, of the format before #3184, or damaged, + /// is a miss and is deleted (it renders again and is stored anew). A frame entry of the + /// other current frame format (8-bit and half-float frames have keys of their own) is a miss + /// and stays. + fn get_checked( + &self, + kind: Kind, + key: u128, + format: u8, + virtual_id: Option>, + decode: impl FnOnce(&[u8]) -> Option, + ) -> Option<(T, ReadFiles)> { let miss = || { self.misses.fetch_add(1, Ordering::Relaxed); None }; - let Some((found, payload)) = self.load(Kind::Frame, key) else { return miss() }; + let Some((found, payload)) = self.load(kind, key) else { return miss() }; if found != format { - if found != FORMAT_RGBA8_FILES && found != FORMAT_F16_FILES { - self.discard(Kind::Frame, key); + let other_frame_format = kind == Kind::Frame && (found == FORMAT_RGBA8_FILES || found == FORMAT_F16_FILES); + if !other_frame_format { + self.discard(kind, key); } return miss(); } - let Some((files, pixels)) = EntryFiles::decode(&payload) else { - self.discard(Kind::Frame, key); + let Some((files, body)) = EntryFiles::decode(&payload) else { + self.discard(kind, key); return miss(); }; self.file_checks.fetch_add(files.len() as u64, Ordering::Relaxed); if !files.unchanged(virtual_id) { - self.discard(Kind::Frame, key); + self.discard(kind, key); return miss(); } - let Some(frame) = decode(pixels) else { - self.discard(Kind::Frame, key); + let Some(value) = decode(body) else { + self.discard(kind, key); return miss(); }; - self.hit(Kind::Frame, key); - Some((frame, files.to_read_files())) + self.hit(kind, key); + Some((value, files.to_read_files())) } - /// Source files looked at so far to check frame entries before using them (one per file a - /// read frame lists; tests). + /// Source files looked at so far to check frame and layer entries before using them (one per + /// file a read entry lists; tests). pub fn file_checks(&self) -> u64 { self.file_checks.load(Ordering::Relaxed) } @@ -685,10 +698,6 @@ impl DiskCache { } /// Write an entry now (atomic rename), then evict down to the limit. - fn write_now(&self, kind: Kind, key: u128, payload: &[u8]) { - self.write_format(kind, key, FORMAT_RGBA8, payload); - } - fn write_format(&self, kind: Kind, key: u128, format: u8, payload: &[u8]) { if self.contains(kind, key) { return; @@ -749,12 +758,12 @@ impl DiskCache { /// those files; `None` for a half-float entry of that key, which /// [`DiskCache::get_frame_f16`] reads. `virtual_id` names files served from memory. pub fn get_frame(&self, key: u128, virtual_id: Option>) -> Option<(Frame8, ReadFiles)> { - self.get_checked(key, FORMAT_RGBA8_FILES, virtual_id, decode_frame) + self.get_checked(Kind::Frame, key, FORMAT_RGBA8_FILES, virtual_id, decode_frame) } /// A half-float frame (32 bpc viewer frames), as [`DiskCache::get_frame`]. pub fn get_frame_f16(&self, key: u128, virtual_id: Option>) -> Option<(FrameF16, ReadFiles)> { - self.get_checked(key, FORMAT_F16_FILES, virtual_id, decode_frame_f16) + self.get_checked(Kind::Frame, key, FORMAT_F16_FILES, virtual_id, decode_frame_f16) } /// Queue a half-float frame for writing (`width * height * 4` binary16 values) with the @@ -786,22 +795,28 @@ impl DiskCache { self.contains(Kind::Frame, key) || self.enqueue_format(Kind::Frame, key, FORMAT_RGBA8_FILES, with_files(&files, encode_frame(width, height, rgba))) } - pub fn get_layer(&self, key: u128) -> Option { - let p = self.read(Kind::Layer, key)?; - decode_layer(&p) + /// A layer buffer (key: [`layer_disk_key`]) whose source files are unchanged, with those + /// files, as [`DiskCache::get_checked`]: an entry whose files changed, damaged, or of the + /// format before #3184 is a miss and is deleted, so the buffer renders again and replaces it. + /// `virtual_id` names files served from memory. + pub fn get_layer(&self, key: u128, virtual_id: Option>) -> Option<(Buf, ReadFiles)> { + self.get_checked(Kind::Layer, key, FORMAT_LAYER_FILES, virtual_id, decode_layer) } - /// Queue a layer buffer for writing. - pub fn put_layer(&self, key: u128, buf: &Buf) { + /// Queue a layer buffer for writing with the source files it was made of (see + /// [`EntryFiles::of`]: a buffer whose files can't all be named must not be stored). + pub fn put_layer(&self, key: u128, buf: &Buf, files: &EntryFiles) { if self.contains(Kind::Layer, key) { return; } - let _ = self.enqueue(Kind::Layer, key, encode_layer(buf)); + let _ = self.enqueue_format(Kind::Layer, key, FORMAT_LAYER_FILES, with_files(files, encode_layer(buf))); } - /// Write a layer buffer synchronously (tests). - pub fn put_layer_now(&self, key: u128, buf: &Buf) { - self.write_now(Kind::Layer, key, &encode_layer(buf)); + /// Write a layer buffer synchronously (tests); a list that can't be stored is not. + pub fn put_layer_now(&self, key: u128, buf: &Buf, files: &ReadFiles) { + if let Some(files) = EntryFiles::of(files, None) { + self.write_format(Kind::Layer, key, FORMAT_LAYER_FILES, &with_files(&files, encode_layer(buf))); + } } /// A segmentation (chain key, scale) written by [`DiskCache::put_seg`]. @@ -860,7 +875,7 @@ impl DiskCache { } } -/// A frame entry's payload: its source files, then its pixels. +/// A frame or layer entry's payload: its source files, then its pixels. fn with_files(files: &EntryFiles, pixels: Vec) -> Vec { let mut out = Vec::with_capacity(pixels.len() + 64); files.encode(&mut out); @@ -953,15 +968,22 @@ pub fn read_frame_entry(data: &[u8], virtual_id: Option>) -> O decode_frame(pixels) } -/// A sealed layer-buffer entry: what the browser's frame workers write to the Origin Private -/// File System (`layers/<32 hex>.ecc`). -pub fn layer_entry(buf: &Buf) -> Vec { - seal(Kind::Layer, &encode_layer(buf)) +/// A sealed layer-buffer entry with the source files it was made of: what the browser's frame +/// workers write to the Origin Private File System (`layers/<32 hex>.ecc`). +pub fn layer_entry(buf: &Buf, files: &EntryFiles) -> Vec { + seal_format(Kind::Layer, FORMAT_LAYER_FILES, &with_files(files, encode_layer(buf))) } -/// A layer buffer from a sealed entry's bytes (`None` when damaged). -pub fn read_layer_entry(data: &[u8]) -> Option { - decode_layer(verify(data, Kind::Layer)?) +/// A layer buffer and its source files from a sealed entry's bytes (`None` when damaged or of +/// another format). The files are not looked at here: the store checks them when the buffer is +/// used ([`EntryFiles::unchanged`]). +pub fn read_layer_entry(data: &[u8]) -> Option<(Buf, EntryFiles)> { + let payload = verify(data, Kind::Layer)?; + if data.get(5) != Some(&FORMAT_LAYER_FILES) { + return None; + } + let (files, body) = EntryFiles::decode(payload)?; + Some((decode_layer(body)?, files)) } /// The disk key of a segmentation: its chain key and scale. @@ -983,11 +1005,11 @@ impl effectcraft_effects::roto::SegStore for DiskCache { } impl crate::cache::LayerStore for DiskCache { - fn get_layer(&self, key: u128) -> Option> { - DiskCache::get_layer(self, key).map(Arc::new) + fn get_layer(&self, key: u128, virtual_id: Option>) -> Option<(Arc, ReadFiles)> { + DiskCache::get_layer(self, key, virtual_id).map(|(b, f)| (Arc::new(b), f)) } - fn put_layer(&self, key: u128, buf: &Buf) { - DiskCache::put_layer(self, key, buf); + fn put_layer(&self, key: u128, buf: &Buf, files: &EntryFiles) { + DiskCache::put_layer(self, key, buf, files); } fn min_layer_ms(&self) -> u64 { DiskCache::min_layer_ms(self) @@ -1107,8 +1129,8 @@ fn decode_layer(p: &[u8]) -> Option { let offset = [f(8)?, f(16)?]; let scale = f(24)?; let planes = lz4_flex::decompress_size_prepended(&p[32..]).ok()?; - let n = w as usize * h as usize; - if planes.len() != n * 16 { + let n = (w as usize).checked_mul(h as usize)?; + if planes.len() != n.checked_mul(16)? { return None; } let mut img = Image::new(w, h); @@ -1137,75 +1159,26 @@ fn hash_debug(h: &mut Hash128, v: &impl std::fmt::Debug) { /// Size and content hash of a path that has no native metadata (the browser file table). pub type VirtualFileId<'a> = &'a (dyn Fn(&str) -> Option<(u64, u64)> + Send + Sync); -/// A file's size and modification time (so edited footage gets a new layer salt): the identity a -/// render records for the files it reads ([`crate::reads::FileStamp`]). When the path has no -/// native metadata, `virtual_id` supplies a durable size and content hash instead. -fn file_stamp(h: &mut Hash128, path: &str, virtual_id: Option>) { - if path.is_empty() { - return; - } - if let Some(crate::reads::FileStamp::Native { len, modified }) = crate::reads::FileStamp::native(path) { - h.write_u64(len); - if let Some(t) = modified { - h.write_u64(t); - } - return; - } - if let Some((len, hash)) = virtual_id.and_then(|id| id(path)) { - h.write_u64(len); - h.write_u64(hash); - } -} +/// A [`VirtualFileId`] a cache can keep (the browser file table's identities). +pub type SharedVirtualFileId = Arc Option<(u64, u64)> + Send + Sync>; -fn footage_stamp(h: &mut Hash128, f: &effectcraft_project::Footage, virtual_id: Option>) { - file_stamp(h, &f.path, virtual_id); - for p in &f.sequence { - file_stamp(h, p, virtual_id); - } -} +/// Layer entries with their source files (#3184), part of every layer disk key: entries of the +/// earlier format (keyed by a project-wide footage salt instead) are never looked up again; +/// least recently used, they are evicted. +const LAYER_ENTRY_VERSION: &[u8] = b"layer-entry-files-1"; -/// Salt for layer cache keys on disk: the renderer version and every footage file's identity -/// (layer keys name footage items, not file contents). -pub fn footage_salt(project: &effectcraft_project::Project) -> u64 { - footage_salt_with(project, None) -} - -/// [`footage_salt`] with [`VirtualFileId`] for paths `std::fs::metadata` cannot describe. -pub fn footage_salt_with(project: &effectcraft_project::Project, virtual_id: Option>) -> u64 { +/// Disk key of a layer buffer: the layer cache's content key ([`crate::cache::layer_key`] and +/// the keys derived from it), the layer entry format and the renderer version. The content key +/// comes from memory alone: it names the footage items the buffer uses with their settings and +/// paths, so two projects only share an entry for the same pixels of the same files; whether +/// those files still hold what the buffer was made of is checked when the entry is read +/// ([`EntryFiles`]). No file is looked at here. +pub fn layer_disk_key(key: u64) -> u128 { let mut h = Hash128::default(); + h.write(LAYER_ENTRY_VERSION); h.write(RENDER_VERSION.as_bytes()); - // Footage another layer reads (Audio Spectrum's Audio Layer); a read precomp can hold any. - let mut read = std::collections::BTreeSet::new(); - let mut read_comp = false; - for (_, c) in project.comps() { - for l in c.layers.iter() { - for r in l.referenced_layers().into_iter().filter(|r| *r != l.id) { - match c.layer(r).map(|x| &x.source) { - Some(effectcraft_project::LayerSource::Footage { item }) => _ = read.insert(*item), - Some(effectcraft_project::LayerSource::Comp { .. }) => read_comp = true, - _ => {} - } - } - } - } - for (id, it) in &project.items { - // (files without video make layer buffers only through a layer that reads them: - // importing music keeps the keys) - if let effectcraft_project::ItemKind::Footage(f) = &it.kind - && (f.has_video || read_comp || read.contains(id)) - { - h.write_u64(id.0); - hash_debug(&mut h, f); - footage_stamp(&mut h, f, virtual_id); - } - if let Some(proxy) = it.proxy.as_ref().filter(|p| p.enabled) { - h.write_u64(id.0); - hash_debug(&mut h, proxy); - footage_stamp(&mut h, &proxy.footage, virtual_id); - } - } - let v = h.finish(); - (v as u64) ^ ((v >> 64) as u64) + h.write_u64(key); + h.finish() } /// Content key of a composition's pixels, from the project in memory alone (no file is looked @@ -1443,11 +1416,12 @@ mod tests { fn hit_miss_and_exact_round_trip() { let dir = tmpdir("hit"); let dc = DiskCache::open(&dir, 1 << 30).unwrap(); - assert!(dc.get_layer(42).is_none()); + assert!(dc.get_layer(42, None).is_none()); let b = buf(1, 33, 17); - dc.put_layer(42, &b); + dc.put_layer(42, &b, &EntryFiles::default()); dc.flush(); - let back = dc.get_layer(42).unwrap(); + let (back, files) = dc.get_layer(42, None).unwrap(); + assert!(files.is_empty() && files.is_complete()); assert_eq!(back.img, b.img); assert_eq!((back.offset, back.scale), (b.offset, b.scale)); let rgba: Vec = (0..20 * 10 * 4).map(|i| (i % 251) as u8).collect(); @@ -1462,7 +1436,7 @@ mod tests { } /// Music doesn't change a comp's disk keys (adding it to the timeline kept no blue frame); - /// hiding a clip does. Importing music keeps the layer-cache salt. + /// hiding a clip does. Importing music keeps them too. #[test] fn music_keeps_the_disk_keys() { use effectcraft_project::{Comp, Footage, FootageKind, ItemKind, LayerSource, Project, Solid, build}; @@ -1474,14 +1448,14 @@ mod tests { let clip = build::layer(&mut p, &comp, "Clip", LayerSource::Solid { item: sid }, (64, 64), None); let clip_id = clip.id; p.comp_mut(cid).unwrap().layers.push(clip); - let (key, salt) = (comp_content_key(&p, cid), footage_salt(&p)); + let key = comp_content_key(&p, cid); let song = p.add_item( "song.wav", Default::default(), None, ItemKind::Footage(Footage { kind: FootageKind::Audio, has_video: false, has_audio: true, ..Default::default() }), ); - assert_eq!(footage_salt(&p), salt, "importing music"); + assert_eq!(comp_content_key(&p, cid), key, "importing music"); let music = build::layer(&mut p, &comp, "Music", LayerSource::Footage { item: song }, (64, 64), None); p.comp_mut(cid).unwrap().layers.insert(0, music); assert_eq!(comp_content_key(&p, cid), key, "music on the timeline"); @@ -1496,7 +1470,7 @@ mod tests { let dir = tmpdir("burst"); let dc = DiskCache::open(&dir, 1 << 30).unwrap(); for k in 0..300 { - dc.put_layer(10_000 + k, &buf(1, 64, 64)); + dc.put_layer(10_000 + k, &buf(1, 64, 64), &EntryFiles::default()); } let rgba = vec![7u8; 32 * 32 * 4]; for k in 0..300 { @@ -1533,7 +1507,7 @@ mod tests { let dir = tmpdir("persist"); { let dc = DiskCache::open(&dir, 1 << 30).unwrap(); - dc.put_layer_now(1, &buf(1, 8, 8)); + dc.put_layer_now(1, &buf(1, 8, 8), &ReadFiles::default()); dc.put_frame_now(2, 2, 2, &[9; 16], &ReadFiles::default()); } let dc = DiskCache::open(&dir, 1 << 30).unwrap(); @@ -1552,11 +1526,11 @@ mod tests { let dir = tmpdir("lru"); let dc = DiskCache::open(&dir, u64::MAX).unwrap(); for k in 0..6u128 { - dc.put_layer_now(k, &buf(k as u32, 64, 64)); + dc.put_layer_now(k, &buf(k as u32, 64, 64), &ReadFiles::default()); } let per = dc.stats().bytes / 6; // Touch 0 so it is the most recently used. - assert!(dc.get_layer(0).is_some()); + assert!(dc.get_layer(0, None).is_some()); dc.set_max_bytes(per * 3 + per * 3 / 4); let st = dc.stats(); assert!(st.bytes <= per * 3 + per * 3 / 4, "{st:?}"); @@ -1568,7 +1542,7 @@ mod tests { let files = walk(&dir); assert_eq!(files, 3); // New writes keep evicting. - dc.put_layer_now(99, &buf(9, 64, 64)); + dc.put_layer_now(99, &buf(9, 64, 64), &ReadFiles::default()); assert!(dc.stats().bytes <= per * 3 + per * 3 / 4); } @@ -1593,7 +1567,7 @@ mod tests { let dir = tmpdir("space"); let dc = DiskCache::open(&dir, 1 << 30).unwrap(); for k in 0..4u128 { - dc.put_layer_now(k, &buf(k as u32, 64, 64)); + dc.put_layer_now(k, &buf(k as u32, 64, 64), &ReadFiles::default()); } let used = dc.stats().bytes; // Unknown space: the setting alone. @@ -1606,13 +1580,13 @@ mod tests { dc.set_disk_space(Some((100 << 30, 5 << 30))); let st = dc.stats(); assert_eq!((st.max_bytes, st.limit_bytes), (1 << 30, used)); - dc.put_layer_now(9, &buf(9, 64, 64)); + dc.put_layer_now(9, &buf(9, 64, 64), &ReadFiles::default()); let st = dc.stats(); assert!(st.bytes <= st.limit_bytes && st.bytes <= used - used / 10 && st.evictions > 0, "{st:?}"); assert!(dc.contains(Kind::Layer, 9), "the new entry is the most recently used"); // Below the reserve the cache gives its space back, and skips writes that can't fit. dc.set_disk_space(Some((100 << 30, 4 << 30))); - dc.put_layer_now(10, &buf(10, 64, 64)); + dc.put_layer_now(10, &buf(10, 64, 64), &ReadFiles::default()); let st = dc.stats(); assert_eq!((st.limit_bytes, st.entries, st.bytes), (0, 0, 0), "{st:?}"); // Plenty of space again: back to the setting. @@ -1627,8 +1601,8 @@ mod tests { let dc = DiskCache::open(&dir, 1 << 30).unwrap(); // A file where the layers folder should be: every layer write fails. std::fs::write(dir.join(VERSION).join(Kind::Layer.dir()), b"x").unwrap(); - dc.put_layer_now(1, &buf(1, 8, 8)); - dc.put_layer_now(2, &buf(2, 8, 8)); + dc.put_layer_now(1, &buf(1, 8, 8), &ReadFiles::default()); + dc.put_layer_now(2, &buf(2, 8, 8), &ReadFiles::default()); let st = dc.stats(); assert_eq!((st.failed, st.writes, st.entries), (2, 0, 0)); let _ = std::fs::remove_dir_all(&dir); @@ -1677,8 +1651,8 @@ mod tests { for i in 0..20u128 { let k = i % 5; let w = if t % 2 == 0 { &a } else { &b }; - w.put_layer_now(k, &buf(k as u32, 16, 16)); - if let Some(x) = w.get_layer(k) { + w.put_layer_now(k, &buf(k as u32, 16, 16), &ReadFiles::default()); + if let Some((x, _)) = w.get_layer(k, None) { assert_eq!(x.img, buf(k as u32, 16, 16).img); } } @@ -1687,41 +1661,16 @@ mod tests { }); b.rescan(); for k in 0..5u128 { - assert_eq!(b.get_layer(k).unwrap().img, buf(k as u32, 16, 16).img); + assert_eq!(b.get_layer(k, None).unwrap().0.img, buf(k as u32, 16, 16).img); } } - /// An audio file nothing reads stays out of the layer salt; one a layer reads (Audio - /// Spectrum) is in it, so overwriting it doesn't reuse that layer's buffers. + /// Replaced bytes of a path with no native metadata (the browser file table) change neither + /// the comp key nor a layer's disk key (both from memory): the frame and layer entries made + /// of them check the hook's size and content hash when read and are misses, deleted (#1253, + /// #3184). #[test] - fn read_audio_counts_in_the_footage_salt() { - use effectcraft_project::build; - use effectcraft_project::{Comp, Footage, FootageKind, ItemKind, LayerSource, MatteKind, Project, TrackMatte}; - use effectcraft_time::{FrameRate, Tick}; - - let mut p = Project::default(); - let f = Footage { path: "/song.wav".into(), kind: FootageKind::Audio, has_video: false, has_audio: true, ..Default::default() }; - let song = p.add_item("song.wav", effectcraft_color::Label::None, None, ItemKind::Footage(f)); - let mut comp = Comp::new(16, 9, FrameRate::FPS_30, Tick::from_seconds_f64(1.0)); - let music = build::layer(&mut p, &comp, "music", LayerSource::Footage { item: song }, (16, 9), None); - let mut reader = build::layer(&mut p, &comp, "reader", LayerSource::Null, (16, 9), None); - let music_id = music.id; - comp.layers = vec![reader.clone(), music].into(); - let cid = p.add_item("C", effectcraft_color::Label::None, None, ItemKind::Comp(comp.into())); - - let id = |mark: u64| move |path: &str| (path == "/song.wav").then_some((8, mark)); - let (one, two) = (id(1), id(2)); - assert_eq!(footage_salt_with(&p, Some(&one)), footage_salt_with(&p, Some(&two)), "unread music stays out"); - reader.track_matte = Some(TrackMatte { layer: music_id, kind: MatteKind::Alpha }); - *p.comp_mut(cid).unwrap().layers.first_mut().unwrap() = reader; - assert_ne!(footage_salt_with(&p, Some(&one)), footage_salt_with(&p, Some(&two)), "read audio counts"); - } - - /// A path with no native metadata takes the layer salt from the caller's size and content hash - /// (#1253). The comp key is from memory: replaced bytes are caught by the frame entries' - /// check instead (#3184). - #[test] - fn virtual_file_bytes_change_the_salt_not_the_comp_key() { + fn virtual_file_bytes_are_checked_by_the_entries_not_the_keys() { use effectcraft_project::build; use effectcraft_project::{Comp, Footage, ItemKind, LayerSource, Project}; use effectcraft_time::{FrameRate, Tick}; @@ -1735,10 +1684,6 @@ mod tests { let id = |mark: u64| move |path: &str| (path == "/virtual.mov").then_some((8, mark)); let (one, two) = (id(1), id(2)); - let a = footage_salt_with(&p, Some(&one)); - let b = footage_salt_with(&p, Some(&two)); - assert_ne!(a, b, "replaced virtual media must not reuse the salt"); - // The frame entry of replaced virtual media is a miss. let dc = DiskCache::open(tmpdir("virtual"), 1 << 30).unwrap(); let k = frame_key(comp_content_key(&p, cid), 0, 1000, 0); let files: ReadFiles = [crate::reads::ReadFile::new("/virtual.mov", crate::reads::FileStamp::Virtual)].into_iter().collect(); @@ -1746,6 +1691,113 @@ mod tests { dc.flush(); assert!(dc.get_frame(k, Some(&one)).is_some_and(|(_, f)| f == files)); assert!(dc.get_frame(k, Some(&two)).is_none() && !dc.contains(Kind::Frame, k), "replaced: a miss, deleted"); + // A layer buffer made of it. + let lk = layer_disk_key(7); + dc.put_layer(lk, &buf(1, 4, 4), &EntryFiles::of(&files, Some(&one)).unwrap()); + dc.flush(); + assert!(dc.get_layer(lk, Some(&one)).is_some_and(|(b, f)| b.img == buf(1, 4, 4).img && f == files && f.is_complete())); + assert!(dc.get_layer(lk, None).is_none() && !dc.contains(Kind::Layer, lk), "no identity: a miss, deleted"); + dc.put_layer(lk, &buf(1, 4, 4), &EntryFiles::of(&files, Some(&one)).unwrap()); + dc.flush(); + assert!(dc.get_layer(lk, Some(&two)).is_none() && !dc.contains(Kind::Layer, lk), "replaced: a miss, deleted"); + // The browser's sealed layer entries carry the same list. + let e = layer_entry(&buf(2, 3, 2), &EntryFiles::of(&files, Some(&one)).unwrap()); + let (b, list) = read_layer_entry(&e).unwrap(); + assert!(b.img == buf(2, 3, 2).img && list.unchanged(Some(&one)) && !list.unchanged(Some(&two))); + assert!(read_layer_entry(&seal(Kind::Layer, &encode_layer(&buf(2, 3, 2)))).is_none(), "the format before #3184"); + let mut bad = e.clone(); + bad[12] ^= 1; + assert!(read_layer_entry(&bad).is_none(), "damaged"); + } + + /// Layer disk keys come from the layer cache's key alone (no file, no project-wide salt) and + /// differ per key. + #[test] + fn layer_disk_keys_need_no_files() { + assert_eq!(layer_disk_key(1), layer_disk_key(1)); + assert_ne!(layer_disk_key(1), layer_disk_key(2)); + // Not the layout of the salted keys before #3184 (`salt << 64 | key`). + assert_ne!(layer_disk_key(1) as u64, 1); + } + + /// A layer entry is used only while the files it lists are what the buffer was made of: a + /// new size, a new time, a missing file that is back, a file replaced by a folder, a damaged + /// files section and the format before #3184 are misses, and the entry is deleted so the + /// buffer is rendered and stored again. A buffer whose files can't all be named is not + /// stored. Only the listed files are looked at. + #[test] + fn layer_entries_check_their_files() { + use crate::reads::{FileStamp, ReadFile}; + let dir = tmpdir("layer-check"); + let src = dir.join("src"); + std::fs::create_dir_all(&src).unwrap(); + let file = |name: &str, bytes: &[u8]| { + let p = src.join(name); + std::fs::write(&p, bytes).unwrap(); + p.to_string_lossy().to_string() + }; + let (a, b) = (file("a.png", b"aa"), file("b.png", b"bb")); + let gone = src.join("gone.png").to_string_lossy().to_string(); + let read = |paths: &[&str]| -> ReadFiles { paths.iter().map(|p| ReadFile::new(*p, FileStamp::native(p).unwrap_or(FileStamp::Missing))).collect() }; + let dc = DiskCache::open(&dir, 1 << 30).unwrap(); + dc.put_layer_now(1, &buf(1, 4, 4), &read(&[&a])); + dc.put_layer_now(2, &buf(2, 4, 4), &read(&[&b, &gone])); + dc.put_layer_now(3, &buf(3, 4, 4), &read(&[&b])); + let (one, files) = dc.get_layer(1, None).unwrap(); + assert!(one.img == buf(1, 4, 4).img && files == read(&[&a]) && files.is_complete()); + assert_eq!(dc.file_checks(), 1, "only the file of that buffer"); + // a.png gets a new size: entry 1 is a miss and deleted, the others stay. + std::fs::write(&a, b"aaa").unwrap(); + assert!(dc.get_layer(1, None).is_none() && !dc.contains(Kind::Layer, 1)); + assert!(dc.get_layer(2, None).is_some() && dc.get_layer(3, None).is_some()); + // b.png gets a new time only. + let t = std::fs::metadata(&b).unwrap().modified().unwrap() + std::time::Duration::from_secs(7); + std::fs::File::options().append(true).open(&b).unwrap().set_modified(t).unwrap(); + assert!(dc.get_layer(3, None).is_none() && !dc.contains(Kind::Layer, 3)); + assert!(dc.get_layer(2, None).is_none(), "b.png is listed there too"); + // A missing file that is back. + dc.put_layer_now(4, &buf(4, 4, 4), &read(&[&gone])); + assert!(dc.get_layer(4, None).is_some(), "missing, still missing"); + file("gone.png", b"g"); + assert!(dc.get_layer(4, None).is_none() && !dc.contains(Kind::Layer, 4), "back"); + // A file replaced by a folder (unreadable). + let c = file("c.png", b"cc"); + dc.put_layer_now(5, &buf(5, 4, 4), &read(&[&c])); + std::fs::remove_file(&c).unwrap(); + std::fs::create_dir(&c).unwrap(); + assert!(dc.get_layer(5, None).is_none() && !dc.contains(Kind::Layer, 5)); + // Written again after the miss: a hit with the new identity. + dc.put_layer_now(1, &buf(9, 4, 4), &read(&[&a])); + assert_eq!(dc.get_layer(1, None).map(|l| l.0.img), Some(buf(9, 4, 4).img)); + // The format before #3184 (no files): a miss, deleted. + dc.write_format(Kind::Layer, 6, FORMAT_RGBA8, &encode_layer(&buf(6, 4, 4))); + assert!(dc.contains(Kind::Layer, 6)); + assert!(dc.get_layer(6, None).is_none() && !dc.contains(Kind::Layer, 6)); + // A valid checksum over a damaged files section, or over a cut buffer: misses, deleted. + let mut payload = vec![]; + payload.extend_from_slice(&3u32.to_le_bytes()); + payload.extend_from_slice(&encode_layer(&buf(7, 4, 4))); + dc.write_format(Kind::Layer, 7, FORMAT_LAYER_FILES, &payload); + assert!(dc.get_layer(7, None).is_none() && !dc.contains(Kind::Layer, 7)); + let mut cut = vec![]; + EntryFiles::default().encode(&mut cut); + cut.extend_from_slice(&encode_layer(&buf(8, 4, 4))[..40]); + dc.write_format(Kind::Layer, 8, FORMAT_LAYER_FILES, &cut); + assert!(dc.get_layer(8, None).is_none() && !dc.contains(Kind::Layer, 8)); + // A damaged file on disk. + dc.put_layer_now(9, &buf(9, 4, 4), &ReadFiles::default()); + let p = dc.path(Kind::Layer, 9); + let mut d = std::fs::read(&p).unwrap(); + let n = d.len(); + d[n / 2] ^= 0xff; + std::fs::write(&p, d).unwrap(); + assert!(dc.get_layer(9, None).is_none() && !dc.contains(Kind::Layer, 9) && !p.exists()); + // Buffers whose files can't all be named are not stored. + let mut incomplete = read(&[&a]); + incomplete.mark_incomplete(); + dc.put_layer_now(10, &buf(10, 4, 4), &incomplete); + assert!(!dc.contains(Kind::Layer, 10)); + let _ = std::fs::remove_dir_all(&dir); } /// A frame entry is used only while the files it lists are what it was made of: a new size, diff --git a/crates/render/src/reads.rs b/crates/render/src/reads.rs index 162c04862..7f65a0110 100644 --- a/crates/render/src/reads.rs +++ b/crates/render/src/reads.rs @@ -12,8 +12,8 @@ use std::sync::{Arc, Mutex, PoisonError}; -/// The identity of a file as a render read it (see [`file_stamp`](crate::disk_cache) for the -/// same identity in the layer-cache salt; frame entries store it, see `disk_cache::EntryFiles`). +/// The identity of a file as a render read it (frame and layer entries on disk store it, see +/// [`EntryFiles`](crate::disk_cache::EntryFiles)). #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] pub enum FileStamp { /// A file on disk: its size in bytes and its modification time (nanoseconds since the Unix diff --git a/crates/ui-egui/src/app/frame.rs b/crates/ui-egui/src/app/frame.rs index e77f07840..8ebea08fc 100644 --- a/crates/ui-egui/src/app/frame.rs +++ b/crates/ui-egui/src/app/frame.rs @@ -170,10 +170,6 @@ impl EffectcraftApp { self.session.poll_jobs(); ctx.request_repaint_after(std::time::Duration::from_millis(100)); } - // The disk cache's footage salt, taken off the UI thread after footage changed. - if self.session.poll_disk_salt() { - ctx.request_repaint_after(std::time::Duration::from_millis(100)); - } // Analyses running in a worker (the web app). if !self.session.offloaded.is_empty() { self.session.poll_offload(); diff --git a/crates/ui-egui/tests/it/ui_unreadable_footage.rs b/crates/ui-egui/tests/it/ui_unreadable_footage.rs index f1c9707ba..21ca1e7c9 100644 --- a/crates/ui-egui/tests/it/ui_unreadable_footage.rs +++ b/crates/ui-egui/tests/it/ui_unreadable_footage.rs @@ -175,8 +175,7 @@ fn restored_original_and_active_proxy_render_new_pixels_through_media_and_disk_c let cache = effectcraft_render::disk_cache::DiskCache::open(dir.join("cache"), 1 << 20).unwrap(); cache.set_min_layer_ms(0); s.disk_cache = Some(cache.clone()); - let salt = s.refresh_disk_salt(true).unwrap(); - s.layer_cache.set_disk(Some((cache.clone(), salt))); + s.layer_cache.set_disk(Some(cache.clone())); let before = s.render(comp, Tick::ZERO, RenderOpts::default()); assert_eq!(before.data[8 * 16 + 8], if proxy { [0.0, 1.0, 0.0, 1.0] } else { [1.0, 0.0, 0.0, 1.0] }); cache.flush(); diff --git a/docs/architecture.md b/docs/architecture.md index 48413d1c1..213aaaf57 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -242,9 +242,14 @@ frame's float values. The browser keeps 8-bit frames for now (its frame workers A persistent **disk cache** (`render::disk_cache`, Settings ▸ Media & Disk Cache) backs both the layer cache and the viewer's RAM preview: layer buffers that were slow to render and every preview frame are written (LZ4, atomic rename, checksummed) under 128-bit content keys — the -comp's content hash (the comp, what it uses, footage file size and time) plus frame, scale and -view for frames; the layer key salted with the footage fingerprint for layers — so entries -survive restarts and never go stale. Frame entries are 8-bit RGBA, or for 32 bpc viewer frames +comp's content hash (the comp and what it uses, footage items with their settings and paths, +from memory alone) plus frame, scale and view for frames; the layer cache's content key (which +names the footage items a buffer uses with their paths) and the renderer version for layers. +Every frame and layer entry keeps the source files it was made of, with the size and +modification time they were read with, and is used only while they are unchanged: a handful of +`metadata` calls when an entry is read, never a scan of the project's files (#3184). Entries +survive restarts and never go stale; frames and buffers whose files can't all be named are not +written. Frame entries are 8-bit RGBA, or for 32 bpc viewer frames half floats with their bytes shuffled into planes before LZ4 (the entry header's format byte tells them apart; the render options in the key keep the two kinds apart). LRU eviction keeps it under the size limit; Edit ▸ Purge empties it, `cache.diskStats` reports it, and the timeline draws disk-only frames in blue. In the diff --git a/docs/web.md b/docs/web.md index 832aa86fe..4f43b753e 100644 --- a/docs/web.md +++ b/docs/web.md @@ -354,8 +354,9 @@ frame whose files can't all be named is not stored. Cache / `edit.purge {what: "disk"}` clears it. `effectcraft.info().diskCache` has the same. **Layer buffers (M13.30).** Slow layer buffers (≥ 20 ms to render) go to the disk cache too -(`effectcraft-cache/v1/layers/<32 hex>.ecc`, `disk_cache::layer_entry`, keys salted per project -and footage as on the desktop). A layer lookup happens in the middle of a synchronous render, +(`effectcraft-cache/v1/layers/<32 hex>.ecc`, `disk_cache::layer_entry`, keyed as on the desktop: +`disk_cache::layer_disk_key`; each entry keeps the source files its buffer was made of, with +the file table's size and content hash, and is used only while they are unchanged). A layer lookup happens in the middle of a synchronous render, where the browser's file system can't be read, so it is made synchronous by fetching first: 1. Each frame worker backs its layer cache with a `PrefetchStore` (`effectcraft_render::cache`): From 2efa859aa9d8d21875242bbfd5e60370f8bc7f27 Mon Sep 17 00:00:00 2001 From: vangel76 Date: Sat, 7 Nov 2026 00:19:15 +0100 Subject: [PATCH 020/451] Disk cache: no-salt worker test, sequence paths in the frame-blend key Part of #3184 (step 3 of 4). - A frame-blended footage frame's layer-cache key now hashes the sequence's file list: with no project-wide salt, two projects whose items share an id and a first frame must not share its disk entry. - Test: a frame worker syncing, patching and rendering a project with an unused 5000-frame sequence asks its file hook only about the file its buffer reads (the salt asked about every file at every sync). Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/background/remote/tests.rs | 67 ++++++++++++++++++++ crates/render/src/pipeline.rs | 3 + 2 files changed, 70 insertions(+) diff --git a/crates/engine/src/background/remote/tests.rs b/crates/engine/src/background/remote/tests.rs index c35d7a717..e6d797f9d 100644 --- a/crates/engine/src/background/remote/tests.rs +++ b/crates/engine/src/background/remote/tests.rs @@ -444,3 +444,70 @@ fn the_worker_reports_the_files_of_each_frame_for_its_disk_entry() { assert!(read_frame_entry(&entry, Some(&two)).is_none(), "the file was replaced: a miss"); } } + +/// No salt work at all (#3184, replacing the background salt of #3106): syncing a project with a +/// large image sequence nobody shows, patching it and rendering with the layer store never asks +/// the file hook about the sequence (the salt asked about every file at every sync). Only the +/// file the rendered buffer reads is asked about: to store its entry and, in another worker, to +/// check it before the buffer from the store is used. +#[test] +fn the_worker_asks_only_about_the_files_its_buffers_read() { + use effectcraft_project::{Comp, Footage, FootageKind, ItemKind, LayerSource, Project, build}; + use effectcraft_time::FrameRate; + use std::sync::Mutex; + let mut p = Project::default(); + let f = Footage { path: "/clip.png".into(), width: 4, height: 4, has_video: true, ..Default::default() }; + let fid = p.add_item("clip.png", effectcraft_color::Label::None, None, ItemKind::Footage(f)); + let seq = Footage { + kind: FootageKind::Sequence, + path: "/seq/f_00000.png".into(), + sequence: (0..5000).map(|i| format!("/seq/f_{i:05}.png")).collect(), + width: 4, + height: 4, + has_video: true, + ..Default::default() + }; + p.add_item("seq", effectcraft_color::Label::None, None, ItemKind::Footage(seq)); + let mut comp = Comp::new(4, 4, FrameRate::FPS_30, Tick::from_seconds_f64(1.0)); + comp.layers = vec![build::layer(&mut p, &comp, "clip", LayerSource::Footage { item: fid }, (4, 4), None)].into(); + let cid = p.add_item("C", effectcraft_color::Label::None, None, ItemKind::Comp(comp.into())); + let asked: Arc>> = Arc::default(); + let worker = || { + let mut w = FrameServer::new(Arc::new(OneVirtualFile { records: true }), None); + let seen = asked.clone(); + w.set_virtual_id(Some(Arc::new(move |path: &str| { + seen.lock().unwrap().push(path.to_string()); + (path == "/clip.png").then_some((10, 1)) + }))); + let store = Arc::new(PrefetchStore::new(1 << 20).with_min_ms(0)); + w.set_layer_store(Some(store.clone())); + (w, store) + }; + let render = |w: &mut FrameServer, revision: u64, prefetch: Vec| { + let out = w.handle(round(&FrameMsg::Render { id: 1, revision, comp: cid, time: Tick::ZERO, opts: Box::default(), disk: None, layers: true, prefetch })); + let FrameReply::Frame { layer_hits, .. } = &out[0].0 else { panic!("{:?}", out[0].0) }; + layer_hits.len() + }; + // Worker A: synced, patched, rendered; its buffer is queued with its file. + let (mut a, store_a) = worker(); + let mut m = Mirror::default(); + assert!(a.handle(round(&m.sync(1, &p).unwrap())).is_empty()); + let mut edited = p.clone(); + edited.item_mut(cid).unwrap().name = "Renamed".into(); + assert!(a.handle(round(&m.sync(2, &edited).unwrap())).is_empty()); + assert!(asked.lock().unwrap().is_empty(), "syncing looks at no file"); + assert_eq!(render(&mut a, 2, vec![]), 0); + let writes = store_a.take_writes(); + assert!(!writes.is_empty(), "the clip's buffer is stored"); + // Worker B: fetched before its frame, checked, used. + let (mut b, store_b) = worker(); + let mut m = Mirror::default(); + assert!(b.handle(round(&m.sync(2, &edited).unwrap())).is_empty()); + for (k, e) in &writes { + assert!(store_b.provide(*k, e)); + } + assert!(render(&mut b, 2, writes.iter().map(|(k, _)| format!("{k:032x}")).collect()) > 0, "served from the store"); + let asked = asked.lock().unwrap(); + assert!(!asked.is_empty(), "the hook names the buffer's file"); + assert!(asked.iter().all(|p| p == "/clip.png"), "only the file the buffer read: {:?}", &asked[..asked.len().min(5)]); +} diff --git a/crates/render/src/pipeline.rs b/crates/render/src/pipeline.rs index 3564c17f9..f802d7b4a 100644 --- a/crates/render/src/pipeline.rs +++ b/crates/render/src/pipeline.rs @@ -903,6 +903,9 @@ impl<'a> Renderer<'a> { use std::hash::{Hash, Hasher}; let mut h = std::collections::hash_map::DefaultHasher::new(); (0x00f8_a3e5_u64, item, i, (w as f32).to_bits(), mode as u8, f.frame_rate.num, f.frame_rate.den, &f.path, float).hash(&mut h); + // Every file of a sequence: the key must tell two projects apart whose items + // share an id and a first frame (on disk, no project-wide salt does, #3184). + f.sequence.hash(&mut h); (f.alpha as u8).hash(&mut h); if f.alpha == effectcraft_project::AlphaMode::Premultiplied { f.premul_color.map(f32::to_bits).hash(&mut h); From 642fcb7bcb5720c74837dfe61c905399e5f6eab1 Mon Sep 17 00:00:00 2001 From: vangel76 Date: Sat, 7 Nov 2026 01:05:11 +0100 Subject: [PATCH 021/451] Disk cache: the comp key covers what its expressions can read With an expression anywhere in the project, every comp's disk key hashed every item of the project, so any edit (another comp, an unused footage item) threw away every comp's frames on disk. The key now covers what the comp can draw plus what the expressions among it can reach (Project::pixel_reach): - without expressions: the items the comp draws, without silent layers, plus the footage its precomp layers swap in (Media Replacement); - with expressions: every layer of the comps they reach, their markers, the comps and footage they name with string literals (comp("Name"), footage("Name")) together with which items have those names now, and the footage named like a reached source (its data is read by name); - the whole project when an expression computes a name, uses the object model's constructors or internals, dynamic code, computed keys or writes, or text the scanner can't read for sure (regex literals, template strings, escapes): expression_reach errs towards reaching more. Markers count only where an expression can read them (#1083). Memory only, no file is looked at. Tests: scanner and reach unit tests in the project crate; engine tests for the key (own-comp expressions keep the key through edits elsewhere, comp("Other") follows Other and not a third comp, a second comp taking the name counts, a computed name counts every item, markers read from another comp); a ui-egui test that the disk frames outside an expression layer are carried when the comp it names changes. Part of #3184. Part of #1492. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/tests/disk_cache.rs | 97 +++++++ crates/project/src/lib.rs | 2 + crates/project/src/reach.rs | 401 ++++++++++++++++++++++++++ crates/project/src/reach/tests.rs | 177 ++++++++++++ crates/render/src/disk_cache.rs | 52 ++-- crates/ui-egui/src/frames/tests.rs | 74 +++++ 6 files changed, 774 insertions(+), 29 deletions(-) create mode 100644 crates/project/src/reach.rs create mode 100644 crates/project/src/reach/tests.rs diff --git a/crates/engine/src/tests/disk_cache.rs b/crates/engine/src/tests/disk_cache.rs index e2b1544b3..8f4973ae3 100644 --- a/crates/engine/src/tests/disk_cache.rs +++ b/crates/engine/src/tests/disk_cache.rs @@ -242,3 +242,100 @@ fn protected_markers_with_a_duration_change_the_content_key() { s.execute("markers.set", json!({"comp": inner.0, "index": index, "duration": 2.0})).unwrap(); assert_ne!(key(&s), k1, "its duration"); } + +/// With expressions the comp key covers what they can read, not the whole project (#3184, +/// #1492): an expression reading only its own comp keeps the key through edits of another comp +/// and of unused footage; `comp("Other")` makes "Other" count (and which comps have that name), +/// not a third comp; a computed name counts every item. +#[test] +fn expressions_reach_only_what_they_name() { + let mut s = Session::default(); + let comp = |s: &mut Session, name: &str| { + let c = s.execute("comp.new", json!({"name": name, "width": 8, "height": 8, "frameRate": 30, "duration": 1})).unwrap()["comp"].as_u64().unwrap(); + let l = s.execute("layer.newSolid", json!({"comp": c, "color": "#ff0000"})).unwrap()["layer"].as_u64().unwrap(); + (effectcraft_project::ItemId(c), (c, l)) + }; + let (main, ml) = comp(&mut s, "Main"); + let (_, ol) = comp(&mut s, "Other"); + let (third, tl) = comp(&mut s, "Third"); + let unused = s.edit("add", None, |p, _| { + let f = effectcraft_project::Footage { path: "/nowhere/a.png".into(), has_video: true, ..Default::default() }; + Ok(p.add_item("a.png", effectcraft_color::Label::None, None, effectcraft_project::ItemKind::Footage(f))) + }); + let unused = unused.unwrap(); + let key = |s: &Session| effectcraft_render::disk_cache::comp_content_key(&s.project, main); + let expr = |s: &mut Session, (comp, layer): (u64, u64), text: &str| { + s.execute("prop.setExpression", json!({"comp": comp, "layer": layer, "path": "transform/opacity", "expression": text})).unwrap(); + }; + let opacity = |s: &mut Session, (comp, layer): (u64, u64), v: f64| { + s.execute("prop.set", json!({"comp": comp, "layer": layer, "path": "transform/opacity", "value": v})).unwrap(); + }; + let repath = |s: &mut Session, path: &str| { + let path = path.to_string(); + s.edit("repath", None, move |p, _| { + if let Some(effectcraft_project::ItemKind::Footage(f)) = p.item_mut(unused).map(|i| &mut i.kind) { + f.path = path; + } + Ok(()) + }) + .unwrap(); + }; + // Its own comp only. + expr(&mut s, ml, "thisComp.layer(1).transform.rotation + wiggle(1, 1)[0]"); + expr(&mut s, ol, "wiggle(2, 10)"); + let k0 = key(&s); + opacity(&mut s, ol, 40.0); + expr(&mut s, tl, "time * 10"); + repath(&mut s, "/nowhere/b.png"); + s.execute("comp.addMarker", json!({"comp": third.0, "time": 0.5})).unwrap(); + assert_eq!(key(&s), k0, "edits elsewhere keep the key"); + // An edit in the comp itself changes it. + opacity(&mut s, ml, 30.0); + assert_ne!(key(&s), k0); + // `comp("Other")`: Other counts, Third doesn't. + expr(&mut s, ml, "comp(\"Other\").layer(1).transform.opacity"); + let k1 = key(&s); + expr(&mut s, ol, "wiggle(3, 10)"); + let k2 = key(&s); + assert_ne!(k2, k1, "the comp it names"); + opacity(&mut s, tl, 20.0); + repath(&mut s, "/nowhere/c.png"); + assert_eq!(key(&s), k2, "a comp it doesn't name"); + // Another comp taking the name changes what it may read. + s.edit("rename", None, |p, _| { + p.item_mut(third).unwrap().name = "Other".into(); + Ok(()) + }) + .unwrap(); + let k3 = key(&s); + assert_ne!(k3, k2, "a second comp named Other"); + // A computed name reaches every item. + expr(&mut s, ml, "comp(\"Oth\" + \"er\").layer(1).transform.opacity"); + let k4 = key(&s); + repath(&mut s, "/nowhere/d.png"); + assert_ne!(key(&s), k4, "unused footage counts with a computed name"); +} + +/// Markers count only for the comps whose expressions can read them (#1083): an expression in +/// another comp that reads markers leaves this comp's markers out of its key. +#[test] +fn markers_count_only_where_an_expression_can_read_them() { + let mut s = Session::default(); + s.execute("comp.new", json!({"name": "M", "width": 8, "height": 8, "frameRate": 30, "duration": 2})).unwrap(); + let cid = s.active_comp_id().unwrap(); + s.execute("layer.newSolid", json!({"color": "#ff0000"})).unwrap(); + let other = s.execute("comp.new", json!({"name": "N", "width": 8, "height": 8, "frameRate": 30, "duration": 2})).unwrap()["comp"].as_u64().unwrap(); + let ol = s.execute("layer.newSolid", json!({"comp": other, "color": "#ff0000"})).unwrap()["layer"].as_u64().unwrap(); + s.execute("prop.setExpression", json!({"comp": other, "layer": ol, "path": "transform/opacity", "expression": "thisComp.marker.numKeys"})).unwrap(); + let key = |s: &Session| effectcraft_render::disk_cache::comp_content_key(&s.project, cid); + let k0 = key(&s); + s.execute("comp.addMarker", json!({"comp": cid.0, "time": 0.5, "comment": "beat"})).unwrap(); + assert_eq!(key(&s), k0, "no expression of M reads its markers"); + s.execute("prop.setExpression", json!({"comp": other, "layer": ol, "path": "transform/opacity", "expression": "comp(\"M\").marker.numKeys"})).unwrap(); + let other_key = |s: &Session| effectcraft_render::disk_cache::comp_content_key(&s.project, effectcraft_project::ItemId(other)); + let n0 = other_key(&s); + s.execute("comp.addMarker", json!({"comp": cid.0, "time": 1.0})).unwrap(); + assert_ne!(other_key(&s), n0, "N reads M's markers"); + assert_eq!(key(&s), k0, "M itself still doesn't"); +} + diff --git a/crates/project/src/lib.rs b/crates/project/src/lib.rs index 079b81765..c9322ac37 100644 --- a/crates/project/src/lib.rs +++ b/crates/project/src/lib.rs @@ -35,6 +35,7 @@ mod footage; mod item; mod layer; mod layers; +mod reach; mod settings; pub use comp::{Comp, Guide, Renderer, Resolution}; @@ -46,6 +47,7 @@ pub use layer::{ reads_other_frames, }; pub use layers::Layers; +pub use reach::{ExprReach, PixelReach, expression_reach}; pub use settings::{ APP_VERSION, BitDepth, ColorEngine, CuePoint, HdrMode, Marker, ProjectError, ProjectSettings, SCHEMA_EFFECT_SPACE, SCHEMA_VERSION, SavedView, TimeDisplayStyle, is_newer_version, saved_by, saved_view, diff --git a/crates/project/src/reach.rs b/crates/project/src/reach.rs new file mode 100644 index 000000000..dd510f9db --- /dev/null +++ b/crates/project/src/reach.rs @@ -0,0 +1,401 @@ +//! What a composition's pixels can depend on, from the project in memory: the items it draws +//! and, when expressions are among them, what those expressions can read (#3184). The disk +//! cache keys a comp's frames by exactly these items, so an edit elsewhere in the project keeps +//! them. +//! +//! An expression reaches its own comp's layers (`thisComp`, `thisLayer`), the sources of the +//! layers it can read (`layer.source`, a precomp's layers through it), and other items by name: +//! `comp("Name")` and `footage("Name")`. A name given as a plain string literal is followed; a +//! computed name (`comp("Shot " + index)`), the object model's constructors and internals +//! (`new Comp(7)`, `__h`), dynamic code (`eval`, `Function`) and anything the scanner can't read +//! for sure (a regular expression literal, a template string, an escape in a name) count as +//! reaching every item of the project. The scan errs on the side of reaching more: an item +//! wrongly left out would serve a stale frame, one wrongly let in only renders again. +//! +//! Known limit (`ponytail`): an expression that builds the names of the object model's private +//! fields at run time into a variable and writes them with a computed key it reads from that +//! variable could forge another comp's id. That is deliberate tampering with the internals, not +//! an expression one writes; the scan refuses every direct form of it (`__` names, the +//! constructors, `Object`, `JSON`, `call`/`apply`/`bind`, computed writes and computed keys). +//! Upgrade: have the expression host record which items an evaluation reached. + +use std::collections::{BTreeMap, BTreeSet}; + +use crate::{Comp, ItemId, ItemKind, LayerId, LayerSource, Node, Project, PropGroup, Value}; + +/// What an expression's text can reach outside its own comp and the layers it can read. +#[derive(Clone, Debug, PartialEq, Eq)] +pub enum ExprReach { + /// Only items named by string literals: comps by `comp("…")`, footage by `footage("…")`. + Names { comps: Vec, footage: Vec }, + /// Any item of the project. + Anything, +} + +/// Names that hand an expression another item by id, run code built at run time, or give it the +/// tools to forge the object model's private fields. +const REACHES_ANYTHING: &[&str] = &[ + "Comp", + "Footage", + "Layer", + "Prop", + "Markers", + "eval", + "Function", + "globalThis", + "this", + "self", + "window", + "arguments", + "constructor", + "prototype", + "Object", + "Reflect", + "Proxy", + "JSON", + "call", + "apply", + "bind", + "class", + "with", + "import", + "require", + "fromCharCode", + "fromCodePoint", + "getOwnPropertyDescriptor", + "getOwnPropertyDescriptors", + "getPrototypeOf", + "setPrototypeOf", + "defineProperty", +]; + +/// Keywords after which a `/` starts a regular expression. +const BEFORE_REGEX: &[&str] = &["return", "typeof", "instanceof", "in", "of", "new", "delete", "void", "throw", "case", "do", "else", "yield", "await"]; + +/// Keywords whose `( … )` a regular expression may follow (`if (a) /x/.test(s)`). +const CONTROL: &[&str] = &["if", "while", "for", "with"]; + +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +enum Tok<'a> { + Ident(&'a str), + /// A string literal's text between its quotes; `plain` when it has no escape. + Str { + text: &'a str, + plain: bool, + }, + Num, + Punct(u8), +} + +/// The tokens of `text`, or `None` when it can't be read for sure. +fn tokens(text: &str) -> Option>> { + let b = text.as_bytes(); + let mut out: Vec> = Vec::new(); + // Per open `(`: whether a control keyword is before it; whether the last `)` closed one + // (only looked at right after a `)`). + let mut parens: Vec = Vec::new(); + let mut control_close = false; + let mut i = 0; + while let Some(&c) = b.get(i) { + match c { + b' ' | b'\t' | b'\n' | b'\r' | 0x0b | 0x0c => i += 1, + b'/' if b.get(i + 1) == Some(&b'/') => { + while b.get(i).is_some_and(|c| *c != b'\n') { + i += 1; + } + } + b'/' if b.get(i + 1) == Some(&b'*') => { + let end = text.get(i + 2..)?.find("*/")?; + i += 2 + end + 2; + } + b'/' => { + if regex_may_start(out.last(), control_close) { + return None; + } + out.push(Tok::Punct(c)); + i += 1; + } + b'"' | b'\'' => { + let start = i + 1; + let mut j = start; + let mut plain = true; + loop { + match *b.get(j)? { + q if q == c => break, + b'\n' | b'\r' => return None, + b'\\' => { + // Only escapes that can't spell a name: `\n`, `\t`, a quote... + if !matches!(b.get(j + 1)?, b'n' | b'r' | b't' | b'b' | b'f' | b'v' | b'\'' | b'"' | b'\\') { + return None; + } + plain = false; + j += 2; + } + _ => j += 1, + } + } + let s = text.get(start..j)?; + if s.contains("__") { + return None; + } + out.push(Tok::Str { text: s, plain }); + i = j + 1; + } + b'0'..=b'9' => { + while b.get(i).is_some_and(|c| c.is_ascii_alphanumeric() || *c == b'_' || *c == b'.') { + i += 1; + } + out.push(Tok::Num); + } + b'.' if b.get(i + 1).is_some_and(u8::is_ascii_digit) => { + i += 1; + while b.get(i).is_some_and(|c| c.is_ascii_alphanumeric() || *c == b'_' || *c == b'.') { + i += 1; + } + out.push(Tok::Num); + } + c if c.is_ascii_alphabetic() || c == b'_' || c == b'$' => { + let start = i; + while b.get(i).is_some_and(|c| c.is_ascii_alphanumeric() || *c == b'_' || *c == b'$') { + i += 1; + } + out.push(Tok::Ident(text.get(start..i)?)); + } + // A template string (code inside `${}`), an escaped identifier, a name in another + // alphabet: not followed. + b'`' | b'\\' => return None, + c if !c.is_ascii() => return None, + c => { + match c { + b'(' => parens.push(matches!(out.last(), Some(Tok::Ident(k)) if CONTROL.contains(k))), + b')' => control_close = parens.pop().unwrap_or(false), + _ => {} + } + out.push(Tok::Punct(c)); + i += 1; + } + } + } + Some(out) +} + +/// Whether a `/` after `prev` may start a regular expression literal (which the scanner doesn't +/// read: its text could hide a quote). +fn regex_may_start(prev: Option<&Tok<'_>>, control_close: bool) -> bool { + match prev { + None => true, + Some(Tok::Ident(k)) => BEFORE_REGEX.contains(k), + Some(Tok::Num | Tok::Str { .. }) => false, + Some(Tok::Punct(b')')) => control_close, + Some(Tok::Punct(b']')) => false, + Some(Tok::Punct(_)) => true, + } +} + +/// What the expression `text` can reach by name, or [`ExprReach::Anything`]. +pub fn expression_reach(text: &str) -> ExprReach { + expression_names(text).map_or(ExprReach::Anything, |(comps, footage)| ExprReach::Names { comps, footage }) +} + +fn expression_names(text: &str) -> Option<(Vec, Vec)> { + let toks = tokens(text)?; + let (mut comps, mut footage) = (Vec::new(), Vec::new()); + // Per open `[`: a computed key (`{[k]: v}`), a computed member (`o[k]`). + let mut brackets: Vec<(bool, bool)> = Vec::new(); + for (i, t) in toks.iter().enumerate() { + let prev = i.checked_sub(1).and_then(|p| toks.get(p)); + let next = |n: usize| toks.get(i + n); + match *t { + Tok::Ident(name) if name.starts_with("__") || REACHES_ANYTHING.contains(&name) => return None, + Tok::Ident(name @ ("comp" | "footage")) => { + // Only a call with a plain literal, not a property of something else. + let (Some(Tok::Punct(b'(')), Some(Tok::Str { text, plain: true }), Some(Tok::Punct(b')'))) = (next(1), next(2), next(3)) else { return None }; + if matches!(prev, Some(Tok::Punct(b'.'))) { + return None; + } + if name == "comp" { comps.push((*text).to_string()) } else { footage.push((*text).to_string()) } + } + Tok::Punct(b'[') => { + let key = matches!(prev, Some(Tok::Punct(b'{' | b',')) | Some(Tok::Ident("get" | "set" | "static" | "async")) | Some(Tok::Punct(b'*'))); + let member = matches!(prev, Some(Tok::Ident(_) | Tok::Str { .. } | Tok::Num | Tok::Punct(b')' | b']' | b'.'))); + brackets.push((key, member)); + } + Tok::Str { .. } if brackets.last().is_some_and(|(_, member)| *member) => return None, + Tok::Punct(b']') => { + let (key, _) = brackets.pop().unwrap_or((true, true)); + // A computed key (`{[k]: v}`, `{[k]() {}}`) or a write through brackets (`o[k] = v`, + // `o[k] ||= v`, `for (o[k] in …)`, `[o[k]] = v`) could name a private field. + if key && matches!(next(1), Some(Tok::Punct(b':' | b'('))) { + return None; + } + if assigns(&toks, i + 1) || matches!(next(1), Some(Tok::Ident("in" | "of"))) { + return None; + } + } + // A destructuring write (`({a: o[k]} = v)`). + Tok::Punct(b'}') if assigns(&toks, i + 1) => return None, + _ => {} + } + } + Some((comps, footage)) +} + +/// Whether the tokens from `at` are an assignment operator (`=`, `+=`, `>>>=`, `??=`...), not a +/// comparison (`==`, `<=`) or an arrow (`=>`). +fn assigns(toks: &[Tok<'_>], at: usize) -> bool { + let mut op = Vec::new(); + for t in toks.iter().skip(at).take(5) { + match t { + Tok::Punct(c) if b"+-*/%&|^<>?=".contains(c) => op.push(*c), + _ => break, + } + } + let Some(eq) = op.iter().position(|c| *c == b'=') else { return false }; + let (before, after) = op.split_at(eq); + if after.get(1).is_some_and(|c| *c == b'=' || *c == b'>') { + return false; + } + matches!(before, b"" | b"+" | b"-" | b"*" | b"/" | b"%" | b"&" | b"|" | b"^" | b"**" | b"<<" | b">>" | b">>>" | b"&&" | b"||" | b"??") +} + +/// The items a comp's pixels can depend on ([`Project::pixel_reach`]). +#[derive(Clone, Debug, Default, PartialEq, Eq)] +pub struct PixelReach { + /// The items whose state counts; `None`: every item of the project. + pub items: Option>, + /// Expressions are among them: they can read every layer of the comps they reach (hidden + /// and silent ones too) and the markers, which therefore count as well (#1083). + pub expressions: bool, + /// The names expressions look items up by (`true`: a comp's, `false`: footage's), each with + /// the ids of the items of that kind that have it now, in id order (the first one is what + /// the lookup finds; another item taking or giving up the name changes it). + pub names: Vec<(bool, String, Vec)>, +} + +/// Each property of a group and its subgroups (iterative: no depth limit to hit). +fn each_prop<'a>(g: &'a PropGroup, f: &mut dyn FnMut(&'a crate::Property) -> Option<()>) -> Option<()> { + let mut stack = vec![g]; + while let Some(g) = stack.pop() { + for n in &g.children { + match n { + Node::Prop(p) => f(p)?, + Node::Group(sub) => stack.push(sub), + } + } + } + Some(()) +} + +impl Project { + /// The items comp `comp` draws ([`Self::silent_layers`] aside, with `heard`) and the + /// footage its precomp layers swap in (Essential Graphics Media Replacement); with an + /// expression in any of its comps, everything those expressions can reach + /// ([`expression_reach`]). Memory only: no file is looked at. + pub fn pixel_reach(&self, comp: ItemId, heard: &crate::Heard) -> PixelReach { + let Some(drawn) = self.reach_walk(comp, &|id, c| self.silent_layers(id, c, heard), &mut |_| Some(vec![])) else { return PixelReach::every() }; + let has_expression = |g: &PropGroup| each_prop(g, &mut |p| p.expr.is_none().then_some(())).is_none(); + if !drawn.iter().filter_map(|id| self.comp(*id)).any(|c| c.layers.iter().any(|l| has_expression(&l.props))) { + return PixelReach { items: Some(drawn), expressions: false, names: vec![] }; + } + // Expressions: every layer of a comp they reach counts, and what they name. + let mut names: BTreeMap<(bool, String), Vec> = BTreeMap::new(); + let mut scan = |p: &crate::Property| match p.expr.as_ref().map(|e| expression_reach(&e.text)) { + None => Some(vec![]), + Some(ExprReach::Anything) => None, + Some(ExprReach::Names { comps, footage }) => { + let mut found = vec![]; + for (is_comp, name) in comps.into_iter().map(|n| (true, n)).chain(footage.into_iter().map(|n| (false, n))) { + let ids = self.named(is_comp, &name); + found.extend(ids.iter().copied()); + names.insert((is_comp, name), ids); + } + Some(found) + } + }; + let Some(mut items) = self.reach_walk(comp, &|_, _| BTreeSet::new(), &mut scan) else { return PixelReach::every() }; + // A source's data is read by its name (`layer.source.sourceData`). + let footage_names: BTreeSet<&str> = + items.iter().filter_map(|id| self.item(*id)).filter(|i| matches!(i.kind, ItemKind::Footage(_))).map(|i| i.name.as_str()).collect(); + let same_name: Vec = + self.items.values().filter(|i| matches!(i.kind, ItemKind::Footage(_)) && footage_names.contains(i.name.as_str())).map(|i| i.id).collect(); + items.extend(same_name); + PixelReach { items: Some(items), expressions: true, names: names.into_iter().map(|((c, n), ids)| (c, n, ids)).collect() } + } + + /// The items of one kind (`is_comp`: comps, else footage) named `name`, in id order. + fn named(&self, is_comp: bool, name: &str) -> Vec { + self.items + .values() + .filter(|i| i.name == name && if is_comp { matches!(i.kind, ItemKind::Comp(_)) } else { matches!(i.kind, ItemKind::Footage(_)) }) + .map(|i| i.id) + .collect() + } + + /// The items reached from `comp` through its layers (but those `quiet` names) and the items + /// `scan` returns for each of their properties; `None` when something reaches every item. + /// (A stack and a visited set: each item is visited once, cycles included.) + fn reach_walk( + &self, + comp: ItemId, + quiet: &dyn Fn(ItemId, &Comp) -> BTreeSet, + scan: &mut dyn FnMut(&crate::Property) -> Option>, + ) -> Option> { + let mut seen = BTreeSet::new(); + let mut stack = vec![comp]; + while let Some(id) = stack.pop() { + if !seen.insert(id) { + continue; + } + let Some(c) = self.comp(id) else { continue }; + let quiet = quiet(id, c); + for l in c.layers.iter().filter(|l| !quiet.contains(&l.id)) { + if let LayerSource::Comp { item } | LayerSource::Footage { item } | LayerSource::Solid { item } = l.source { + stack.push(item); + } + stack.extend(self.media_replacements(l)?); + let mut reached = vec![]; + each_prop(&l.props, &mut |p| { + reached.extend(scan(p)?); + Some(()) + })?; + stack.extend(reached); + } + } + Some(seen) + } + + /// The footage a precomp layer swaps in through its Essential Properties (Media Replacement): + /// the items its overridden properties name. `None` when they can't be listed (an + /// expression or keyframes choose the item over time). + fn media_replacements(&self, layer: &crate::Layer) -> Option> { + let over = crate::essential::overridden(layer); + let Some(g) = crate::essential::group(layer).filter(|_| !over.is_empty()) else { return Some(vec![]) }; + let mut out = vec![]; + each_prop(g, &mut |p| { + if !over.contains(&p.uid) { + return Some(()); + } + if p.expr.is_some() || !p.keys.is_empty() { + return None; + } + if let Value::Scalar(id) = p.value { + let item = ItemId(id.max(0.0) as u64); + if matches!(self.item(item).map(|i| &i.kind), Some(ItemKind::Footage(_))) { + out.push(item); + } + } + Some(()) + })?; + Some(out) + } +} + +impl PixelReach { + /// Every item of the project, with expressions. + fn every() -> PixelReach { + PixelReach { items: None, expressions: true, names: vec![] } + } +} + +#[cfg(test)] +mod tests; diff --git a/crates/project/src/reach/tests.rs b/crates/project/src/reach/tests.rs new file mode 100644 index 000000000..3a195088d --- /dev/null +++ b/crates/project/src/reach/tests.rs @@ -0,0 +1,177 @@ +use super::*; +use crate::{Expression, Solid, build}; +use effectcraft_time::{FrameRate, Tick}; + +fn names(comps: &[&str], footage: &[&str]) -> ExprReach { + ExprReach::Names { comps: comps.iter().map(|s| s.to_string()).collect(), footage: footage.iter().map(|s| s.to_string()).collect() } +} + +/// Expressions that read their own comp, or other items by literal names, are followed; every +/// way to reach items by a computed name or an id, or text the scanner can't read for sure, +/// reaches everything. +#[test] +fn expression_reach_follows_literal_names_and_refuses_the_rest() { + let follows = [ + ("wiggle(2, 20)", names(&[], &[])), + ("thisComp.layer(\"Comp 1 Layer\").transform.opacity * 2 / 3", names(&[], &[])), + ("value + [10, 0]; value[0] / 2", names(&[], &[])), + ("// comp(name) in a comment\n/* footage(x) */ value", names(&[], &[])), + ("\"a string that says comp(x) and Layer\"", names(&[], &[])), + ("comp(\"Other\").layer(1).transform.position", names(&["Other"], &[])), + ("comp( 'A' ).width + comp(\"B\").height", names(&["A", "B"], &[])), + ("footage(\"data.json\").sourceData.x", names(&[], &["data.json"])), + ("x = a[0] <= b ? a[1] : 0; y = a[0] == 1", names(&[], &[])), + ("thisLayer.source.layer(1).name", names(&[], &[])), + ("if (a) x = 1; else x = 2; (a + b) / 2", names(&[], &[])), + ("\"Ünïcödé name\"", names(&[], &[])), + ("const f = (v) => v * 2; f(1)", names(&[], &[])), + ]; + for (text, want) in follows { + assert_eq!(expression_reach(text), want, "{text}"); + } + let anything = [ + "comp(\"Shot \" + index).layer(1)", + "comp(name)", + "var n = \"Other\"; comp(n)", + "comp(\"O\\\"ther\")", + "x.comp(\"Other\")", + "var comp = 1", + "footage(thisComp.name)", + "new Comp(7).layer(1)", + "Layer(7, 3).name", + "__h(__COMP, 7)", + "o.__c = 7", + "eval('1')", + "Function('return 1')()", + "this.x", + "({}).constructor", + "Object.getPrototypeOf(thisComp)", + "JSON.parse(s)", + "thisComp.layer.call(o, 1)", + "o['_' + '_c']", + "o[k] = 7", + "o[k] ||= 7", + "o[k] += 7", + "[o[k]] = [7]", + "({a: o[k]} = {a: 7})", + "for (o[k] in x) {}", + "({[k]: 7})", + "({a: 1, [k]: 7})", + "o = {'__c': 7}", + "'\\x5f\\x5fc'", + "'\\_\\_c'", + "`${x}`", + "c\\u006fmp('A')", + "comp\u{0430}('A')", + "/\"/.test(s); comp(n); \"", + "return /x/", + "if (a) /\"/.test(s)", + "x = '", + "/* comp(n)", + "class X {}", + "String.fromCharCode(95)", + ]; + for text in anything { + assert_eq!(expression_reach(text), ExprReach::Anything, "{text}"); + } +} + +/// `a / b` divides after a name, a number, a string and a closing bracket or parenthesis. +#[test] +fn division_is_not_a_regular_expression() { + for text in ["a / b", "2 / 3", "'a' / 2", "x[0] / 2", "(a + b) / 2", "f(x) / 2 / g(y)"] { + assert_eq!(expression_reach(text), names(&[], &[]), "{text}"); + } +} + +struct Fixture { + p: Project, + main: ItemId, + other: ItemId, + third: ItemId, + unused: ItemId, + solid: ItemId, +} + +/// Comps "Main" (a solid), "Other" (a solid), "Third" (empty), an unused footage item. +fn fixture() -> Fixture { + let mut p = Project::default(); + let comp = Comp::new(64, 64, FrameRate::FPS_30, Tick::from_seconds_f64(2.0)); + let solid = + p.add_item("Solid", effectcraft_color::Label::None, None, ItemKind::Solid(Solid { color: [1.0, 0.0, 0.0], width: 64, height: 64, pixel_aspect: 1.0 })); + let main = p.add_item("Main", effectcraft_color::Label::None, None, ItemKind::Comp(comp.clone().into())); + let other = p.add_item("Other", effectcraft_color::Label::None, None, ItemKind::Comp(comp.clone().into())); + let third = p.add_item("Third", effectcraft_color::Label::None, None, ItemKind::Comp(comp.clone().into())); + let unused = p.add_item("unused.png", effectcraft_color::Label::None, None, ItemKind::Footage(crate::Footage { has_video: true, ..Default::default() })); + for c in [main, other] { + let l = build::layer(&mut p, &comp, "S", LayerSource::Solid { item: solid }, (64, 64), None); + p.comp_mut(c).unwrap().layers.push(l); + } + Fixture { p, main, other, third, unused, solid } +} + +fn set_expr(p: &mut Project, comp: ItemId, text: &str) { + let l = p.comp_mut(comp).unwrap().layers.first_mut().unwrap(); + l.props.prop_mut("transform/opacity").unwrap().expr = Some(Expression { text: text.into(), enabled: true }); +} + +fn reach(p: &Project, comp: ItemId) -> PixelReach { + p.pixel_reach(comp, &p.heard_layers()) +} + +#[test] +fn pixel_reach_is_what_the_comp_draws_and_what_its_expressions_name() { + let mut f = fixture(); + let ids = |r: &PixelReach| r.items.clone().map(|s| s.into_iter().collect::>()); + assert_eq!(reach(&f.p, f.main), PixelReach { items: Some([f.solid, f.main].into()), expressions: false, names: vec![] }); + // An expression reading only its own comp: what it draws, with expressions. + set_expr(&mut f.p, f.main, "thisComp.layer(1).transform.opacity"); + let r = reach(&f.p, f.main); + assert!(r.expressions); + assert_eq!(ids(&r), Some(vec![f.solid, f.main])); + // An expression in another comp doesn't reach this one. + set_expr(&mut f.p, f.other, "wiggle(1, 1)"); + assert_eq!(ids(&reach(&f.p, f.main)), Some(vec![f.solid, f.main])); + // A literal name: that comp and what it draws, with the name and the comps that have it. + set_expr(&mut f.p, f.main, "comp(\"Other\").layer(1).transform.opacity"); + let r = reach(&f.p, f.main); + assert_eq!(ids(&r), Some(vec![f.solid, f.main, f.other])); + assert_eq!(r.names, vec![(true, "Other".to_string(), vec![f.other])]); + // Another comp taking the name is part of it, whichever the lookup finds. + f.p.item_mut(f.third).unwrap().name = "Other".into(); + let r = reach(&f.p, f.main); + assert_eq!(r.names, vec![(true, "Other".to_string(), vec![f.other, f.third])]); + assert!(r.items.unwrap().contains(&f.third)); + // A name no item has yet still counts (with no item). + set_expr(&mut f.p, f.main, "footage(\"later.json\").sourceData"); + assert_eq!(reach(&f.p, f.main).names, vec![(false, "later.json".to_string(), vec![])]); + // A computed name reaches everything. + set_expr(&mut f.p, f.main, "comp(\"Ot\" + \"her\").width"); + assert_eq!(reach(&f.p, f.main), PixelReach { items: None, expressions: true, names: vec![] }); + // Footage reached as a layer's source brings the footage of its name (its data is read by + // name). + let comp = f.p.comp(f.main).unwrap().clone(); + let l = build::layer(&mut f.p, &comp, "U", LayerSource::Footage { item: f.unused }, (64, 64), None); + f.p.comp_mut(f.main).unwrap().layers.push(l); + let twin = f.p.add_item("unused.png", effectcraft_color::Label::None, None, ItemKind::Footage(crate::Footage::default())); + set_expr(&mut f.p, f.main, "value"); + let r = reach(&f.p, f.main).items.unwrap(); + assert!(r.contains(&f.unused) && r.contains(&twin), "{r:?}"); +} + +/// A comp nested in the reach is scanned too: its expression's names count for the outer comp. +#[test] +fn nested_comps_bring_their_expressions_reach() { + let mut f = fixture(); + let comp = f.p.comp(f.main).unwrap().clone(); + let pre = build::layer(&mut f.p, &comp, "Pre", LayerSource::Comp { item: f.other }, (64, 64), None); + f.p.comp_mut(f.main).unwrap().layers.push(pre); + set_expr(&mut f.p, f.other, "comp(\"Third\").width"); + let r = reach(&f.p, f.main); + assert!(r.expressions && r.items.unwrap().contains(&f.third)); + // A cycle through names ends. + let l = build::layer(&mut f.p, &comp, "S", LayerSource::Solid { item: f.solid }, (64, 64), None); + f.p.comp_mut(f.third).unwrap().layers.push(l); + set_expr(&mut f.p, f.third, "comp(\"Main\").width"); + assert!(reach(&f.p, f.main).items.unwrap().contains(&f.main)); +} diff --git a/crates/render/src/disk_cache.rs b/crates/render/src/disk_cache.rs index 93c949ff2..61f2d8240 100644 --- a/crates/render/src/disk_cache.rs +++ b/crates/render/src/disk_cache.rs @@ -1183,44 +1183,38 @@ pub fn layer_disk_key(key: u64) -> u128 { /// Content key of a composition's pixels, from the project in memory alone (no file is looked /// at: the frame entries check their own source files when read, see [`EntryFiles`]): project -/// render settings, the comp and everything it uses (nested comps, footage items with their -/// settings and paths, solids, their proxies and Use Proxy switches). With expressions in play -/// (which can read any comp) the whole project counts. Switches that don't change pixels (Audio, -/// Lock, Shy, Hide Shy Layers) don't count, and neither do markers unless an expression mentions -/// them. +/// render settings, the comp and the items it can draw (nested comps, footage items with their +/// settings and paths, solids, Media Replacement footage, their proxies and Use Proxy switches; +/// [`effectcraft_project::Project::pixel_reach`]). With expressions among them, everything those +/// expressions can read counts too: every layer of their comps, markers, the comps and footage +/// they name with literal names (and which items have those names), or the whole project when +/// they compute a name or reach items another way. An edit to an item the comp can't reach keeps +/// its key and its frames on disk (#3184, #1492). Switches that don't change pixels (Audio, Lock, +/// Shy, Hide Shy Layers) don't count, and neither do markers unless an expression can read them. pub fn comp_content_key(project: &effectcraft_project::Project, comp: effectcraft_project::ItemId) -> u128 { comp_content_key_for_renderer(project, comp, RENDER_VERSION) } fn comp_content_key_for_renderer(project: &effectcraft_project::Project, comp: effectcraft_project::ItemId, renderer: &str) -> u128 { - use effectcraft_project::{ItemKind, LayerSource}; + use effectcraft_project::ItemKind; let mut h = Hash128::default(); h.write(renderer.as_bytes()); hash_debug(&mut h, &project.settings); - // Expressions can read anything (every item counts); without them, layers that can't - // change the picture (music, hidden layers nothing reads) and their files don't count. - let expressions = project.reads_markers(); let heard = project.heard_layers(); + let reach = project.pixel_reach(comp, &heard); + // Expressions can read any layer of the comps they reach, hidden or not, and their markers + // (#1083); without them, layers that can't change the picture (music, hidden layers nothing + // reads) don't count. + let expressions = reach.expressions; let silent = |id, c: &effectcraft_project::Comp| if expressions { Default::default() } else { project.silent_layers(id, c, &heard) }; - let mut seen = std::collections::BTreeSet::new(); - let mut stack = vec![comp]; - while let Some(id) = stack.pop() { - if !seen.insert(id) { - continue; - } - let Some(it) = project.item(id) else { continue }; - if let ItemKind::Comp(c) = &it.kind { - let quiet = silent(id, c); - for l in c.layers.iter().filter(|l| !quiet.contains(&l.id)) { - if let LayerSource::Comp { item } | LayerSource::Footage { item } | LayerSource::Solid { item } = l.source { - stack.push(item); - } - } - } + // (the names expressions look items up by: which items have them now) + if !reach.names.is_empty() { + hash_debug(&mut h, &reach.names); } - // Markers are pixels only to the expressions that read them (#1083). - let markers = expressions; - let ids: Vec = if expressions { project.items.keys().copied().collect() } else { seen.into_iter().collect() }; + let ids: Vec = match reach.items { + Some(items) => items.into_iter().collect(), + None => project.items.keys().copied().collect(), + }; for id in ids { let Some(it) = project.item(id) else { continue }; h.write_u64(id.0); @@ -1230,11 +1224,11 @@ fn comp_content_key_for_renderer(project: &effectcraft_project::Project, comp: e let quiet = silent(id, c); let heard = |l| heard.contains(id, l); if quiet.is_empty() { - hash_debug(&mut h, &c.pixel_form_with(markers, &heard)); + hash_debug(&mut h, &c.pixel_form_with(expressions, &heard)); } else { let mut pic = (**c).clone(); pic.layers.retain(|l| !quiet.contains(&l.id)); - hash_debug(&mut h, &pic.pixel_form_with(markers, &heard)); + hash_debug(&mut h, &pic.pixel_form_with(expressions, &heard)); } } k => hash_debug(&mut h, k), diff --git a/crates/ui-egui/src/frames/tests.rs b/crates/ui-egui/src/frames/tests.rs index 596f3054a..2644095f4 100644 --- a/crates/ui-egui/src/frames/tests.rs +++ b/crates/ui-egui/src/frames/tests.rs @@ -1975,6 +1975,80 @@ fn disk_frames_outlive_an_edit_that_cant_change_them() { let _ = std::fs::remove_dir_all(&dir); } +/// With expressions the disk key covers what they can read (#3184, #1492): an edit to a comp no +/// expression names keeps every frame on disk under the same key; an edit to the comp one names +/// gives the comp a new key, and the frames outside the layer with that expression are carried to +/// it (the dirty spans of #2795). +#[test] +fn disk_frames_outlive_edits_their_expressions_cant_read() { + use effectcraft_engine::Session; + use effectcraft_engine::project::{Expression, LayerId, Value}; + use serde_json::json; + let dir = std::env::temp_dir().join(format!("ec-disk-carry-expr-{}", std::process::id())); + let _ = std::fs::remove_dir_all(&dir); + let disk = DiskCache::open(&dir, 1 << 30).unwrap(); + let mut s = Session::default(); + let comp = |s: &mut Session, name: &str| { + ItemId(s.execute("comp.new", json!({"name": name, "width": 8, "height": 8, "duration": 1, "frameRate": 30})).unwrap()["comp"].as_u64().unwrap()) + }; + let solid = |s: &mut Session, c: ItemId| LayerId(s.execute("layer.newSolid", json!({"comp": c.0, "color": "#ff0000"})).unwrap()["layer"].as_u64().unwrap()); + let cid = comp(&mut s, "A"); + let (a, b) = (solid(&mut s, cid), solid(&mut s, cid)); + let other = comp(&mut s, "Other"); + let o = solid(&mut s, other); + let third = comp(&mut s, "Third"); + let t = solid(&mut s, third); + let fr = s.project.comp(cid).unwrap().frame_rate; + let mut p0 = (*s.project).clone(); + for (l, i, out) in [(a, 0, 15), (b, 15, 30)] { + let l = p0.comp_mut(cid).unwrap().layer_mut(l).unwrap(); + (l.start_time, l.in_point, l.out_point) = (fr.tick_of(i), fr.tick_of(i), fr.tick_of(out)); + } + p0.comp_mut(cid).unwrap().layer_mut(a).unwrap().props.prop_mut("transform/opacity").unwrap().expr = + Some(Expression { text: "comp(\"Other\").layer(1).transform.opacity".into(), enabled: true }); + let p0 = Arc::new(p0); + let opts = RenderOpts::default(); + let oh = opts_hash(&opts); + let src = |p: &Arc| RenderSource { + project: p.clone(), + footage: Arc::new(effectcraft_engine::render::NoFootage), + expr: None, + layer_cache: Arc::default(), + gpu: None, + gpu_display: false, + disk: Some(disk.clone()), + }; + let content0 = disk_cache::comp_content_key(&p0, cid); + for f in 0..30 { + disk.put_frame_now(disk_cache::frame_key(content0, f, 1000, oh), 1, 1, &[1, 2, 3, 255], &ReadFiles::default()); + } + let opacity = |p: &mut Project, c: ItemId, l: LayerId| { + p.comp_mut(c).unwrap().layer_mut(l).unwrap().props.prop_mut("transform/opacity").unwrap().value = Value::Scalar(40.0) + }; + for (name, edited, layer, same_key, kept) in [("Third", third, t, true, (0..30).collect::>()), ("Other", other, o, false, (17..30).collect())] { + let f = Frames::default(); + let series = |p: &Arc, rev: u64| FrameKey { revision: rev, content: f.content_of(p, rev, cid), comp: cid.0, opts: oh, ..key(0, 0, 0) }; + let blue = |p: &Arc, rev: u64, want: &[i64]| { + let base = series(p, rev); + let mut got = vec![]; + for _ in 0..1000 { + got = f.disk_frames(&src(p), &base, 0..30, &opts); + if got == want { + break; + } + std::thread::sleep(std::time::Duration::from_millis(5)); + } + got + }; + assert_eq!(blue(&p0, 1, &(0..30).collect::>()), (0..30).collect::>(), "{name}: before"); + let mut p1 = p0.clone(); + opacity(Arc::make_mut(&mut p1), edited, layer); + assert_eq!(disk_cache::comp_content_key(&p1, cid) == content0, same_key, "{name}: the key"); + assert_eq!(blue(&p1, 2, &kept), kept, "{name}: after"); + } + let _ = std::fs::remove_dir_all(&dir); +} + /// A keyframe edit re-renders only around the keys it changed: two keys either side (auto-Bezier /// and continuous tangents reach the neighbouring segments), and from the layer's in point when /// the first key changes. A static value or an expression still reaches the whole layer. Every From 0bf8bf2b5e0ca0f5239298f71d00337a8930453c Mon Sep 17 00:00:00 2001 From: vangel76 Date: Sat, 7 Nov 2026 01:11:55 +0100 Subject: [PATCH 022/451] Disk cache: Reload Footage drops the entries of its files, docs File > Reload Footage now deletes the frame and layer entries whose file lists name the reloaded item's files (DiskCache::drop_files), so a file replaced by one with the same size and modification time, which the check on hit can't tell apart, is read again. The index knows keys, not files: the writer thread reads the files section at the start of each frame and layer entry (not the pixels) after the writes queued before it, and deletes the entries that list one of the files. Until it is done, an entry made of one of them is a miss and frames aren't linked to new keys. The entries are gone for good, so they don't come back after a restart. Automatic reloads don't drop anything: they follow a changed stamp, which the check on hit catches. The browser needs nothing (its file identities are content hashes). Removed: disk_cache::seal, which steps 2 and 3 left without callers (the tests use seal_format). Updated the module, seal_format and forget_media docs, and docs/architecture.md / docs/web.md describe the final design: what is cached, keys from memory, file lists checked on hit, nothing scans the project, incomplete lists stay in memory, Reload Footage drops entries, edits keep the frames they can't change. Tests: render unit tests (same size and time passes the check but not the drop; other files' entries stay; an entry queued before the drop is dropped; a layer entry too; written again afterwards it is used; the drop survives a restart; a pending drop is a miss), and an engine test through file.reloadFootage. Closes #3184. Part of #1492. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/footage/footage_reload.rs | 14 +- crates/engine/src/tests/disk_cache.rs | 58 ++++++ crates/render/src/disk_cache.rs | 212 ++++++++++++++++++-- docs/architecture.md | 48 +++-- docs/web.md | 8 +- 5 files changed, 297 insertions(+), 43 deletions(-) diff --git a/crates/engine/src/footage/footage_reload.rs b/crates/engine/src/footage/footage_reload.rs index 4232e1d11..2744d0224 100644 --- a/crates/engine/src/footage/footage_reload.rs +++ b/crates/engine/src/footage/footage_reload.rs @@ -6,7 +6,8 @@ //! or PDF page an item shows and its interpretation (alpha, conformed frame rate, pixel aspect, //! fields, colour). A Photoshop layer is found again by name when layers were added or removed //! around it. The media layer then forgets the file and the layer cache is emptied, so the next -//! render reads the new pixels. +//! render reads the new pixels; File ▸ Reload Footage also deletes the disk cache entries made of +//! the file (#3184). //! //! The automatic part compares each footage file's size and modification time with what they //! were when the file was last seen. The desktop app keeps a [`Watcher`]: a worker thread that @@ -279,6 +280,12 @@ fn reload(s: &mut Session, ids: &[ItemId], undoable: bool) -> crate::Result<(usi let n = updates.len(); apply_reloads(s, updates, undoable)?; forget_media(s, &paths); + // An explicit reload also reads files again that kept their size and time (the check on hit + // can't tell those apart): their entries in the disk cache go (#3184). An automatic one + // only follows a changed stamp, which the check catches. + if undoable && let Some(dc) = &s.disk_cache { + dc.drop_files(paths.iter().map(String::as_str)); + } Ok((n, failed)) } @@ -317,8 +324,9 @@ fn apply_reloads(s: &mut Session, updates: Vec<(ItemId, Footage)>, undoable: boo Ok(()) } -/// Make the media layer and the layer cache let go of `paths`, so renders read them again. The -/// disk cache needs nothing: its entries check the files they were made of when read (#3184). +/// Make the media layer and the layer cache let go of `paths`, so renders read them again. Disk +/// cache entries check the files they were made of when read (#3184); File ▸ Reload Footage +/// also drops the entries of its files ([`reload`]). pub(crate) fn forget_media(s: &mut Session, paths: &BTreeSet) { for p in paths { s.footage.forget(p); diff --git a/crates/engine/src/tests/disk_cache.rs b/crates/engine/src/tests/disk_cache.rs index 8f4973ae3..fed00e852 100644 --- a/crates/engine/src/tests/disk_cache.rs +++ b/crates/engine/src/tests/disk_cache.rs @@ -339,3 +339,61 @@ fn markers_count_only_where_an_expression_can_read_them() { assert_eq!(key(&s), k0, "M itself still doesn't"); } +/// File ▸ Reload Footage drops the disk entries made of the item's files (#3184): a file +/// replaced by one with the same size and modification time is read again (the check on hit +/// can't tell), and entries of other files stay. +#[test] +fn reload_footage_drops_the_entries_of_its_files() { + use crate::render::reads::{FileStamp, ReadFile, ReadFiles}; + struct Probe; + impl crate::Importer for Probe { + fn probe(&self, path: &str) -> std::result::Result { + Ok(effectcraft_project::Footage { + path: path.into(), + kind: effectcraft_project::FootageKind::Still, + width: 1, + height: 1, + has_video: true, + ..Default::default() + }) + } + } + let dir = folder("reload"); + let mut s = Session { importer: Some(std::sync::Arc::new(Probe)), ..Default::default() }; + s.execute_checked("prefs.set", json!({"values": {"disk.diskCacheFolder": &dir, "disk.diskCacheEnabled": true}})).unwrap(); + let src = std::path::Path::new(&dir).join("src"); + std::fs::create_dir_all(&src).unwrap(); + let mut add = |name: &str| { + let p = src.join(name); + std::fs::write(&p, b"aa").unwrap(); + let path = p.to_string_lossy().to_string(); + let f = effectcraft_project::Footage { + path: path.clone(), + kind: effectcraft_project::FootageKind::Still, + width: 1, + height: 1, + has_video: true, + ..Default::default() + }; + let id = s.edit("add", None, |p, _| Ok(p.add_item(name, effectcraft_color::Label::None, None, effectcraft_project::ItemKind::Footage(f)))).unwrap(); + (id, path) + }; + let (a, a_path) = add("a.png"); + let (_, b_path) = add("b.png"); + let dc = s.disk_cache.clone().unwrap(); + let read = |p: &str| -> ReadFiles { [ReadFile::new(p, FileStamp::native(p).unwrap())].into_iter().collect() }; + dc.put_frame_now(1, 1, 1, &[1; 4], &read(&a_path)); + dc.put_frame_now(2, 1, 1, &[2; 4], &read(&b_path)); + dc.put_layer_now(3, &effectcraft_effects::Buf { img: effectcraft_raster::Image::new(1, 1), offset: [0.0; 2], scale: 1.0 }, &read(&a_path)); + // Other bytes, same size, the old time back. + let t = std::fs::metadata(&a_path).unwrap().modified().unwrap(); + std::fs::write(&a_path, b"AA").unwrap(); + std::fs::File::options().append(true).open(&a_path).unwrap().set_modified(t).unwrap(); + assert!(dc.contains(crate::render::disk_cache::Kind::Frame, 1)); + s.execute_checked("file.reloadFootage", json!({"item": a.0})).unwrap(); + dc.flush(); + assert!(dc.get_frame(1, None).is_none(), "the reloaded file's frame renders again"); + assert!(dc.get_layer(3, None).is_none(), "and its layer buffer"); + assert!(dc.get_frame(2, None).is_some(), "another file's frame stays"); + let _ = std::fs::remove_dir_all(&dir); +} diff --git a/crates/render/src/disk_cache.rs b/crates/render/src/disk_cache.rs index 61f2d8240..d92505c98 100644 --- a/crates/render/src/disk_cache.rs +++ b/crates/render/src/disk_cache.rs @@ -2,16 +2,18 @@ //! and layer cache entries kept on disk between sessions, like After Effects' disk cache. //! //! * Entries are files keyed by a 128-bit content hash (`/v1//<2 hex>/<32 hex>.ecc`): -//! frames by the hash of the composition's content as it is in memory (the comp and everything -//! it uses, footage items with their settings and paths; no file is looked at) plus frame, -//! scale and view; layer buffers by the layer cache's content key (which names the footage -//! items a buffer uses with their settings and paths) and the renderer version -//! ([`layer_disk_key`]). A changed project therefore never reads stale pixels: its keys simply -//! change. +//! frames by the hash of the composition's content as it is in memory (the comp and what it can +//! draw, footage items with their settings and paths, and what its expressions can read; no +//! file is looked at, [`comp_content_key`]) plus frame, scale and view; layer buffers by the +//! layer cache's content key (which names the footage items a buffer uses with their settings +//! and paths) and the renderer version ([`layer_disk_key`]). A changed project therefore never +//! reads stale pixels: its keys simply change, and an edit elsewhere keeps them. //! * Frame and layer entries keep the source files they were made of, each with the size and //! modification time it was read with ([`EntryFiles`], #3184). An entry is used only while //! those files are unchanged: a handful of `metadata` calls when it is read, never a scan of -//! the project's files. A frame or buffer whose files can't all be named is not stored. +//! the project's files. A frame or buffer whose files can't all be named is not stored. File ▸ +//! Reload Footage deletes the entries made of the reloaded files ([`DiskCache::drop_files`]): +//! a file replaced by one of the same size and time is read again. //! * Payloads are LZ4-compressed (`lz4_flex`, MIT): frames as 8-bit premultiplied RGBA (or, for //! 32 bpc viewer frames, half-float RGBA with the bytes shuffled into planes; the entry //! header's format byte tells them apart: 2 and 3, both with their source files first), layer @@ -261,6 +263,8 @@ impl LayerPrefetch { enum Job { /// Kind, key, header format byte, payload. Write(Kind, u128, u8, Vec), + /// Delete the frame and layer entries made of these files ([`DiskCache::drop_files`]). + Drop(Vec>), } struct Queue { @@ -279,8 +283,9 @@ impl Queue { #[cfg(not(target_arch = "wasm32"))] fn pop(&mut self) -> Option { if let Some(j) = self.frames.pop_front() { - let Job::Write(_, _, _, p) = &j; - self.frame_bytes = self.frame_bytes.saturating_sub(p.len()); + if let Job::Write(_, _, _, p) = &j { + self.frame_bytes = self.frame_bytes.saturating_sub(p.len()); + } return Some(j); } self.jobs.pop_front() @@ -310,6 +315,9 @@ pub struct DiskCache { queue: Arc<(Mutex, Condvar)>, /// Layer buffers that took less than this to render are not written (ms). min_layer_ms: AtomicU64, + /// Files whose entries are being deleted ([`DiskCache::drop_files`]), each with the number + /// of drops of it pending: until then an entry made of one is a miss. + dropping: Mutex, u32>>, } /// FNV-1a 128-bit (content keys). @@ -395,6 +403,7 @@ impl DiskCache { Condvar::new(), )), min_layer_ms: AtomicU64::new(30), + dropping: Mutex::new(HashMap::new()), }); dc.rescan(); // Shrinking a large cache deletes many files: the writer thread does it. @@ -631,7 +640,7 @@ impl DiskCache { return miss(); }; self.file_checks.fetch_add(files.len() as u64, Ordering::Relaxed); - if !files.unchanged(virtual_id) { + if self.made_of_dropped(&files) || !files.unchanged(virtual_id) { self.discard(kind, key); return miss(); } @@ -752,6 +761,91 @@ impl DiskCache { } } + /// Delete the frame and layer entries made of any of `paths` (File ▸ Reload Footage: a file + /// replaced by one with the same size and modification time must be read again, which the + /// check on hit can't tell). The index knows keys, not files, so the writer thread reads the + /// files section at the start of each frame and layer entry (no pixels) and deletes the + /// entries that list one of `paths`, after the writes queued before (those are swept too); + /// until it is done, an entry made of one of them is a miss. Entries are deleted for good, + /// so they don't come back after a restart. Nothing else in the cache is touched. + pub fn drop_files(&self, paths: impl IntoIterator>>) { + let paths: Vec> = paths.into_iter().map(Into::into).collect(); + if paths.is_empty() { + return; + } + { + let mut d = self.dropping.lock().unwrap_or_else(std::sync::PoisonError::into_inner); + for p in &paths { + let n = d.entry(p.clone()).or_default(); + *n = n.saturating_add(1); + } + } + #[cfg(not(target_arch = "wasm32"))] + { + let (m, cv) = &*self.queue; + if let Ok(mut q) = m.lock() { + // (never refused for a full queue) + q.jobs.push_back(Job::Drop(paths)); + cv.notify_all(); + return; + } + } + self.sweep(&paths); + } + + /// Whether a [`DiskCache::drop_files`] is pending. + pub fn is_dropping(&self) -> bool { + !self.dropping.lock().unwrap_or_else(std::sync::PoisonError::into_inner).is_empty() + } + + /// An entry made of a file being dropped. + fn made_of_dropped(&self, files: &EntryFiles) -> bool { + let d = self.dropping.lock().unwrap_or_else(std::sync::PoisonError::into_inner); + !d.is_empty() && files.files().iter().any(|f| d.contains_key(&f.path)) + } + + /// The writer's part of [`DiskCache::drop_files`]: delete the entries made of `paths`, then + /// end their drop. + fn sweep(&self, paths: &[Arc]) { + let set: std::collections::HashSet<&str> = paths.iter().map(|p| &**p).collect(); + for kind in [Kind::Frame, Kind::Layer] { + for key in self.keys(kind) { + if self.entry_files(kind, key).is_some_and(|f| f.files().iter().any(|f| set.contains(&*f.path))) { + self.discard(kind, key); + } + } + } + let mut d = self.dropping.lock().unwrap_or_else(std::sync::PoisonError::into_inner); + for p in paths { + if let Some(n) = d.get_mut(p) { + *n = n.saturating_sub(1); + if *n == 0 { + d.remove(p); + } + } + } + } + + /// The source files a frame or layer entry lists, read from the start of its file (the + /// whole file only when the list is longer than that). `None` when it has none to read (an + /// earlier format, gone, damaged): such an entry is never used anyway. + fn entry_files(&self, kind: Kind, key: u128) -> Option { + use std::io::Read; + const HEAD: u64 = 64 << 10; + let parse = |d: &[u8]| { + let format = *d.get(5)?; + let ours = d.get(..4)? == MAGIC && *d.get(4)? == kind.tag(); + if !ours || !matches!(format, FORMAT_RGBA8_FILES | FORMAT_F16_FILES | FORMAT_LAYER_FILES) { + return None; + } + EntryFiles::decode(d.get(8..)?).map(|(files, _)| files) + }; + let path = self.path(kind, key); + let mut head = Vec::new(); + std::fs::File::open(&path).ok()?.take(HEAD).read_to_end(&mut head).ok()?; + parse(&head).or_else(|| if head.len() as u64 == HEAD { parse(&std::fs::read(&path).ok()?) } else { None }) + } + // ------------------------------------------------------------ typed entries /// An 8-bit frame whose source files are unchanged (see [`DiskCache::get_checked`]), with @@ -840,7 +934,8 @@ impl DiskCache { /// has no links. `false` when `from` isn't cached, `to` already is, or the file system /// refused. (Entries don't contain their key, so the same file serves both.) pub fn link_frame(&self, from: u128, to: u128) -> bool { - if !self.contains(Kind::Frame, from) || self.contains(Kind::Frame, to) { + // (while files are being dropped, `from` may be made of one: it renders again instead) + if !self.contains(Kind::Frame, from) || self.contains(Kind::Frame, to) || self.is_dropping() { return false; } let (src, dst) = (self.path(Kind::Frame, from), self.path(Kind::Frame, to)); @@ -913,12 +1008,20 @@ fn writer(dc: std::sync::Weak, q: Arc<(Mutex, Condvar)>) { } }; let Some(cache) = dc.upgrade() else { return }; - let Job::Write(kind, key, format, payload) = job; - cache.write_format(kind, key, format, &payload); + let written = match job { + Job::Write(kind, key, format, payload) => { + cache.write_format(kind, key, format, &payload); + (kind == Kind::Frame).then_some(key) + } + Job::Drop(paths) => { + cache.sweep(&paths); + None + } + }; drop(cache); if let Ok(mut g) = m.lock() { g.busy = false; - if kind == Kind::Frame { + if let Some(key) = written { g.pending_frames.remove(&key); } } @@ -926,12 +1029,9 @@ fn writer(dc: std::sync::Weak, q: Arc<(Mutex, Condvar)>) { } } -/// An entry file's bytes: header (magic, kind, format 0), payload, checksum. -pub fn seal(kind: Kind, payload: &[u8]) -> Vec { - seal_format(kind, FORMAT_RGBA8, payload) -} - -/// [`seal`] with the header's format byte (frames: 0 = 8-bit, 1 = half float). +/// An entry file's bytes: header (magic, kind, the format byte: [`FORMAT_RGBA8`] for +/// segmentations, [`FORMAT_RGBA8_FILES`] / [`FORMAT_F16_FILES`] for frames, +/// [`FORMAT_LAYER_FILES`] for layer buffers), payload, checksum. fn seal_format(kind: Kind, format: u8, payload: &[u8]) -> Vec { let mut data = Vec::with_capacity(payload.len() + 16); data.extend_from_slice(MAGIC); @@ -1331,7 +1431,7 @@ mod tests { bad[20] ^= 1; assert!(read_frame_entry(&bad, Some(&one)).is_none()); // An entry of the format before #3184 (pixels without files) is never read. - assert!(read_frame_entry(&seal(Kind::Frame, &encode_frame(6, 3, &rgba)), Some(&one)).is_none()); + assert!(read_frame_entry(&seal_format(Kind::Frame, FORMAT_RGBA8, &encode_frame(6, 3, &rgba)), Some(&one)).is_none()); let key = 0x0123_4567_89ab_cdef_0011_2233_4455_6677u128; assert_eq!(parse_entry_name(&entry_name(key)), Some(key)); assert_eq!(parse_entry_name("abc.ecc"), None); @@ -1698,7 +1798,7 @@ mod tests { let e = layer_entry(&buf(2, 3, 2), &EntryFiles::of(&files, Some(&one)).unwrap()); let (b, list) = read_layer_entry(&e).unwrap(); assert!(b.img == buf(2, 3, 2).img && list.unchanged(Some(&one)) && !list.unchanged(Some(&two))); - assert!(read_layer_entry(&seal(Kind::Layer, &encode_layer(&buf(2, 3, 2)))).is_none(), "the format before #3184"); + assert!(read_layer_entry(&seal_format(Kind::Layer, FORMAT_RGBA8, &encode_layer(&buf(2, 3, 2)))).is_none(), "the format before #3184"); let mut bad = e.clone(); bad[12] ^= 1; assert!(read_layer_entry(&bad).is_none(), "damaged"); @@ -1860,4 +1960,72 @@ mod tests { assert!(!dc.contains(Kind::Frame, 8)); let _ = std::fs::remove_dir_all(&dir); } + + /// Reload Footage drops the entries made of the reloaded files (#3184): a file replaced by + /// one with the same size and modification time passes the check on hit, so only the drop + /// makes the next use a miss. Entries of other files stay; an entry written after the drop + /// is used; a layer entry and one written while the drop waits in the queue are dropped too; + /// the drop survives a restart (the files are gone). + #[test] + fn dropped_files_take_their_entries_with_them() { + use crate::reads::{FileStamp, ReadFile}; + let dir = tmpdir("drop"); + let src = dir.join("src"); + std::fs::create_dir_all(&src).unwrap(); + let file = |name: &str, bytes: &[u8]| { + let p = src.join(name); + std::fs::write(&p, bytes).unwrap(); + p.to_string_lossy().to_string() + }; + let (a, b) = (file("a.png", b"aa"), file("b.png", b"bb")); + let read = |paths: &[&str]| -> ReadFiles { paths.iter().map(|p| ReadFile::new(*p, FileStamp::native(p).unwrap())).collect() }; + let dc = DiskCache::open(&dir, 1 << 30).unwrap(); + dc.put_frame_now(1, 1, 1, &[1; 4], &read(&[&a])); + dc.put_frame_now(2, 1, 1, &[2; 4], &read(&[&b])); + dc.put_frame_now(3, 1, 1, &[3; 4], &read(&[&a, &b])); + dc.put_layer_now(4, &buf(4, 2, 2), &read(&[&a])); + // a.png gets other bytes of the same size and its old time back: the check can't tell. + let t = std::fs::metadata(&a).unwrap().modified().unwrap(); + std::fs::write(&a, b"AA").unwrap(); + std::fs::File::options().append(true).open(&a).unwrap().set_modified(t).unwrap(); + assert!(dc.get_frame(1, None).is_some(), "same size and time: still a hit"); + // A frame queued (not written yet) when the drop comes is dropped too. + assert!(dc.put_frame(5, 1, 1, &[5; 4], &read(&[&a]), None)); + dc.drop_files([a.clone()]); + dc.flush(); + assert!(!dc.is_dropping()); + for (kind, key) in [(Kind::Frame, 1), (Kind::Frame, 3), (Kind::Layer, 4), (Kind::Frame, 5)] { + assert!(!dc.contains(kind, key), "{kind:?} {key} made of a.png is gone"); + } + assert!(dc.get_frame(1, None).is_none() && dc.get_layer(4, None).is_none()); + assert_eq!(dc.get_frame(2, None).map(|f| f.0.rgba), Some(vec![2; 4]), "b.png's frame stays"); + // Written again from the reloaded file: used. + dc.put_frame_now(1, 1, 1, &[9; 4], &read(&[&a])); + assert_eq!(dc.get_frame(1, None).map(|f| f.0.rgba), Some(vec![9; 4])); + // The drop is for good: a new session on the folder finds what is left. + drop(dc); + let dc = DiskCache::open(&dir, 1 << 30).unwrap(); + assert_eq!(dc.keys(Kind::Frame).into_iter().collect::>(), [1, 2].into()); + assert!(dc.keys(Kind::Layer).is_empty()); + let _ = std::fs::remove_dir_all(&dir); + } + + /// While a drop waits, an entry made of a dropped file is a miss (and deleted), and frames + /// aren't linked to new keys. + #[test] + fn entries_of_a_pending_drop_are_misses() { + use crate::reads::{FileStamp, ReadFile}; + let dir = tmpdir("drop-pending"); + std::fs::create_dir_all(&dir).unwrap(); + let a = dir.join("a.png"); + std::fs::write(&a, b"aa").unwrap(); + let a = a.to_string_lossy().to_string(); + let files: ReadFiles = [ReadFile::new(a.as_str(), FileStamp::native(&a).unwrap())].into_iter().collect(); + let dc = DiskCache::open(dir.join("cache"), 1 << 30).unwrap(); + dc.put_frame_now(1, 1, 1, &[1; 4], &files); + dc.dropping.lock().unwrap().insert(a.as_str().into(), 1); + assert!(!dc.link_frame(1, 2)); + assert!(dc.get_frame(1, None).is_none() && !dc.contains(Kind::Frame, 1)); + let _ = std::fs::remove_dir_all(&dir); + } } diff --git a/docs/architecture.md b/docs/architecture.md index 213aaaf57..90573a1c9 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -240,21 +240,39 @@ converted on demand with the HDR step and without the exposure; the Info panel s frame's float values. The browser keeps 8-bit frames for now (its frame workers send RGBA8). A persistent **disk cache** (`render::disk_cache`, Settings ▸ Media & Disk Cache) backs both -the layer cache and the viewer's RAM preview: layer buffers that were slow to render and every -preview frame are written (LZ4, atomic rename, checksummed) under 128-bit content keys — the -comp's content hash (the comp and what it uses, footage items with their settings and paths, -from memory alone) plus frame, scale and view for frames; the layer cache's content key (which -names the footage items a buffer uses with their paths) and the renderer version for layers. -Every frame and layer entry keeps the source files it was made of, with the size and -modification time they were read with, and is used only while they are unchanged: a handful of -`metadata` calls when an entry is read, never a scan of the project's files (#3184). Entries -survive restarts and never go stale; frames and buffers whose files can't all be named are not -written. Frame entries are 8-bit RGBA, or for 32 bpc viewer frames -half floats with their bytes shuffled into planes before LZ4 (the entry header's format byte -tells them apart; the render options in the key keep the two kinds apart). LRU eviction keeps it under the size limit; Edit ▸ Purge -empties it, `cache.diskStats` reports it, and the timeline draws disk-only frames in blue. In the -browser the frames live in the Origin Private File System: frame workers write them, the page -keeps the index (`DiskIndex`) and reads hits ([web.md](web.md#disk-cache)). +the layer cache and the viewer's RAM preview: layer buffers that were slow to render, every +preview frame and Roto Brush / Object Matte segmentations are written (LZ4, atomic rename, +checksummed) and survive restarts. The design (#3184): + +- **Keys from memory.** A frame's key is its comp's content key plus frame, scale, view and + render options; the content key hashes the project settings and the items the comp can draw + (its layers but those that can't change the picture, nested comps, footage with its settings + and paths, solids, Media Replacement footage, proxies: `Project::pixel_reach`). Expressions + among them add what they can read: every layer of their comps, the markers, the comps and + footage they name with literal names (`comp("Name")`, `footage("Name")`, and which items have + those names), or the whole project when they compute a name or reach items another way + (`expression_reach`). An edit to anything else keeps the key. A layer buffer's key is the + layer cache's content key (which names the footage it uses with its paths) and the renderer + version. Nothing here looks at a file, and nothing ever scans the project's files. +- **File lists checked on hit.** Every frame and layer entry keeps the source files it was + made of, with the size and modification time they were read with (the browser: size and + content hash). An entry is used only while they are unchanged: one `metadata` call per listed + file when it is read. A changed, missing or unreadable file, a damaged entry or an older + format is a miss; the entry is deleted and the frame renders again and replaces it. +- **Incomplete lists stay in memory.** A frame or buffer whose files can't all be named (a + source that doesn't say what it read, more than 4096 files) is shown but never written. +- **Reload Footage drops entries.** File ▸ Reload Footage deletes the frame and layer entries + whose lists name the item's files (the writer thread reads each entry's list, not its + pixels), so a file replaced by one with the same size and time is read again. +- **Edits keep what they can't change.** RAM frames outside an edit's dirty spans are kept + (`Project::dirty_spans`), and their disk entries are linked to the comp's new key. + +Frame entries are 8-bit RGBA, or for 32 bpc viewer frames half floats with their bytes shuffled +into planes before LZ4 (the entry header's format byte tells them apart; the render options in +the key keep the two kinds apart). LRU eviction keeps the cache under the size limit; Edit ▸ +Purge empties it, `cache.diskStats` reports it, and the timeline draws disk-only frames in blue. +In the browser the frames live in the Origin Private File System: frame workers write them, the +page keeps the index (`DiskIndex`) and reads hits ([web.md](web.md#disk-cache)). **Deferred readbacks** (`effectcraft-gpu` `deferred`): where a readback can't be waited for (WebGPU in a browser worker) a frame renders in passes. `Accelerator::frame_begin` / `pass_begin` / diff --git a/docs/web.md b/docs/web.md index 4f43b753e..666ffe37b 100644 --- a/docs/web.md +++ b/docs/web.md @@ -334,9 +334,11 @@ Settings ▸ Disk ▸ Disk Cache works in the browser, backed by the **Origin Pr (`src/diskcache.rs`): viewer frames are kept under `effectcraft-cache/v1/frames/<32 hex>.ecc` between visits, in the desktop cache's format (`disk_cache::frame_entry`: the source files the frame read with their size and content hash, then 8-bit premultiplied RGBA, LZ4, a checksum), -keyed by the same content hash (the comp and everything it uses as held in memory, frame, scale, -view, render options). The page reads an entry only while the files it lists are unchanged; a -frame whose files can't all be named is not stored. +keyed by the same content hash (from memory: the comp, everything it can draw and what its +expressions can read, frame, scale, view, render options; see +[architecture.md](architecture.md)). The page reads an entry only while the files it lists are +unchanged; a frame whose files can't all be named is not stored. Reload Footage has nothing to +drop here: the file table's identities are content hashes, so a replaced file never matches. - A render request to a frame worker carries the frame's disk key; the worker posts the frame, then writes the entry with a **synchronous access handle** into a temporary file moved into From d2372b7e2da297c8708466d8b5c42df06965ddea Mon Sep 17 00:00:00 2001 From: vangel76 Date: Sat, 7 Nov 2026 01:58:15 +0100 Subject: [PATCH 023/451] Disk cache: file stamps keep the whole modification time A file's modification time was nanoseconds since 1970 as u64: a time before 1970 read as "no time" (two such files of one size looked alike) and times after 2554 were truncated. It is now i128 nanoseconds, negative before the epoch; None only means the file system has no time. The content-key hash writes a presence tag and the full value. Co-Authored-By: Claude Opus 5.5 --- crates/render/src/disk_cache.rs | 8 ++++-- crates/render/src/reads.rs | 50 ++++++++++++++++++++++++++++++--- 2 files changed, 52 insertions(+), 6 deletions(-) diff --git a/crates/render/src/disk_cache.rs b/crates/render/src/disk_cache.rs index 03832643b..335fe293a 100644 --- a/crates/render/src/disk_cache.rs +++ b/crates/render/src/disk_cache.rs @@ -1064,8 +1064,12 @@ fn file_stamp(h: &mut Hash128, path: &str, virtual_id: Option> } if let Some(crate::reads::FileStamp::Native { len, modified }) = crate::reads::FileStamp::native(path) { h.write_u64(len); - if let Some(t) = modified { - h.write_u64(t); + match modified { + Some(t) => { + h.write(&[1]); + h.write(&t.to_le_bytes()); + } + None => h.write(&[0]), } return; } diff --git a/crates/render/src/reads.rs b/crates/render/src/reads.rs index d5648cca6..b05429893 100644 --- a/crates/render/src/reads.rs +++ b/crates/render/src/reads.rs @@ -17,8 +17,8 @@ use std::sync::{Arc, Mutex, PoisonError}; #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] pub enum FileStamp { /// A file on disk: its size in bytes and its modification time (nanoseconds since the Unix - /// epoch; `None` where the file system has none). - Native { len: u64, modified: Option }, + /// epoch, negative before it; `None` only where the file system has none). + Native { len: u64, modified: Option }, /// Bytes given from memory instead of the file system (the browser's file table): their /// identity is the size and content hash a /// [`VirtualFileId`](crate::disk_cache::VirtualFileId) gives for the path. @@ -31,8 +31,7 @@ pub enum FileStamp { impl FileStamp { /// The identity of a file from metadata the caller already has (of an open file). pub fn of_metadata(md: &std::fs::Metadata) -> FileStamp { - let modified = md.modified().ok().and_then(|t| t.duration_since(std::time::UNIX_EPOCH).ok()).map(|d| d.as_nanos() as u64); - FileStamp::Native { len: md.len(), modified } + FileStamp::Native { len: md.len(), modified: md.modified().ok().map(epoch_nanos) } } /// The identity of the file at `path` now: one `metadata` call. `None` when the file system @@ -42,6 +41,16 @@ impl FileStamp { } } +/// `t` in nanoseconds since the Unix epoch, negative before it: every time a file system can +/// store fits (`i128` nanoseconds span far more than any `SystemTime`), saturating otherwise. +pub fn epoch_nanos(t: std::time::SystemTime) -> i128 { + let nanos = |d: std::time::Duration| i128::try_from(d.as_nanos()).unwrap_or(i128::MAX); + match t.duration_since(std::time::UNIX_EPOCH) { + Ok(after) => nanos(after), + Err(before) => nanos(before.duration()).saturating_neg(), + } +} + /// One file a render read. #[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] pub struct ReadFile { @@ -209,6 +218,39 @@ mod tests { assert!(!files.is_complete()); } + /// Modification times keep their full value: before 1970 (not "no time") and past 2554 + /// (where `u64` nanoseconds end), so two such files never look alike. + #[test] + fn modification_times_are_kept_whole() { + use std::time::{Duration, UNIX_EPOCH}; + let day = Duration::from_secs(86_400); + assert_eq!(epoch_nanos(UNIX_EPOCH), 0); + assert_eq!(epoch_nanos(UNIX_EPOCH - day), -86_400_000_000_000); + let far = 600 * 365 * day; + if let Some(t) = UNIX_EPOCH.checked_add(far) { + assert_eq!(epoch_nanos(t), i128::try_from(far.as_nanos()).unwrap()); + } + let dir = std::env::temp_dir().join(format!("effectcraft-stamp-1969-{}", std::process::id())); + let _ = std::fs::remove_dir_all(&dir); + std::fs::create_dir_all(&dir).unwrap(); + let (a, b) = (dir.join("a.bin"), dir.join("b.bin")); + let mut stamps = vec![]; + for (p, back) in [(&a, day), (&b, 2 * day)] { + std::fs::write(p, b"abc").unwrap(); + let f = std::fs::File::options().write(true).open(p).unwrap(); + if f.set_modified(UNIX_EPOCH - back).is_err() { + // (a file system that can't store times before 1970) + let _ = std::fs::remove_dir_all(&dir); + return; + } + drop(f); + stamps.push(FileStamp::native(&p.to_string_lossy()).unwrap()); + } + assert!(matches!(stamps[0], FileStamp::Native { modified: Some(t), .. } if t < 0), "{:?}", stamps[0]); + assert_ne!(stamps[0], stamps[1], "two files from before 1970 with the same size"); + let _ = std::fs::remove_dir_all(&dir); + } + #[test] fn the_list_is_bounded() { let files: ReadFiles = (0..MAX_READ_FILES + 3).map(|i| file(&format!("/f{i:06}"), 1)).collect(); From 551ae89c6a08f53c1a88082905b79b1e385e1ae5 Mon Sep 17 00:00:00 2001 From: vangel76 Date: Sat, 7 Nov 2026 01:58:15 +0100 Subject: [PATCH 024/451] Automation: a refused footage read leaves the render's file list incomplete Footage outside the read roots shows nothing and was noted as no file at all, so a picture made without it had a complete, empty list and could be kept on disk for a later session with other roots. A refused read during `recording` now marks the list incomplete. Co-Authored-By: Claude Opus 5.5 --- crates/automation/src/confine.rs | 91 ++++++++++++++++++++++++++++---- 1 file changed, 81 insertions(+), 10 deletions(-) diff --git a/crates/automation/src/confine.rs b/crates/automation/src/confine.rs index c24f62acb..ebc68900e 100644 --- a/crates/automation/src/confine.rs +++ b/crates/automation/src/confine.rs @@ -346,32 +346,51 @@ impl ConfinedFootage { fn inside(&self, f: &Footage) -> bool { std::iter::once(&f.path).chain(&f.sequence).filter(|p| !p.is_empty()).all(|p| self.confinement.check(p, Access::Read).is_ok()) } + + /// [`Self::inside`] for a read: a refused one is counted on this thread, so the render + /// [`recording`](FootageSource::recording) it can't list what it made without the footage. + fn readable(&self, f: &Footage) -> bool { + let inside = self.inside(f); + if !inside { + let _ = REFUSED_READS.try_with(|n| n.set(n.get().wrapping_add(1))); + } + inside + } +} + +thread_local! { + /// Footage reads refused on this thread (see [`ConfinedFootage::readable`]). + static REFUSED_READS: std::cell::Cell = const { std::cell::Cell::new(0) }; +} + +fn refused_reads() -> u64 { + REFUSED_READS.try_with(std::cell::Cell::get).unwrap_or(0) } impl FootageSource for ConfinedFootage { fn frame(&self, item: ItemId, footage: &Footage, t: Tick) -> Option> { - self.inside(footage).then(|| self.inner.frame(item, footage, t)).flatten() + self.readable(footage).then(|| self.inner.frame(item, footage, t)).flatten() } fn frame_at_size(&self, item: ItemId, footage: &Footage, t: Tick, width: u32, height: u32) -> Option> { - self.inside(footage).then(|| self.inner.frame_at_size(item, footage, t, width, height)).flatten() + self.readable(footage).then(|| self.inner.frame_at_size(item, footage, t, width, height)).flatten() } fn frame_with(&self, item: ItemId, footage: &Footage, t: Tick, size: Option<(u32, u32)>, float: FloatCurve) -> Option> { - self.inside(footage).then(|| self.inner.frame_with(item, footage, t, size, float)).flatten() + self.readable(footage).then(|| self.inner.frame_with(item, footage, t, size, float)).flatten() } fn audio(&self, item: ItemId, footage: &Footage, t: Tick, frames: usize, rate: u32) -> Option> { - self.inside(footage).then(|| self.inner.audio(item, footage, t, frames, rate)).flatten() + self.readable(footage).then(|| self.inner.audio(item, footage, t, frames, rate)).flatten() } fn aux(&self, item: ItemId, footage: &Footage, t: Tick) -> Option> { - self.inside(footage).then(|| self.inner.aux(item, footage, t)).flatten() + self.readable(footage).then(|| self.inner.aux(item, footage, t)).flatten() } fn set_aux_footage(&self, paths: &[String]) { self.inner.set_aux_footage(paths) } fn model(&self, item: ItemId, footage: &Footage) -> Option> { - self.inside(footage).then(|| self.inner.model(item, footage)).flatten() + self.readable(footage).then(|| self.inner.model(item, footage)).flatten() } fn vector_frame(&self, item: ItemId, footage: &Footage, scale: f64) -> Option> { - self.inside(footage).then(|| self.inner.vector_frame(item, footage, scale)).flatten() + self.readable(footage).then(|| self.inner.vector_frame(item, footage, scale)).flatten() } /// Says why footage outside the roots shows nothing, so the agent can act on it. fn problem(&self, footage: &Footage) -> Option { @@ -401,10 +420,16 @@ impl FootageSource for ConfinedFootage { fn called_off(&self) -> bool { self.inner.called_off() } - /// The files read inside the roots, as the inner source notes them (footage outside reads - /// nothing). + /// The files read inside the roots, as the inner source notes them. Footage outside reads + /// nothing, and what is made without it can't be listed by its files: a refused read makes + /// the list incomplete, so it never outlives the session in a disk cache (another session + /// with other roots would read the footage). fn recording(&self, reads: &effectcraft_engine::render::reads::ReadLog, f: &mut dyn FnMut()) { - self.inner.recording(reads, f) + let refused = refused_reads(); + self.inner.recording(reads, f); + if refused_reads() != refused { + reads.mark_incomplete(); + } } } @@ -598,6 +623,52 @@ mod tests { } } + /// Footage outside the roots shows nothing: a render that asked for it can't be listed by its + /// files (#3184), or a disk cache would keep the empty picture for a session with other + /// roots. Reads inside the roots record as the inner source tells. + #[test] + fn a_refused_footage_read_makes_the_render_unlisted() { + use effectcraft_engine::render::reads::{FileStamp, ReadFile, ReadLog}; + /// Reads every file, noting it. + struct Noting; + impl FootageSource for Noting { + fn frame(&self, _: ItemId, f: &Footage, _: Tick) -> Option> { + NOTED.with(|n| n.borrow_mut().push(f.path.clone())); + Some(Arc::new(Image::new(1, 1))) + } + fn recording(&self, reads: &ReadLog, f: &mut dyn FnMut()) { + f(); + for p in NOTED.with(|n| std::mem::take(&mut *n.borrow_mut())) { + reads.note(ReadFile::new(p, FileStamp::Missing)); + } + } + } + thread_local! { + static NOTED: std::cell::RefCell> = const { std::cell::RefCell::new(Vec::new()) }; + } + let base = std::env::temp_dir().join(format!("ec-confine-3184-{}", std::process::id())); + let (inside, outside) = (base.join("in"), base.join("elsewhere")); + for d in [&inside, &outside] { + std::fs::create_dir_all(d).unwrap(); + } + let c = Confinement::new(std::slice::from_ref(&inside), &[]).unwrap(); + let src = ConfinedFootage::new(Arc::new(Noting), c); + let footage = |d: &std::path::Path| Footage { path: d.join("a.png").to_string_lossy().into_owned(), ..Default::default() }; + let read = |f: &Footage| { + let log = ReadLog::new(); + let mut got = None; + src.recording(&log, &mut || got = src.frame(ItemId(1), f, Tick::ZERO)); + (got.is_some(), log.into_files()) + }; + let (shown, files) = read(&footage(&inside)); + assert!(shown && files.is_complete() && files.len() == 1, "inside the roots: {files:?}"); + let (shown, files) = read(&footage(&outside)); + assert!(!shown && !files.is_complete(), "outside the roots: {files:?}"); + // The next render on the thread is not affected. + assert!(read(&footage(&inside)).1.is_complete()); + let _ = std::fs::remove_dir_all(&base); + } + #[test] fn relative_and_outside_paths_of_newly_listed_commands_are_refused() { let base = std::env::temp_dir().join(format!("ec-confine-1243-{}", std::process::id())); From 8d948c231c416580fd1e9219298c3e591cb90ce6 Mon Sep 17 00:00:00 2001 From: vangel76 Date: Sat, 7 Nov 2026 01:58:15 +0100 Subject: [PATCH 025/451] Render: a buffer kept by another worker comes with its own files LayerCache::insert returns the files of the buffer it keeps, and Renderer::keep notes them in the render's log and returns them, so a render that uses another worker's buffer lists that buffer's files (a file changed between the two reads then has two identities and the list is incomplete). Co-Authored-By: Claude Opus 5.5 --- crates/render/src/accel.rs | 2 +- crates/render/src/cache.rs | 63 ++++++++++++++++++++++++++--------- crates/render/src/layers.rs | 25 +++++++++++--- crates/render/src/pipeline.rs | 29 ++++++++++------ 4 files changed, 89 insertions(+), 30 deletions(-) diff --git a/crates/render/src/accel.rs b/crates/render/src/accel.rs index eecf05580..9e5d2138a 100644 --- a/crates/render/src/accel.rs +++ b/crates/render/src/accel.rs @@ -358,7 +358,7 @@ impl<'a> Renderer<'a> { Some(foot) }); // The buffer the cache keeps (another worker's, if it kept one first). - Some(self.keep(key, Arc::new(foot?), &files)) + Some(self.keep(key, Arc::new(foot?), &files).0) } /// Draw one 2D layer into `canvas` on the CPU (any kind: adjustment, wireframe, styled…). diff --git a/crates/render/src/cache.rs b/crates/render/src/cache.rs index 79b948b89..b1c6710c9 100644 --- a/crates/render/src/cache.rs +++ b/crates/render/src/cache.rs @@ -177,7 +177,7 @@ impl LayerCache { let mut files = ReadFiles::default(); files.mark_incomplete(); let files = Arc::new(files); - Some((self.insert_mem(key, buf, files.clone()), files)) + Some(self.insert_mem(key, buf, files)) } } } @@ -188,12 +188,12 @@ impl LayerCache { /// and packs it once instead of once per worker, which ran it out of memory). Renders don't /// wait for each other: on the frame workers' shared thread pool a wait can end up under /// the very work it waits for. `files`: the source files `buf` was made of (see - /// [`crate::reads`]). - pub fn insert(&self, key: u64, buf: Arc, files: Arc) -> Arc { + /// [`crate::reads`]); the files returned are the ones the returned buffer was made of. + pub fn insert(&self, key: u64, buf: Arc, files: Arc) -> (Arc, Arc) { if self.gated() { - return buf; + return (buf, files); } - if let Some(kept) = self.inner.lock().ok().and_then(|g| g.map.get(&key).map(|e| e.buf.clone())) { + if let Some(kept) = self.inner.lock().ok().and_then(|g| g.map.get(&key).map(|e| (e.buf.clone(), e.files.clone()))) { return kept; } let started = self.inner.lock().ok().and_then(|mut g| g.missed_at.remove(&key)); @@ -206,21 +206,21 @@ impl LayerCache { self.insert_mem(key, buf, files) } - /// See [`LayerCache::insert`]: the buffer kept under `key` (`buf`, unless one was kept first - /// or `buf` is too large to keep). - fn insert_mem(&self, key: u64, buf: Arc, files: Arc) -> Arc { + /// See [`LayerCache::insert`]: the buffer kept under `key` and its files (`buf` and `files`, + /// unless one was kept first or `buf` is too large to keep). + fn insert_mem(&self, key: u64, buf: Arc, files: Arc) -> (Arc, Arc) { let bytes = buf.img.data.len() * std::mem::size_of::(); - let Ok(mut g) = self.inner.lock() else { return buf }; + let Ok(mut g) = self.inner.lock() else { return (buf, files) }; if bytes > g.budget / 4 { - return buf; + return (buf, files); } g.clock += 1; let now = g.clock; if let Some(e) = g.map.get_mut(&key) { e.last_use = now; - return e.buf.clone(); + return (e.buf.clone(), e.files.clone()); } - g.map.insert(key, Entry { buf: buf.clone(), files, bytes, last_use: now }); + g.map.insert(key, Entry { buf: buf.clone(), files: files.clone(), bytes, last_use: now }); g.bytes += bytes; if g.bytes > g.budget { // Evict least-recently used entries down to 3/4 of the budget. @@ -236,7 +236,7 @@ impl LayerCache { } } } - buf + (buf, files) } /// The memory budget in bytes. @@ -796,8 +796,41 @@ mod shared_insert_tests { let cache = LayerCache::default(); let buf = || Arc::new(Buf { img: Image::new(4, 4), offset: [0.0; 2], scale: 1.0 }); let (a, b) = (buf(), buf()); - assert!(Arc::ptr_eq(&cache.insert(3, a.clone(), Default::default()), &a)); - assert!(Arc::ptr_eq(&cache.insert(3, b, Default::default()), &a), "the later render gets the first buffer"); + assert!(Arc::ptr_eq(&cache.insert(3, a.clone(), Default::default()).0, &a)); + assert!(Arc::ptr_eq(&cache.insert(3, b, Default::default()).0, &a), "the later render gets the first buffer"); assert!(Arc::ptr_eq(&cache.get(3).unwrap().0, &a)); } + + /// A render that gets another render's buffer gets that buffer's files too (#3184): when a + /// file changed between the two reads, its frame lists the file with both identities, so the + /// list is incomplete and the frame is not kept on disk with the new identity and the old + /// pixels. + #[test] + fn the_buffer_kept_first_brings_its_files() { + use crate::reads::{FileStamp, ReadFile, ReadFiles, ReadLog}; + use crate::{NoFootage, RenderOpts, Renderer}; + let cache = LayerCache::default(); + let buf = || Arc::new(Buf { img: Image::new(4, 4), offset: [0.0; 2], scale: 1.0 }); + let files = |len| Arc::new([ReadFile::new("/a.png", FileStamp::Native { len, modified: Some(1) })].into_iter().collect::()); + let (first, second) = (files(1), files(2)); + let a = buf(); + cache.insert(3, a.clone(), first.clone()); + let project = effectcraft_project::Project::default(); + let log = ReadLog::new(); + let mut r = Renderer::new(&project, &NoFootage, RenderOpts::default()); + r.cache = Some(&cache); + r.reads = Some(&log); + // (what `Renderer::recorded` noted for the second render) + log.note_all(&second); + let (kept, kept_files) = r.keep(Some(3), buf(), &second); + assert!(Arc::ptr_eq(&kept, &a)); + assert_eq!(kept_files, first); + assert!(!log.files().is_complete()); + // The same files: nothing changes. + let same = ReadLog::new(); + r.reads = Some(&same); + same.note_all(&first); + let _ = r.keep(Some(3), buf(), &files(1)); + assert!(same.files().is_complete()); + } } diff --git a/crates/render/src/layers.rs b/crates/render/src/layers.rs index b551d1c1b..9eb87a47e 100644 --- a/crates/render/src/layers.rs +++ b/crates/render/src/layers.rs @@ -59,10 +59,27 @@ impl<'a> Renderer<'a> { t.effects.push(("layerStyles".into(), t0.elapsed().as_secs_f64() * 1e3)); } // The buffers the cache keeps (another worker's, if it kept them first), made of the - // content's files. - let body = self.keep(key, Arc::new(st.body), &files); - let passes: Vec<_> = - st.passes.into_iter().enumerate().map(|(i, (b, m))| (self.keep(key.map(|k| cache::derive(k, i as u64 + 1)), Arc::new(b), &files), m)).collect(); + // content's files; the styled layer then lists the files of every buffer it holds. + let mut kept_files = vec![]; + let (body, f) = self.keep(key, Arc::new(st.body), &files); + kept_files.push(f); + let passes: Vec<_> = st + .passes + .into_iter() + .enumerate() + .map(|(i, (b, m))| { + let (b, f) = self.keep(key.map(|k| cache::derive(k, i as u64 + 1)), Arc::new(b), &files); + kept_files.push(f); + (b, m) + }) + .collect(); + let files = if kept_files.iter().all(|f| Arc::ptr_eq(f, &files)) { + files + } else { + let mut all = (*files).clone(); + kept_files.iter().for_each(|f| all.extend(f)); + Arc::new(all) + }; Some(StyledLayer { passes, body, content, key, ckey, plain: false, files }) } diff --git a/crates/render/src/pipeline.rs b/crates/render/src/pipeline.rs index 3564c17f9..e793b2ad4 100644 --- a/crates/render/src/pipeline.rs +++ b/crates/render/src/pipeline.rs @@ -151,12 +151,19 @@ impl<'a> Renderer<'a> { } /// Keep `buf`, made of `files`, under `key` (see [`Renderer::recorded`]): the buffer the cache - /// keeps (another worker's, if it kept one first), or `buf` when nothing is kept. - pub(crate) fn keep(&self, key: Option, buf: Arc, files: &Arc) -> Arc { - match (self.cache_to_keep(), key) { - (Some(c), Some(k)) => c.insert(k, buf, files.clone()), - _ => buf, + /// keeps (another worker's, if it kept one first), or `buf` when nothing is kept, with the + /// files that buffer was made of. Another worker's files are noted in [`Renderer::reads`] + /// too: its pixels are the ones this render uses (a file that changed between the two reads + /// then has two identities, and the list is incomplete). + pub(crate) fn keep(&self, key: Option, buf: Arc, files: &Arc) -> (Arc, Arc) { + let (Some(c), Some(k)) = (self.cache_to_keep(), key) else { return (buf, files.clone()) }; + let (kept, kept_files) = c.insert(k, buf, files.clone()); + if !Arc::ptr_eq(&kept_files, files) + && let Some(log) = self.reads + { + log.note_all(&kept_files); } + (kept, kept_files) } /// Run `make`, which makes a buffer to keep under `key` in the layer cache, on this renderer @@ -923,7 +930,7 @@ impl<'a> Renderer<'a> { }); if let (Some(a), Some(b)) = (a, b) { let img = blend_frames(mode, &a, &b, w as f32); - self.keep(key, Arc::new(Buf { img: img.clone(), offset: [0.0; 2], scale: 1.0 }), &files); + let _kept = self.keep(key, Arc::new(Buf { img: img.clone(), offset: [0.0; 2], scale: 1.0 }), &files); return Some(Arc::new(img)); } } @@ -967,7 +974,7 @@ impl<'a> Renderer<'a> { } let mut nb = (*b).clone(); color::convert(&mut nb.img, &c); - self.keep(key, Arc::new(nb), files) + self.keep(key, Arc::new(nb), files).0 } /// The flattened layer buffer, its cache key and the source files it was made of. @@ -981,7 +988,8 @@ impl<'a> Renderer<'a> { return Some((b, key, files)); } let flat = Arc::new(styles::Styled { passes: st.passes.iter().map(|(b, m)| ((**b).clone(), *m)).collect(), body: (*st.body).clone() }.flatten()); - Some((self.keep(key, flat, &st.files), key, st.files)) + let (flat, files) = self.keep(key, flat, &st.files); + Some((flat, key, files)) } /// A layer's source pixels at the context time, before masks, effects and the transform @@ -1039,7 +1047,8 @@ impl<'a> Renderer<'a> { let buf = r.masked_source(ctx, layer)?; Some(r.apply_effects_timed(ctx, layer, buf, false, usize::MAX, timing.map(|t| &mut t.effects))) }); - Some((self.keep(key, Arc::new(buf?), &files), key, files)) + let (buf, files) = self.keep(key, Arc::new(buf?), &files); + Some((buf, key, files)) } /// A layer's input at the context time: source → masks → its first `effects` effects @@ -1061,6 +1070,6 @@ impl<'a> Renderer<'a> { } Some(buf) }); - Some(self.keep(key, Arc::new(buf?), &files)) + Some(self.keep(key, Arc::new(buf?), &files).0) } } From d04ccd52344a8b83366df6810b6fef612bfe5fca Mon Sep 17 00:00:00 2001 From: vangel76 Date: Sat, 7 Nov 2026 01:58:15 +0100 Subject: [PATCH 026/451] Render: sampleImage and text fonts note the files they read EvalCtx carries the render's read log. A sampleImage render records its footage reads, keeps them with its per-thread cached buffer and notes them in the evaluating render's log on every use. Text notes the font files it is drawn with, with the identity their bytes were read with; a family that isn't installed, a fallback or missing glyph, or a font from memory leaves the list incomplete. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/analysis/tracking.rs | 2 +- crates/engine/src/cmd/effect.rs | 5 ++ crates/engine/src/cmd/layer/parent.rs | 1 + crates/engine/src/cmd/layer_time.rs | 1 + crates/engine/src/cmd/path_nulls.rs | 2 + crates/engine/src/cmd/prop.rs | 1 + crates/engine/src/cmd/puppet.rs | 13 ++++- crates/engine/src/cmd/rig3d.rs | 1 + crates/engine/src/cmd/three_d.rs | 26 +++++++-- crates/engine/src/tests/crypto_pick.rs | 1 + crates/engine/src/tests/rig3d.rs | 14 ++++- crates/expr/src/host.rs | 1 + crates/expr/src/lib.rs | 1 + crates/expr/src/sample.rs | 22 ++++++-- crates/expr/src/tests.rs | 39 +++++++++++++ crates/gpu/src/tests/adv3d.rs | 2 + crates/host/src/tests.rs | 2 + crates/render/src/eval.rs | 5 +- crates/render/src/pipeline.rs | 23 +++++++- crates/render/src/tests/collapse.rs | 13 ++++- crates/render/src/tests/time.rs | 1 + crates/render/src/text.rs | 39 +++++++++++++ crates/render/src/text/tests.rs | 55 +++++++++++++++++++ crates/render/src/three_d/adv/scene.rs | 4 +- crates/render/src/three_d/adv/tests.rs | 4 ++ crates/render/src/three_d/compose.rs | 2 +- crates/script/src/tests/ui_more.rs | 1 + crates/text/src/fonts.rs | 31 ++++++++++- crates/ui-egui/src/menus/invoke.rs | 1 + .../src/panels/effect_controls/panel.rs | 1 + crates/ui-egui/src/panels/layer_panel.rs | 1 + crates/ui-egui/src/panels/properties.rs | 1 + crates/ui-egui/src/panels/roto_tool.rs | 1 + crates/ui-egui/src/panels/text_panels.rs | 1 + crates/ui-egui/src/panels/timeline.rs | 1 + crates/ui-egui/src/panels/viewer.rs | 1 + crates/ui-egui/src/panels/viewer/shapes.rs | 1 + crates/ui-egui/src/panels/viewer/view.rs | 1 + 38 files changed, 298 insertions(+), 24 deletions(-) diff --git a/crates/engine/src/analysis/tracking.rs b/crates/engine/src/analysis/tracking.rs index 221b28602..912a8adfe 100644 --- a/crates/engine/src/analysis/tracking.rs +++ b/crates/engine/src/analysis/tracking.rs @@ -208,7 +208,7 @@ pub(crate) fn source_frame( t: Tick, expr: Option<&dyn ExprHost>, ) -> Option<(Arc, [f64; 2])> { - let ctx = EvalCtx { project, comp_id: cid, comp, time: t, expr, footage: None, property_overrides: &[], media_overrides: &[] }; + let ctx = EvalCtx { project, comp_id: cid, comp, time: t, expr, footage: None, property_overrides: &[], media_overrides: &[], reads: None }; if let effectcraft_project::LayerSource::Footage { item } = &layer.source && let Some(effectcraft_project::ItemKind::Footage(f)) = project.item(*item).map(|i| &i.kind) && f.has_video diff --git a/crates/engine/src/cmd/effect.rs b/crates/engine/src/cmd/effect.rs index 69bdb5a4a..1d352d192 100644 --- a/crates/engine/src/cmd/effect.rs +++ b/crates/engine/src/cmd/effect.rs @@ -345,6 +345,7 @@ fn warning(s: &mut Session, p: &Value) -> Result { footage: None, property_overrides: &[], media_overrides: &[], + reads: None, }; Ok(json!({"effect": uid, "warning": effectcraft_effects::warning(g, &mut |pr| ctx.value(layer, pr))})) } @@ -378,6 +379,7 @@ fn pick_color(s: &mut Session, p: &Value) -> Result { footage: None, property_overrides: &[], media_overrides: &[], + reads: None, }; let mut r = effectcraft_render::Renderer::new(&s.project, &*s.footage, effectcraft_render::RenderOpts::default()); r.expr = s.expr.as_deref(); @@ -515,6 +517,7 @@ impl CryptoProbe { footage: None, property_overrides: &[], media_overrides: &[], + 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)?; @@ -586,6 +589,7 @@ fn probe_key<'a>(s: &'a Session, p: &Value, cmd: &str) -> Result<(ProbeKey, Tick footage: None, property_overrides: &[], media_overrides: &[], + reads: None, }; let frame = probe_frame(&ctx, layer, pos); let o = s.render_opts(Default::default()); @@ -780,6 +784,7 @@ fn crypto_hit(s: &Session, p: &Value, cmd: &str) -> Result { footage: None, property_overrides: &[], media_overrides: &[], + reads: None, }; let selection = effectcraft_effects::flatten_params(g, &mut |pr| ctx.value(layer, pr)).s("selection").to_string(); let driven = prop.expr.as_ref().is_some_and(|e| e.enabled); diff --git a/crates/engine/src/cmd/layer/parent.rs b/crates/engine/src/cmd/layer/parent.rs index 870d22f5f..271bad28c 100644 --- a/crates/engine/src/cmd/layer/parent.rs +++ b/crates/engine/src/cmd/layer/parent.rs @@ -371,6 +371,7 @@ pub(crate) fn parent_fixes(s: &Session, cid: ItemId, ids: &[LayerId], parent: Op footage: Some(s.footage.as_ref()), property_overrides: &[], media_overrides: &[], + reads: None, }; let space = |id: Option| -> effectcraft_geom::Mat3 { id.and_then(|i| comp.layer(i)).filter(|l| !l.is_3d()).map(|l| ectx.layer_to_comp(l).0).unwrap_or(effectcraft_geom::Mat3::IDENTITY) diff --git a/crates/engine/src/cmd/layer_time.rs b/crates/engine/src/cmd/layer_time.rs index 4ecf725ec..2f8661885 100644 --- a/crates/engine/src/cmd/layer_time.rs +++ b/crates/engine/src/cmd/layer_time.rs @@ -194,6 +194,7 @@ fn freeze(s: &mut Session, p: &Value, last: bool) -> Result { footage: Some(s.footage.as_ref()), property_overrides: &[], media_overrides: &[], + reads: None, }; let now: Vec<(effectcraft_project::LayerId, f64)> = comp .layers diff --git a/crates/engine/src/cmd/path_nulls.rs b/crates/engine/src/cmd/path_nulls.rs index 93d71cd67..a6b51c763 100644 --- a/crates/engine/src/cmd/path_nulls.rs +++ b/crates/engine/src/cmd/path_nulls.rs @@ -87,6 +87,7 @@ fn info(s: &Session, cid: ItemId, lid: LayerId, uid: Uid, cmd: &str) -> Result

Result Res footage: Some(s.footage.as_ref()), property_overrides: &[], media_overrides: &[], + reads: None, }; keys.push(Keyframe::new(layer.layer_time(t), ctx.value(&layer, &pr))); t += fd; diff --git a/crates/engine/src/cmd/puppet.rs b/crates/engine/src/cmd/puppet.rs index d894516c2..bd20bd885 100644 --- a/crates/engine/src/cmd/puppet.rs +++ b/crates/engine/src/cmd/puppet.rs @@ -39,8 +39,17 @@ pub fn puppet_eval(s: &Session, cid: ItemId, lid: LayerId, fx_uid: Uid, t: Tick) let fx = layer.effects()?; let index = fx.groups().position(|g| g.uid == fx_uid)?; let g = fx.groups().nth(index)?; - let ctx = - EvalCtx { project: &s.project, comp_id: cid, comp, time: t, expr: s.expr.as_deref(), footage: None, property_overrides: &[], media_overrides: &[] }; + let ctx = EvalCtx { + project: &s.project, + comp_id: cid, + comp, + time: t, + expr: s.expr.as_deref(), + footage: None, + property_overrides: &[], + media_overrides: &[], + reads: None, + }; let mut r = Renderer::new(&s.project, &*s.footage, RenderOpts::default()); r.expr = s.expr.as_deref(); r.cache = Some(&s.layer_cache); diff --git a/crates/engine/src/cmd/rig3d.rs b/crates/engine/src/cmd/rig3d.rs index dbcaa3c3c..e7852fbd2 100644 --- a/crates/engine/src/cmd/rig3d.rs +++ b/crates/engine/src/cmd/rig3d.rs @@ -57,6 +57,7 @@ impl Env { footage: Some(self.footage.as_ref()), property_overrides: &[], media_overrides: &[], + reads: None, } } } diff --git a/crates/engine/src/cmd/three_d.rs b/crates/engine/src/cmd/three_d.rs index f7b1c3e08..de6bc4d7a 100644 --- a/crates/engine/src/cmd/three_d.rs +++ b/crates/engine/src/cmd/three_d.rs @@ -424,8 +424,17 @@ fn get_3d(s: &mut Session, p: &Value) -> Result { let (w, h) = (comp.width as f64, comp.height as f64); let vs = s.state.views3d.get(&cid).cloned().unwrap_or_default(); let t = s.state.times.get(&cid).copied().unwrap_or(Tick::ZERO); - let ctx = - EvalCtx { project: &s.project, comp_id: cid, comp, time: t, expr: s.expr.as_deref(), footage: None, property_overrides: &[], media_overrides: &[] }; + let ctx = EvalCtx { + project: &s.project, + comp_id: cid, + comp, + time: t, + expr: s.expr.as_deref(), + footage: None, + property_overrides: &[], + media_overrides: &[], + reads: None, + }; let cam = vs.override_camera(w, h).unwrap_or_else(|| camera::active_camera(&ctx)); let f = cam.forward(); let lights: Vec = comp @@ -567,8 +576,17 @@ fn auto_orient(s: &mut Session, p: &Value) -> Result { /// through each layer's world matrix; cameras and lights contribute their position). fn layer_points(s: &Session, cid: ItemId, ids: &[LayerId], t: Tick) -> Vec { let Some(comp) = s.project.comp(cid) else { return vec![] }; - let ctx = - EvalCtx { project: &s.project, comp_id: cid, comp, time: t, expr: s.expr.as_deref(), footage: None, property_overrides: &[], media_overrides: &[] }; + let ctx = EvalCtx { + project: &s.project, + comp_id: cid, + comp, + time: t, + expr: s.expr.as_deref(), + footage: None, + property_overrides: &[], + media_overrides: &[], + reads: None, + }; let mut out = vec![]; for l in comp.layers.iter().filter(|l| ids.contains(&l.id)) { let m = ctx.world_matrix(l); diff --git a/crates/engine/src/tests/crypto_pick.rs b/crates/engine/src/tests/crypto_pick.rs index e3a8cd50c..82fe21e71 100644 --- a/crates/engine/src/tests/crypto_pick.rs +++ b/crates/engine/src/tests/crypto_pick.rs @@ -214,6 +214,7 @@ fn rendered_matte_of_pick(s: &mut Session, x: f64, y: f64, scale: f64) -> (Strin footage: None, property_overrides: &[], media_overrides: &[], + reads: None, }; let buf = s.renderer(effectcraft_render::RenderOpts { scale, ..Default::default() }).content_buf(&ctx, layer).unwrap(); let (px, py) = buf.to_px([x, y]); diff --git a/crates/engine/src/tests/rig3d.rs b/crates/engine/src/tests/rig3d.rs index cf2518447..98d67edbb 100644 --- a/crates/engine/src/tests/rig3d.rs +++ b/crates/engine/src/tests/rig3d.rs @@ -40,7 +40,17 @@ fn close3(a: [f64; 3], b: [f64; 3], tol: f64) -> bool { fn frame(s: &Session, id: u64) -> (Vec3, Vec3) { let c = cid(s); let comp = s.project.comp(c).unwrap(); - let ctx = EvalCtx { project: &s.project, comp_id: c, comp, time: Tick::ZERO, expr: None, footage: None, property_overrides: &[], media_overrides: &[] }; + let ctx = EvalCtx { + project: &s.project, + comp_id: c, + comp, + time: Tick::ZERO, + expr: None, + footage: None, + property_overrides: &[], + media_overrides: &[], + reads: None, + }; let (e, f, _) = layer_frame(&ctx, comp.layer(LayerId(id)).unwrap()); (e, f) } @@ -244,7 +254,7 @@ fn parented_camera_keeps_its_frame_under_an_offset_null() { fn frame_at(s: &Session, id: u64, t: Tick) -> (Vec3, Vec3, Vec3) { let c = cid(s); let comp = s.project.comp(c).unwrap(); - let ctx = EvalCtx { project: &s.project, comp_id: c, comp, time: t, expr: None, footage: None, property_overrides: &[], media_overrides: &[] }; + let ctx = EvalCtx { project: &s.project, comp_id: c, comp, time: t, expr: None, footage: None, property_overrides: &[], media_overrides: &[], reads: None }; layer_frame(&ctx, comp.layer(LayerId(id)).unwrap()) } diff --git a/crates/expr/src/host.rs b/crates/expr/src/host.rs index fa2993f97..b0abcaafa 100644 --- a/crates/expr/src/host.rs +++ b/crates/expr/src/host.rs @@ -309,6 +309,7 @@ impl<'a> Resolver<'a> { footage: self.ctx.footage, property_overrides: if same_comp { self.ctx.property_overrides } else { &[] }, media_overrides: if same_comp { self.ctx.media_overrides } else { &[] }, + reads: self.ctx.reads, }) } fn prop(&self, c: u64, l: u64, path: &str) -> Option<(&'a Layer, &'a Property)> { diff --git a/crates/expr/src/lib.rs b/crates/expr/src/lib.rs index 9e78d250f..ae9e647f8 100644 --- a/crates/expr/src/lib.rs +++ b/crates/expr/src/lib.rs @@ -172,6 +172,7 @@ fn evaluate_out( footage: ctx.footage, property_overrides: ctx.property_overrides, media_overrides: ctx.media_overrides, + reads: ctx.reads, }; let comp = ctx.comp_id.0; let path = layer.props.path_of(prop.uid).unwrap_or_else(|| format!("@{}", prop.uid)); diff --git a/crates/expr/src/sample.rs b/crates/expr/src/sample.rs index 28f830bb2..e097691de 100644 --- a/crates/expr/src/sample.rs +++ b/crates/expr/src/sample.rs @@ -4,13 +4,16 @@ //! expression (its footage source; [`EvalCtx::footage`]): source → masks → effects for //! `postEffect = true`, the bare source otherwise, in layer space (before the transform). Buffers //! are cached per thread for the frame, so many expressions sampling the same layer at the same -//! time render it once. +//! time render it once. The source files a sampled render reads are kept with its buffer and +//! noted in the evaluating render's log ([`EvalCtx::reads`]) on every use, so a frame whose +//! expressions sample footage lists that footage too (#3184). use std::cell::RefCell; use std::collections::HashMap; use std::sync::Arc; use effectcraft_project::{ItemId, Layer}; +use effectcraft_render::reads::{ReadFiles, ReadLog}; use effectcraft_render::{EvalCtx, NoFootage, RenderOpts, Renderer}; use effectcraft_time::Tick; @@ -26,7 +29,8 @@ struct Sampled { type Key = (usize, u64, u64, u64, bool, u64); thread_local! { - static CACHE: RefCell>> = RefCell::new(HashMap::new()); + /// The sampled buffers and the source files each was made of. + static CACHE: RefCell, Arc)>> = RefCell::new(HashMap::new()); /// Nested sampleImage renders (a sampled layer whose expressions sample again). static DEPTH: RefCell = const { RefCell::new(0) }; } @@ -48,7 +52,13 @@ fn render(ctx: EvalCtx, comp: ItemId, layer: &Layer, post: bool, t: f64) -> Opti return None; } let key: Key = (ctx.project as *const _ as usize, comp.0, layer.id.0, t.to_bits(), post, fingerprint(layer)); - if let Some(hit) = CACHE.with(|c| c.borrow().get(&key).cloned()) { + let note = |files: &ReadFiles| { + if let Some(log) = ctx.reads { + log.note_all(files); + } + }; + if let Some((hit, files)) = CACHE.with(|c| c.borrow().get(&key).cloned()) { + note(&files); return hit; } DEPTH.with(|d| *d.borrow_mut() += 1); @@ -60,20 +70,24 @@ fn render(ctx: EvalCtx, comp: ItemId, layer: &Layer, post: bool, t: f64) -> Opti } let _pop = Pop; let footage: &dyn effectcraft_render::FootageSource = ctx.footage.unwrap_or(&NoFootage); + let log = ReadLog::new(); let mut r = Renderer::new(ctx.project, footage, RenderOpts { motion_blur: false, ..Default::default() }); r.expr = ctx.expr; + r.reads = Some(&log); let ectx = r.eval_ctx(comp, Tick::from_seconds_f64(t))?; let out = if post { r.content_buf(&ectx, layer).map(|b| Sampled { img: Arc::new(b.img.clone()), offset: b.offset, scale: b.scale }) } else { r.layer_source(&ectx, layer).map(|b| Sampled { img: Arc::new(b.img), offset: b.offset, scale: b.scale }) }; + let files = Arc::new(log.into_files()); + note(&files); CACHE.with(|c| { let mut c = c.borrow_mut(); if c.len() >= MAX_CACHE { c.clear(); } - c.insert(key, out.clone()); + c.insert(key, (out.clone(), files)); }); out } diff --git a/crates/expr/src/tests.rs b/crates/expr/src/tests.rs index 48f656e52..5f16ac5ee 100644 --- a/crates/expr/src/tests.rs +++ b/crates/expr/src/tests.rs @@ -1326,6 +1326,7 @@ fn source_dimensions_follow_media_replacement() { footage: None, property_overrides: &[], media_overrides: &[media], + reads: None, }; assert_eq!(ctx.value(l, l.props.prop(ROT).unwrap()), Value::Scalar(130.0)); } @@ -1548,6 +1549,7 @@ fn text_expression_selector_values() { footage: None, property_overrides: &[], media_overrides: &[], + reads: None, }; let doc = effectcraft_render::text::source_text(&ctx, l).unwrap(); let lay = effectcraft_text::layout_doc(&doc); @@ -1600,6 +1602,43 @@ fn sample_image_reads_rendered_pixels() { assert_close!(f.num(&code("thisComp.layer(\"B\").sampleImage([-50, -50])"), 0.0), 0.0); } +/// The footage `sampleImage` renders is a file the evaluating render read (#3184): it is noted in +/// the render's log, also when the sampled buffer comes from the per-thread cache. +#[test] +fn sample_image_notes_the_files_it_reads() { + use effectcraft_render::reads::{FileStamp, ReadFile, ReadLog}; + /// A grey picture of any footage, noting `/clip.png` for every read. + struct Clip; + impl effectcraft_render::FootageSource for Clip { + fn frame(&self, _: ItemId, f: &effectcraft_project::Footage, _: Tick) -> Option> { + let mut img = effectcraft_render::Image::new(f.width, f.height); + img.data.fill([0.5, 0.5, 0.5, 1.0]); + Some(std::sync::Arc::new(img)) + } + fn recording(&self, reads: &ReadLog, f: &mut dyn FnMut()) { + f(); + reads.note(ReadFile::new("/clip.png", FileStamp::Native { len: 3, modified: Some(1) })); + } + } + let mut p = Project::default(); + let comp = Comp::new(20, 20, FrameRate::FPS_30, Tick::from_seconds_f64(1.0)); + let footage = + effectcraft_project::Footage { path: "/clip.png".into(), width: 8, height: 8, has_video: true, frame_rate: FrameRate::FPS_30, ..Default::default() }; + let item = p.add_item("Clip", Label::Aqua, None, ItemKind::Footage(footage)); + let layer = build::layer(&mut p, &comp, "Clip", LayerSource::Footage { item }, (8, 8), None); + let cid = p.add_item("C", Label::Sandstone, None, ItemKind::Comp(comp.into())); + let c = p.comp(cid).unwrap(); + for pass in ["rendered", "cached"] { + let log = ReadLog::new(); + let ctx = EvalCtx { footage: Some(&Clip), reads: Some(&log), ..EvalCtx::new(&p, cid, c, Tick::ZERO) }; + let px = crate::sample::sample_image(ctx, cid, &layer, [4.0, 4.0], [0.5, 0.5], false, 0.0).unwrap(); + assert!((px[0] - 0.5).abs() < 1e-3 && px[3] > 0.99, "{pass}: {px:?}"); + let files = log.into_files(); + assert_eq!(files.files().iter().map(|f| &*f.path).collect::>(), ["/clip.png"], "{pass}"); + assert!(files.is_complete(), "{pass}"); + } +} + /// A huge sample point saturates the pixel coordinates; it must not overflow the loop bounds. #[test] fn sample_image_huge_point_is_transparent() { diff --git a/crates/gpu/src/tests/adv3d.rs b/crates/gpu/src/tests/adv3d.rs index 00b1fee14..4914c4912 100644 --- a/crates/gpu/src/tests/adv3d.rs +++ b/crates/gpu/src/tests/adv3d.rs @@ -123,6 +123,7 @@ pub(crate) fn scene(p: &Project, cid: ItemId) -> Scene { footage: None, property_overrides: &[], media_overrides: &[], + reads: None, }; let run: Vec<&effectcraft_project::Layer> = ctx.comp.layers.iter().rev().filter(|l| l.is_3d() && l.has_video()).collect(); adv::scene_of(&r, &ctx, &run, (ctx.comp.width, ctx.comp.height)) @@ -315,6 +316,7 @@ pub(crate) fn run_of(p: &Project, cid: ItemId) -> (EvalCtx<'_>, Vec<&effectcraft footage: None, property_overrides: &[], media_overrides: &[], + reads: None, }; let run: Vec<&effectcraft_project::Layer> = ctx.comp.layers.iter().rev().filter(|l| l.is_3d() && l.has_video()).collect(); (ctx, run) diff --git a/crates/host/src/tests.rs b/crates/host/src/tests.rs index f628ce4e4..339b48d3d 100644 --- a/crates/host/src/tests.rs +++ b/crates/host/src/tests.rs @@ -343,6 +343,7 @@ fn value(s: &effectcraft_engine::Session, l: u64, path: &str) -> effectcraft_eng footage: None, property_overrides: &[], media_overrides: &[], + reads: None, }; ctx.value(layer, layer.props.prop(path).unwrap()) } @@ -606,6 +607,7 @@ fn stereo_rig_expressions_follow_the_master_camera() { footage: None, property_overrides: &[], media_overrides: &[], + reads: None, }; ctx.value(layer, layer.props.prop(path).unwrap()).as_vec3() }; diff --git a/crates/render/src/eval.rs b/crates/render/src/eval.rs index f4d2cbb37..e900ffa6e 100644 --- a/crates/render/src/eval.rs +++ b/crates/render/src/eval.rs @@ -44,11 +44,14 @@ pub struct EvalCtx<'a> { /// Media Replacement values overridden by the Essential Properties of a collapsed precomp /// instance. pub media_overrides: &'a [crate::MediaOverride], + /// Where the source files of what expressions render (`sampleImage`) are noted: the + /// renderer's [`Renderer::reads`](crate::Renderer::reads) while rendering. + pub reads: Option<&'a crate::reads::ReadLog>, } impl<'a> EvalCtx<'a> { pub fn new(project: &'a Project, comp_id: ItemId, comp: &'a Comp, time: Tick) -> EvalCtx<'a> { - EvalCtx { project, comp_id, comp, time, expr: None, footage: None, property_overrides: &[], media_overrides: &[] } + EvalCtx { project, comp_id, comp, time, expr: None, footage: None, property_overrides: &[], media_overrides: &[], reads: None } } pub fn at(&self, time: Tick) -> EvalCtx<'a> { EvalCtx { time, ..*self } diff --git a/crates/render/src/pipeline.rs b/crates/render/src/pipeline.rs index e793b2ad4..136874be1 100644 --- a/crates/render/src/pipeline.rs +++ b/crates/render/src/pipeline.rs @@ -140,6 +140,13 @@ impl<'a> Renderer<'a> { out } + /// `ctx` noting what it reads (fonts, `sampleImage`) in this render's [`Renderer::reads`]: + /// a context made by an outer render carries that render's log, not the one of the buffer + /// [`Renderer::recorded`] makes. + pub(crate) fn with_reads<'c>(&'c self, ctx: &EvalCtx<'c>) -> EvalCtx<'c> { + EvalCtx { reads: self.reads, ..*ctx } + } + /// The buffer the layer cache keeps under `key`, with the files it was made of noted in /// [`Renderer::reads`]. pub(crate) fn cached(&self, key: Option) -> Option<(Arc, Arc)> { @@ -422,7 +429,17 @@ impl<'a> Renderer<'a> { } pub(crate) fn ctx(&self, comp_id: ItemId, comp: &'a Comp, t: Tick) -> EvalCtx<'a> { - EvalCtx { project: self.project, comp_id, comp, time: t, expr: self.expr, footage: Some(self.footage), property_overrides: &[], media_overrides: &[] } + EvalCtx { + project: self.project, + comp_id, + comp, + time: t, + expr: self.expr, + footage: Some(self.footage), + property_overrides: &[], + media_overrides: &[], + reads: self.reads, + } } /// This renderer with another accelerator (or none): the passes of @@ -831,7 +848,9 @@ impl<'a> Renderer<'a> { let img = self.footage_frame(ctx, layer, item, pf, lt, size)?; Some(self.footage_buf(&img, pf, f.width, f.height)) } - LayerSource::Text => Some(self.authored(text::render(ctx, layer, self.raster_scale(ctx, layer)))), + // (the font files go to this render's log, which `ctx` may not carry: see + // [`Renderer::with_reads`]) + LayerSource::Text => Some(self.authored(text::render(&self.with_reads(ctx), layer, self.raster_scale(ctx, layer)))), LayerSource::Shape => layer.props.sub("contents").map(|c| self.authored(shapes::render(ctx, layer, c, self.raster_scale(ctx, layer)))), _ => None, } diff --git a/crates/render/src/tests/collapse.rs b/crates/render/src/tests/collapse.rs index 30d2163c1..4104e0b38 100644 --- a/crates/render/src/tests/collapse.rs +++ b/crates/render/src/tests/collapse.rs @@ -161,8 +161,17 @@ fn referenced_layer_overrides_change_the_owner_cache_key() { let opacity = comp.layer(aid).unwrap().props.prop("transform/opacity").unwrap().uid; let key = |value: f64| { let overrides = [crate::PropertyOverride { layer: aid, prop: opacity, value: Value::Scalar(value), font: false }]; - let ctx = - EvalCtx { project: &p, comp_id: cid, comp, time: Tick::ZERO, expr: None, footage: None, property_overrides: &overrides, media_overrides: &[] }; + let ctx = EvalCtx { + project: &p, + comp_id: cid, + comp, + time: Tick::ZERO, + expr: None, + footage: None, + property_overrides: &overrides, + media_overrides: &[], + reads: None, + }; crate::cache::layer_key(&ctx, b, 1.0, false, false) }; let (opaque, half) = (key(100.0), key(50.0)); diff --git a/crates/render/src/tests/time.rs b/crates/render/src/tests/time.rs index e9599f70b..715c37ef0 100644 --- a/crates/render/src/tests/time.rs +++ b/crates/render/src/tests/time.rs @@ -143,6 +143,7 @@ fn input_keys_ignore_later_effects() { footage: None, property_overrides: &[], media_overrides: &[], + reads: None, }; let l = &comp.layers[0]; (crate::cache::input_key(&ctx, l, 1.0, false, false, 1), crate::cache::input_key(&ctx, l, 1.0, false, false, 2)) diff --git a/crates/render/src/text.rs b/crates/render/src/text.rs index 683da82ee..cb7e16fce 100644 --- a/crates/render/src/text.rs +++ b/crates/render/src/text.rs @@ -638,11 +638,49 @@ fn align_index(j: Justify) -> u8 { } } +/// Note the font files `lay` is drawn with in [`EvalCtx::reads`] (#3184), each with its identity +/// as its bytes were read, so a cache entry of the text is checked against them. What the +/// files can't vouch for makes the list incomplete: a family that is not installed (installing +/// it changes the text), a character drawn with a fallback face or with none (another installed +/// font could take it), a font from memory. +fn note_fonts(ctx: &EvalCtx, lay: &TextLayout) { + use crate::reads::{FileStamp, ReadFile}; + use effectcraft_text::fonts; + let Some(log) = ctx.reads else { return }; + let resolved: Vec = lay.styles.iter().map(|s| fonts::resolve(&s.font, &s.style)).collect(); + if resolved.iter().any(|r| r.missing) { + log.mark_incomplete(); + } + let mut faces: Vec = Vec::new(); + for g in &lay.layout.glyphs { + if g.id == 0 || resolved.get(g.run).is_none_or(|r| r.face != g.face) { + log.mark_incomplete(); + } + if !faces.contains(&g.face) { + faces.push(g.face); + } + } + for id in faces { + let face = fonts::face(id); + match &face.info.data { + fonts::FaceData::Static(_) => {} + fonts::FaceData::Shared(_) => log.mark_incomplete(), + fonts::FaceData::File(_) => { + if let Some((path, meta)) = face.file_read() { + let stamp = meta.map_or(FileStamp::Missing, FileStamp::of_metadata); + log.note(ReadFile::new(path.to_string_lossy().as_ref(), stamp)); + } + } + } + } +} + /// Lay out and animate a text layer. pub fn text_geom(ctx: &EvalCtx, layer: &Layer) -> Option { let doc = source_text(ctx, layer)?; let text = layer.props.sub("text")?; let lay = layout_doc(&doc); + note_fonts(ctx, &lay); let xfs = char_transforms(ctx, layer, text, &lay); let three = per_char_3d(ctx, layer); let more = text.sub("moreOptions"); @@ -665,6 +703,7 @@ pub fn text_geom(ctx: &EvalCtx, layer: &Layer) -> Option { // Same character count: the style runs still line up. let d2 = TextDoc { text: chars.into_iter().collect(), ..doc.clone() }; let l2 = layout_doc(&d2); + note_fonts(ctx, &l2); let by_char: std::collections::HashMap = lay.glyphs.iter().zip(&xfs).map(|(g, x)| (g.char_index, *x)).collect(); let x2: Vec = l2.glyphs.iter().map(|g| by_char.get(&g.char_index).copied().unwrap_or_default()).collect(); subs = vec![None; l2.glyphs.len()]; diff --git a/crates/render/src/text/tests.rs b/crates/render/src/text/tests.rs index 0280115a5..cd89ad1d1 100644 --- a/crates/render/src/text/tests.rs +++ b/crates/render/src/text/tests.rs @@ -715,3 +715,58 @@ fn range_bar_drag_values() { assert_eq!(range_value_of(3.6 / 7.0, 0.0, true, 7), 4.0); assert_eq!(range_value_of(3.6 / 7.0, 2.0 / 7.0, true, 7), 2.0, "less a 2-character Offset"); } + +/// Text names the font files it is drawn with (#3184), with their identity as they were read, so +/// a cache entry of it is checked against them; what the files can't vouch for (a family that +/// isn't installed) leaves the list incomplete. +#[test] +fn text_notes_the_font_files_it_draws_with() { + use crate::reads::{FileStamp, ReadLog}; + use effectcraft_text::fonts::{self, FaceData, FaceInfo, FontSource}; + struct OneFile(std::path::PathBuf); + impl FontSource for OneFile { + fn faces(&self) -> Vec { + vec![FaceInfo { + family: "Reads Test Sans".into(), + style: "Regular".into(), + weight: 400, + italic: false, + index: 0, + data: FaceData::File(self.0.clone()), + origin: "system", + native_family: None, + full_name: "Reads Test Sans Regular".into(), + postscript: None, + variable: false, + instances: vec![], + }] + } + } + let dir = std::env::temp_dir().join(format!("effectcraft-font-reads-{}", std::process::id())); + let _ = std::fs::remove_dir_all(&dir); + std::fs::create_dir_all(&dir).unwrap(); + let font = dir.join("reads-test-sans.ttf"); + std::fs::write(&font, fonts::INTER_REGULAR).unwrap(); + fonts::add_source(&OneFile(font.clone())); + let stamp = FileStamp::native(&font.to_string_lossy()).unwrap(); + let files_of = |family: &str| { + let (mut p, cid, comp) = setup(200, 80); + let l = + text_layer(&mut p, &comp, TextDoc { text: "Hi there\rtwo".into(), font: family.into(), style: "Regular".into(), size: 30.0, ..Default::default() }); + p.comp_mut(cid).unwrap().layers.push(l); + let log = ReadLog::new(); + let c = EvalCtx { reads: Some(&log), ..ctx(&p, cid, 0.0) }; + assert!(text_geom(&c, &p.comp(cid).unwrap().layers[0]).is_some()); + log.into_files() + }; + let files = files_of("Reads Test Sans"); + assert!(files.is_complete(), "{files:?}"); + assert_eq!(files.files().len(), 1, "{files:?}"); + assert_eq!(files.get(&font.to_string_lossy()), Some(stamp)); + // The bundled family reads no file. + let files = files_of(effectcraft_text::fonts::DEFAULT_FAMILY); + assert!(files.is_complete() && files.is_empty(), "{files:?}"); + // A family that isn't installed falls back: installing it would change the text. + assert!(!files_of("No Such Family 3184").is_complete()); + let _ = std::fs::remove_dir_all(&dir); +} diff --git a/crates/render/src/three_d/adv/scene.rs b/crates/render/src/three_d/adv/scene.rs index b706826de..9166dc4a4 100644 --- a/crates/render/src/three_d/adv/scene.rs +++ b/crates/render/src/three_d/adv/scene.rs @@ -656,7 +656,7 @@ fn extruded_layer(r: &Renderer, ctx: &EvalCtx, layer: &Layer, p: &model::extrude let opacity = (ctx.opacity(layer) as f32 * r.opacity_mul()).clamp(0.0, 1.0); let world = b.outer * ctx.world_matrix(layer); let lin = b.s.linear_io; - for (mesh, c, local) in extruded_meshes(ctx, layer, p) { + for (mesh, c, local) in extruded_meshes(&r.with_reads(ctx), layer, p) { let l = |v: f32| if lin { v } else { srgb_to_linear(v) }; let m = b.material(Material { base: [l(c[0]), l(c[1]), l(c[2]), c[3]], @@ -699,7 +699,7 @@ fn card_layer(r: &Renderer, ctx: &EvalCtx, layer: &Layer, b: &mut Builder) { mat.opacity = (ctx.opacity(layer) as f32 * r.opacity_mul()).clamp(0.0, 1.0); let world = b.outer * ctx.world_matrix(layer); if crate::text::per_char_3d(ctx, layer) { - for (buf, m) in crate::text::per_char_planes(ctx, layer, r.opts.scale) { + for (buf, m) in crate::text::per_char_planes(&r.with_reads(ctx), layer, r.opts.scale) { let buf = r.to_blend(Arc::new(buf), None, &Arc::default()); card(b, &buf, world * m, mat); } diff --git a/crates/render/src/three_d/adv/tests.rs b/crates/render/src/three_d/adv/tests.rs index b2612de98..88e805882 100644 --- a/crates/render/src/three_d/adv/tests.rs +++ b/crates/render/src/three_d/adv/tests.rs @@ -822,6 +822,7 @@ fn extruded_text_renders_as_a_mesh() { footage: None, property_overrides: &[], media_overrides: &[], + reads: None, }; let l = &ctx.comp.layers[0]; let params = scene::extrusion_params(&ctx, l).unwrap(); @@ -870,6 +871,7 @@ fn shape_surface_items_colour_the_extruded_surfaces() { footage: None, property_overrides: &[], media_overrides: &[], + reads: None, }; let l = &ctx.comp.layers[0]; let params = scene::extrusion_params(&ctx, l).unwrap(); @@ -915,6 +917,7 @@ fn text_animators_colour_the_extruded_surfaces() { footage: None, property_overrides: &[], media_overrides: &[], + reads: None, }; let l = &ctx.comp.layers[0]; let params = scene::extrusion_params(&ctx, l).unwrap(); @@ -1122,6 +1125,7 @@ fn extruded_strokes_render_as_bevelled_meshes() { footage: None, property_overrides: &[], media_overrides: &[], + reads: None, }; let l = &ctx.comp.layers[0]; let params = scene::extrusion_params(&ctx, l).unwrap(); diff --git a/crates/render/src/three_d/compose.rs b/crates/render/src/three_d/compose.rs index 361f427c3..ff08eb05f 100644 --- a/crates/render/src/three_d/compose.rs +++ b/crates/render/src/three_d/compose.rs @@ -203,7 +203,7 @@ pub(crate) fn prepare<'a>(r: &Renderer, ctx: &EvalCtx<'_>, layer: &'a Layer, ord /// Prepare a layer as planes: one per character for per-character 3D text, else one. pub(crate) fn prepare_all<'a>(r: &Renderer, ctx: &EvalCtx<'_>, layer: &'a Layer, order: usize, out: (u32, u32), in_run: bool) -> Vec> { if crate::text::per_char_3d(ctx, layer) { - return crate::text::per_char_planes(ctx, layer, r.opts.scale) + return crate::text::per_char_planes(&r.with_reads(ctx), layer, r.opts.scale) .into_iter() .filter_map(|(buf, m)| { prepare_with(r, ctx, layer, order, out, in_run, PlaneInput { buf: r.to_blend(Arc::new(buf), None, &Arc::default()), local: m }) diff --git a/crates/script/src/tests/ui_more.rs b/crates/script/src/tests/ui_more.rs index 483d686ef..c15aee0ae 100644 --- a/crates/script/src/tests/ui_more.rs +++ b/crates/script/src/tests/ui_more.rs @@ -231,6 +231,7 @@ fn position_now(s: &Session, layer: u64) -> [f64; 2] { footage: None, property_overrides: &[], media_overrides: &[], + reads: None, }; let v = ctx.value(l, l.props.prop("transform/position").unwrap()).components(); [v[0], v[1]] diff --git a/crates/text/src/fonts.rs b/crates/text/src/fonts.rs index 5388629cf..f9ad858eb 100644 --- a/crates/text/src/fonts.rs +++ b/crates/text/src/fonts.rs @@ -158,11 +158,24 @@ fn info_from(n: FaceNames, data: FaceData, origin: &'static str) -> FaceInfo { } } +/// A font file's bytes and its metadata from the same open file (so the metadata describes the +/// bytes, not a later version of the file). +fn read_with_metadata(path: &std::path::Path) -> std::io::Result<(Vec, std::fs::Metadata)> { + use std::io::Read; + let mut f = std::fs::File::open(path)?; + let meta = f.metadata()?; + let mut bytes = Vec::new(); + f.read_to_end(&mut bytes)?; + Ok((bytes, meta)) +} + /// A loaded (or loadable) face. pub struct Face { pub id: FaceId, pub info: FaceInfo, bytes: OnceLock>, + /// The file's metadata as its bytes were read (a [`FaceData::File`] face, once loaded). + file_meta: OnceLock, shaper: OnceLock, } @@ -200,11 +213,23 @@ impl Face { .get_or_init(|| match &self.info.data { FaceData::Static(b) => Some(FaceBytes::Static(b)), FaceData::Shared(b) => Some(FaceBytes::Shared(b.clone())), - FaceData::File(p) => std::fs::read(p).ok().map(|v| FaceBytes::Shared(Arc::new(v))), + FaceData::File(p) => { + let (bytes, meta) = read_with_metadata(p).ok()?; + let _ = self.file_meta.set(meta); + Some(FaceBytes::Shared(Arc::new(bytes))) + } }) .as_ref() .map(FaceBytes::get) } + /// The file a [`FaceData::File`] face is drawn from, with its metadata as its bytes were read + /// (`None` when it could not be read): what text drawn with the face was made of. Loads the + /// face. `None` for bundled faces and faces from memory. + pub fn file_read(&self) -> Option<(&std::path::Path, Option<&std::fs::Metadata>)> { + let FaceData::File(p) = &self.info.data else { return None }; + let _ = self.bytes(); + Some((p, self.file_meta.get())) + } /// The parsed font (None if the file is missing or unreadable). pub fn font(&self) -> Option> { FontRef::from_index(self.bytes()?, self.info.index).ok() @@ -314,7 +339,7 @@ fn bundled_default_face() -> Arc { variable: false, instances: Vec::new(), }); - Arc::new(Face { id: 0, info, bytes: OnceLock::new(), shaper: OnceLock::new() }) + Arc::new(Face { id: 0, info, bytes: OnceLock::new(), file_meta: OnceLock::new(), shaper: OnceLock::new() }) } fn db() -> &'static RwLock { @@ -333,7 +358,7 @@ fn db() -> &'static RwLock { fn push(db: &mut Db, info: FaceInfo) -> FaceId { let id = db.faces.len(); - db.faces.push(Arc::new(Face { id, info, bytes: OnceLock::new(), shaper: OnceLock::new() })); + db.faces.push(Arc::new(Face { id, info, bytes: OnceLock::new(), file_meta: OnceLock::new(), shaper: OnceLock::new() })); id } diff --git a/crates/ui-egui/src/menus/invoke.rs b/crates/ui-egui/src/menus/invoke.rs index 4d2c15b2a..1c34c2cb1 100644 --- a/crates/ui-egui/src/menus/invoke.rs +++ b/crates/ui-egui/src/menus/invoke.rs @@ -163,6 +163,7 @@ fn vertex_delta(app: &EffectcraftApp, layer: effectcraft_engine::project::LayerI footage: None, property_overrides: &[], media_overrides: &[], + reads: None, }; let (l2c, _) = crate::panels::viewer::l2c(&ectx, l); l2c.inverse().map_or(d, |inv| { diff --git a/crates/ui-egui/src/panels/effect_controls/panel.rs b/crates/ui-egui/src/panels/effect_controls/panel.rs index 0857dfa3f..39fd4847a 100644 --- a/crates/ui-egui/src/panels/effect_controls/panel.rs +++ b/crates/ui-egui/src/panels/effect_controls/panel.rs @@ -186,6 +186,7 @@ pub fn show(app: &mut EffectcraftApp, ui: &mut egui::Ui, rect: Rect) { footage: None, property_overrides: &[], media_overrides: &[], + reads: None, }; let hdr = Rect::from_min_size(rect.min, vec2(rect.width(), 24.0)); p.text(pos2(hdr.min.x + 10.0, hdr.center().y), Align2::LEFT_CENTER, format!("{} • {}", comp_name, layer.name), Tokens::ui(11.5), t.text_dim); diff --git a/crates/ui-egui/src/panels/layer_panel.rs b/crates/ui-egui/src/panels/layer_panel.rs index 8e4f3502f..e23e11cfb 100644 --- a/crates/ui-egui/src/panels/layer_panel.rs +++ b/crates/ui-egui/src/panels/layer_panel.rs @@ -113,6 +113,7 @@ fn render_tex( footage: None, property_overrides: &[], media_overrides: &[], + reads: None, }; let mut r = Renderer::new(&app.session.project, &*app.session.footage, RenderOpts { scale, ..Default::default() }); r.expr = app.session.expr.as_deref(); diff --git a/crates/ui-egui/src/panels/properties.rs b/crates/ui-egui/src/panels/properties.rs index 25829be7d..4edcbb31a 100644 --- a/crates/ui-egui/src/panels/properties.rs +++ b/crates/ui-egui/src/panels/properties.rs @@ -79,6 +79,7 @@ pub fn show(app: &mut EffectcraftApp, ui: &mut egui::Ui, rect: Rect) { footage: None, property_overrides: &[], media_overrides: &[], + reads: None, }; let scroll = widgets::PanelScroll::begin(ui, egui::Id::unique("props-scroll"), rect); let rect = scroll.content; diff --git a/crates/ui-egui/src/panels/roto_tool.rs b/crates/ui-egui/src/panels/roto_tool.rs index 194bba26a..c01a8f07e 100644 --- a/crates/ui-egui/src/panels/roto_tool.rs +++ b/crates/ui-egui/src/panels/roto_tool.rs @@ -114,6 +114,7 @@ pub fn draw_overlay( footage: None, property_overrides: &[], media_overrides: &[], + reads: None, }; let mut r = Renderer::new(&app.session.project, &*app.session.footage, RenderOpts { scale, ..Default::default() }); r.expr = app.session.expr.as_deref(); diff --git a/crates/ui-egui/src/panels/text_panels.rs b/crates/ui-egui/src/panels/text_panels.rs index 096b41cf2..f22d775a3 100644 --- a/crates/ui-egui/src/panels/text_panels.rs +++ b/crates/ui-egui/src/panels/text_panels.rs @@ -66,6 +66,7 @@ pub fn text_target(app: &EffectcraftApp) -> Option { footage: None, property_overrides: &[], media_overrides: &[], + reads: None, }; effectcraft_engine::render::text::source_text(&ectx, layer).map(|d| TextTarget { layer: layer.id.0, doc: d, range: None }) } diff --git a/crates/ui-egui/src/panels/timeline.rs b/crates/ui-egui/src/panels/timeline.rs index 038dcc9b9..d7017e7fd 100644 --- a/crates/ui-egui/src/panels/timeline.rs +++ b/crates/ui-egui/src/panels/timeline.rs @@ -1982,6 +1982,7 @@ pub fn show(app: &mut EffectcraftApp, ui: &mut egui::Ui, rect: Rect) { footage: None, property_overrides: &[], media_overrides: &[], + reads: None, }; let mut rw = begin_rows(app, ui, tl); let g = &mut rw; diff --git a/crates/ui-egui/src/panels/viewer.rs b/crates/ui-egui/src/panels/viewer.rs index b1899e1f8..1e214ab53 100644 --- a/crates/ui-egui/src/panels/viewer.rs +++ b/crates/ui-egui/src/panels/viewer.rs @@ -212,6 +212,7 @@ pub fn show(app: &mut EffectcraftApp, ui: &mut egui::Ui, rect: Rect) { footage: None, property_overrides: &[], media_overrides: &[], + reads: None, }; phase_guides(app, &ectx, &mut v); phase_layers(app, ui, &ectx, &mut v); diff --git a/crates/ui-egui/src/panels/viewer/shapes.rs b/crates/ui-egui/src/panels/viewer/shapes.rs index 0cd579883..903abd42f 100644 --- a/crates/ui-egui/src/panels/viewer/shapes.rs +++ b/crates/ui-egui/src/panels/viewer/shapes.rs @@ -219,6 +219,7 @@ pub(super) fn create_shape(app: &mut EffectcraftApp, tool: Tool, a: [f64; 2], b: footage: None, property_overrides: &[], media_overrides: &[], + reads: None, }; let inv = l2c(&ectx, &l).0.inverse().unwrap_or(Mat3::IDENTITY); let p0 = inv.apply(gv2(cx - w / 2.0, cy - h / 2.0)); diff --git a/crates/ui-egui/src/panels/viewer/view.rs b/crates/ui-egui/src/panels/viewer/view.rs index 60a68c57c..e837528b3 100644 --- a/crates/ui-egui/src/panels/viewer/view.rs +++ b/crates/ui-egui/src/panels/viewer/view.rs @@ -53,6 +53,7 @@ pub(super) fn aux_views( footage: None, property_overrides: &[], media_overrides: &[], + reads: None, }; let selected = app.session.state.selected_layers.clone(); let mut picked: Option<(usize, View3D)> = None; From 1e569ee3a98dd52defaf6468d4f72a243335eddb Mon Sep 17 00:00:00 2001 From: vangel76 Date: Sat, 7 Nov 2026 02:14:17 +0100 Subject: [PATCH 027/451] Disk cache: frame entries store the whole modification time A frame entry's file list stores a file's modification time as i128 nanoseconds since 1970 (negative before), as the file stamps now keep it; the frame entry format version goes to frame-entry-files-2 so entries in the old layout are not read. Co-Authored-By: Claude Opus 5.5 --- crates/render/src/disk_cache.rs | 2 +- crates/render/src/disk_cache/entry_files.rs | 20 ++++++++++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/crates/render/src/disk_cache.rs b/crates/render/src/disk_cache.rs index b4f90fc4d..01ab5118e 100644 --- a/crates/render/src/disk_cache.rs +++ b/crates/render/src/disk_cache.rs @@ -1279,7 +1279,7 @@ fn comp_content_key_for_renderer(project: &effectcraft_project::Project, comp: e /// Frame entries with their source files (#3184), part of every frame key: entries of the /// earlier format (keyed by footage stamps instead) are never looked up again; least recently /// used, they are evicted. -const FRAME_ENTRY_VERSION: &[u8] = b"frame-entry-files-1"; +const FRAME_ENTRY_VERSION: &[u8] = b"frame-entry-files-2"; /// Disk key of one viewer frame. pub fn frame_key(content: u128, frame: i64, scale_milli: u32, view: u64) -> u128 { diff --git a/crates/render/src/disk_cache/entry_files.rs b/crates/render/src/disk_cache/entry_files.rs index fae8cab8f..4ebd1f2e6 100644 --- a/crates/render/src/disk_cache/entry_files.rs +++ b/crates/render/src/disk_cache/entry_files.rs @@ -4,8 +4,9 @@ //! //! Layout (little endian), before the frame's pixel payload: //! `u32 count`, then per file `u32 path length`, the path (UTF-8), a tag byte and its fields: -//! `0` a file on disk (`u64 size`, `u8 has time`, `u64 time`), `1` bytes from the browser's file -//! table (`u64 size`, `u64 content hash`), `2` a file that could not be read. +//! `0` a file on disk (`u64 size`, `u8 has time`, `i128 time`: nanoseconds since the Unix epoch, +//! negative before it), `1` bytes from the browser's file table (`u64 size`, `u64 content +//! hash`), `2` a file that could not be read. use std::sync::Arc; @@ -18,8 +19,9 @@ const MAX_PATH_BYTES: usize = 1 << 16; /// A file's identity as a frame entry keeps it. #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum EntryStamp { - /// Size and modification time (nanoseconds since the Unix epoch) on disk. - Native { len: u64, modified: Option }, + /// Size and modification time (nanoseconds since the Unix epoch, negative before it) on + /// disk. + Native { len: u64, modified: Option }, /// Size and content hash from the [`VirtualFileId`] hook (the browser's file table). Virtual { len: u64, hash: u64 }, /// It could not be read when the frame was made: it still must not be readable. @@ -134,7 +136,7 @@ impl EntryFiles { 0 => { let len = r.u64()?; let has = r.u8()?; - let t = r.u64()?; + let t = r.i128()?; match has { 0 => EntryStamp::Native { len, modified: None }, 1 => EntryStamp::Native { len, modified: Some(t) }, @@ -179,6 +181,9 @@ impl<'a> Reader<'a> { fn u64(&mut self) -> Option { Some(u64::from_le_bytes(self.take(8)?.try_into().ok()?)) } + fn i128(&mut self) -> Option { + Some(i128::from_le_bytes(self.take(16)?.try_into().ok()?)) + } } #[cfg(test)] @@ -189,6 +194,9 @@ mod tests { [ ReadFile::new("/a.png", FileStamp::Native { len: 3, modified: Some(9) }), ReadFile::new("/b.png", FileStamp::Native { len: 4, modified: None }), + // Before 1970, and past where `u64` nanoseconds end (2554). + ReadFile::new("/d.png", FileStamp::Native { len: 5, modified: Some(-86_400_000_000_000) }), + ReadFile::new("/e.png", FileStamp::Native { len: 6, modified: Some(i128::from(u64::MAX) + 1) }), ReadFile::new("/c.png", FileStamp::Missing), ReadFile::new("/v.mov", FileStamp::Virtual), ] @@ -200,7 +208,7 @@ mod tests { fn lists_round_trip_and_damage_is_caught() { let id = |p: &str| (p == "/v.mov").then_some((8, 77)); let list = EntryFiles::of(&files(), Some(&id)).unwrap(); - assert_eq!(list.files()[3].stamp, EntryStamp::Virtual { len: 8, hash: 77 }); + assert_eq!(list.files()[5].stamp, EntryStamp::Virtual { len: 8, hash: 77 }); let mut bytes = vec![]; list.encode(&mut bytes); bytes.extend_from_slice(b"rest"); From eeff6f44ffb2eec374922de568aaf810b3d37b1e Mon Sep 17 00:00:00 2001 From: vangel76 Date: Sat, 7 Nov 2026 02:30:50 +0100 Subject: [PATCH 028/451] Disk cache: layer entries store the whole modification time Layer entries share the frame entries' file list layout, which now stores the full i128 modification time: the layer entry format version goes to layer-entry-files-2. The module doc names the font files text is drawn with among an entry's source files, and what keeps a list incomplete. Co-Authored-By: Claude Opus 5.5 --- crates/render/src/disk_cache.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/crates/render/src/disk_cache.rs b/crates/render/src/disk_cache.rs index 53137bd5c..fe8ec05a5 100644 --- a/crates/render/src/disk_cache.rs +++ b/crates/render/src/disk_cache.rs @@ -8,10 +8,12 @@ //! items a buffer uses with their settings and paths) and the renderer version //! ([`layer_disk_key`]). A changed project therefore never reads stale pixels: its keys simply //! change. -//! * Frame and layer entries keep the source files they were made of, each with the size and -//! modification time it was read with ([`EntryFiles`], #3184). An entry is used only while -//! those files are unchanged: a handful of `metadata` calls when it is read, never a scan of -//! the project's files. A frame or buffer whose files can't all be named is not stored. +//! * Frame and layer entries keep the source files they were made of (footage, and the font +//! files text is drawn with), each with the size and modification time it was read with +//! ([`EntryFiles`], #3184). An entry is used only while those files are unchanged: a handful +//! of `metadata` calls when it is read, never a scan of the project's files. A frame or +//! buffer whose files can't all be named is not stored (text in a family that isn't installed +//! or with fallback glyphs, footage refused by automation read roots, …). //! * Payloads are LZ4-compressed (`lz4_flex`, MIT): frames as 8-bit premultiplied RGBA (or, for //! 32 bpc viewer frames, half-float RGBA with the bytes shuffled into planes; the entry //! header's format byte tells them apart: 2 and 3, both with their source files first), layer @@ -1165,7 +1167,7 @@ pub type SharedVirtualFileId = Arc Option<(u64, u64)> + Send + S /// Layer entries with their source files (#3184), part of every layer disk key: entries of the /// earlier format (keyed by a project-wide footage salt instead) are never looked up again; /// least recently used, they are evicted. -const LAYER_ENTRY_VERSION: &[u8] = b"layer-entry-files-1"; +const LAYER_ENTRY_VERSION: &[u8] = b"layer-entry-files-2"; /// Disk key of a layer buffer: the layer cache's content key ([`crate::cache::layer_key`] and /// the keys derived from it), the layer entry format and the renderer version. The content key From a5e673dd6aa719169010fb3cc10029ae118a76cf Mon Sep 17 00:00:00 2001 From: vangel76 Date: Sat, 7 Nov 2026 02:42:22 +0100 Subject: [PATCH 029/451] Layer cache: buffers that read other layers are keyed by the switches passed down MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A layer whose effect reads another layer (Gradient Wipe, Set Matte, Blend…) gets that layer drawn by its own renderer. Through a precomp layer, Switches Affect Nested Comps, the switches inherited from the precomp layers above and motion blur on change those pixels, but the key held only the layers' own switches: a buffer made with the setting on was reused (from memory or the disk cache) with it off. Such layers now derive their key with what the renderer passes down. Co-Authored-By: Claude Opus 5.5 --- crates/render/src/cache.rs | 15 +++++++++++++++ crates/render/src/layers.rs | 4 ++++ crates/render/src/pipeline.rs | 18 ++++++++++++++++++ crates/render/src/tests.rs | 35 +++++++++++++++++++++++++++++++++++ 4 files changed, 72 insertions(+) diff --git a/crates/render/src/cache.rs b/crates/render/src/cache.rs index 015aec26c..881d8b2b7 100644 --- a/crates/render/src/cache.rs +++ b/crates/render/src/cache.rs @@ -22,6 +22,7 @@ use std::hash::{Hash, Hasher}; use std::sync::{Arc, Mutex}; use effectcraft_effects::Buf; +use effectcraft_keyframe::Value; use effectcraft_project::{FootageKind, ItemKind, Layer, LayerSource, Node, PropGroup}; use crate::disk_cache::{EntryFiles, SharedVirtualFileId, VirtualFileId, layer_disk_key}; @@ -790,6 +791,20 @@ fn key_any(ctx: &EvalCtx, layer: &Layer, scale: f64, draft: bool, blur: bool, fo Some(h.finish()) } +/// Does the layer read another layer through an enabled effect's layer parameter (Gradient Wipe, +/// Set Matte…)? Those layers are drawn by the reading layer's renderer, so the switches it +/// passes down belong in the key (`Renderer::nested_look`). +pub(crate) fn reads_layers(ctx: &EvalCtx, layer: &Layer) -> bool { + fn reads(ctx: &EvalCtx, layer: &Layer, g: &PropGroup, depth: usize) -> bool { + depth < 32 + && g.children.iter().any(|n| match n { + Node::Prop(p) => matches!(p.value, Value::Layer(_)) && ctx.value(layer, p).as_layer().is_some_and(|id| id != layer.id.0), + Node::Group(sub) => sub.enabled && reads(ctx, layer, sub, depth + 1), + }) + } + layer.switches.effects && layer.effects().is_some_and(|fx| fx.groups().any(|g| g.enabled && reads(ctx, layer, g, 0))) +} + /// Does the layer run an effect that reads the comp camera or lights (Card Dance, CC Particle /// World…)? fn reads_comp_scene(layer: &Layer) -> bool { diff --git a/crates/render/src/layers.rs b/crates/render/src/layers.rs index 9eb87a47e..fe0ff0ef1 100644 --- a/crates/render/src/layers.rs +++ b/crates/render/src/layers.rs @@ -250,6 +250,10 @@ impl<'a> Renderer<'a> { /// depends on the content at every sub-sample). pub(crate) fn content_key(&self, ctx: &EvalCtx, layer: &Layer, key: Option) -> Option { let k = key?; + // A layer that reads other layers through its effects' layer parameters gets them drawn + // by this renderer: the switches it passes down (Switches Affect Nested Comps, the + // precomp layers above, motion blur on) change those pixels, not just the layers' own. + let k = if cache::reads_layers(ctx, layer) { cache::derive(k, self.nested_look()) } else { k }; let Some(times) = self.content_times(ctx, layer) else { return Some(k) }; times.iter().try_fold(cache::derive(k, 0x6d62_6c72), |d, t| Some(cache::derive(d, cache::layer_key(&ctx.at(*t), layer, 1.0, false, false)?))) } diff --git a/crates/render/src/pipeline.rs b/crates/render/src/pipeline.rs index 78ac11fb6..2b55bcea6 100644 --- a/crates/render/src/pipeline.rs +++ b/crates/render/src/pipeline.rs @@ -205,6 +205,24 @@ impl<'a> Renderer<'a> { } } + /// What this renderer passes down to the layers it draws beyond their own switches + /// ([`RenderOpts::nested_switches`], the switches inherited from the precomp layers above, + /// motion blur on): part of the cache key of a buffer that reads other layers. + pub(crate) fn nested_look(&self) -> u64 { + let inherited = match self.inherited { + None => 0, + Some((q, mb)) => { + let q = match q { + Quality::Best => 0, + Quality::Draft => 1, + Quality::Wireframe => 2, + }; + 1 + q * 2 + u64::from(mb) + } + }; + 0x6e65_7374_0000_0000 | inherited << 2 | u64::from(self.opts.nested_switches) << 1 | u64::from(self.opts.motion_blur) + } + /// A layer's Motion Blur switch, limited by the precomp layers above it. pub(crate) fn layer_motion_blur(&self, layer: &Layer) -> bool { layer.switches.motion_blur && self.inherited.is_none_or(|(_, mb)| mb) diff --git a/crates/render/src/tests.rs b/crates/render/src/tests.rs index c77fc2d94..3afe5f794 100644 --- a/crates/render/src/tests.rs +++ b/crates/render/src/tests.rs @@ -820,6 +820,41 @@ fn effects_read_layer_params() { assert!(px[2] > 0.99 && px[0] < 0.01, "{px:?}"); } +/// A cached layer whose effect reads a precomp layer: how the precomp's layers render depends on +/// Switches Affect Nested Comps (the precomp layer's Draft quality passes down) and on the +/// switches the reading layer's own comp inherits, so the key must tell them apart (a buffer +/// made under the other setting, from memory or disk, is stale). +#[test] +fn a_cached_layer_reading_a_precomp_is_keyed_by_the_nested_switches() { + let (mut p, cid, comp) = setup(); + let mut inner = Comp::new(200, 100, FrameRate::FPS_30, Tick::from_seconds_f64(2.0)); + // A rotated square off the pixel grid: Draft (nearest) and Best (bilinear) sampling differ. + let mut dot = solid(&mut p, &inner, [1.0, 1.0, 1.0], 40, 40); + dot.props.prop_mut("transform/position").unwrap().value = Value::Vec3([100.3, 50.6, 0.0]); + dot.props.prop_mut("transform/rotation").unwrap().value = Value::Scalar(30.0); + inner.layers.push(dot); + let iid = p.add_item("Inner", Label::Sandstone, None, ItemKind::Comp(inner.into())); + let mut pre = build::layer(&mut p, &comp, "Inner", LayerSource::Comp { item: iid }, (200, 100), None); + pre.switches.video = false; + pre.switches.quality = effectcraft_project::Quality::Draft; + let mut top = solid(&mut p, &comp, [1.0, 0.0, 0.0], 200, 100); + add_effect_200(&mut p, &mut top, "ec.channel.blend", &[("blendWithLayer", Value::Layer(Some(pre.id.0)))]); + let c = p.comp_mut(cid).unwrap(); + c.layers.push(top); + c.layers.push(pre); + let frame = |nested_switches: bool, cache: Option<&crate::LayerCache>| { + let mut r = crate::Renderer::new(&p, &crate::NoFootage, crate::RenderOpts { nested_switches, ..Default::default() }); + r.cache = cache; + r.comp_frame(cid, Tick::ZERO).data + }; + let (on, off) = (frame(true, None), frame(false, None)); + assert!(on != off, "the precomp layer's Draft quality passes down"); + let cache = crate::LayerCache::default(); + assert!(frame(true, Some(&cache)) == on); + assert!(frame(false, Some(&cache)) == off, "not the buffer made with switches affecting nested comps"); + assert!(frame(true, Some(&cache)) == on, "and back"); +} + /// Records whether the GPU compositor was asked to draw a frame. struct ProbeAccel(std::sync::atomic::AtomicBool); impl crate::Accelerator for ProbeAccel { From e88b847259168506dbff5ef2ba95894c1553730a Mon Sep 17 00:00:00 2001 From: vangel76 Date: Sat, 7 Nov 2026 02:51:51 +0100 Subject: [PATCH 030/451] Layer cache: masked buffers are keyed by the mask motion blur gate A mask with Mask Motion Blur On blurs even when the layer's own switch is off, as long as the render's gate is open (Render Settings motion blur, and with Switches Affect Nested Comps the precomp layers above). The key held the layer's own motion blur state only, so a buffer blurred with the gate open was reused with it closed (and the other way round), also from the disk cache. Masked layer, input and footprint keys now tell a closed gate apart. Co-Authored-By: Claude Opus 5.5 --- crates/render/src/accel.rs | 1 + crates/render/src/layers.rs | 11 ++++++++++- crates/render/src/tests/mask_blur.rs | 29 ++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 1 deletion(-) diff --git a/crates/render/src/accel.rs b/crates/render/src/accel.rs index 9e5d2138a..e794f84f7 100644 --- a/crates/render/src/accel.rs +++ b/crates/render/src/accel.rs @@ -349,6 +349,7 @@ impl<'a> Renderer<'a> { pub fn adjustment_footprint(&self, ctx: &EvalCtx, layer: &Layer) -> Option> { // Cached, so an accelerator sees the same buffer (and uploads it once) every frame. let key = self.cache.and_then(|_| cache::footprint_key(ctx, layer, self.raster_scale(ctx, layer), self.opts.draft, self.mb_on(ctx, layer))); + let key = self.mask_gate_key(ctx, layer, key); if let Some((b, _)) = self.cached(key) { return Some(b); } diff --git a/crates/render/src/layers.rs b/crates/render/src/layers.rs index fe0ff0ef1..5a45c0f0b 100644 --- a/crates/render/src/layers.rs +++ b/crates/render/src/layers.rs @@ -249,7 +249,7 @@ impl<'a> Renderer<'a> { /// A processed-layer cache key that also covers content motion blur (the averaged source /// depends on the content at every sub-sample). pub(crate) fn content_key(&self, ctx: &EvalCtx, layer: &Layer, key: Option) -> Option { - let k = key?; + let k = self.mask_gate_key(ctx, layer, key)?; // A layer that reads other layers through its effects' layer parameters gets them drawn // by this renderer: the switches it passes down (Switches Affect Nested Comps, the // precomp layers above, motion blur on) change those pixels, not just the layers' own. @@ -274,6 +274,15 @@ impl<'a> Renderer<'a> { } } + /// A cache key of a masked layer's buffer, told apart when mask motion blur can't run at all + /// in this render ([`Self::mask_blur`]'s gate: the render options, the precomp layers above). + /// The key has the layer's own motion blur state, but a mask set to On blurs without it. + pub(crate) fn mask_gate_key(&self, ctx: &EvalCtx, layer: &Layer, key: Option) -> Option { + let k = key?; + let masked = layer.masks().is_some_and(|m| !m.children.is_empty()); + Some(if masked && !self.mask_blur(ctx, layer).allowed { cache::derive(k, 0x6d62_6f66) } else { k }) + } + /// Motion-blur sub-samples for a layer buffer (1 = no motion blur). As in After Effects, a 2D /// layer gets about one sample per output pixel its corners travel during the shutter, /// at least Samples Per Frame and at most the comp's Adaptive Sample Limit; a layer that diff --git a/crates/render/src/tests/mask_blur.rs b/crates/render/src/tests/mask_blur.rs index 07bc1e95f..5f3ff4e2a 100644 --- a/crates/render/src/tests/mask_blur.rs +++ b/crates/render/src/tests/mask_blur.rs @@ -75,3 +75,32 @@ fn mask_motion_blur_follows_the_render_and_the_comp() { let (p, cid) = project(false); assert!(alpha_at_25(&p, cid, true) < 0.01, "the comp's switch off"); } + +/// Whether mask motion blur may run at all (the render options, Switches Affect Nested Comps with +/// a precomp layer's switch off) is part of the layer cache key, also for a layer whose own +/// switch is off: a buffer made with the gate open must not serve a render with it closed. +#[test] +fn the_mask_motion_blur_gate_keys_the_layer_cache() { + let (mut p, inner) = project(true); + let mut outer = Comp::new(100, 100, FrameRate::FPS_30, Tick::from_seconds_f64(1.0)); + outer.enable_motion_blur = true; + let mut pre = build::layer(&mut p, &outer, "Inner", LayerSource::Comp { item: inner }, (100, 100), None); + pre.switches.motion_blur = false; + outer.layers.push(pre); + let oid = p.add_item("Outer", Label::Sandstone, None, ItemKind::Comp(outer.into())); + let half = Tick::from_seconds_f64(0.5 / 30.0); + let cache = crate::LayerCache::default(); + let render = |cid: ItemId, opts: RenderOpts, cached: bool| { + let mut r = Renderer::new(&p, &NoFootage, opts); + r.cache = cached.then_some(&cache); + r.comp_frame(cid, half).data + }; + let on = RenderOpts { motion_blur: true, nested_switches: true, ..Default::default() }; + let off = RenderOpts { nested_switches: false, ..on }; + assert!(render(oid, on, false) != render(oid, off, false), "the precomp layer's switch closes the gate"); + assert!(render(oid, off, true) == render(oid, off, false)); + assert!(render(oid, on, true) == render(oid, on, false), "not the buffer blurred with the gate open"); + let still = RenderOpts { motion_blur: false, ..on }; + assert!(render(inner, on, true) == render(inner, on, false)); + assert!(render(inner, still, true) == render(inner, still, false), "Render Settings ▸ Motion Blur off"); +} From e6b19c9bc4b723e9600e91185ae3be8d8e46467d Mon Sep 17 00:00:00 2001 From: vangel76 Date: Sat, 7 Nov 2026 03:10:25 +0100 Subject: [PATCH 031/451] Render: cached buffers list what their expressions and substituted characters read - Buffers made under `Renderer::recorded` (layer content, a Time effect's input, an adjustment layer's footprint) evaluate their masks, shapes and effects with the context that notes into the buffer's own read log, so a file an expression reads (`sampleImage`, also at shutter times mask motion blur adds and the cache key doesn't see) is in the buffer's files. - A styled layer served from the cache lists the files of the cached body and passes too, so the buffers made of it (flattened, blending space) don't get a complete list when one of them came with an incomplete one. - A character put in by Character Offset or Character Value without a relayout notes the font it is drawn with; a fallback face (or none) leaves the list incomplete. Co-Authored-By: Claude Opus 5.5 --- crates/render/src/accel.rs | 2 + crates/render/src/layers.rs | 37 +++++++++++++----- crates/render/src/pipeline.rs | 3 ++ crates/render/src/tests.rs | 63 +++++++++++++++++++++++++++++++ crates/render/src/tests/styles.rs | 31 +++++++++++++++ crates/render/src/text.rs | 23 +++++++++-- crates/render/src/text/tests.rs | 17 ++++++++- 7 files changed, 161 insertions(+), 15 deletions(-) diff --git a/crates/render/src/accel.rs b/crates/render/src/accel.rs index 9e5d2138a..69fe8e051 100644 --- a/crates/render/src/accel.rs +++ b/crates/render/src/accel.rs @@ -353,6 +353,8 @@ impl<'a> Renderer<'a> { return Some(b); } let (foot, files) = self.recorded(key, |r| { + // (what the masks' expressions read, at shutter times too, goes to the buffer's files) + let ctx = &r.with_reads(ctx); let mut foot = r.source(ctx, layer)?; let _ = masks::apply(ctx, layer, &mut foot, r.mask_blur(ctx, layer)); Some(foot) diff --git a/crates/render/src/layers.rs b/crates/render/src/layers.rs index 9eb87a47e..1eaf2847b 100644 --- a/crates/render/src/layers.rs +++ b/crates/render/src/layers.rs @@ -34,6 +34,17 @@ impl Shutter { } } +/// `files` (a content's) with the files of the buffers made of it that the layer cache kept: +/// `files` itself when they are all its own. +fn with_kept_files(files: Arc, kept: &[Arc]) -> Arc { + if kept.iter().all(|f| Arc::ptr_eq(f, &files)) { + return files; + } + let mut all = (*files).clone(); + kept.iter().for_each(|f| all.extend(f)); + Arc::new(all) +} + impl<'a> Renderer<'a> { /// The layer with its styles: exterior passes and body (cached per pass). pub(crate) fn styled(&self, ctx: &EvalCtx, layer: &Layer, mut timing: Option<&mut LayerTiming>) -> Option { @@ -43,10 +54,22 @@ impl<'a> Renderer<'a> { } let modes = styles::pass_modes(ctx, layer); let key = ckey.map(|k| cache::styles_key(ctx, layer, k)); - if let Some((body, _)) = self.cached(key) { - let passes: Option> = - modes.iter().enumerate().map(|(i, m)| self.cached(key.map(|k| cache::derive(k, i as u64 + 1))).map(|(b, _)| (b, *m))).collect(); + // (a cached body or pass may have been made of other files than the content: another + // worker's, or one from disk; the styled layer lists the files of every buffer it holds) + if let Some((body, body_files)) = self.cached(key) { + let mut kept_files = vec![body_files]; + let passes: Option> = modes + .iter() + .enumerate() + .map(|(i, m)| { + self.cached(key.map(|k| cache::derive(k, i as u64 + 1))).map(|(b, f)| { + kept_files.push(f); + (b, *m) + }) + }) + .collect(); if let Some(passes) = passes { + let files = with_kept_files(files, &kept_files); return Some(StyledLayer { passes, body, content, key, ckey, plain: false, files }); } } @@ -73,13 +96,7 @@ impl<'a> Renderer<'a> { (b, m) }) .collect(); - let files = if kept_files.iter().all(|f| Arc::ptr_eq(f, &files)) { - files - } else { - let mut all = (*files).clone(); - kept_files.iter().for_each(|f| all.extend(f)); - Arc::new(all) - }; + let files = with_kept_files(files, &kept_files); Some(StyledLayer { passes, body, content, key, ckey, plain: false, files }) } diff --git a/crates/render/src/pipeline.rs b/crates/render/src/pipeline.rs index 136874be1..9f1d3fba3 100644 --- a/crates/render/src/pipeline.rs +++ b/crates/render/src/pipeline.rs @@ -1063,6 +1063,8 @@ impl<'a> Renderer<'a> { return Some((b, key, files)); } let (buf, files) = self.recorded(key, |r| { + // (what expressions read while it is made, at shutter times too, goes to its files) + let ctx = &r.with_reads(ctx); let buf = r.masked_source(ctx, layer)?; Some(r.apply_effects_timed(ctx, layer, buf, false, usize::MAX, timing.map(|t| &mut t.effects))) }); @@ -1081,6 +1083,7 @@ impl<'a> Renderer<'a> { return Some(b); } let (buf, files) = self.recorded(key, |r| { + let ctx = &r.with_reads(ctx); let mut buf = r.masked_source(ctx, layer)?; let origin = ctx.effect_bounds(layer).1; buf.rebase(origin); diff --git a/crates/render/src/tests.rs b/crates/render/src/tests.rs index c77fc2d94..723671afa 100644 --- a/crates/render/src/tests.rs +++ b/crates/render/src/tests.rs @@ -482,6 +482,69 @@ impl crate::eval::ExprHost for ControllerRate { } } +/// An expression that reads a file (as `sampleImage` does, into [`EvalCtx::reads`]) and keeps +/// the value. +/// +/// [`EvalCtx::reads`]: crate::eval::EvalCtx::reads +struct ReadsAFile; + +impl crate::eval::ExprHost for ReadsAFile { + fn eval(&self, ctx: &crate::eval::EvalCtx, _: &effectcraft_project::Layer, _: &effectcraft_project::Property, value: &Value) -> Result { + if let Some(log) = ctx.reads { + log.note(crate::reads::ReadFile::new("/sampled.png", crate::reads::FileStamp::Native { len: 3, modified: Some(1) })); + } + Ok(value.clone()) + } +} + +/// What expressions read while a cached buffer is made (a mask expression, which mask motion +/// blur also runs at shutter times the cache key doesn't see) goes to that buffer's files, not +/// only to the frame's (#3184): a later render served the buffer lists the file too. Content, +/// a Time effect's input and an adjustment layer's footprint. +#[test] +fn what_expressions_read_goes_to_the_files_of_the_buffer_they_make() { + use crate::reads::ReadLog; + use crate::{NoFootage, RenderOpts, Renderer}; + let (mut p, cid, comp) = setup(); + for adjustment in [false, true] { + let mut l = solid(&mut p, &comp, [1.0, 1.0, 1.0], 200, 100); + l.switches.adjustment = adjustment; + let mut next = p.next_id; + let m = build::mask(&mut Ids(&mut next), "Mask 1", ShapePath::rect([50.0, 50.0], 40.0, 40.0), MaskMode::Add, [255, 255, 0]); + p.next_id = next; + l.props.sub_mut("masks").unwrap().children.push(m.into()); + l.props.prop_mut("masks/#1/path").unwrap().expr = Some(effectcraft_project::Expression { text: "sampled".into(), enabled: true }); + p.comp_mut(cid).unwrap().layers.push(l); + } + let cache = crate::LayerCache::default(); + let c = p.comp(cid).unwrap(); + let (content, adjustment) = (&c.layers[0], &c.layers[1]); + // `make`, rendered once with the expressions (the files go to `log`) and then served from + // the cache to a render without them: the files that render lists. + let files_served = |what: &str, make: &dyn Fn(&Renderer, &crate::eval::EvalCtx) -> bool| { + let log = ReadLog::new(); + let mut r = Renderer::new(&p, &NoFootage, RenderOpts::default()); + r.expr = Some(&ReadsAFile); + r.cache = Some(&cache); + r.reads = Some(&log); + assert!(make(&r, &r.ctx(cid, c, Tick::ZERO)), "{what}"); + assert!(log.files().get("/sampled.png").is_some(), "{what}: the frame lists the file"); + let hits = cache.stats().hits; + let served = ReadLog::new(); + r.expr = None; + r.reads = Some(&served); + assert!(make(&r, &r.ctx(cid, c, Tick::ZERO)), "{what}"); + assert!(cache.stats().hits > hits, "{what}: served from the cache"); + served.into_files() + }; + let files = files_served("content", &|r, ctx| r.content_buf(ctx, content).is_some()); + assert!(files.get("/sampled.png").is_some(), "content: {files:?}"); + let files = files_served("input", &|r, ctx| r.layer_input(ctx, content, 0).is_some()); + assert!(files.get("/sampled.png").is_some(), "input: {files:?}"); + let files = files_served("footprint", &|r, ctx| r.adjustment_footprint(ctx, adjustment).is_some()); + assert!(files.get("/sampled.png").is_some(), "footprint: {files:?}"); +} + /// A Birth Rate expression reading another layer: changing that layer changes the history but /// not the current rate (0) nor this layer's properties, which is all the layer cache key sees. /// CC Particle World layers with expressions therefore aren't layer cached. diff --git a/crates/render/src/tests/styles.rs b/crates/render/src/tests/styles.rs index 2450fcf64..a9de6fb52 100644 --- a/crates/render/src/tests/styles.rs +++ b/crates/render/src/tests/styles.rs @@ -507,3 +507,34 @@ fn workers_styling_a_layer_at_once_share_its_buffers() { assert!(st.passes.iter().zip(&first.passes).all(|(a, b)| std::sync::Arc::ptr_eq(&a.0, &b.0)), "one set of passes"); } } + +/// A styled layer served from the cache lists the files of the body and passes it was served, +/// not only its content's (#3184): one made of other files (another worker's, or from disk, +/// whose list can't vouch for them) passes that on to the buffers made of it (flattened, in the +/// blending space), which are then not kept on disk as complete. +#[test] +fn a_cached_styled_layer_lists_the_files_of_its_cached_buffers() { + let (p, cid) = scene([1.0; 3], None, |p, c, l| add(p, c, l, "dropShadow")); + let layer = &p.comp(cid).unwrap().layers[0]; + let styled = |cache: &crate::LayerCache| { + let mut r = Renderer::new(&p, &NoFootage, RenderOpts::default()); + r.cache = Some(cache); + let ctx = r.eval_ctx(cid, Tick::ZERO).unwrap(); + r.styled_layer(&ctx, layer).unwrap() + }; + let first = styled(&crate::LayerCache::default()); + assert!(first.files.is_complete() && !first.passes.is_empty()); + let key = first.key.unwrap(); + // Body and passes kept with a list that can't vouch for them; the content renders again. + let cache = crate::LayerCache::default(); + let mut unsure = crate::reads::ReadFiles::default(); + unsure.mark_incomplete(); + let unsure = std::sync::Arc::new(unsure); + cache.insert(key, first.body.clone(), unsure.clone()); + for (i, (b, _)) in first.passes.iter().enumerate() { + cache.insert(crate::cache::derive(key, i as u64 + 1), b.clone(), unsure.clone()); + } + let hit = styled(&cache); + assert!(std::sync::Arc::ptr_eq(&hit.body, &first.body), "the cached body"); + assert!(!hit.files.is_complete(), "{:?}", hit.files); +} diff --git a/crates/render/src/text.rs b/crates/render/src/text.rs index cb7e16fce..4165d150d 100644 --- a/crates/render/src/text.rs +++ b/crates/render/src/text.rs @@ -644,15 +644,32 @@ fn align_index(j: Justify) -> u8 { /// it changes the text), a character drawn with a fallback face or with none (another installed /// font could take it), a font from memory. fn note_fonts(ctx: &EvalCtx, lay: &TextLayout) { + note_layout_fonts(ctx, &lay.styles, &lay.layout); +} + +/// A character put in by Character Offset or Character Value (`ch`, in style `st`), outside a +/// relayout: its outline and advance, with the font it is drawn with noted as [`note_fonts`] does +/// (the run's face may not have it: a fallback face then draws it). +fn substituted_glyph(ctx: &EvalCtx, st: &effectcraft_keyframe::CharStyle, ch: char) -> (BezPath, f64) { + if ctx.reads.is_some() { + // (the layout `char_glyph_style` makes, served from the layout cache there) + let lay = effectcraft_text::layout_text(&ch.to_string(), &effectcraft_text::text_style(st), &effectcraft_text::ParagraphStyle::default()); + note_layout_fonts(ctx, std::slice::from_ref(st), &lay); + } + char_glyph_style(st, ch) +} + +/// [`note_fonts`] for `layout`, whose glyphs' runs index `styles`. +fn note_layout_fonts(ctx: &EvalCtx, styles: &[effectcraft_keyframe::CharStyle], layout: &effectcraft_text::Layout) { use crate::reads::{FileStamp, ReadFile}; use effectcraft_text::fonts; let Some(log) = ctx.reads else { return }; - let resolved: Vec = lay.styles.iter().map(|s| fonts::resolve(&s.font, &s.style)).collect(); + let resolved: Vec = styles.iter().map(|s| fonts::resolve(&s.font, &s.style)).collect(); if resolved.iter().any(|r| r.missing) { log.mark_incomplete(); } let mut faces: Vec = Vec::new(); - for g in &lay.layout.glyphs { + for g in &layout.glyphs { if g.id == 0 || resolved.get(g.run).is_none_or(|r| r.face != g.face) { log.mark_incomplete(); } @@ -828,7 +845,7 @@ pub fn text_geom(ctx: &EvalCtx, layer: &Layer) -> Option { // Outline (substituted characters aligned in the original slot). let (outline, adv) = match subs[gi] { Some(c) => { - let (p, a) = char_glyph_style(st, c); + let (p, a) = substituted_glyph(ctx, st, c); let dx = match x.char_align { 0 => 0.0, 2 => g.advance - a, diff --git a/crates/render/src/text/tests.rs b/crates/render/src/text/tests.rs index cd89ad1d1..c4e43bb2e 100644 --- a/crates/render/src/text/tests.rs +++ b/crates/render/src/text/tests.rs @@ -749,16 +749,22 @@ fn text_notes_the_font_files_it_draws_with() { std::fs::write(&font, fonts::INTER_REGULAR).unwrap(); fonts::add_source(&OneFile(font.clone())); let stamp = FileStamp::native(&font.to_string_lossy()).unwrap(); - let files_of = |family: &str| { + // (`value`: a Character Value animator puts that character in for every one) + let files_with = |family: &str, value: Option| { let (mut p, cid, comp) = setup(200, 80); - let l = + let mut l = text_layer(&mut p, &comp, TextDoc { text: "Hi there\rtwo".into(), font: family.into(), style: "Regular".into(), size: 30.0, ..Default::default() }); + if let Some(c) = value { + animator(&mut p, &mut l, &["characterValue"], &["range"]); + set(&mut l, "text/animators/#1/properties/characterValue", Value::Scalar(c as u32 as f64)); + } p.comp_mut(cid).unwrap().layers.push(l); let log = ReadLog::new(); let c = EvalCtx { reads: Some(&log), ..ctx(&p, cid, 0.0) }; assert!(text_geom(&c, &p.comp(cid).unwrap().layers[0]).is_some()); log.into_files() }; + let files_of = |family: &str| files_with(family, None); let files = files_of("Reads Test Sans"); assert!(files.is_complete(), "{files:?}"); assert_eq!(files.files().len(), 1, "{files:?}"); @@ -768,5 +774,12 @@ fn text_notes_the_font_files_it_draws_with() { assert!(files.is_complete() && files.is_empty(), "{files:?}"); // A family that isn't installed falls back: installing it would change the text. assert!(!files_of("No Such Family 3184").is_complete()); + // A substituted character the face has is drawn with it: the same one file. + let files = files_with("Reads Test Sans", Some('B')); + assert!(files.is_complete(), "{files:?}"); + assert_eq!(files.get(&font.to_string_lossy()), Some(stamp)); + // One it lacks (Inter has no CJK) is drawn with a fallback face, or none: another installed + // font could take it, so the list can't vouch for the text. + assert!(!files_with("Reads Test Sans", Some('\u{4e2d}')).is_complete()); let _ = std::fs::remove_dir_all(&dir); } From 3095b856ee765bc05431d7a4f7e25aceb112a60f Mon Sep 17 00:00:00 2001 From: vangel76 Date: Sat, 7 Nov 2026 04:54:38 +0100 Subject: [PATCH 032/451] Render: text lists the font file of a run that draws no glyph; tests clean their temp dirs An empty first paragraph draws no glyph, but in a box its face sets the first baseline that places every later line. The read list took faces only from glyphs, so it could be complete without that file. Note each style run's resolved face as well. The font-reads and confine tests use tempfile::tempdir(): a fresh directory per run, removed on panic too. Co-Authored-By: Claude Opus 5.5 --- Cargo.lock | 2 ++ crates/automation/Cargo.toml | 1 + crates/automation/src/confine.rs | 5 +++-- crates/render/Cargo.toml | 3 +++ crates/render/src/text.rs | 7 +++++++ crates/render/src/text/tests.rs | 29 ++++++++++++++++++++++++----- 6 files changed, 40 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b35796cce..f897737db 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1468,6 +1468,7 @@ dependencies = [ "effectcraft-script", "image", "serde_json", + "tempfile", "thiserror 2.0.21", ] @@ -1878,6 +1879,7 @@ dependencies = [ "lz4_flex", "rayon", "serde", + "tempfile", "web-time", ] diff --git a/crates/automation/Cargo.toml b/crates/automation/Cargo.toml index 916cc3501..e0caf3218 100644 --- a/crates/automation/Cargo.toml +++ b/crates/automation/Cargo.toml @@ -19,3 +19,4 @@ effectcraft-model = { workspace = true } [dev-dependencies] effectcraft-script = { workspace = true } effectcraft-host = { workspace = true } +tempfile = { workspace = true } diff --git a/crates/automation/src/confine.rs b/crates/automation/src/confine.rs index ebc68900e..55fa8043c 100644 --- a/crates/automation/src/confine.rs +++ b/crates/automation/src/confine.rs @@ -646,7 +646,9 @@ mod tests { thread_local! { static NOTED: std::cell::RefCell> = const { std::cell::RefCell::new(Vec::new()) }; } - let base = std::env::temp_dir().join(format!("ec-confine-3184-{}", std::process::id())); + // (a fresh directory, removed when the test ends, panicking or not) + let tmp = tempfile::tempdir().unwrap(); + let base = tmp.path(); let (inside, outside) = (base.join("in"), base.join("elsewhere")); for d in [&inside, &outside] { std::fs::create_dir_all(d).unwrap(); @@ -666,7 +668,6 @@ mod tests { assert!(!shown && !files.is_complete(), "outside the roots: {files:?}"); // The next render on the thread is not affected. assert!(read(&footage(&inside)).1.is_complete()); - let _ = std::fs::remove_dir_all(&base); } #[test] diff --git a/crates/render/Cargo.toml b/crates/render/Cargo.toml index efbd1fc19..cd67e846a 100644 --- a/crates/render/Cargo.toml +++ b/crates/render/Cargo.toml @@ -26,3 +26,6 @@ rayon = { workspace = true } web-time = { workspace = true } serde = { workspace = true } log = { workspace = true } + +[dev-dependencies] +tempfile = { workspace = true } diff --git a/crates/render/src/text.rs b/crates/render/src/text.rs index 4165d150d..efe95023f 100644 --- a/crates/render/src/text.rs +++ b/crates/render/src/text.rs @@ -668,7 +668,14 @@ fn note_layout_fonts(ctx: &EvalCtx, styles: &[effectcraft_keyframe::CharStyle], if resolved.iter().any(|r| r.missing) { log.mark_incomplete(); } + // Each run's face, glyphs or not: an empty paragraph's face sets its line's metrics (in a + // box, the first baseline that places every later line). let mut faces: Vec = Vec::new(); + for r in &resolved { + if !faces.contains(&r.face) { + faces.push(r.face); + } + } for g in &layout.glyphs { if g.id == 0 || resolved.get(g.run).is_none_or(|r| r.face != g.face) { log.mark_incomplete(); diff --git a/crates/render/src/text/tests.rs b/crates/render/src/text/tests.rs index c4e43bb2e..9b52d3098 100644 --- a/crates/render/src/text/tests.rs +++ b/crates/render/src/text/tests.rs @@ -742,10 +742,9 @@ fn text_notes_the_font_files_it_draws_with() { }] } } - let dir = std::env::temp_dir().join(format!("effectcraft-font-reads-{}", std::process::id())); - let _ = std::fs::remove_dir_all(&dir); - std::fs::create_dir_all(&dir).unwrap(); - let font = dir.join("reads-test-sans.ttf"); + // (a fresh directory, removed when the test ends, panicking or not) + let dir = tempfile::tempdir().unwrap(); + let font = dir.path().join("reads-test-sans.ttf"); std::fs::write(&font, fonts::INTER_REGULAR).unwrap(); fonts::add_source(&OneFile(font.clone())); let stamp = FileStamp::native(&font.to_string_lossy()).unwrap(); @@ -781,5 +780,25 @@ fn text_notes_the_font_files_it_draws_with() { // One it lacks (Inter has no CJK) is drawn with a fallback face, or none: another installed // font could take it, so the list can't vouch for the text. assert!(!files_with("Reads Test Sans", Some('\u{4e2d}')).is_complete()); - let _ = std::fs::remove_dir_all(&dir); + // An empty first paragraph in the face draws no glyph, but in a box its face sets the first + // baseline that places the lines after it: the file is read all the same. + let (mut p, cid, comp) = setup(200, 80); + let base = TextDoc { + text: "\rHi".into(), + font: fonts::DEFAULT_FAMILY.into(), + style: "Regular".into(), + size: 30.0, + box_size: Some([180.0, 60.0]), + ..Default::default() + }; + let first = effectcraft_keyframe::CharStyle { font: "Reads Test Sans".into(), ..base.base_style() }; + let runs = vec![effectcraft_keyframe::StyleRun { len: 1, style: first }, effectcraft_keyframe::StyleRun { len: 2, style: base.base_style() }]; + let l = text_layer(&mut p, &comp, TextDoc { runs, ..base }); + p.comp_mut(cid).unwrap().layers.push(l); + let log = ReadLog::new(); + let c = EvalCtx { reads: Some(&log), ..ctx(&p, cid, 0.0) }; + assert!(text_geom(&c, &p.comp(cid).unwrap().layers[0]).is_some()); + let files = log.into_files(); + assert!(files.is_complete(), "{files:?}"); + assert_eq!(files.get(&font.to_string_lossy()), Some(stamp), "{files:?}"); } From 037895f4689d980d1d9f4003f7dc70dc58a86960 Mon Sep 17 00:00:00 2001 From: vangel76 Date: Sat, 7 Nov 2026 11:18:42 +0100 Subject: [PATCH 033/451] Disk cache: Reload Footage closes the gaps around its drop (#3184) - A reload while the disk cache is off is kept on the session (pending_disk_drops) and applied when the cache is switched on, before anything is read from it. - Each render takes the cache's drop generation before it reads (frame worker; layer cache at the miss). An entry listing a file dropped after that is refused under the queue's lock, so a render that was under way during the reload can't store pixels from before it. Such a frame is shown with an incomplete file list, so persist_missing skips it too. The per-file record is bounded (past it, everything older is refused). - An entry read while its drop was pending is a miss even when the writer ends the sweep between the read and the check (a stale hit found under load): the pending drops and the generation are taken before the entry is read. - Test: a reopened project serves its frame from disk with no source file opened or decoded. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/footage/footage_reload.rs | 12 +- crates/engine/src/lib.rs | 4 + .../engine/src/settings/session_settings.rs | 5 + crates/engine/src/tests/disk_cache.rs | 70 +++++ crates/render/src/cache.rs | 72 ++++- crates/render/src/disk_cache.rs | 259 +++++++++++++++--- crates/ui-egui/src/frames.rs | 32 ++- crates/ui-egui/src/frames/tests.rs | 29 +- docs/architecture.md | 6 +- 9 files changed, 422 insertions(+), 67 deletions(-) diff --git a/crates/engine/src/footage/footage_reload.rs b/crates/engine/src/footage/footage_reload.rs index 2744d0224..e56e16a96 100644 --- a/crates/engine/src/footage/footage_reload.rs +++ b/crates/engine/src/footage/footage_reload.rs @@ -281,10 +281,14 @@ fn reload(s: &mut Session, ids: &[ItemId], undoable: bool) -> crate::Result<(usi apply_reloads(s, updates, undoable)?; forget_media(s, &paths); // An explicit reload also reads files again that kept their size and time (the check on hit - // can't tell those apart): their entries in the disk cache go (#3184). An automatic one - // only follows a changed stamp, which the check catches. - if undoable && let Some(dc) = &s.disk_cache { - dc.drop_files(paths.iter().map(String::as_str)); + // can't tell those apart): their entries in the disk cache go (#3184), when the cache is + // switched on if it is off now. An automatic one only follows a changed stamp, which the + // check catches. + if undoable { + match &s.disk_cache { + Some(dc) => dc.drop_files(paths.iter().map(String::as_str)), + None => s.pending_disk_drops.extend(paths), + } } Ok((n, failed)) } diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index 69d1f9e1b..599aba1b7 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -171,6 +171,9 @@ pub struct Session { pub crypto_probe: Arc>, /// The persistent disk cache (Settings ▸ Media & Disk Cache), when enabled. pub disk_cache: Option>, + /// Files File ▸ Reload Footage reloaded while the disk cache was off: their entries are + /// dropped when it is switched on ([`Session::configure_disk_cache`]), before it is used. + pub pending_disk_drops: std::collections::BTreeSet, /// Settings (Preferences). pub prefs: prefs::Prefs, /// Bumped whenever settings change (frontends re-apply theme, labels…). @@ -348,6 +351,7 @@ impl Default for Session { layer_cache: Arc::new(LayerCache::default()), crypto_probe: Default::default(), disk_cache: None, + pending_disk_drops: Default::default(), prefs: prefs::Prefs::default(), prefs_revision: 0, config: None, diff --git a/crates/engine/src/settings/session_settings.rs b/crates/engine/src/settings/session_settings.rs index b479963ed..8ade9f8a3 100644 --- a/crates/engine/src/settings/session_settings.rs +++ b/crates/engine/src/settings/session_settings.rs @@ -158,6 +158,11 @@ impl Session { } }, }; + // Files reloaded while the cache was off: their entries go before anything is read from + // it (until the writer has deleted them they are misses, and no frame is linked). + if !self.pending_disk_drops.is_empty() { + dc.drop_files(std::mem::take(&mut self.pending_disk_drops)); + } self.disk_cache = Some(dc.clone()); // The reserve applies from the start (a new folder's watcher is idle). self.poll_disk_space(); diff --git a/crates/engine/src/tests/disk_cache.rs b/crates/engine/src/tests/disk_cache.rs index fed00e852..4c610dceb 100644 --- a/crates/engine/src/tests/disk_cache.rs +++ b/crates/engine/src/tests/disk_cache.rs @@ -397,3 +397,73 @@ fn reload_footage_drops_the_entries_of_its_files() { assert!(dc.get_frame(2, None).is_some(), "another file's frame stays"); let _ = std::fs::remove_dir_all(&dir); } + +/// Reload Footage while the disk cache is off (#3184): when it is switched on later in the +/// session, the entries made of the reloaded files are dropped before anything is read from it +/// (a file replaced by one with the same size and time would pass the check on hit); entries of +/// other files stay. +#[test] +fn reload_footage_while_the_disk_cache_is_off_drops_its_entries_when_it_is_on() { + use crate::render::disk_cache::{DiskCache, Kind}; + use crate::render::reads::{FileStamp, ReadFile, ReadFiles}; + struct Probe; + impl crate::Importer for Probe { + fn probe(&self, path: &str) -> std::result::Result { + Ok(effectcraft_project::Footage { + path: path.into(), + kind: effectcraft_project::FootageKind::Still, + width: 1, + height: 1, + has_video: true, + ..Default::default() + }) + } + } + let dir = folder("reload-off"); + let src = std::path::Path::new(&dir).join("src"); + std::fs::create_dir_all(&src).unwrap(); + let mut s = Session { importer: Some(std::sync::Arc::new(Probe)), ..Default::default() }; + let mut add = |name: &str| { + let p = src.join(name); + std::fs::write(&p, b"aa").unwrap(); + let path = p.to_string_lossy().to_string(); + let f = effectcraft_project::Footage { + path: path.clone(), + kind: effectcraft_project::FootageKind::Still, + width: 1, + height: 1, + has_video: true, + ..Default::default() + }; + let id = s.edit("add", None, |p, _| Ok(p.add_item(name, effectcraft_color::Label::None, None, effectcraft_project::ItemKind::Footage(f)))).unwrap(); + (id, path) + }; + let (a, a_path) = add("a.png"); + let (_, b_path) = add("b.png"); + // Entries from an earlier session in the cache folder. + let read = |p: &str| -> ReadFiles { [ReadFile::new(p, FileStamp::native(p).unwrap())].into_iter().collect() }; + { + let dc = DiskCache::open(&dir, 1 << 30).unwrap(); + dc.put_frame_now(1, 1, 1, &[1; 4], &read(&a_path)); + dc.put_frame_now(2, 1, 1, &[2; 4], &read(&b_path)); + dc.put_layer_now(3, &effectcraft_effects::Buf { img: effectcraft_raster::Image::new(1, 1), offset: [0.0; 2], scale: 1.0 }, &read(&a_path)); + } + // Other bytes, same size, the old time back; reloaded while the cache is off. + let t = std::fs::metadata(&a_path).unwrap().modified().unwrap(); + std::fs::write(&a_path, b"AA").unwrap(); + std::fs::File::options().append(true).open(&a_path).unwrap().set_modified(t).unwrap(); + assert!(s.disk_cache.is_none()); + s.execute_checked("file.reloadFootage", json!({"item": a.0})).unwrap(); + // Switched on: the reloaded file's entries are misses from the start, and then gone. + s.execute_checked("prefs.set", json!({"values": {"disk.diskCacheFolder": &dir, "disk.diskCacheEnabled": true}})).unwrap(); + let dc = s.disk_cache.clone().unwrap(); + assert!(dc.get_frame(1, None).is_none(), "the reloaded file's frame renders again"); + assert!(dc.get_layer(3, None).is_none(), "and its layer buffer"); + dc.flush(); + assert!(!dc.contains(Kind::Frame, 1) && !dc.contains(Kind::Layer, 3)); + assert!(dc.get_frame(2, None).is_some(), "another file's frame stays"); + assert!(s.pending_disk_drops.is_empty(), "applied once"); + drop(dc); + drop(s); + let _ = std::fs::remove_dir_all(&dir); +} diff --git a/crates/render/src/cache.rs b/crates/render/src/cache.rs index 881d8b2b7..7b0e7fc4e 100644 --- a/crates/render/src/cache.rs +++ b/crates/render/src/cache.rs @@ -63,8 +63,9 @@ struct Inner { clock: u64, hits: u64, misses: u64, - /// When each recent miss happened (to time the render that follows it). - missed_at: HashMap, + /// When each recent miss happened (to time the render that follows it), with the store's + /// drop generation then ([`LayerStore::drop_generation`]). + missed_at: HashMap, } /// Hit/miss counters and memory use (for perf readouts and tests). @@ -164,13 +165,18 @@ impl LayerCache { } None => { g.misses += 1; - if g.missed_at.len() > 4096 { - g.missed_at.clear(); - } - g.missed_at.insert(key, web_time::Instant::now()); drop(g); + let store = self.persistent(); + // (before the buffer's reads: what it is made of may be dropped meanwhile) + let since = store.as_ref().map_or(0, |s| s.drop_generation()); + if let Ok(mut g) = self.inner.lock() { + if g.missed_at.len() > 4096 { + g.missed_at.clear(); + } + g.missed_at.insert(key, (web_time::Instant::now(), since)); + } // Disk cache: a hit comes back into memory. - let store = self.persistent()?; + let store = store?; let id = self.virtual_id(); let (buf, files) = store.get_layer(layer_disk_key(key), id.as_deref())?; let files = Arc::new(files); @@ -196,11 +202,13 @@ impl LayerCache { } let started = self.inner.lock().ok().and_then(|mut g| g.missed_at.remove(&key)); if let Some(store) = self.persistent() { - let slow = started.is_some_and(|t| t.elapsed().as_secs_f64() * 1e3 >= store.min_layer_ms() as f64); let id = self.virtual_id(); // (an incomplete list, or a file from memory without its identity: not stored) - if slow && let Some(entry) = EntryFiles::of(&files, id.as_deref()) { - store.put_layer(layer_disk_key(key), &buf, &entry); + if let Some((t, since)) = started + && t.elapsed().as_secs_f64() * 1e3 >= store.min_layer_ms() as f64 + && let Some(entry) = EntryFiles::of(&files, id.as_deref()) + { + store.put_layer(layer_disk_key(key), &buf, &entry, since); } } self.insert_mem(key, buf, files) @@ -282,8 +290,15 @@ pub trait LayerStore: Send + Sync { /// mid-render). An entry whose files changed, or damaged, is a miss and is dropped, so the /// buffer rendered again replaces it. `virtual_id` names files served from memory. fn get_layer(&self, key: u128, virtual_id: Option>) -> Option<(Arc, ReadFiles)>; - /// Keep a buffer that was slow to render, with the source files it was made of. - fn put_layer(&self, key: u128, buf: &Buf, files: &EntryFiles); + /// Keep a buffer that was slow to render, with the source files it was made of. `since`: the + /// [`LayerStore::drop_generation`] when its render started (a buffer made of a file dropped + /// after that is refused). + fn put_layer(&self, key: u128, buf: &Buf, files: &EntryFiles, since: u64); + /// How many times files were dropped from the store (File ▸ Reload Footage, + /// [`crate::disk_cache::DiskCache::drop_files`]); `0` for a store that never drops. + fn drop_generation(&self) -> u64 { + 0 + } /// Buffers faster to render than this (ms) are not stored. fn min_layer_ms(&self) -> u64 { 0 @@ -444,7 +459,7 @@ impl LayerStore for PrefetchStore { Some((buf, files.to_read_files())) } - fn put_layer(&self, key: u128, buf: &Buf, files: &EntryFiles) { + fn put_layer(&self, key: u128, buf: &Buf, files: &EntryFiles, _since: u64) { let Ok(mut s) = self.st.lock() else { return }; if s.known.insert(key) { s.writes.push((key, crate::disk_cache::layer_entry(buf, files))); @@ -878,7 +893,7 @@ mod shared_insert_tests { assert!(store.get_layer(5, Some(&two)).is_none()); assert!(!store.has(5)); assert_eq!(store.take_misses(), [5]); - store.put_layer(5, &buf(), &EntryFiles::of(&files, Some(&two)).unwrap()); + store.put_layer(5, &buf(), &EntryFiles::of(&files, Some(&two)).unwrap(), 0); assert_eq!(store.take_writes().len(), 1, "written over the changed entry"); // Through the layer cache: a hit reports its files; incomplete lists are not queued. let cache = LayerCache::default(); @@ -898,6 +913,35 @@ mod shared_insert_tests { assert_eq!(written, [layer_disk_key(11)], "only the buffer whose files are all named"); } + /// A layer buffer whose render started before Reload Footage dropped its file (#3184) is + /// not written to the disk cache when it is kept afterwards; one whose render started after + /// the drop is. + #[test] + fn a_buffer_rendered_across_a_drop_is_not_written() { + use crate::disk_cache::{DiskCache, Kind, layer_disk_key}; + use crate::reads::{FileStamp, ReadFile, ReadFiles}; + let dir = std::env::temp_dir().join(format!("effectcraft-layer-drop-{}", std::process::id())); + let _ = std::fs::remove_dir_all(&dir); + let dc = DiskCache::open(&dir, 1 << 30).unwrap(); + dc.set_min_layer_ms(0); + let cache = LayerCache::default(); + cache.set_disk(Some(dc.clone())); + let buf = || Arc::new(Buf { img: Image::new(2, 2), offset: [0.0; 2], scale: 1.0 }); + let files = Arc::new([ReadFile::new("/a.png", FileStamp::Native { len: 3, modified: Some(1) })].into_iter().collect::()); + // The miss starts the render; the file is reloaded before the buffer is kept. + assert!(cache.get(1).is_none()); + dc.drop_files(["/a.png"]); + cache.insert(1, buf(), files.clone()); + // A render after the drop. + assert!(cache.get(2).is_none()); + cache.insert(2, buf(), files); + dc.flush(); + assert!(!dc.contains(Kind::Layer, layer_disk_key(1)), "made of the file as it was before the drop"); + assert!(dc.contains(Kind::Layer, layer_disk_key(2))); + drop((cache, dc)); + let _ = std::fs::remove_dir_all(&dir); + } + /// A render that gets another render's buffer gets that buffer's files too (#3184): when a /// file changed between the two reads, its frame lists the file with both identities, so the /// list is incomplete and the frame is not kept on disk with the new identity and the old diff --git a/crates/render/src/disk_cache.rs b/crates/render/src/disk_cache.rs index c6d590010..67fbc4a7c 100644 --- a/crates/render/src/disk_cache.rs +++ b/crates/render/src/disk_cache.rs @@ -279,6 +279,44 @@ struct Queue { busy: bool, /// Keys of frames queued or being written. pending_frames: std::collections::HashSet, + /// The drops so far (under the queue's lock: a write is queued either before a drop, which + /// then sweeps it, or after it, when this refuses it if it was made from before). + drops: Drops, +} + +/// Files dropped from the cache files beyond this are not remembered one by one: everything made +/// before the drop that forgot them is refused instead. +const MAX_DROPPED_PATHS: usize = 1 << 16; + +/// The [`DiskCache::drop_files`] calls so far: their number (the drop generation) and the last one +/// of each file. An entry made of a file read before that file's last drop (its render started at +/// an earlier generation) holds the pixels from before and is refused. +#[derive(Default)] +struct Drops { + generation: u64, + last: HashMap, u64>, + /// Everything made before this generation is refused (the per-file record was forgotten). + floor: u64, +} + +impl Drops { + fn record(&mut self, paths: &[Arc]) { + self.generation = self.generation.saturating_add(1); + if self.last.len().saturating_add(paths.len()) > MAX_DROPPED_PATHS { + self.last.clear(); + self.floor = self.generation; + return; + } + for p in paths { + self.last.insert(p.clone(), self.generation); + } + } + + /// Whether something made of `paths`, whose reads started at generation `since`, read one of + /// them before it was dropped. + fn stale<'a>(&self, mut paths: impl Iterator>, since: u64) -> bool { + since < self.floor || paths.any(|p| self.last.get(p).is_some_and(|g| *g > since)) + } } impl Queue { @@ -401,6 +439,7 @@ impl DiskCache { jobs: Default::default(), busy: cfg!(not(target_arch = "wasm32")), pending_frames: Default::default(), + drops: Drops::default(), }), Condvar::new(), )), @@ -629,6 +668,9 @@ impl DiskCache { self.misses.fetch_add(1, Ordering::Relaxed); None }; + // (before the file is read: the writer may finish a drop's sweep between the read and the + // check below, and a drop may start meanwhile) + let drops = self.drops_now(); let Some((found, payload)) = self.load(kind, key) else { return miss() }; if found != format { let other_frame_format = kind == Kind::Frame && (found == FORMAT_RGBA8_FILES || found == FORMAT_F16_FILES); @@ -642,7 +684,7 @@ impl DiskCache { return miss(); }; self.file_checks.fetch_add(files.len() as u64, Ordering::Relaxed); - if self.made_of_dropped(&files) || !files.unchanged(virtual_id) { + if self.made_of_dropped(&files, &drops) || !files.unchanged(virtual_id) { self.discard(kind, key); return miss(); } @@ -674,13 +716,19 @@ impl DiskCache { /// Queue a write; `false` when it was dropped (a full queue). fn enqueue(&self, kind: Kind, key: u128, payload: Vec) -> bool { - self.enqueue_format(kind, key, FORMAT_RGBA8, payload) + self.enqueue_format(kind, key, FORMAT_RGBA8, payload, None) } - /// [`DiskCache::enqueue`] with the entry's header format byte. - fn enqueue_format(&self, kind: Kind, key: u128, format: u8, payload: Vec) -> bool { + /// [`DiskCache::enqueue`] with the entry's header format byte. `made`: the source files of a + /// frame or layer entry and the drop generation its reads started at + /// ([`DiskCache::drop_generation`]); refused (`false`) when one of them was dropped since. + fn enqueue_format(&self, kind: Kind, key: u128, format: u8, payload: Vec, made: Option<(&EntryFiles, u64)>) -> bool { + let stale = |q: &Queue| made.is_some_and(|(files, since)| q.drops.stale(files.files().iter().map(|f| &f.path), since)); #[cfg(target_arch = "wasm32")] { + if self.queue.0.lock().is_ok_and(|q| stale(&q)) { + return false; + } self.write_format(kind, key, format, &payload); true } @@ -688,6 +736,9 @@ impl DiskCache { { let (m, cv) = &*self.queue; let Ok(mut q) = m.lock() else { return false }; + if stale(&q) { + return false; + } let full = match kind { Kind::Frame => q.frame_bytes.saturating_add(payload.len()) > FRAME_QUEUE_BYTES, _ => q.jobs.len() >= QUEUE_LIMIT, @@ -770,6 +821,9 @@ impl DiskCache { /// entries that list one of `paths`, after the writes queued before (those are swept too); /// until it is done, an entry made of one of them is a miss. Entries are deleted for good, /// so they don't come back after a restart. Nothing else in the cache is touched. + /// + /// A render that was under way meanwhile may still offer an entry made of one of `paths` as + /// it was before: it is refused, see [`DiskCache::drop_generation`]. pub fn drop_files(&self, paths: impl IntoIterator>>) { let paths: Vec> = paths.into_iter().map(Into::into).collect(); if paths.is_empty() { @@ -782,28 +836,58 @@ impl DiskCache { *n = n.saturating_add(1); } } - #[cfg(not(target_arch = "wasm32"))] - { - let (m, cv) = &*self.queue; - if let Ok(mut q) = m.lock() { - // (never refused for a full queue) - q.jobs.push_back(Job::Drop(paths)); - cv.notify_all(); - return; + #[cfg_attr(target_arch = "wasm32", allow(unused_variables))] + let (m, cv) = &*self.queue; + match m.lock() { + Ok(mut q) => { + q.drops.record(&paths); + #[cfg(not(target_arch = "wasm32"))] + { + // (never refused for a full queue) + q.jobs.push_back(Job::Drop(paths)); + cv.notify_all(); + return; + } } + // (no writer thread to take the job any more) + Err(poisoned) => poisoned.into_inner().drops.record(&paths), } self.sweep(&paths); } + /// The number of [`DiskCache::drop_files`] calls so far. A render takes it before it starts + /// reading and hands it to `put_frame` / `put_layer` with what it made: an entry listing a + /// file dropped after that is refused (the render may have read the file as it was before). + pub fn drop_generation(&self) -> u64 { + self.queue.0.lock().unwrap_or_else(std::sync::PoisonError::into_inner).drops.generation + } + + /// Whether one of `files` was dropped after generation `since` ([`DiskCache::drop_generation`]): + /// what a render that started then made of them is from before the drop (shown, never stored). + pub fn dropped_since(&self, files: &ReadFiles, since: u64) -> bool { + self.queue.0.lock().unwrap_or_else(std::sync::PoisonError::into_inner).drops.stale(files.files().iter().map(|f| &f.path), since) + } + /// Whether a [`DiskCache::drop_files`] is pending. pub fn is_dropping(&self) -> bool { !self.dropping.lock().unwrap_or_else(std::sync::PoisonError::into_inner).is_empty() } - /// An entry made of a file being dropped. - fn made_of_dropped(&self, files: &EntryFiles) -> bool { + /// The drop generation and the files being dropped now, taken before an entry is read + /// (see [`DiskCache::made_of_dropped`]). + fn drops_now(&self) -> (u64, Vec>) { + let generation = self.drop_generation(); let d = self.dropping.lock().unwrap_or_else(std::sync::PoisonError::into_inner); - !d.is_empty() && files.files().iter().any(|f| d.contains_key(&f.path)) + (generation, d.keys().cloned().collect()) + } + + /// An entry read after [`DiskCache::drops_now`] gave `drops` that is made of a file whose + /// drop was pending then (its sweep may have ended since, after the entry was read) or that + /// was dropped since. + fn made_of_dropped(&self, files: &EntryFiles, drops: &(u64, Vec>)) -> bool { + let (since, pending) = drops; + let paths = || files.files().iter().map(|f| &f.path); + paths().any(|p| pending.contains(p)) || self.queue.0.lock().unwrap_or_else(std::sync::PoisonError::into_inner).drops.stale(paths(), *since) } /// The writer's part of [`DiskCache::drop_files`]: delete the entries made of `paths`, then @@ -864,13 +948,25 @@ impl DiskCache { /// Queue a half-float frame for writing (`width * height * 4` binary16 values) with the /// source files it was made of. `true` when it is on disk or queued; `false` when refused - /// (wrong size, a full queue, files that can't be checked later: see [`EntryFiles::of`]). - pub fn put_frame_f16(&self, key: u128, width: u32, height: u32, rgba: &[u16], files: &ReadFiles, virtual_id: Option>) -> bool { + /// (wrong size, a full queue, files that can't be checked later: see [`EntryFiles::of`]; + /// a file dropped after `since`, the [`DiskCache::drop_generation`] the render started at). + #[allow(clippy::too_many_arguments)] + pub fn put_frame_f16( + &self, + key: u128, + width: u32, + height: u32, + rgba: &[u16], + files: &ReadFiles, + virtual_id: Option>, + since: u64, + ) -> bool { if rgba.len() as u64 != width as u64 * height as u64 * 4 { return false; } let Some(files) = EntryFiles::of(files, virtual_id) else { return false }; - self.contains(Kind::Frame, key) || self.enqueue_format(Kind::Frame, key, FORMAT_F16_FILES, with_files(&files, encode_frame_f16(width, height, rgba))) + let payload = with_files(&files, encode_frame_f16(width, height, rgba)); + self.contains(Kind::Frame, key) || self.enqueue_format(Kind::Frame, key, FORMAT_F16_FILES, payload, Some((&files, since))) } /// Write a half-float frame synchronously (tests); a list that can't be stored is not. @@ -882,13 +978,16 @@ impl DiskCache { /// Queue a frame for writing (8-bit premultiplied RGBA, `width * height * 4` bytes) with the /// source files it was made of. `true` when it is on disk or queued; `false` when refused - /// (wrong size, a full queue, files that can't be checked later: see [`EntryFiles::of`]). - pub fn put_frame(&self, key: u128, width: u32, height: u32, rgba: &[u8], files: &ReadFiles, virtual_id: Option>) -> bool { + /// (wrong size, a full queue, files that can't be checked later: see [`EntryFiles::of`]; + /// a file dropped after `since`, the [`DiskCache::drop_generation`] the render started at). + #[allow(clippy::too_many_arguments)] + pub fn put_frame(&self, key: u128, width: u32, height: u32, rgba: &[u8], files: &ReadFiles, virtual_id: Option>, since: u64) -> bool { if rgba.len() as u64 != width as u64 * height as u64 * 4 { return false; } let Some(files) = EntryFiles::of(files, virtual_id) else { return false }; - self.contains(Kind::Frame, key) || self.enqueue_format(Kind::Frame, key, FORMAT_RGBA8_FILES, with_files(&files, encode_frame(width, height, rgba))) + let payload = with_files(&files, encode_frame(width, height, rgba)); + self.contains(Kind::Frame, key) || self.enqueue_format(Kind::Frame, key, FORMAT_RGBA8_FILES, payload, Some((&files, since))) } /// A layer buffer (key: [`layer_disk_key`]) whose source files are unchanged, with those @@ -900,12 +999,14 @@ impl DiskCache { } /// Queue a layer buffer for writing with the source files it was made of (see - /// [`EntryFiles::of`]: a buffer whose files can't all be named must not be stored). - pub fn put_layer(&self, key: u128, buf: &Buf, files: &EntryFiles) { + /// [`EntryFiles::of`]: a buffer whose files can't all be named must not be stored). Refused + /// when one of them was dropped after `since`, the [`DiskCache::drop_generation`] its render + /// started at. + pub fn put_layer(&self, key: u128, buf: &Buf, files: &EntryFiles, since: u64) { if self.contains(Kind::Layer, key) { return; } - let _ = self.enqueue_format(Kind::Layer, key, FORMAT_LAYER_FILES, with_files(files, encode_layer(buf))); + let _ = self.enqueue_format(Kind::Layer, key, FORMAT_LAYER_FILES, with_files(files, encode_layer(buf)), Some((files, since))); } /// Write a layer buffer synchronously (tests); a list that can't be stored is not. @@ -1110,8 +1211,11 @@ impl crate::cache::LayerStore for DiskCache { fn get_layer(&self, key: u128, virtual_id: Option>) -> Option<(Arc, ReadFiles)> { DiskCache::get_layer(self, key, virtual_id).map(|(b, f)| (Arc::new(b), f)) } - fn put_layer(&self, key: u128, buf: &Buf, files: &EntryFiles) { - DiskCache::put_layer(self, key, buf, files); + fn put_layer(&self, key: u128, buf: &Buf, files: &EntryFiles, since: u64) { + DiskCache::put_layer(self, key, buf, files, since); + } + fn drop_generation(&self) -> u64 { + DiskCache::drop_generation(self) } fn min_layer_ms(&self) -> u64 { DiskCache::min_layer_ms(self) @@ -1470,7 +1574,7 @@ mod tests { assert!(dc.get_frame_f16(3, None).map(|f| f.0).is_none()); assert!(!dc.contains(Kind::Frame, 3) && !p.exists()); // Wrong lengths are not written. - dc.put_frame_f16(4, w, h, &rgba[1..], &ReadFiles::default(), None); + dc.put_frame_f16(4, w, h, &rgba[1..], &ReadFiles::default(), None, 0); dc.flush(); assert!(!dc.contains(Kind::Frame, 4)); let _ = std::fs::remove_dir_all(&dir); @@ -1514,15 +1618,15 @@ mod tests { let dc = DiskCache::open(&dir, 1 << 30).unwrap(); assert!(dc.get_layer(42, None).is_none()); let b = buf(1, 33, 17); - dc.put_layer(42, &b, &EntryFiles::default()); + dc.put_layer(42, &b, &EntryFiles::default(), 0); dc.flush(); let (back, files) = dc.get_layer(42, None).unwrap(); assert!(files.is_empty() && files.is_complete()); assert_eq!(back.img, b.img); assert_eq!((back.offset, back.scale), (b.offset, b.scale)); let rgba: Vec = (0..20 * 10 * 4).map(|i| (i % 251) as u8).collect(); - assert!(dc.put_frame(7, 20, 10, &rgba, &ReadFiles::default(), None)); - assert!(!dc.put_frame(8, 2, 2, &[0; 3], &ReadFiles::default(), None), "a wrong-size frame is refused"); + assert!(dc.put_frame(7, 20, 10, &rgba, &ReadFiles::default(), None, 0)); + assert!(!dc.put_frame(8, 2, 2, &[0; 3], &ReadFiles::default(), None, 0), "a wrong-size frame is refused"); dc.flush(); assert_eq!(dc.get_frame(7, None).map(|f| f.0).unwrap().rgba, rgba); let st = dc.stats(); @@ -1566,11 +1670,11 @@ mod tests { let dir = tmpdir("burst"); let dc = DiskCache::open(&dir, 1 << 30).unwrap(); for k in 0..300 { - dc.put_layer(10_000 + k, &buf(1, 64, 64), &EntryFiles::default()); + dc.put_layer(10_000 + k, &buf(1, 64, 64), &EntryFiles::default(), 0); } let rgba = vec![7u8; 32 * 32 * 4]; for k in 0..300 { - dc.put_frame(k, 32, 32, &rgba, &ReadFiles::default(), None); + dc.put_frame(k, 32, 32, &rgba, &ReadFiles::default(), None, 0); } dc.flush(); assert!((0..300).all(|k| dc.contains(Kind::Frame, k)), "every frame written"); @@ -1783,17 +1887,17 @@ mod tests { let dc = DiskCache::open(tmpdir("virtual"), 1 << 30).unwrap(); let k = frame_key(comp_content_key(&p, cid), 0, 1000, 0); let files: ReadFiles = [crate::reads::ReadFile::new("/virtual.mov", crate::reads::FileStamp::Virtual)].into_iter().collect(); - assert!(dc.put_frame(k, 1, 1, &[1, 2, 3, 4], &files, Some(&one))); + assert!(dc.put_frame(k, 1, 1, &[1, 2, 3, 4], &files, Some(&one), 0)); dc.flush(); assert!(dc.get_frame(k, Some(&one)).is_some_and(|(_, f)| f == files)); assert!(dc.get_frame(k, Some(&two)).is_none() && !dc.contains(Kind::Frame, k), "replaced: a miss, deleted"); // A layer buffer made of it. let lk = layer_disk_key(7); - dc.put_layer(lk, &buf(1, 4, 4), &EntryFiles::of(&files, Some(&one)).unwrap()); + dc.put_layer(lk, &buf(1, 4, 4), &EntryFiles::of(&files, Some(&one)).unwrap(), 0); dc.flush(); assert!(dc.get_layer(lk, Some(&one)).is_some_and(|(b, f)| b.img == buf(1, 4, 4).img && f == files && f.is_complete())); assert!(dc.get_layer(lk, None).is_none() && !dc.contains(Kind::Layer, lk), "no identity: a miss, deleted"); - dc.put_layer(lk, &buf(1, 4, 4), &EntryFiles::of(&files, Some(&one)).unwrap()); + dc.put_layer(lk, &buf(1, 4, 4), &EntryFiles::of(&files, Some(&one)).unwrap(), 0); dc.flush(); assert!(dc.get_layer(lk, Some(&two)).is_none() && !dc.contains(Kind::Layer, lk), "replaced: a miss, deleted"); // The browser's sealed layer entries carry the same list. @@ -1957,7 +2061,7 @@ mod tests { // Frames whose files can't all be named are not stored. let mut incomplete = read(&[&fresh]); incomplete.mark_incomplete(); - assert!(!dc.put_frame(8, 1, 1, &[8; 4], &incomplete, None)); + assert!(!dc.put_frame(8, 1, 1, &[8; 4], &incomplete, None, 0)); dc.flush(); assert!(!dc.contains(Kind::Frame, 8)); let _ = std::fs::remove_dir_all(&dir); @@ -1992,7 +2096,7 @@ mod tests { std::fs::File::options().append(true).open(&a).unwrap().set_modified(t).unwrap(); assert!(dc.get_frame(1, None).is_some(), "same size and time: still a hit"); // A frame queued (not written yet) when the drop comes is dropped too. - assert!(dc.put_frame(5, 1, 1, &[5; 4], &read(&[&a]), None)); + assert!(dc.put_frame(5, 1, 1, &[5; 4], &read(&[&a]), None, 0)); dc.drop_files([a.clone()]); dc.flush(); assert!(!dc.is_dropping()); @@ -2012,6 +2116,64 @@ mod tests { let _ = std::fs::remove_dir_all(&dir); } + /// A render under way when Reload Footage drops its files offers its entries after the drop + /// (#3184), when the writer has already deleted the old ones: made of the files as they were, + /// they are refused, frames and layer buffers alike. What the same render made of other files + /// is stored, and so is what a render that started after the drop makes. + #[test] + fn entries_made_before_a_drop_are_refused_after_it() { + use crate::reads::{FileStamp, ReadFile}; + let dir = tmpdir("drop-in-flight"); + std::fs::create_dir_all(&dir).unwrap(); + let file = |name: &str| { + let p = dir.join(name); + std::fs::write(&p, name.as_bytes()).unwrap(); + p.to_string_lossy().to_string() + }; + let (a, b) = (file("a.png"), file("b.png")); + let read = |paths: &[&str]| -> ReadFiles { paths.iter().map(|p| ReadFile::new(*p, FileStamp::native(p).unwrap())).collect() }; + let dc = DiskCache::open(dir.join("cache"), 1 << 30).unwrap(); + // The render starts (and reads a.png and b.png), then a.png is reloaded. + let before = dc.drop_generation(); + dc.drop_files([a.clone()]); + dc.flush(); + assert!(!dc.is_dropping()); + assert!(dc.dropped_since(&read(&[&a]), before) && !dc.dropped_since(&read(&[&b]), before)); + assert!(!dc.put_frame(1, 1, 1, &[1; 4], &read(&[&a, &b]), None, before), "a frame from before the drop"); + assert!(!dc.put_frame_f16(2, 1, 1, &[1; 4], &read(&[&a]), None, before)); + dc.put_layer(3, &buf(3, 2, 2), &EntryFiles::of(&read(&[&a]), None).unwrap(), before); + assert!(dc.put_frame(4, 1, 1, &[4; 4], &read(&[&b]), None, before), "b.png wasn't dropped"); + dc.flush(); + assert!(!dc.contains(Kind::Frame, 1) && !dc.contains(Kind::Frame, 2) && !dc.contains(Kind::Layer, 3)); + assert!(dc.get_frame(1, None).is_none() && dc.get_layer(3, None).is_none()); + assert_eq!(dc.get_frame(4, None).map(|f| f.0.rgba), Some(vec![4; 4])); + // A render that starts after the drop reads the reloaded file: stored and served. + let after = dc.drop_generation(); + assert!(after > before && !dc.dropped_since(&read(&[&a]), after)); + assert!(dc.put_frame(5, 1, 1, &[5; 4], &read(&[&a]), None, after)); + dc.put_layer(6, &buf(6, 2, 2), &EntryFiles::of(&read(&[&a]), None).unwrap(), after); + dc.flush(); + assert_eq!(dc.get_frame(5, None).map(|f| f.0.rgba), Some(vec![5; 4])); + assert!(dc.get_layer(6, None).is_some()); + let _ = std::fs::remove_dir_all(&dir); + } + + /// The record of dropped files is bounded: past it, everything made before the drop that + /// forgot the record is refused, and what is made after it is stored. + #[test] + fn the_record_of_dropped_files_is_bounded() { + let mut d = Drops::default(); + let a: Arc = "/a.png".into(); + d.record(std::slice::from_ref(&a)); + assert!(d.stale([&a].into_iter(), 0) && !d.stale([&a].into_iter(), 1)); + let many: Vec> = (0..=MAX_DROPPED_PATHS).map(|i| format!("/f{i}").into()).collect(); + d.record(&many); + assert!(d.last.is_empty(), "forgotten, not grown"); + let other: Arc = "/other.png".into(); + assert!(d.stale([&other].into_iter(), 1), "made before the drop that forgot the record"); + assert!(!d.stale([&a].into_iter(), 2), "made after it"); + } + /// While a drop waits, an entry made of a dropped file is a miss (and deleted), and frames /// aren't linked to new keys. #[test] @@ -2030,4 +2192,27 @@ mod tests { assert!(dc.get_frame(1, None).is_none() && !dc.contains(Kind::Frame, 1)); let _ = std::fs::remove_dir_all(&dir); } + + /// An entry read while its file's drop was pending is a miss even when the writer ends the + /// sweep between the read and the check (it deleted the file, but its bytes were read), and + /// so is one read before a drop that starts meanwhile. Found under load: a stale hit. + #[test] + fn a_sweep_ending_during_a_read_never_makes_a_hit() { + use crate::reads::{FileStamp, ReadFile}; + let dir = tmpdir("drop-race"); + let dc = DiskCache::open(dir.join("cache"), 1 << 30).unwrap(); + let files = EntryFiles::of(&[ReadFile::new("/a.png", FileStamp::Missing)].into_iter().collect(), None).unwrap(); + // Read while the drop is pending; the sweep ends before the check. + dc.dropping.lock().unwrap().insert("/a.png".into(), 1); + let drops = dc.drops_now(); + dc.dropping.lock().unwrap().clear(); + assert!(dc.made_of_dropped(&files, &drops)); + // Read before a drop that starts (and ends) before the check. + let drops = dc.drops_now(); + dc.drop_files(["/a.png"]); + dc.flush(); + assert!(dc.made_of_dropped(&files, &drops)); + assert!(!dc.made_of_dropped(&files, &dc.drops_now()), "read after the drop: used"); + let _ = std::fs::remove_dir_all(&dir); + } } diff --git a/crates/ui-egui/src/frames.rs b/crates/ui-egui/src/frames.rs index faacd9b23..3595026ee 100644 --- a/crates/ui-egui/src/frames.rs +++ b/crates/ui-egui/src/frames.rs @@ -450,17 +450,18 @@ fn frame_disk_key(keys: &ContentKeys, project: &Project, key: &FrameKey, opts_ha /// Queue `img` for the disk cache under `dk` with the source files it was made of. `false` when /// refused: a GPU frame (no CPU pixels), files that can't be checked when the entry is read -/// (an incomplete list, #3184: the frame is shown, not stored), a full queue. -fn put_disk_frame(dc: &DiskCache, dk: u128, img: &FrameImage, files: &ReadFiles, virtual_id: Option>) -> bool { +/// (an incomplete list, #3184: the frame is shown, not stored), a full queue, a file dropped +/// (File ▸ Reload Footage) after `since`, the drop generation its render started at. +fn put_disk_frame(dc: &DiskCache, dk: u128, img: &FrameImage, files: &ReadFiles, virtual_id: Option>, since: u64) -> bool { if !files.is_complete() { return false; } match img { FrameImage::Cpu(img) => { let rgba: Vec = img.pixels.iter().flat_map(|c| c.to_array()).collect(); - dc.put_frame(dk, img.size[0] as u32, img.size[1] as u32, &rgba, files, virtual_id) + dc.put_frame(dk, img.size[0] as u32, img.size[1] as u32, &rgba, files, virtual_id, since) } - FrameImage::CpuF16(f) => dc.put_frame_f16(dk, f.width, f.height, f.bits(), files, virtual_id), + FrameImage::CpuF16(f) => dc.put_frame_f16(dk, f.width, f.height, f.bits(), files, virtual_id, since), FrameImage::Gpu(_) => false, } } @@ -1065,10 +1066,12 @@ impl Frames { } let (persisted, written, virtual_id) = (self.persisted.clone(), self.written.clone(), self.virtual_id.clone()); let work = move || { + // (a frame made of a file dropped while it rendered kept an incomplete list: not here) + let since = dc.drop_generation(); for (dk, img, files) in missing { // (accepted: the disk cache tracks it until written, and it counts as a try; // refused by a full queue: retried, without counting) - let accepted = put_disk_frame(&dc, dk, &img, &files, virtual_id.as_deref()); + let accepted = put_disk_frame(&dc, dk, &img, &files, virtual_id.as_deref(), since); if accepted && let Ok(mut w) = written.lock() { let n = w.1.entry(dk).or_default(); *n = n.saturating_add(1); @@ -1609,8 +1612,11 @@ impl Worker { job }; let t0 = web_time::Instant::now(); - let disk = job.src.disk.as_ref().map(|dc| (dc.clone(), frame_disk_key(content_keys, &job.src.project, &job.key, opts_hash(&job.opts)))); - let from_disk = disk.as_ref().and_then(|(dc, k)| self.disk_frame(dc, *k, &job)); + // (the drop generation before the frame reads anything: File ▸ Reload Footage meanwhile + // makes what it read from a reloaded file stale) + let disk = + job.src.disk.as_ref().map(|dc| (dc.clone(), frame_disk_key(content_keys, &job.src.project, &job.key, opts_hash(&job.opts)), dc.drop_generation())); + let from_disk = disk.as_ref().and_then(|(dc, k, _)| self.disk_frame(dc, *k, &job)); let disk_hit = from_disk.is_some(); // `files`: the source files the frame was made of (see `render::reads`). let (ci, files) = match from_disk { @@ -1625,13 +1631,21 @@ impl Worker { } }, }; + let mut files = files; + if let Some((dc, _, since)) = &disk + && dc.dropped_since(&files, *since) + { + // Made of a file as it was before File ▸ Reload Footage dropped it: shown, but its + // list can't vouch for it, so neither this worker nor `persist_missing` stores it. + files.mark_incomplete(); + } let files = Arc::new(files); // Publish the shared frame and wake the viewer before optional RGBA conversion // and compression. Persistence still runs on this worker, using the same snapshot. self.finish(&job, ci.clone(), Some(files.clone()), t0); if !disk_hit - && let Some((dc, k)) = &disk - && put_disk_frame(dc, *k, &ci, &files, self.virtual_id.as_deref()) + && let Some((dc, k, since)) = &disk + && put_disk_frame(dc, *k, &ci, &files, self.virtual_id.as_deref(), *since) && let Some(ctx) = &self.ctx { ctx.request_repaint(); diff --git a/crates/ui-egui/src/frames/tests.rs b/crates/ui-egui/src/frames/tests.rs index 2644095f4..959d14de2 100644 --- a/crates/ui-egui/src/frames/tests.rs +++ b/crates/ui-egui/src/frames/tests.rs @@ -2582,6 +2582,8 @@ mod frame_files { src: RenderSource, disk: Arc, hook_calls: Arc, + /// The session's media pool (`src.footage`): what it decoded and opened. + pool: Arc, } fn session(p: &Arc, dir: &Path) -> Session { @@ -2593,16 +2595,17 @@ mod frame_files { calls.fetch_add(1, Ordering::Relaxed); None })); + let pool = Arc::new(effectcraft_media::MediaPool::new()); let src = RenderSource { project: p.clone(), - footage: Arc::new(effectcraft_media::MediaPool::new()), + footage: pool.clone(), expr: None, layer_cache: Arc::default(), gpu: None, gpu_display: false, disk: Some(disk.clone()), }; - Session { frames, src, disk, hook_calls } + Session { frames, src, disk, hook_calls, pool } } impl Session { @@ -2696,6 +2699,28 @@ mod frame_files { let _ = std::fs::remove_dir_all(&dir); } + /// Reopened (a new preview cache, media pool, layer cache and disk cache on the same folder): + /// the frame comes from disk, its one source file is checked (a `metadata` call), and no + /// source file is opened or decoded for it. + #[test] + fn a_reopened_project_serves_its_frame_from_disk_without_opening_a_source_file() { + let dir = folder("reopen"); + let (p, cid, _) = project(&dir); + let first = session(&p, &dir); + let shown = first.show(cid, &[1]); + assert!(close(shown[0], level(1)), "{shown:?}"); + assert!(first.pool.stats().misses > 0, "the first session decodes the frame's file: {:?}", first.pool.stats()); + assert!(first.disk.contains(disk_cache::Kind::Frame, first.disk_key(cid, 1))); + drop(first); + let again = session(&p, &dir); + let shown = again.show(cid, &[1]); + assert!(close(shown[0], level(1)), "{shown:?}"); + assert_eq!(again.hits(), (1, 0), "served from disk"); + assert_eq!(again.disk.file_checks(), 1, "its one file checked"); + assert_eq!(again.pool.stats(), effectcraft_media::PoolStats::default(), "no source file opened or decoded"); + let _ = std::fs::remove_dir_all(&dir); + } + /// No scan: opening a comp of a project that also holds a large sequence, and showing a /// frame, looks only at the files that frame reads; the comp's key looks at no file (it /// stays the same when its files change, and never asks for the identity of a path). diff --git a/docs/architecture.md b/docs/architecture.md index 90573a1c9..83c03f14f 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -263,7 +263,11 @@ checksummed) and survive restarts. The design (#3184): source that doesn't say what it read, more than 4096 files) is shown but never written. - **Reload Footage drops entries.** File ▸ Reload Footage deletes the frame and layer entries whose lists name the item's files (the writer thread reads each entry's list, not its - pixels), so a file replaced by one with the same size and time is read again. + pixels), so a file replaced by one with the same size and time is read again. A reload while + the cache is off is remembered for the session and applied when it is switched on, before it + is read. A render already under way offers entries made of the files as they were: each + render takes the cache's drop generation before it reads, and an entry listing a file dropped + after that is refused (`DiskCache::drop_generation`); the frame is shown, never stored. - **Edits keep what they can't change.** RAM frames outside an edit's dirty spans are kept (`Project::dirty_spans`), and their disk entries are linked to the comp's new key. From ac34105a57d737088a4254aafb205b4e111acd4c Mon Sep 17 00:00:00 2001 From: vangel76 Date: Sat, 7 Nov 2026 11:42:56 +0100 Subject: [PATCH 034/451] Disk cache: RAM frames keep the drop generation their render started at Reload Footage empties the RAM preview, but an idle pass of persist_missing may already hold a frame from before the reload. It took the cache's drop generation when it ran, after the drop, so the old pixels could be written back and, with the file's size and time unchanged, served again after a restart. Each RAM frame now keeps the disk cache its render started with and that cache's drop generation then. persist_missing writes a frame only to that cache, with that generation, and skips it once one of its files was dropped since; a frame rendered without that cache is not written from there. Tests use tempfile directories (the layer drop test, the frame_files folders under target/). Co-Authored-By: Claude Opus 5.5 --- crates/render/src/cache.rs | 6 +- crates/ui-egui/src/frames.rs | 57 ++++++++---- crates/ui-egui/src/frames/tests.rs | 135 +++++++++++++++++++++-------- 3 files changed, 143 insertions(+), 55 deletions(-) diff --git a/crates/render/src/cache.rs b/crates/render/src/cache.rs index 7b0e7fc4e..692a80576 100644 --- a/crates/render/src/cache.rs +++ b/crates/render/src/cache.rs @@ -920,9 +920,8 @@ mod shared_insert_tests { fn a_buffer_rendered_across_a_drop_is_not_written() { use crate::disk_cache::{DiskCache, Kind, layer_disk_key}; use crate::reads::{FileStamp, ReadFile, ReadFiles}; - let dir = std::env::temp_dir().join(format!("effectcraft-layer-drop-{}", std::process::id())); - let _ = std::fs::remove_dir_all(&dir); - let dc = DiskCache::open(&dir, 1 << 30).unwrap(); + let dir = tempfile::tempdir().unwrap(); + let dc = DiskCache::open(dir.path(), 1 << 30).unwrap(); dc.set_min_layer_ms(0); let cache = LayerCache::default(); cache.set_disk(Some(dc.clone())); @@ -939,7 +938,6 @@ mod shared_insert_tests { assert!(!dc.contains(Kind::Layer, layer_disk_key(1)), "made of the file as it was before the drop"); assert!(dc.contains(Kind::Layer, layer_disk_key(2))); drop((cache, dc)); - let _ = std::fs::remove_dir_all(&dir); } /// A render that gets another render's buffer gets that buffer's files too (#3184): when a diff --git a/crates/ui-egui/src/frames.rs b/crates/ui-egui/src/frames.rs index 3595026ee..14c3f32ef 100644 --- a/crates/ui-egui/src/frames.rs +++ b/crates/ui-egui/src/frames.rs @@ -168,6 +168,28 @@ struct Cached { /// (the browser's frames are stored by its frame workers, not from here) #[cfg_attr(target_arch = "wasm32", allow(dead_code))] files: Option>, + /// The disk cache its render started with and that cache's drop generation then: the frame + /// is written to that cache only, and only while none of its files was dropped since + /// (`None`: rendered without a disk cache, or elsewhere; never written from here). + #[cfg_attr(target_arch = "wasm32", allow(dead_code))] + since: Option, +} + +/// A disk cache and its drop generation ([`DiskCache::drop_generation`]) when a render started. +#[derive(Clone)] +struct DiskSince(std::sync::Weak, u64); + +impl DiskSince { + fn of(dc: &Arc, generation: u64) -> DiskSince { + DiskSince(Arc::downgrade(dc), generation) + } + + /// The generation, when `dc` is the cache it was taken from (the weak reference keeps that + /// cache's address from being reused by another). + #[cfg_attr(target_arch = "wasm32", allow(dead_code))] + fn for_cache(&self, dc: &Arc) -> Option { + std::ptr::eq(self.0.as_ptr(), Arc::as_ptr(dc)).then_some(self.1) + } } struct Cache { @@ -191,12 +213,13 @@ impl Cache { /// A frame without its source files (tests). #[cfg(test)] fn insert(&mut self, k: FrameKey, img: FrameImage) { - self.insert_with(k, img, None); + self.insert_with(k, img, None, None); } - /// [`Cache::insert`] with the source files the frame was made of. - fn insert_with(&mut self, k: FrameKey, img: FrameImage, files: Option>) { + /// [`Cache::insert`] with the source files the frame was made of and the disk cache's drop + /// generation when its render started. + fn insert_with(&mut self, k: FrameKey, img: FrameImage, files: Option>, since: Option) { let (sz, gpu) = (img.bytes(), img.is_gpu()); - if let Some(old) = self.map.insert(k, Cached { img, files }) { + if let Some(old) = self.map.insert(k, Cached { img, files, since }) { self.forget(&old.img); } else { self.order.push_back(k); @@ -1036,7 +1059,7 @@ impl Frames { self.request_content_key(src.project.clone(), base.revision, base.comp); return true; }; - let (missing, converting): (Vec<(u128, FrameImage, Arc)>, bool) = { + let (missing, converting): (Vec<(u128, FrameImage, Arc, u64)>, bool) = { let (Ok(c), Ok(mut queued), Ok(mut written)) = (self.cache.lock(), self.persisted.lock(), self.written.lock()) else { return false }; if queued.len() > 100_000 { queued.clear(); @@ -1053,10 +1076,13 @@ impl Frames { // (GPU frames have no CPU pixels to write; a frame that can't name its files // can't be checked when read) let files = c.files.as_ref().filter(|f| f.is_complete() && !c.img.is_gpu())?; + // (only with the generation its render started at, for this cache: a frame + // made of a file Reload Footage dropped since holds the pixels from before) + let since = c.since.as_ref().and_then(|s| s.for_cache(&dc)).filter(|s| !dc.dropped_since(files, *s))?; let dk = disk_cache::frame_key(content, k.frame, k.scale, k.view ^ oh); let tries = written.1.get(&dk).copied().unwrap_or(0); (tries < 2 && !dc.contains(disk_cache::Kind::Frame, dk) && !dc.frame_pending(dk) && queued.insert(dk)) - .then(|| (dk, c.img.clone(), files.clone())) + .then(|| (dk, c.img.clone(), files.clone(), since)) }) .collect(); (missing, !queued.is_empty()) @@ -1066,9 +1092,7 @@ impl Frames { } let (persisted, written, virtual_id) = (self.persisted.clone(), self.written.clone(), self.virtual_id.clone()); let work = move || { - // (a frame made of a file dropped while it rendered kept an incomplete list: not here) - let since = dc.drop_generation(); - for (dk, img, files) in missing { + for (dk, img, files, since) in missing { // (accepted: the disk cache tracks it until written, and it counts as a try; // refused by a full queue: retried, without counting) let accepted = put_disk_frame(&dc, dk, &img, &files, virtual_id.as_deref(), since); @@ -1481,7 +1505,7 @@ impl Frames { // (A frame kept on the GPU is not written to the disk cache: its files are not // needed.) if let Some((img, _files)) = w.render_gpu(&job) { - w.finish(&job, img, None, t0); + w.finish(&job, img, None, None, t0); continue; } } @@ -1504,7 +1528,7 @@ impl Frames { match r { Ok(f) => { let img = egui::ColorImage::from_rgba_premultiplied([f.width as usize, f.height as usize], &f.rgba); - fw.finish_key(key, urgent, FrameImage::Cpu(Arc::new(img)), None, t0); + fw.finish_key(key, urgent, FrameImage::Cpu(Arc::new(img)), None, None, t0); } Err(e) => { // Not rendered (a stale revision, a lost worker): the viewer asks again. @@ -1642,7 +1666,8 @@ impl Worker { let files = Arc::new(files); // Publish the shared frame and wake the viewer before optional RGBA conversion // and compression. Persistence still runs on this worker, using the same snapshot. - self.finish(&job, ci.clone(), Some(files.clone()), t0); + let since = disk.as_ref().map(|(dc, _, since)| DiskSince::of(dc, *since)); + self.finish(&job, ci.clone(), Some(files.clone()), since, t0); if !disk_hit && let Some((dc, k, since)) = &disk && put_disk_frame(dc, *k, &ci, &files, self.virtual_id.as_deref(), *since) @@ -1672,18 +1697,18 @@ impl Worker { /// Store a finished frame (with the source files it was made of, when known) and release its /// job. - fn finish(&self, job: &Job, img: FrameImage, files: Option>, t0: web_time::Instant) { - self.finish_key(job.key, job.urgent, img, files, t0); + fn finish(&self, job: &Job, img: FrameImage, files: Option>, since: Option, t0: web_time::Instant) { + self.finish_key(job.key, job.urgent, img, files, since, t0); } - fn finish_key(&self, key: FrameKey, urgent: bool, img: FrameImage, files: Option>, t0: web_time::Instant) { + fn finish_key(&self, key: FrameKey, urgent: bool, img: FrameImage, files: Option>, since: Option, t0: web_time::Instant) { if urgent && let Ok(mut l) = self.last.lock() { *l = t0.elapsed().as_secs_f64() * 1000.0; } if let Ok(mut c) = self.cache.lock() && (!img.is_gpu() || !self.gpu_retired.load(Ordering::Acquire)) { - c.insert_with(key, img, files); + c.insert_with(key, img, files, since); } self.release(key, urgent); } diff --git a/crates/ui-egui/src/frames/tests.rs b/crates/ui-egui/src/frames/tests.rs index 959d14de2..13fda15e8 100644 --- a/crates/ui-egui/src/frames/tests.rs +++ b/crates/ui-egui/src/frames/tests.rs @@ -211,7 +211,7 @@ fn retirement_reaches_existing_workers_and_keeps_cpu_frames_and_completion_live( let next = key(1, 1, 0); frames.inflight.lock().unwrap().insert(next); frames.queue.lock().unwrap().running.insert(next); - worker.finish_key(next, false, img(), None, web_time::Instant::now()); + worker.finish_key(next, false, img(), None, None, web_time::Instant::now()); assert!(frames.is_cached(&next), "CPU retry can still publish"); assert_eq!(frames.inflight(), 0); assert!(frames.queue.lock().unwrap().running.is_empty()); @@ -1593,6 +1593,71 @@ fn half_float_ram_frames_missing_on_disk_are_written() { ram_frames_missing_on_disk_are_written_as(true); } +/// A RAM frame whose render started before Reload Footage dropped one of its files (#3184) +/// holds the pixels from before: writing it later to the disk cache (an idle pass after the +/// drop) would bring them back, also after a restart, since the file kept its size and time. It +/// is written only with the drop generation its render started at, for the cache it started +/// with: so it is not written, nor is a frame rendered without that cache. Frames of other files, +/// and frames rendered after the drop, are written. +#[test] +fn ram_frames_from_before_a_drop_are_not_written() { + use effectcraft_engine::Session; + use effectcraft_engine::render::reads::{FileStamp, ReadFile}; + use serde_json::json; + let dir = tempfile::tempdir().unwrap(); + let disk = DiskCache::open(dir.path().join("cache"), 1 << 30).unwrap(); + let other = DiskCache::open(dir.path().join("other"), 1 << 30).unwrap(); + let mut s = Session::default(); + let cid = ItemId(s.execute("comp.new", json!({"name": "A", "width": 8, "height": 8, "duration": 1})).unwrap()["comp"].as_u64().unwrap()); + s.execute("layer.newSolid", json!({})).unwrap(); + let src = RenderSource { + project: s.project.clone(), + footage: Arc::new(effectcraft_engine::render::NoFootage), + expr: None, + layer_cache: Arc::default(), + gpu: None, + gpu_display: false, + disk: Some(disk.clone()), + }; + let f = Frames::default(); + let series = FrameKey { revision: 1, content: f.content_of(&src.project, 1, cid), comp: cid.0, opts: opts_hash(&RenderOpts::default()), ..key(0, 0, 0) }; + let read = |p: &str| Some(Arc::new([ReadFile::new(p, FileStamp::Native { len: 3, modified: Some(1) })].into_iter().collect::())); + let before = DiskSince::of(&disk, disk.drop_generation()); + { + let mut c = f.cache.lock().unwrap(); + c.insert_with(FrameKey { frame: 0, ..series }, img(), read("/a.png"), Some(before.clone())); + c.insert_with(FrameKey { frame: 1, ..series }, img(), read("/b.png"), Some(before)); + c.insert_with(FrameKey { frame: 2, ..series }, img(), read("/a.png"), None); + c.insert_with(FrameKey { frame: 3, ..series }, img(), read("/a.png"), Some(DiskSince::of(&other, other.drop_generation()))); + } + // Reload Footage of a.png. + disk.drop_files(["/a.png"]); + disk.flush(); + f.cache.lock().unwrap().insert_with(FrameKey { frame: 4, ..series }, img(), read("/a.png"), Some(DiskSince::of(&disk, disk.drop_generation()))); + let on_disk = |fr: i64| { + disk.contains( + disk_cache::Kind::Frame, + frame_disk_key(&f.content_keys, &src.project, &FrameKey { frame: fr, ..series }, opts_hash(&RenderOpts::default())), + ) + }; + // Idle passes until there is nothing left to write. + let mut done = false; + for _ in 0..1000 { + let more = f.persist_missing(&src, &series, &RenderOpts::default()); + disk.flush(); + if !more && f.persisted.lock().unwrap().is_empty() { + done = true; + break; + } + std::thread::sleep(std::time::Duration::from_millis(5)); + } + assert!(done, "the idle passes end"); + assert!(on_disk(1) && on_disk(4), "another file's frame, and a frame rendered after the drop"); + assert!(!on_disk(0), "made of a.png as it was before the drop"); + assert!(!on_disk(2) && !on_disk(3), "rendered without this disk cache"); + assert_eq!(disk.stats().entries, 2); +} + fn ram_frames_missing_on_disk_are_written_as(half: bool) { use effectcraft_engine::Session; use serde_json::json; @@ -1616,7 +1681,7 @@ fn ram_frames_missing_on_disk_are_written_as(half: bool) { FrameKey { revision: 1, content: f.content_of(&src.project, 1, cid), comp: cid.0, opts: opts_hash(&RenderOpts::default()) ^ 1, ..key(0, 0, 0) }; for fr in 0..10 { let frame = if half { FrameImage::CpuF16(Arc::new(F16Frame::from_image(&effectcraft_engine::render::Image::new(8, 8), SRGB))) } else { img() }; - f.cache.lock().unwrap().insert_with(FrameKey { frame: fr, ..series }, frame, Some(Arc::default())); + f.cache.lock().unwrap().insert_with(FrameKey { frame: fr, ..series }, frame, Some(Arc::default()), Some(DiskSince::of(&disk, disk.drop_generation()))); } let on_disk = |fr: i64| { disk.contains( @@ -2529,12 +2594,12 @@ mod frame_files { const RATE: FrameRate = FrameRate::FPS_30; const FRAMES: i64 = 5; - /// A fresh folder for test `name` (on the build drive, not the system temp folder). - fn folder(name: &str) -> PathBuf { - let dir = Path::new(env!("CARGO_MANIFEST_DIR")).join(format!("../../target/test-frame-files-{name}-{}", std::process::id())); - let _ = std::fs::remove_dir_all(&dir); - std::fs::create_dir_all(&dir).unwrap(); - dir + /// A fresh folder for test `name` (on the build drive, not the system temp folder), deleted + /// when the guard is dropped. + fn folder(name: &str) -> tempfile::TempDir { + let target = Path::new(env!("CARGO_MANIFEST_DIR")).join("../../target"); + std::fs::create_dir_all(&target).unwrap(); + tempfile::Builder::new().prefix(&format!("test-frame-files-{name}-")).tempdir_in(target).unwrap() } /// A flat grey PNG of `level` at `path`. @@ -2671,10 +2736,11 @@ mod frame_files { /// others come from disk, also after reopening. #[test] fn a_changed_source_file_re_renders_exactly_its_frames() { - let dir = folder("correct"); - let (p, cid, files) = project(&dir); + let tmp = folder("correct"); + let dir = tmp.path(); + let (p, cid, files) = project(dir); let all: Vec = (0..FRAMES).collect(); - let first = session(&p, &dir); + let first = session(&p, dir); let shown = first.show(cid, &all); assert!(all.iter().all(|f| close(shown[*f as usize], level(*f))), "{shown:?}"); assert_eq!(first.hits(), (0, FRAMES as u64), "rendered, nothing on disk yet"); @@ -2683,7 +2749,7 @@ mod frame_files { // Frame 2's file gets new pixels (and size), frame 3's only a new time. png(Path::new(&files[2]), 250); touch(&files[3], 30); - let second = session(&p, &dir); + let second = session(&p, dir); let shown = second.show(cid, &all); assert!(close(shown[2], 250), "frame 2 shows its new file: {shown:?}"); assert!([0, 1, 3, 4].iter().all(|f| close(shown[*f as usize], level(*f))), "{shown:?}"); @@ -2692,11 +2758,10 @@ mod frame_files { assert_eq!(second.disk.stats().entries, FRAMES as usize, "the entries of 2 and 3 were replaced"); drop(second); // Reopened: every frame from disk, the replaced ones with their new pixels. - let third = session(&p, &dir); + let third = session(&p, dir); let shown = third.show(cid, &all); assert_eq!(third.hits(), (FRAMES as u64, 0)); assert!(close(shown[2], 250) && close(shown[3], level(3)), "{shown:?}"); - let _ = std::fs::remove_dir_all(&dir); } /// Reopened (a new preview cache, media pool, layer cache and disk cache on the same folder): @@ -2704,21 +2769,21 @@ mod frame_files { /// source file is opened or decoded for it. #[test] fn a_reopened_project_serves_its_frame_from_disk_without_opening_a_source_file() { - let dir = folder("reopen"); - let (p, cid, _) = project(&dir); - let first = session(&p, &dir); + let tmp = folder("reopen"); + let dir = tmp.path(); + let (p, cid, _) = project(dir); + let first = session(&p, dir); let shown = first.show(cid, &[1]); assert!(close(shown[0], level(1)), "{shown:?}"); assert!(first.pool.stats().misses > 0, "the first session decodes the frame's file: {:?}", first.pool.stats()); assert!(first.disk.contains(disk_cache::Kind::Frame, first.disk_key(cid, 1))); drop(first); - let again = session(&p, &dir); + let again = session(&p, dir); let shown = again.show(cid, &[1]); assert!(close(shown[0], level(1)), "{shown:?}"); assert_eq!(again.hits(), (1, 0), "served from disk"); assert_eq!(again.disk.file_checks(), 1, "its one file checked"); assert_eq!(again.pool.stats(), effectcraft_media::PoolStats::default(), "no source file opened or decoded"); - let _ = std::fs::remove_dir_all(&dir); } /// No scan: opening a comp of a project that also holds a large sequence, and showing a @@ -2726,16 +2791,17 @@ mod frame_files { /// stays the same when its files change, and never asks for the identity of a path). #[test] fn showing_a_frame_checks_only_the_files_it_reads() { - let dir = folder("no-scan"); - let (p, cid, files) = project(&dir); + let tmp = folder("no-scan"); + let dir = tmp.path(); + let (p, cid, files) = project(dir); let key = disk_cache::comp_content_key(&p, cid); png(Path::new(&files[1]), 99); touch(&files[2], 5); assert_eq!(disk_cache::comp_content_key(&p, cid), key, "the key looks at no file"); - let first = session(&p, &dir); + let first = session(&p, dir); first.show(cid, &[2]); drop(first); - let again = session(&p, &dir); + let again = session(&p, dir); // (the indicator's key is computed off the UI thread first) let mut blue = vec![]; for _ in 0..400 { @@ -2752,7 +2818,6 @@ mod frame_files { assert_eq!(again.hits(), (1, 0)); assert_eq!(again.disk.file_checks(), 1, "only the file frame 2 read"); assert_eq!(again.hook_calls.load(Ordering::Relaxed), 0, "no path of the unused sequence was asked about"); - let _ = std::fs::remove_dir_all(&dir); } /// The frame entry files under the cache folder. @@ -2776,22 +2841,23 @@ mod frame_files { /// cache entry never serve the frame from before; each is rendered again and stored anew. #[test] fn missing_or_unreadable_files_and_damaged_entries_never_serve_a_stale_frame() { - let dir = folder("safe"); - let (p, cid, files) = project(&dir); - let first = session(&p, &dir); + let tmp = folder("safe"); + let dir = tmp.path(); + let (p, cid, files) = project(dir); + let first = session(&p, dir); first.show(cid, &[0]); assert_eq!(first.disk.stats().entries, 1); drop(first); // Missing: not served; the frame is rendered without it. std::fs::remove_file(&files[0]).unwrap(); - let missing = session(&p, &dir); + let missing = session(&p, dir); let shown = missing.show(cid, &[0]); assert!(!close(shown[0], level(0)), "the frame from before was served: {shown:?}"); assert_eq!(missing.hits(), (0, 1)); drop(missing); // Back, with other pixels: the entry made while it was missing is not served either. png(Path::new(&files[0]), 180); - let back = session(&p, &dir); + let back = session(&p, dir); let shown = back.show(cid, &[0]); assert!(close(shown[0], 180), "{shown:?}"); assert_eq!(back.hits(), (0, 1)); @@ -2799,30 +2865,29 @@ mod frame_files { // Unreadable (a folder in its place). std::fs::remove_file(&files[0]).unwrap(); std::fs::create_dir(&files[0]).unwrap(); - let unreadable = session(&p, &dir); + let unreadable = session(&p, dir); let shown = unreadable.show(cid, &[0]); assert!(!close(shown[0], 180), "the frame from before was served: {shown:?}"); assert_eq!(unreadable.hits(), (0, 1)); drop(unreadable); std::fs::remove_dir(&files[0]).unwrap(); png(Path::new(&files[0]), 120); - let fresh = session(&p, &dir); + let fresh = session(&p, dir); assert!(close(fresh.show(cid, &[0])[0], 120)); drop(fresh); // A damaged entry: a miss, rendered, stored again, then served. - let found = entries(&dir); + let found = entries(dir); assert_eq!(found.len(), 1, "{found:?}"); let mut bytes = std::fs::read(&found[0]).unwrap(); let n = bytes.len() / 2; bytes[n] ^= 0x5a; std::fs::write(&found[0], bytes).unwrap(); - let damaged = session(&p, &dir); + let damaged = session(&p, dir); assert!(close(damaged.show(cid, &[0])[0], 120)); assert_eq!(damaged.hits(), (0, 1)); drop(damaged); - let healed = session(&p, &dir); + let healed = session(&p, dir); assert!(close(healed.show(cid, &[0])[0], 120)); assert_eq!(healed.hits(), (1, 0), "the rewritten entry is used"); - let _ = std::fs::remove_dir_all(&dir); } } From 26dc7b3a5e6a40e13c83665dffaf5fc41aedf7bf Mon Sep 17 00:00:00 2001 From: vangel76 Date: Sat, 7 Nov 2026 12:40:04 +0100 Subject: [PATCH 035/451] CC Ball Action: add Coloring, Shading, Scatter Motion, Displace and Displace Property (#3197) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After Effects 24.2 reworked CC Ball Action's controls. EffectCraft now lists them in After Effects' order with its defaults: Grid Spacing (5), Ball Size (100), Coloring (Medium), Shading (-75), Scatter, Scatter Motion, Displace, Displace Property (Brightness), Twist Angle, Twist Property, Rotation Axis, Rotation. Grid Spacing and Ball Size used to default to 4 and 40; saved projects keep their values. - Shading scales the balls' light and shine. -75 is the lit sphere as before, 0 draws flat balls in the layer's colour, larger magnitudes shade more, and the sign mirrors the light's direction. The value is clamped to -100..100 (an assumed range) so huge values stay finite on the GPU. Values other than -75 and 0 use a new sprite shape (Shape::Ball), drawn the same way on the CPU and the GPU. - Coloring is an approximation: Crisp takes the nearest pixel, Medium keeps EffectCraft's earlier smooth sample (for compatibility), Smooth averages 16 samples over the ball's cell. - Scatter Motion is treated as the renamed Instability State, since 24.2 shows no Instability State. Old projects are upgraded through PARAM_ID_ALIASES. - Displace and Displace Property (Red, Green, Blue, Brightness, Saturation, RGB, Radius, Diamond, Spherize) move each ball towards or away from the camera. The scale, direction, pivot and range, and what Radius, Diamond and Spherize compute, are EffectCraft's own choice pending a comparison with After Effects. Displace is clamped to -1000..1000. With the old Grid Spacing and Ball Size, every CC Ball Action golden hash is unchanged, so the new controls at their defaults draw what was drawn before. Only the golden cases that use the default Grid Spacing and Ball Size were reblessed. CC Ball Action has no .aep mapping yet. Sources (behaviour and public descriptions only): - After Effects February 2024 (24.2) feature summary: "Ball Action: Rearranged effect controls with new controls, such as Displacement, Shading, and Coloring" https://helpx.adobe.com/ae_en/after-effects/using/whats-new/2024-2.html - The After Effects screenshot in #3197: control order and defaults. - 163.com, "Ae 效果详解:CC Ball Action": option lists, defaults, and that Shading 0 is flat https://www.163.com/dy/article/JOICG6E10536FE6V.html - Adobe community, "CC Ball Action is broken in update 24.4": the Coloring options Crisp, Medium and Smooth - Mike Murphy, "How To Use CC Ball Action": Shading 0 with Displace on Brightness https://mikemurphy.ai/tutorials/ccballaction/ Fixes #3197 --- crates/effects/src/migrate.rs | 3 + crates/effects/src/sim/sprites.rs | 22 ++++ crates/effects/src/sim2/pixels.rs | 118 +++++++++++++++++- crates/effects/src/sim2/registry.rs | 21 +++- crates/effects/src/sim2/tests.rs | 132 +++++++++++++++++++++ crates/effects/tests/it/particle_golden.rs | 42 +++---- crates/gpu/src/fx_sim.rs | 2 + crates/gpu/src/shaders/fx_sim.wgsl | 21 ++++ crates/gpu/src/tests/fx_particles.rs | 17 ++- docs/effects.md | 4 +- 10 files changed, 347 insertions(+), 35 deletions(-) diff --git a/crates/effects/src/migrate.rs b/crates/effects/src/migrate.rs index 59daca49d..6529e658d 100644 --- a/crates/effects/src/migrate.rs +++ b/crates/effects/src/migrate.rs @@ -44,6 +44,9 @@ pub const PARAM_ID_ALIASES: &[(&str, &str, &str)] = &[ ("ec.key.innerouter", "additionalBackground", "additionalBackground/background1"), // Generate: Radio Waves' growth speed was called Velocity; Velocity now moves the wave. ("ec.generate.radiowaves", "velocity", "waveMotion/expansion"), + // Simulation: CC Ball Action's Instability State is treated as the control After Effects + // 24.2 calls Scatter Motion (#3197; an assumption: 24.2 shows no Instability State). + ("ec.sim.ccballaction", "instabilityState", "scatterMotion"), ]; /// Popup option labels renamed since they were first saved: diff --git a/crates/effects/src/sim/sprites.rs b/crates/effects/src/sim/sprites.rs index 55ba594b4..031bee978 100644 --- a/crates/effects/src/sim/sprites.rs +++ b/crates/effects/src/sim/sprites.rs @@ -93,6 +93,10 @@ pub enum Shape { Disc, /// Lit sphere (upper-left light, specular). Sphere, + /// CC Ball Action's ball: [`Shape::Sphere`]'s light and shine scaled by `|shade|` (1 is the + /// sphere's look, 0 a flat disc; callers keep it finite, the GPU draws the same); a negative + /// `shade` mirrors the light's direction (lit from the lower right). + Ball { shade: f32 }, /// Disc fading linearly to its rim. Faded, /// Thin ring with a highlight. @@ -277,6 +281,24 @@ fn sprite_shade(s: &Sprite, x: f32, y: f32) -> Option { rgb = [rgb[0] * k + spec, rgb[1] * k + spec, rgb[2] * k + spec]; cv } + Shape::Ball { shade } => { + let d = (dx * dx + dy * dy).sqrt(); + let cv = aa(r - d); + if cv <= 0.0 { + return None; + } + let (nx, ny) = (dx / r, dy / r); + let nz = (1.0 - nx * nx - ny * ny).max(0.0).sqrt(); + let m = if shade < 0.0 { -1.0 } else { 1.0 }; + let (lx, ly, lz) = (-0.48 * m, -0.58 * m, 0.66); + let diff = (nx * lx + ny * ly + nz * lz).max(0.0); + let rz = 2.0 * diff * nz - lz; + let st = shade.abs(); + let spec = rz.max(0.0).powi(20) * 0.6 * st; + let k = (1.0 - st * 0.8 * (1.0 - diff)).max(0.0); + rgb = [rgb[0] * k + spec, rgb[1] * k + spec, rgb[2] * k + spec]; + cv + } Shape::Bubble => { let d = (dx * dx + dy * dy).sqrt() / r; if d > 1.0 + 1.0 / r { diff --git a/crates/effects/src/sim2/pixels.rs b/crates/effects/src/sim2/pixels.rs index 2cda428db..4fed8da59 100644 --- a/crates/effects/src/sim2/pixels.rs +++ b/crates/effects/src/sim2/pixels.rs @@ -4,10 +4,91 @@ use super::{Acc, Buf, EffectCtx, IntoParallelIterator, ParallelIterator, Post, S // ------------------------------------------------------------------ CC Ball Action +/// CC Ball Action's Coloring: how a ball takes its colour from the layer under its grid cell. +/// An approximation: After Effects' own meaning is not published beyond "how smooth the +/// balls look". Crisp takes the nearest pixel, Medium keeps EffectCraft's earlier smooth +/// sample at the cell centre (for compatibility), Smooth averages 16 samples over the cell. +pub(super) const BALL_COLORING: &[&str] = &["Crisp", "Medium", "Smooth"]; +pub(super) const BALL_COLORING_MEDIUM: u32 = 1; +/// CC Ball Action's default Shading: the lit sphere (`Shape::Sphere`); 0 draws flat discs. +pub(super) const BALL_SHADING_DEFAULT: f64 = -75.0; +/// CC Ball Action's Displace Property: what pushes a ball towards (high values) or away from +/// (low values) the camera. The option names come from public descriptions; what Radius, +/// Diamond and Spherize compute here is an assumption pending a comparison with After Effects. +pub(super) const BALL_DISPLACE_PROPERTIES: &[&str] = &["Red", "Green", "Blue", "Brightness", "Saturation", "RGB", "Radius", "Diamond", "Spherize"]; +pub(super) const BALL_DISPLACE_BRIGHTNESS: u32 = 3; + pub(super) fn ball_action(ctx: &EffectCtx, b: Buf) -> Buf { ball_action_plan(ctx, &b).finish(b) } +/// A parameter's number, or `default` when the instance does not carry it. +fn f_or(ctx: &EffectCtx, id: &str, default: f64) -> f64 { + ctx.params.values.get(id).map(|v| v.as_f64()).unwrap_or(default) +} + +/// The layer's straight colour and alpha for the ball of the grid cell centred on (`sx`, `sy`) +/// (buffer pixels, cell `cell` buffer pixels wide), by Coloring `coloring`. +fn ball_color(src: &effectcraft_raster::Image, sx: f64, sy: f64, cell: f64, coloring: u32) -> ([f32; 3], f32) { + match coloring { + // Crisp: the pixel under the cell centre. + 0 => unpremul(src.get(sx.floor() as i64, sy.floor() as i64)), + // Smooth: the cell's average (4 × 4 samples, premultiplied). + 2 => { + const N: u32 = 4; + let mut acc = [0.0f32; 4]; + for j in 0..N { + for i in 0..N { + let ox = (f64::from(i) + 0.5) / f64::from(N) - 0.5; + let oy = (f64::from(j) + 0.5) / f64::from(N) - 0.5; + let p = src.sample_bilinear(sx + ox * cell, sy + oy * cell); + for (a, v) in acc.iter_mut().zip(p) { + *a += v; + } + } + } + let n = (N * N) as f32; + unpremul([acc[0] / n, acc[1] / n, acc[2] / n, acc[3] / n]) + } + // Medium: a smooth sample at the cell centre. + _ => unpremul(src.sample_bilinear(sx, sy)), + } +} + +/// CC Ball Action's Displace Property `prop` (0..1) for a ball of straight colour `c` at +/// (`gx`, `gy`) on a `lw` × `lh` layer (`maxr`: half its diagonal). Assumed meanings (not +/// compared with After Effects yet): Radius, Diamond and Spherize are shapes that peak at the +/// layer centre. +fn ball_displace_value(prop: u32, c: [f32; 3], gx: f32, gy: f32, lw: f32, lh: f32, maxr: f32) -> f32 { + let (cx, cy) = (lw * 0.5, lh * 0.5); + let v = match prop { + 0 => c[0], + 1 => c[1], + 2 => c[2], + // Brightness: the brightest channel (HSB brightness). + 3 => c[0].max(c[1]).max(c[2]), + // Saturation: HSB saturation. + 4 => { + let mx = c[0].max(c[1]).max(c[2]); + let mn = c[0].min(c[1]).min(c[2]); + if mx > 0.0 { (mx - mn) / mx } else { 0.0 } + } + // RGB: the channels' mean. + 5 => (c[0] + c[1] + c[2]) / 3.0, + // Radius: high at the centre, low at the corners. + 6 => 1.0 - (gx - cx).hypot(gy - cy) / maxr.max(1.0), + // Diamond: high at the centre, falling linearly to the edge midpoints' diamond. + 7 => 1.0 - ((gx - cx).abs() / cx.max(0.5) + (gy - cy).abs() / cy.max(0.5)) * 0.5, + // Spherize: a hemisphere over the largest centred circle. + _ => { + let rr = cx.min(cy).max(0.5); + let d = (gx - cx).hypot(gy - cy) / rr; + (1.0 - d * d).max(0.0).sqrt() + } + }; + if v.is_finite() { v.clamp(0.0, 1.0) } else { 0.0 } +} + /// CC Ball Action's balls (far to near), coloured by the layer's pixels. fn ball_action_plan(ctx: &EffectCtx, b: &Buf) -> SpritePlan { let pr = ctx.params; @@ -18,7 +99,29 @@ fn ball_action_plan(ctx: &EffectCtx, b: &Buf) -> SpritePlan { let twist = pr.f("twistAngle").to_radians(); let spacing = pr.f("gridSpacing").max(1.0) as f32; let size = pr.f("ballSize") as f32 / 100.0; - let instab = pr.f("instabilityState").to_radians() as f32; + // Scatter Motion, treated as the renamed Instability State (an assumption: After Effects + // 24.2 shows Scatter Motion and no Instability State): turns each ball's scatter direction. + let instab = pr.f("scatterMotion").to_radians() as f32; + let coloring = pr.values.get("coloring").map(|v| v.as_enum()).unwrap_or(BALL_COLORING_MEDIUM); + let shading = f_or(ctx, "shading", BALL_SHADING_DEFAULT); + // Shading: -75 is the lit sphere as it always was, 0 flat discs; the magnitude scales the + // light and shine (strength 1 at 75) and the sign mirrors the light's direction (positive + // lights the balls from the lower right). How this compares with After Effects' sign + // (described as concave versus convex) is unverified, as is the -100..100 range. + let shape = if shading == BALL_SHADING_DEFAULT || !shading.is_finite() { + Shape::Sphere + } else if shading == 0.0 { + Shape::Disc + } else { + // Clamped: a huge value would reach the GPU as an infinite strength (and NaN colours). + Shape::Ball { shade: (-shading.clamp(-100.0, 100.0) / 75.0) as f32 } + }; + // Displace: pushes each ball along z by its Displace Property (high values towards the + // camera, pivoting at the property's middle value); 100 moves the extremes by half the + // layer's diagonal. Scale, direction, pivot and range are EffectCraft's own choice, + // pending a comparison with After Effects. Clamped so huge values stay finite. + let displace = pr.f("displace").clamp(-1000.0, 1000.0) as f32; + let displace_prop = pr.values.get("displaceProperty").map(|v| v.as_enum()).unwrap_or(BALL_DISPLACE_BRIGHTNESS); let seed = ctx.seed.wrapping_mul(0x2545f491); let (lw, lh) = (ctx.layer_size[0] as f32, ctx.layer_size[1] as f32); let s = b.scale as f32; @@ -43,7 +146,7 @@ fn ball_action_plan(ctx: &EffectCtx, b: &Buf) -> SpritePlan { let gx = (i % nx) as f32 * spacing + spacing * 0.5; let gy = (i / nx) as f32 * spacing + spacing * 0.5; let (sx, sy) = b.to_px([gx as f64, gy as f64]); - let (c, a) = unpremul(src.sample_bilinear(sx, sy)); + let (c, a) = ball_color(src, sx, sy, f64::from(spacing * s), coloring); if a <= 0.0 || size <= 0.0 { return None; } @@ -54,11 +157,16 @@ fn ball_action_plan(ctx: &EffectCtx, b: &Buf) -> SpritePlan { _ => crate::util::rgb3([c[0], c[1], c[2], 0.0]).iter().sum::() / 3.0, } as f64; let ang = rot + twist * tp; - // Scatter: random 3D offsets whose direction drifts with the instability state. + // Scatter: random 3D offsets whose direction drifts with Scatter Motion. let ph = h(i, 1, seed) * std::f32::consts::TAU + instab; let sc = scatter * h(i, 2, seed); let off = [(sc * ph.cos()) as f64, (sc * ph.sin()) as f64, (scatter * hs(i, 3, seed)) as f64]; - let p0 = [gx as f64 - cx + off[0], gy as f64 - cy + off[1], off[2]]; + let mut p0 = [gx as f64 - cx + off[0], gy as f64 - cy + off[1], off[2]]; + // Only when set, so Displace 0 leaves every depth (and the far-to-near order) as is. + if displace != 0.0 && displace.is_finite() { + let v = ball_displace_value(displace_prop, c, gx, gy, lw, lh, maxr); + p0[2] -= f64::from(displace / 100.0 * (v - 0.5) * 2.0 * maxr); + } let m = rot_axis(ax, ang); let q: [f64; 3] = std::array::from_fn(|k| m[k][0] * p0[0] + m[k][1] * p0[1] + m[k][2] * p0[2]); if d + q[2] <= d * 0.05 { @@ -67,7 +175,7 @@ fn ball_action_plan(ctx: &EffectCtx, b: &Buf) -> SpritePlan { let persp = d / (d + q[2]); let (bx, by) = b.to_px([cx + q[0] * persp, cy + q[1] * persp]); let r = spacing * 0.5 * size * persp as f32 * s; - Some((q[2], Sprite::new(bx as f32, by as f32, r, [c[0], c[1], c[2], a], Shape::Sphere))) + Some((q[2], Sprite::new(bx as f32, by as f32, r, [c[0], c[1], c[2], a], shape))) }) .collect(); balls.sort_by(|a, b| b.0.total_cmp(&a.0)); diff --git a/crates/effects/src/sim2/registry.rs b/crates/effects/src/sim2/registry.rs index 333916a16..28eb8e808 100644 --- a/crates/effects/src/sim2/registry.rs +++ b/crates/effects/src/sim2/registry.rs @@ -1,5 +1,7 @@ use super::foam::{FOAM_TEXTURES, foam}; -use super::pixels::{ball_action, pixel_polly, scatterize}; +use super::pixels::{ + BALL_COLORING, BALL_COLORING_MEDIUM, BALL_DISPLACE_BRIGHTNESS, BALL_DISPLACE_PROPERTIES, BALL_SHADING_DEFAULT, ball_action, pixel_polly, scatterize, +}; use super::shatter::{CD_PROPS, CD_SOURCES, SHATTER_PATTERNS, SHATTER_TEXTURE_MODES, card_dance, shatter}; use super::surfaces::{caustics, wave_world}; use super::{EffectSpec, ParamUi, Value, col, num, p, pct, popup, pt, slider, spec}; @@ -80,15 +82,22 @@ pub fn specs() -> Vec { spec( "ec.sim.ccballaction", "CC Ball Action", + // After Effects' order and defaults since 24.2 (#3197). Scatter Motion is treated as + // the renamed Instability State (an assumption, `migrate::PARAM_ID_ALIASES`). The + // Shading range is not published; -100..100 is an assumption. vec![ + p("gridSpacing", "Grid Spacing", num(5.0), slider(1.0, 200.0, 1.0, 50.0, 0)), + p("ballSize", "Ball Size", num(100.0), slider(0.0, 400.0, 0.0, 200.0, 1)), + p("coloring", "Coloring", Value::Enum(BALL_COLORING_MEDIUM), popup(BALL_COLORING)), + p("shading", "Shading", num(BALL_SHADING_DEFAULT), slider(-100.0, 100.0, -100.0, 100.0, 1)), p("scatter", "Scatter", num(0.0), slider(0.0, 2000.0, 0.0, 300.0, 1)), + p("scatterMotion", "Scatter Motion", num(0.0), ParamUi::Angle), + p("displace", "Displace", num(0.0), slider(-1000.0, 1000.0, 0.0, 100.0, 1)), + p("displaceProperty", "Displace Property", Value::Enum(BALL_DISPLACE_BRIGHTNESS), popup(BALL_DISPLACE_PROPERTIES)), + p("twistAngle", "Twist Angle", num(0.0), ParamUi::Angle), + p("twistProperty", "Twist Property", Value::Enum(0), popup(&["X Axis", "Y Axis", "Radius", "Brightness"])), p("rotationAxis", "Rotation Axis", Value::Enum(0), popup(&["X Axis", "Y Axis", "Z Axis", "XY Axis", "XZ Axis", "YZ Axis", "XYZ Axis"])), p("rotation", "Rotation", num(0.0), ParamUi::Angle), - p("twistProperty", "Twist Property", Value::Enum(0), popup(&["X Axis", "Y Axis", "Radius", "Brightness"])), - p("twistAngle", "Twist Angle", num(0.0), ParamUi::Angle), - p("gridSpacing", "Grid Spacing", num(4.0), slider(1.0, 200.0, 1.0, 50.0, 0)), - p("ballSize", "Ball Size", num(40.0), slider(0.0, 400.0, 0.0, 200.0, 1)), - p("instabilityState", "Instability State", num(0.0), ParamUi::Angle), ], ball_action, ), diff --git a/crates/effects/src/sim2/tests.rs b/crates/effects/src/sim2/tests.rs index 2ef35b122..6ad6eb21c 100644 --- a/crates/effects/src/sim2/tests.rs +++ b/crates/effects/src/sim2/tests.rs @@ -46,6 +46,138 @@ fn ball_action_draws_balls() { assert!(sum_diff(&a, &sc) > 1.0); } +/// #3197: CC Ball Action has After Effects' controls (since 24.2), in its order, with its +/// defaults: Coloring, Shading, Scatter Motion (formerly Instability State), Displace and +/// Displace Property were missing. +#[test] +fn ball_action_has_after_effects_controls() { + let spec = crate::find("ec.sim.ccballaction").unwrap(); + let names: Vec<&str> = spec.params.iter().map(|p| p.name).collect(); + assert_eq!( + names, + [ + "Grid Spacing", + "Ball Size", + "Coloring", + "Shading", + "Scatter", + "Scatter Motion", + "Displace", + "Displace Property", + "Twist Angle", + "Twist Property", + "Rotation Axis", + "Rotation" + ] + ); + let sp = |id: &str| spec.params.iter().find(|p| p.id == id).unwrap_or_else(|| panic!("no {id}")); + assert_eq!(sp("gridSpacing").default, num(5.0)); + assert_eq!(sp("ballSize").default, num(100.0)); + assert_eq!(sp("coloring").default, Value::Enum(1)); + assert_eq!(sp("coloring").ui, ParamUi::Popup { options: vec!["Crisp".into(), "Medium".into(), "Smooth".into()] }); + assert_eq!(sp("shading").default, num(-75.0)); + assert!(matches!(sp("shading").ui, ParamUi::Slider { min, max, .. } if min <= -100.0 && max >= 100.0)); + assert_eq!(sp("scatterMotion").default, num(0.0)); + assert_eq!(sp("scatterMotion").ui, ParamUi::Angle); + assert_eq!(sp("displace").default, num(0.0)); + let ParamUi::Popup { options } = &sp("displaceProperty").ui else { panic!("Displace Property is a popup") }; + let Value::Enum(d) = sp("displaceProperty").default else { panic!("Displace Property defaults to an option") }; + assert_eq!(options.get(d as usize).map(String::as_str), Some("Brightness")); + // Old projects' Instability State becomes Scatter Motion through `PARAM_ID_ALIASES`; the + // engine test `opening_an_old_project_upgrades_effect_instances` covers every alias. +} + +/// #3197: the new controls at After Effects' defaults draw exactly what CC Ball Action drew +/// before (the lit sphere, a smooth colour sample, no displacement). +#[test] +fn ball_action_new_controls_at_defaults_keep_the_render() { + let base = [("ballSize", num(80.0)), ("scatter", num(6.0)), ("rotationAxis", Value::Enum(1)), ("rotation", num(25.0))]; + let a = run("ec.sim.ccballaction", &base, ramp(32, 32), 0.0); + let mut explicit = base.to_vec(); + explicit.extend([ + ("coloring", Value::Enum(1)), + ("shading", num(-75.0)), + ("scatterMotion", num(0.0)), + ("displace", num(0.0)), + ("displaceProperty", Value::Enum(3)), + ]); + assert_eq!(a, run("ec.sim.ccballaction", &explicit, ramp(32, 32), 0.0)); +} + +/// #3197: Shading 0 removes the built-in light: every ball is the layer's flat colour. The +/// default (-75) shades it; a smaller magnitude shades less, a positive value lights the balls +/// from the other side. +#[test] +fn ball_action_shading_zero_is_flat() { + let c = [0.6, 0.3, 0.2, 1.0]; + let shade = |v: f64| run("ec.sim.ccballaction", &[("ballSize", num(100.0)), ("gridSpacing", num(8.0)), ("shading", num(v))], Image::filled(32, 32, c), 0.0); + let flat = shade(0.0); + let covered: Vec<&[f32; 4]> = flat.data.iter().filter(|p| p[3] > 0.999).collect(); + assert!(!covered.is_empty(), "balls drawn"); + for p in &covered { + for k in 0..3 { + assert!((p[k] / p[3] - c[k]).abs() < 1e-4, "flat colour: {p:?}"); + } + } + let lit = shade(-75.0); + assert!(lit.data.iter().any(|p| p[3] > 0.999 && (0..3).any(|k| (p[k] / p[3] - c[k]).abs() > 0.05)), "the default shading lights and darkens the balls"); + let soft = shade(-30.0); + assert!(sum_diff(&flat, &soft) > 0.1 && sum_diff(&flat, &soft) < sum_diff(&flat, &lit), "less shading, closer to flat"); + assert!(sum_diff(&shade(75.0), &lit) > 1.0, "the sign moves the light"); +} + +/// #3197: Coloring Crisp takes the pixel under each ball's cell centre; Medium samples +/// smoothly between pixels. Grid Spacing 4 puts the cell centres on pixel corners (with the +/// default 5 they fall on pixel centres, where Medium's sample equals Crisp's). +#[test] +fn ball_action_coloring_crisp_takes_the_pixel() { + let mut src = Image::new(32, 32); + for y in 0..32u32 { + for x in 0..32u32 { + src.set(x, y, [x as f32 / 32.0, y as f32 / 32.0, ((x * 7 + y * 3) % 5) as f32 / 4.0, 1.0]); + } + } + let col = |m: u32| { + let v = [("gridSpacing", num(4.0)), ("ballSize", num(100.0)), ("shading", num(0.0)), ("coloring", Value::Enum(m))]; + run("ec.sim.ccballaction", &v, src.clone(), 0.0) + }; + let crisp = col(0); + // Flat, opaque balls of radius 2 centred on (4i + 2, 4j + 2): the pixel to the lower right + // of each centre is fully covered by its ball alone. + for j in 0..8i64 { + for i in 0..8i64 { + let (x, y) = (4 * i + 2, 4 * j + 2); + let (got, want) = (crisp.get(x, y), src.get(x, y)); + assert!((0..4).all(|k| (got[k] - want[k]).abs() < 1e-5), "ball ({i}, {j}): {got:?} vs the pixel {want:?}"); + } + } + assert!(sum_diff(&crisp, &col(1)) > 1.0, "medium blends the pixels"); +} + +/// #3197: a huge Shading (typed or from an expression) is clamped, so the balls stay finite. +#[test] +fn ball_action_huge_shading_stays_finite() { + for v in [1e45, -1e45, f64::MAX] { + let o = run("ec.sim.ccballaction", &[("gridSpacing", num(8.0)), ("shading", num(v))], ramp(32, 32), 0.0); + assert!(o.data.iter().all(|p| p.iter().all(|c| c.is_finite())), "shading {v}"); + assert!(o.data.iter().any(|p| p[3] > 0.0), "shading {v}: balls drawn"); + } +} + +/// #3197: Displace pushes the balls along z by the chosen property (Radius: the centre comes +/// towards the camera and grows); 0 leaves them in the layer's plane. +#[test] +fn ball_action_displace_moves_balls_in_depth() { + let flat = run("ec.sim.ccballaction", &[("ballSize", num(80.0))], ramp(32, 32), 0.0); + let d = run("ec.sim.ccballaction", &[("ballSize", num(80.0)), ("displace", num(60.0)), ("displaceProperty", Value::Enum(6))], ramp(32, 32), 0.0); + assert_eq!(d, run("ec.sim.ccballaction", &[("ballSize", num(80.0)), ("displace", num(60.0)), ("displaceProperty", Value::Enum(6))], ramp(32, 32), 0.0)); + assert!(sum_diff(&flat, &d) > 1.0); + for prop in 0..9 { + let o = run("ec.sim.ccballaction", &[("ballSize", num(80.0)), ("displace", num(400.0)), ("displaceProperty", Value::Enum(prop))], ramp(32, 32), 0.0); + assert!(o.data.iter().all(|p| p.iter().all(|v| v.is_finite())), "property {prop}"); + } +} + #[test] fn pixel_polly_breaks_after_start() { let v = [("forceCenter", pt(16.0, 16.0)), ("gridSpacing", num(4.0))]; diff --git a/crates/effects/tests/it/particle_golden.rs b/crates/effects/tests/it/particle_golden.rs index 0dbf19d76..5d0b255b1 100644 --- a/crates/effects/tests/it/particle_golden.rs +++ b/crates/effects/tests/it/particle_golden.rs @@ -192,7 +192,7 @@ fn cases() -> Vec<(&'static str, Vec)> { vec![ vec![], vec![("scatter", n(20.0)), ("rotationAxis", e(6)), ("rotation", n(40.0)), ("twistProperty", e(3)), ("twistAngle", n(90.0))], - vec![("gridSpacing", n(2.0)), ("ballSize", n(80.0)), ("instabilityState", n(45.0)), ("twistProperty", e(2)), ("twistAngle", n(30.0))], + vec![("gridSpacing", n(2.0)), ("ballSize", n(80.0)), ("scatterMotion", n(45.0)), ("twistProperty", e(2)), ("twistAngle", n(30.0))], ], ), ( @@ -538,26 +538,26 @@ const GOLDEN: &[(&str, u64)] = &[ ("ec.sim.particleplayground/8/32bpc/t1.5", 0xb5b7f0281f26baad), ("ec.sim.particleplayground/8/32bpc/t0.8", 0x8b6934363ef4dcfd), ("ec.sim.particleplayground/8/32bpc/t2.2", 0x0a31c17e8e34b9f5), - ("ec.sim.ccballaction/0/8bpc/t0.5", 0x12698ec8353be38c), - ("ec.sim.ccballaction/0/8bpc/t1.5", 0x12698ec8353be38c), - ("ec.sim.ccballaction/0/8bpc/t0.8", 0x12698ec8353be38c), - ("ec.sim.ccballaction/0/8bpc/t2.2", 0x12698ec8353be38c), - ("ec.sim.ccballaction/0/32bpc/t0.5", 0x3fb733487e120261), - ("ec.sim.ccballaction/0/32bpc/t1.5", 0x3fb733487e120261), - ("ec.sim.ccballaction/0/32bpc/t0.8", 0x3fb733487e120261), - ("ec.sim.ccballaction/0/32bpc/t2.2", 0x3fb733487e120261), - ("ec.sim.ccballaction/0/8bpc/half/t0.5", 0x4946070917cc0945), - ("ec.sim.ccballaction/0/8bpc/half/t1.5", 0x4946070917cc0945), - ("ec.sim.ccballaction/0/8bpc/half/t0.8", 0x4946070917cc0945), - ("ec.sim.ccballaction/0/8bpc/half/t2.2", 0x4946070917cc0945), - ("ec.sim.ccballaction/1/8bpc/t0.5", 0xf34b3be38a4dd468), - ("ec.sim.ccballaction/1/8bpc/t1.5", 0xf34b3be38a4dd468), - ("ec.sim.ccballaction/1/8bpc/t0.8", 0xf34b3be38a4dd468), - ("ec.sim.ccballaction/1/8bpc/t2.2", 0xf34b3be38a4dd468), - ("ec.sim.ccballaction/1/32bpc/t0.5", 0x503b7238edf2912c), - ("ec.sim.ccballaction/1/32bpc/t1.5", 0x503b7238edf2912c), - ("ec.sim.ccballaction/1/32bpc/t0.8", 0x503b7238edf2912c), - ("ec.sim.ccballaction/1/32bpc/t2.2", 0x503b7238edf2912c), + ("ec.sim.ccballaction/0/8bpc/t0.5", 0x5f7401d3d1e5a513), + ("ec.sim.ccballaction/0/8bpc/t1.5", 0x5f7401d3d1e5a513), + ("ec.sim.ccballaction/0/8bpc/t0.8", 0x5f7401d3d1e5a513), + ("ec.sim.ccballaction/0/8bpc/t2.2", 0x5f7401d3d1e5a513), + ("ec.sim.ccballaction/0/32bpc/t0.5", 0x9cf15a7756ab88ed), + ("ec.sim.ccballaction/0/32bpc/t1.5", 0x9cf15a7756ab88ed), + ("ec.sim.ccballaction/0/32bpc/t0.8", 0x9cf15a7756ab88ed), + ("ec.sim.ccballaction/0/32bpc/t2.2", 0x9cf15a7756ab88ed), + ("ec.sim.ccballaction/0/8bpc/half/t0.5", 0xe2e3a624434f8e88), + ("ec.sim.ccballaction/0/8bpc/half/t1.5", 0xe2e3a624434f8e88), + ("ec.sim.ccballaction/0/8bpc/half/t0.8", 0xe2e3a624434f8e88), + ("ec.sim.ccballaction/0/8bpc/half/t2.2", 0xe2e3a624434f8e88), + ("ec.sim.ccballaction/1/8bpc/t0.5", 0x07382912d068a625), + ("ec.sim.ccballaction/1/8bpc/t1.5", 0x07382912d068a625), + ("ec.sim.ccballaction/1/8bpc/t0.8", 0x07382912d068a625), + ("ec.sim.ccballaction/1/8bpc/t2.2", 0x07382912d068a625), + ("ec.sim.ccballaction/1/32bpc/t0.5", 0xa1e843936e72815f), + ("ec.sim.ccballaction/1/32bpc/t1.5", 0xa1e843936e72815f), + ("ec.sim.ccballaction/1/32bpc/t0.8", 0xa1e843936e72815f), + ("ec.sim.ccballaction/1/32bpc/t2.2", 0xa1e843936e72815f), ("ec.sim.ccballaction/2/8bpc/t0.5", 0x0b6bf26753ee4582), ("ec.sim.ccballaction/2/8bpc/t1.5", 0x0b6bf26753ee4582), ("ec.sim.ccballaction/2/8bpc/t0.8", 0x0b6bf26753ee4582), diff --git a/crates/gpu/src/fx_sim.rs b/crates/gpu/src/fx_sim.rs index 944ca6c07..a3f0f7a0c 100644 --- a/crates/gpu/src/fx_sim.rs +++ b/crates/gpu/src/fx_sim.rs @@ -228,6 +228,8 @@ pub(crate) fn sprite_layer(e: &mut Enc, src: &GpuImage, plan: &SpritePlan) -> Op Shape::Square => (6.0, 0.0, 0.0), Shape::Tri => (7.0, 0.0, 0.0), Shape::Line { dx, dy } => (8.0, dx, dy), + // The strength rides in the (otherwise unused) first segment slot. + Shape::Ball { shade } => (9.0, shade, 0.0), }; let mut rec = [kind, s.x, s.y, s.r, s.c[0], s.c[1], s.c[2], s.c[3], s.rot, dx, dy, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]; match plan.tints.get(i).copied().unwrap_or(Tint::Fixed) { diff --git a/crates/gpu/src/shaders/fx_sim.wgsl b/crates/gpu/src/shaders/fx_sim.wgsl index 7deeac048..cf4a14a03 100644 --- a/crates/gpu/src/shaders/fx_sim.wgsl +++ b/crates/gpu/src/shaders/fx_sim.wgsl @@ -145,6 +145,27 @@ fn fxm_sprite(at: u32, x: f32, y: f32) -> FxmShade { } cov = fxm_aa(m); } + // sim::Shape::Ball (CC Ball Action's Shading): the sphere's light and shine scaled by + // |shade| (data[at + 9]), lit from the lower right when shade < 0. + case 9u: { + let d = sqrt(dx * dx + dy * dy); + let cv = fxm_aa(r - d); + if (cv <= 0.0) { + return fxm_none(); + } + let shade = data[at + 9u]; + let nx = dx / r; + let ny = dy / r; + let nz = sqrt(max(1.0 - nx * nx - ny * ny, 0.0)); + let m = select(1.0, -1.0, shade < 0.0); + let diff = max(nx * (-0.48 * m) + ny * (-0.58 * m) + nz * 0.66, 0.0); + let rz = 2.0 * diff * nz - 0.66; + let st = abs(shade); + let spec = powz(max(rz, 0.0), 20.0) * 0.6 * st; + let k = max(1.0 - st * 0.8 * (1.0 - diff), 0.0); + rgb = rgb * k + spec; + cov = cv; + } default: { let lx = data[at + 9u]; let ly = data[at + 10u]; diff --git a/crates/gpu/src/tests/fx_particles.rs b/crates/gpu/src/tests/fx_particles.rs index e8c3a7ce6..a4d531a37 100644 --- a/crates/gpu/src/tests/fx_particles.rs +++ b/crates/gpu/src/tests/fx_particles.rs @@ -141,7 +141,22 @@ fn ball_action_pixel_polly_scatterize() { 0.0, 0.0, ); - case("ec.sim.ccballaction", &[("gridSpacing", n(2.0)), ("ballSize", n(80.0)), ("instabilityState", n(45.0)), ("twistProperty", e(2))], 0.0, 0.0); + case("ec.sim.ccballaction", &[("gridSpacing", n(2.0)), ("ballSize", n(80.0)), ("scatterMotion", n(45.0)), ("twistProperty", e(2))], 0.0, 0.0); + // #3197: Shading (flat, weaker, stronger, lit from the other side), Coloring, Displace. + for shading in [0.0, -30.0, -100.0, 60.0, 1e45] { + case("ec.sim.ccballaction", &[("ballSize", n(80.0)), ("shading", n(shading))], 0.0, 0.0); + } + for coloring in [0, 2] { + case("ec.sim.ccballaction", &[("ballSize", n(80.0)), ("coloring", e(coloring))], 0.0, 0.0); + } + for prop in [3, 6, 8] { + case( + "ec.sim.ccballaction", + &[("ballSize", n(80.0)), ("rotationAxis", e(1)), ("rotation", n(30.0)), ("displace", n(40.0)), ("displaceProperty", e(prop))], + 0.0, + 0.0, + ); + } for object in 0..4 { case("ec.sim.ccpixelpolly", &[("object", e(object)), ("gridSpacing", n(6.0))], 0.6, 0.0); } diff --git a/docs/effects.md b/docs/effects.md index d9f726481..130d00a90 100644 --- a/docs/effects.md +++ b/docs/effects.md @@ -3,7 +3,7 @@ -EffectCraft ships 308 effects with 2988 parameters in total, grouped into the same categories as the Effects & Presets panel. Every effect is our own implementation, written from public behaviour descriptions and standard image-processing literature. Parameter names, order, popup options, units, defaults and ranges follow the reference application so that projects, expressions and muscle memory carry over. +EffectCraft ships 308 effects with 2992 parameters in total, grouped into the same categories as the Effects & Presets panel. Every effect is our own implementation, written from public behaviour descriptions and standard image-processing literature. Parameter names, order, popup options, units, defaults and ranges follow the reference application so that projects, expressions and muscle memory carry over. - **GPU**: 280 effects also run on the GPU compositor with identical results. - **32**: 308 effects process 32-bit float (HDR, overbright) pixels without clamping. @@ -319,7 +319,7 @@ Effects are addressed by id (`ec..`) or display name in commands | Effect | Id | Params | GPU | 32 | Status | |---|---|---:|:-:|:-:|---| -| CC Ball Action | `ec.sim.ccballaction` | 8 | GPU | 32 | Implemented | +| CC Ball Action | `ec.sim.ccballaction` | 12 | GPU | 32 | Implemented | | CC Bubbles | `ec.sim.ccbubbles` | 7 | GPU | 32 | Implemented | | CC Drizzle | `ec.sim.ccdrizzle` | 14 | GPU | 32 | Implemented | | CC Hair | `ec.sim.cchair` | 20 | GPU | 32 | Implemented | From 1c47f233ea9b18bd74a4eb4a178f406f2896b716 Mon Sep 17 00:00:00 2001 From: vangel76 Date: Sat, 7 Nov 2026 12:57:53 +0100 Subject: [PATCH 036/451] Graph Editor: the value curve passes through every key and draws Hold steps vertically Refs #2720 The curve was sampled on an even grid every 2 px, blind to key times. Zoomed out, keys one frame apart sit closer than a sample step, so the polyline cut across the jump instead of passing through the key squares, and a Hold step was drawn as a slope across one step. The samples now also include every visible key time and both sides of the key after a Hold key (so a stretched layer's one-tick rounding or a reversed layer still gives a vertical step). Keys denser than the grid add no samples, so the work stays bounded. This does not change the slanted spans in the issue's screenshot: their key squares sit at different values (about 0.36 vs 0.40, 0.01 vs 0.00), so the curve draws the stored values as they are. --- crates/ui-egui/src/panels/graph.rs | 142 ++++++++++++++++++++++++++++- 1 file changed, 137 insertions(+), 5 deletions(-) diff --git a/crates/ui-egui/src/panels/graph.rs b/crates/ui-egui/src/panels/graph.rs index be18999d4..8a4401d97 100644 --- a/crates/ui-egui/src/panels/graph.rs +++ b/crates/ui-egui/src/panels/graph.rs @@ -130,6 +130,45 @@ fn speed_at(pr: &Property, spatial: bool, d: usize, lt: Tick) -> f64 { } } +/// How far either side of the key after a Hold key the step is sampled (seconds; far below a +/// pixel, far above the tick a stretched layer's time conversion can be off by). +const HOLD_EDGE: f64 = 1e-6; + +/// The comp times (seconds) a curve is sampled at between `t0` and `t1`: `n` evenly spaced +/// times, plus every key time `keys` puts inside the span, and around the key after a key that +/// holds (its out side is Hold) the instants just before and after it. `keys` are the active +/// keys in key order, as (comp seconds, holds); on a reversed layer their comp times descend. +/// Without the key times the polyline only passes near the keys: keys closer together than a +/// sample step (a one-frame jump zoomed out) got cut across, missing their squares, and a Hold +/// step was drawn as a slope across one step instead of a vertical edge (#2720). With no keys +/// this is the plain even grid. Keys denser than the grid (baked keys zoomed out) add nothing +/// visible and would multiply the evaluations, so past `2 * n` key samples only the grid is used. +fn sample_times(t0: f64, t1: f64, n: usize, keys: &[(f64, bool)]) -> Vec { + let n = n.max(2); + let mut ts: Vec = (0..n).map(|i| t0 + (t1 - t0) * i as f64 / (n - 1) as f64).collect(); + let (lo, hi) = (t0.min(t1), t0.max(t1)); + let inside = |t: f64| t > lo && t < hi; + let max_extra = n.saturating_mul(2); + let mut extra = vec![]; + for (i, &(kt, holds)) in keys.iter().enumerate() { + if inside(kt) { + extra.push(kt); + } + if holds && let Some(&(next, _)) = keys.get(i + 1) { + extra.extend([next - HOLD_EDGE, next + HOLD_EDGE].into_iter().filter(|&t| inside(t))); + } + if extra.len() > max_extra { + extra.clear(); + break; + } + } + ts.extend(extra); + ts.retain(|t| t.is_finite()); + ts.sort_by(f64::total_cmp); + ts.dedup(); + ts +} + /// Build the curves for the visible time span. fn curves<'a>(app: &EffectcraftApp, comp: &'a Comp, ectx: &EvalCtx, tm: TMap, plot: Rect, speed: bool) -> Vec> { let sel = &app.session.state.selected_keys; @@ -140,12 +179,14 @@ fn curves<'a>(app: &EffectcraftApp, comp: &'a Comp, ectx: &EvalCtx, tm: TMap, pl let Some(pr) = l.props.find(uid) else { continue }; let spatial = pr.spatial && matches!(pr.value, Value::Vec2(_) | Value::Vec3(_)); let dims = if speed && spatial { 1 } else { shown_dims(l, pr) }; + // The active keys (muted ones are skipped by evaluation) in comp seconds, and whether each + // holds its value up to the next one. + let active: Vec<(f64, bool)> = pr.keys.iter().filter(|k| !k.muted).map(|k| (l.comp_time(k.time).seconds(), k.out_interp == Interp::Hold)).collect(); + let times = sample_times(tm.t(plot.min.x), tm.t(plot.max.x), n, &active); for d in 0..dims { let color = if dims > 1 { DIM_COLORS[d % 4] } else { PROP_COLORS[pi % PROP_COLORS.len()] }; - let mut pts = Vec::with_capacity(n); - for i in 0..n { - let x = plot.min.x + plot.width() * i as f32 / (n - 1) as f32; - let ct = tm.t(x); + let mut pts = Vec::with_capacity(times.len()); + for &ct in × { let tt = Tick::from_seconds_f64(ct); let v = if speed { speed_at(pr, spatial, d, l.layer_time(tt)) } else { ectx.at(tt).value(l, pr).components().get(d).copied().unwrap_or(0.0) }; pts.push((ct, v)); @@ -892,7 +933,98 @@ fn shift_axes(shift: bool, dx: f32, dy: f32) -> (bool, bool) { #[cfg(test)] mod tests { - use super::shift_axes; + use super::{HOLD_EDGE, sample_times, shift_axes}; + use effectcraft_engine::keyframe::{Keyframe, Value, evaluate}; + use effectcraft_engine::time::Tick; + + /// The value-graph polyline of `keys` (layer time = comp time) sampled at `times`. + fn polyline(keys: &[Keyframe], times: &[f64]) -> Vec<(f64, f64)> { + times + .iter() + .map(|&t| { + let v = evaluate(keys, Tick::from_seconds_f64(t), false).map(|v| v.components().first().copied().unwrap_or(f64::NAN)).unwrap_or(f64::NAN); + (t, v) + }) + .collect() + } + + fn active(keys: &[Keyframe]) -> Vec<(f64, bool)> { + keys.iter().map(|k| (k.time.seconds(), k.out_interp == effectcraft_engine::keyframe::Interp::Hold)).collect() + } + + /// #2720: a step one frame wide, zoomed out so it is narrower than a sample step. The curve + /// has to pass through every key square: the old even grid (`sample_times` with no keys) + /// never sampled 0.2 s or 0.2 s + 1 frame and drew a slope from 0 to 1 across the step. + #[test] + fn value_graph_passes_through_keys_narrower_than_a_sample_step() { + let keys = [ + Keyframe::new(Tick::from_seconds_f64(0.0), Value::Scalar(0.0)), + Keyframe::new(Tick::from_seconds_f64(0.2), Value::Scalar(0.0)), + Keyframe::new(Tick::from_seconds_f64(0.2 + 1.0 / 30.0), Value::Scalar(1.0)), + Keyframe::new(Tick::from_seconds_f64(0.9), Value::Scalar(1.0)), + ]; + let times = sample_times(0.0, 1.0, 4, &active(&keys)); + let pts = polyline(&keys, ×); + for k in &keys { + let (t, v) = (k.time.seconds(), k.value.components()[0]); + assert!(pts.iter().any(|p| p.0 == t && (p.1 - v).abs() < 1e-12), "no curve point on the key at {t} s ({v}): {pts:?}"); + } + // The spans between equal keys are flat: no sample between 0 and 0.2 s leaves 0, none + // between 0.2 s + 1 frame and 0.9 s leaves 1. + for &(t, v) in &pts { + if t <= 0.2 { + assert!(v.abs() < 1e-12, "{t} s: {v}"); + } else if (0.2 + 1.0 / 30.0..=0.9).contains(&t) { + assert!((v - 1.0).abs() < 1e-12, "{t} s: {v}"); + } + } + // Times are sorted and unique, the even grid is still there. + assert!(times.windows(2).all(|w| w[0] < w[1]), "{times:?}"); + assert!([0.0, 1.0 / 3.0, 2.0 / 3.0, 1.0].iter().all(|g| times.iter().any(|t| (t - g).abs() < 1e-12)), "{times:?}"); + } + + /// #2720: a Hold key draws a vertical step at the next key, not a slope across a sample step. + #[test] + fn hold_step_is_vertical() { + let keys = [Keyframe::new(Tick::from_seconds_f64(0.1), Value::Scalar(0.0)).hold(), Keyframe::new(Tick::from_seconds_f64(0.5), Value::Scalar(1.0))]; + let pts = polyline(&keys, &sample_times(0.0, 1.0, 4, &active(&keys))); + let at = pts.iter().position(|p| p.0 == 0.5).unwrap_or_else(|| panic!("no sample on the key at 0.5 s: {pts:?}")); + let before = pts[at - 1]; + assert!((0.5 - before.0 - HOLD_EDGE).abs() < 1e-12 && before.1.abs() < 1e-12, "the held value ends right before the next key: {pts:?}"); + assert!((pts[at].1 - 1.0).abs() < 1e-12, "{pts:?}"); + } + + #[test] + fn sample_times_keep_keys_inside_the_span_only() { + let times = sample_times(1.0, 2.0, 3, &[(0.5, true), (1.25, false), (2.5, false)]); + // 0.5 s and 2.5 s are off screen; the hold from 0.5 s ends at 1.25 s, inside it. + assert_eq!(times, vec![1.0, 1.25 - HOLD_EDGE, 1.25, 1.25 + HOLD_EDGE, 1.5, 2.0]); + // Degenerate input never panics: an empty span is one point, a NaN span has no points. + assert_eq!(sample_times(0.0, 0.0, 0, &[]), vec![0.0]); + assert!(sample_times(f64::NAN, 1.0, 4, &[(0.5, true)]).iter().all(|t| t.is_finite())); + } + + /// A reversed layer: its keys run backwards in comp time, and both sides of each step after + /// a Hold key are still sampled. + #[test] + fn sample_times_cover_hold_steps_on_a_reversed_layer() { + let times = sample_times(1.0, 2.0, 10, &[(1.8, true), (1.4, true), (1.1, false)]); + for t in [1.8, 1.4 - HOLD_EDGE, 1.4, 1.4 + HOLD_EDGE, 1.1 - HOLD_EDGE, 1.1, 1.1 + HOLD_EDGE] { + assert!(times.contains(&t), "{t} missing: {times:?}"); + } + assert!(times.windows(2).all(|w| w[0] < w[1]), "{times:?}"); + } + + /// Dense keys zoomed out (100 000 in one second, half of them Hold) don't multiply the samples. + #[test] + fn sample_times_stay_bounded_with_dense_keys() { + let keys: Vec<(f64, bool)> = (0..100_000).map(|i| (i as f64 / 100_000.0, i % 2 == 0)).collect(); + let times = sample_times(0.0, 1.0, 100, &keys); + assert!(times.len() <= 300, "{} samples", times.len()); + // A few keys inside the span are still all sampled. + let few = sample_times(0.0, 1.0, 100, &keys[..50]); + assert!(keys[1..50].iter().all(|(t, _)| few.contains(t)), "{few:?}"); + } #[test] fn shift_locks_drag_to_dominant_axis() { From 36854318db1bbd8a2d1eafacb1efc5611fba8422 Mon Sep 17 00:00:00 2001 From: vangel76 Date: Sat, 7 Nov 2026 14:02:20 +0100 Subject: [PATCH 037/451] Viewer: the Rotation tool counts the turn from the press The Rotation gesture seeded its angle from the pointer where egui registered the drag, past the drag threshold, so the sweep round the anchor before that was lost; near the anchor that is a large angle. Count from where the button went down, as After Effects does and as the Create and Pan Behind gestures already do. A press within 3 points of the anchor, or with no anchor on screen, has no direction and still counts from where the drag registered, so the first move doesn't jump. The layer under the press is the one picked. The issue's main cause, a pivot far off for child and 3D layers, was fixed by #2887. Refs #2769 --- crates/ui-egui/src/panels/viewer.rs | 13 ++++-- crates/ui-egui/tests/it/ui_viewer.rs | 61 ++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+), 3 deletions(-) diff --git a/crates/ui-egui/src/panels/viewer.rs b/crates/ui-egui/src/panels/viewer.rs index b1899e1f8..f17d11795 100644 --- a/crates/ui-egui/src/panels/viewer.rs +++ b/crates/ui-egui/src/panels/viewer.rs @@ -1193,16 +1193,23 @@ fn phase_dragstart(app: &mut EffectcraftApp, ui: &mut egui::Ui, ectx: &EvalCtx, }) } Tool::MaskFeather => ov::begin_feather(app, ectx, &paths, &map, press).map(Gesture::Overlay), - Tool::Rotate => pick(app, ectx, cpt, mods.shift).map(|l| { + // The layer under the press is the one that turns. + Tool::Rotate => pick(app, ectx, map.to_comp(press), mods.shift).map(|l| { let layer = comp.layer(l).cloned(); let sign = layer.as_ref().map_or(1.0, |l| rotation_sign(ectx, l)); let others = selected_others(app, comp, l) .into_iter() .filter_map(|o| Some((o.id, ectx.f(o, o.transform()?, "rotation", 0.0), rotation_sign(ectx, o) * sign))) .collect(); - let pivot = layer.as_ref().and_then(|l| anchor_in_comp(ectx, l)).unwrap_or(cpt); + let anchor = layer.as_ref().and_then(|l| anchor_in_comp(ectx, l)); + let pivot = anchor.unwrap_or(cpt); let rot = layer.as_ref().and_then(|l| l.transform().map(|tr| ectx.f(l, tr, "rotation", 0.0))).unwrap_or(0.0); - let last_angle = (cpt[1] - pivot[1]).atan2(cpt[0] - pivot[0]).to_degrees(); + // The turn counts from where the button went down, as in After Effects: by the + // time the drag registers the pointer has already swept some way round the anchor. + // A press on the anchor (or with no anchor to turn about) has no direction, so + // the turn then counts from where the drag registered. + let seed = if anchor.is_some() && press.distance(map.to_screen(pivot)) > 3.0 { map.to_comp(press) } else { cpt }; + let last_angle = (seed[1] - pivot[1]).atan2(seed[0] - pivot[0]).to_degrees(); Gesture::Rotate { layer: l, pivot, sign, last_angle, turned: 0.0, start_rot: rot, others } }), Tool::PanBehind => pick(app, ectx, cpt, false).and_then(|l| { diff --git a/crates/ui-egui/tests/it/ui_viewer.rs b/crates/ui-egui/tests/it/ui_viewer.rs index 7b32fa2ec..bd047088b 100644 --- a/crates/ui-egui/tests/it/ui_viewer.rs +++ b/crates/ui-egui/tests/it/ui_viewer.rs @@ -3022,6 +3022,67 @@ fn rotate_tool_counts_revolutions_both_ways() { assert_eq!(h.state().session.history.undo.len(), undo_before + 1, "one drag, one undo step"); } +/// #2769: the Rotation tool counts the turn from where the button went down, as in After Effects, +/// not from where the drag registered: a first move that sweeps 60° round the anchor turns the +/// layer 60° (it used to drop that sweep, so near the anchor the tool lagged behind the pointer). +#[test] +fn rotate_tool_counts_the_turn_from_the_press() { + let mut h = harness(); + let box_id = h.state().session.active_comp().unwrap().layers[0].id; + h.state_mut().session.execute("layer.select", json!({"layers": [box_id.0]})).unwrap(); + h.state_mut().ui.tool = Tool::Rotate; + h.run_steps(2); + let center = screen(&h, [320.0, 180.0]); + let r = (screen(&h, [350.0, 180.0]) - center).x; + // Press on the box right of its anchor (0°), then one move to 60° clockwise, still on the box. + let press = center + vec2(r * 0.3, 0.0); + let to = center + vec2(r * 60f32.to_radians().cos(), r * 60f32.to_radians().sin()); + h.input_mut().events.push(Event::PointerMoved(press)); + h.input_mut().events.push(Event::PointerButton { pos: press, button: egui::PointerButton::Primary, pressed: true, modifiers: Default::default() }); + h.step(); + h.input_mut().events.push(Event::PointerMoved(to)); + h.step(); + // The gesture applies the previous frame's pointer: hold a frame. + h.step(); + h.input_mut().events.push(Event::PointerButton { pos: to, button: egui::PointerButton::Primary, pressed: false, modifiers: Default::default() }); + h.run_steps(2); + let rot = h.state().session.active_comp().unwrap().layer(box_id).unwrap().props.prop("transform/rotation").unwrap().value.as_f64(); + assert!((rot - 60.0).abs() < 1.0, "the whole sweep from the press turns the layer: {rot}"); +} + +/// #2769: a press right on the anchor point has no direction to count the turn from, so the layer +/// doesn't jump on the first move; the turn counts from where the drag registered. +#[test] +fn rotate_tool_pressed_on_the_anchor_does_not_jump() { + let mut h = harness(); + let box_id = h.state().session.active_comp().unwrap().layers[0].id; + h.state_mut().session.execute("layer.select", json!({"layers": [box_id.0]})).unwrap(); + h.state_mut().ui.tool = Tool::Rotate; + h.run_steps(2); + let rotation = |h: &Harness<'_, EffectcraftApp>| { + h.state().session.active_comp().unwrap().layer(box_id).unwrap().props.prop("transform/rotation").unwrap().value.as_f64() + }; + let center = screen(&h, [320.0, 180.0]); + let r = (screen(&h, [350.0, 180.0]) - center).x; + let at = |deg: f32| center + vec2(r * deg.to_radians().cos(), r * deg.to_radians().sin()); + h.input_mut().events.push(Event::PointerMoved(center)); + h.input_mut().events.push(Event::PointerButton { pos: center, button: egui::PointerButton::Primary, pressed: true, modifiers: Default::default() }); + h.step(); + h.input_mut().events.push(Event::PointerMoved(at(60.0))); + h.step(); + // The gesture applies the previous frame's pointer: hold a frame. + h.step(); + let first = rotation(&h); + assert!(first.abs() < 1.0, "no jump on the first move: {first}"); + h.input_mut().events.push(Event::PointerMoved(at(90.0))); + h.step(); + h.step(); + let next = rotation(&h); + assert!((next - 30.0).abs() < 1.0, "then turns with the pointer: {next}"); + h.input_mut().events.push(Event::PointerButton { pos: at(90.0), button: egui::PointerButton::Primary, pressed: false, modifiers: Default::default() }); + h.run_steps(2); +} + /// A harness whose Box is a child of Plate (anchor 320,180) with `plate` set on Plate first, at /// parent-space position (200, 120). Returns the two layers' ids. fn rotate_child_harness(plate: serde_json::Value) -> (Harness<'static, EffectcraftApp>, u64, u64) { From e109fa6b95310ac84955bef6b272c0c76aa2e2c3 Mon Sep 17 00:00:00 2001 From: vangel76 Date: Sat, 7 Nov 2026 15:20:11 +0100 Subject: [PATCH 038/451] Graph Editor: a dense key cluster only thins its own grid steps Refs #2720 When the key samples passed the budget, sample_times dropped all of them, so a sparse Hold step elsewhere in view went back to a slope. Key samples are now kept per grid step: up to four as they are, past that only the earliest and latest of that step. Sparse keys keep every sample and a curve still has at most 5 * n samples. --- crates/ui-egui/src/panels/graph.rs | 87 +++++++++++++++++++++++++----- 1 file changed, 73 insertions(+), 14 deletions(-) diff --git a/crates/ui-egui/src/panels/graph.rs b/crates/ui-egui/src/panels/graph.rs index 8a4401d97..397d9cab3 100644 --- a/crates/ui-egui/src/panels/graph.rs +++ b/crates/ui-egui/src/panels/graph.rs @@ -134,6 +134,42 @@ fn speed_at(pr: &Property, spatial: bool, d: usize, lt: Tick) -> f64 { /// pixel, far above the tick a stretched layer's time conversion can be off by). const HOLD_EDGE: f64 = 1e-6; +/// How many key samples one grid step of [`sample_times`] keeps as they are (a key and both +/// sides of a Hold step fit); past that only its earliest and latest are kept. +const BUCKET_KEEP: usize = 4; + +/// The key samples falling in one grid step of [`sample_times`]. +#[derive(Clone)] +struct Bucket { + few: Vec, + first: f64, + last: f64, + /// More than [`BUCKET_KEEP`] samples fell here. + full: bool, +} + +impl Default for Bucket { + fn default() -> Self { + Bucket { few: Vec::new(), first: f64::INFINITY, last: f64::NEG_INFINITY, full: false } + } +} + +impl Bucket { + fn add(&mut self, t: f64) { + self.first = self.first.min(t); + self.last = self.last.max(t); + if self.full { + return; + } + if self.few.len() < BUCKET_KEEP { + self.few.push(t); + } else { + self.full = true; + self.few = Vec::new(); + } + } +} + /// The comp times (seconds) a curve is sampled at between `t0` and `t1`: `n` evenly spaced /// times, plus every key time `keys` puts inside the span, and around the key after a key that /// holds (its out side is Hold) the instants just before and after it. `keys` are the active @@ -142,27 +178,40 @@ const HOLD_EDGE: f64 = 1e-6; /// sample step (a one-frame jump zoomed out) got cut across, missing their squares, and a Hold /// step was drawn as a slope across one step instead of a vertical edge (#2720). With no keys /// this is the plain even grid. Keys denser than the grid (baked keys zoomed out) add nothing -/// visible and would multiply the evaluations, so past `2 * n` key samples only the grid is used. +/// visible and would multiply the evaluations: in a grid step with more than [`BUCKET_KEEP`] +/// key samples only the earliest and latest are kept, so a curve has at most `5 * n` samples +/// and sparse keys elsewhere in view keep every sample. fn sample_times(t0: f64, t1: f64, n: usize, keys: &[(f64, bool)]) -> Vec { let n = n.max(2); let mut ts: Vec = (0..n).map(|i| t0 + (t1 - t0) * i as f64 / (n - 1) as f64).collect(); let (lo, hi) = (t0.min(t1), t0.max(t1)); let inside = |t: f64| t > lo && t < hi; - let max_extra = n.saturating_mul(2); - let mut extra = vec![]; + // One bucket per grid step. + let steps = n - 1; + let mut buckets = vec![Bucket::default(); steps]; + let mut add = |t: f64| { + if !inside(t) { + return; + } + let b = (((t - lo) / (hi - lo) * steps as f64) as usize).min(steps - 1); + if let Some(bucket) = buckets.get_mut(b) { + bucket.add(t); + } + }; for (i, &(kt, holds)) in keys.iter().enumerate() { - if inside(kt) { - extra.push(kt); - } + add(kt); if holds && let Some(&(next, _)) = keys.get(i + 1) { - extra.extend([next - HOLD_EDGE, next + HOLD_EDGE].into_iter().filter(|&t| inside(t))); + add(next - HOLD_EDGE); + add(next + HOLD_EDGE); } - if extra.len() > max_extra { - extra.clear(); - break; + } + for b in &buckets { + if b.full { + ts.extend([b.first, b.last]); + } else { + ts.extend_from_slice(&b.few); } } - ts.extend(extra); ts.retain(|t| t.is_finite()); ts.sort_by(f64::total_cmp); ts.dedup(); @@ -1021,9 +1070,19 @@ mod tests { let keys: Vec<(f64, bool)> = (0..100_000).map(|i| (i as f64 / 100_000.0, i % 2 == 0)).collect(); let times = sample_times(0.0, 1.0, 100, &keys); assert!(times.len() <= 300, "{} samples", times.len()); - // A few keys inside the span are still all sampled. - let few = sample_times(0.0, 1.0, 100, &keys[..50]); - assert!(keys[1..50].iter().all(|(t, _)| few.contains(t)), "{few:?}"); + } + + /// A dense cluster of keys only thins its own grid steps: a Hold step elsewhere in view keeps + /// its key and both sides of the step. + #[test] + fn sample_times_keep_sparse_keys_beside_a_dense_cluster() { + let mut keys: Vec<(f64, bool)> = (0..100_000).map(|i| (0.1 * i as f64 / 100_000.0, i % 2 == 0)).collect(); + keys.extend([(0.5, true), (0.8, false)]); + let times = sample_times(0.0, 1.0, 100, &keys); + assert!(times.len() <= 500, "{} samples", times.len()); + for t in [0.5, 0.8 - HOLD_EDGE, 0.8, 0.8 + HOLD_EDGE] { + assert!(times.contains(&t), "{t} missing"); + } } #[test] From a2728fbf094d79ef92d164b2769228dc938487b2 Mon Sep 17 00:00:00 2001 From: vangel76 Date: Sat, 7 Nov 2026 15:29:46 +0100 Subject: [PATCH 039/451] Timeline waveform: draw what the mix plays for reversed layers and Backwards (#3238) A time-reversed layer (negative stretch) is silent in the audio mix, but the Timeline drew its waveform; with the Backwards audio effect the mix plays the layer's [in, out) span reversed, but the waveform was drawn forwards. The render crate now exposes the mix's rules as stretch_is_mixed and plays_backwards, and the mix uses them. The waveform uses the same rules, decided once per layer: only the baselines for a layer the mix leaves silent, and comp time mirrored over [in, out) under Backwards, as the mix maps it. Columns are limited to [in, out) so an edge column draws no audio past the out point. Fixes #3238 --- crates/render/src/audio.rs | 15 ++- crates/ui-egui/src/panels/waveform.rs | 177 ++++++++++++++++++++++++-- 2 files changed, 180 insertions(+), 12 deletions(-) diff --git a/crates/render/src/audio.rs b/crates/render/src/audio.rs index e2861340c..b715c5efe 100644 --- a/crates/render/src/audio.rs +++ b/crates/render/src/audio.rs @@ -66,6 +66,17 @@ fn generates(l: &Layer) -> bool { audio_effect_groups(l).any(|(id, _)| audio_fx::generates_audio(id)) } +/// Does the mix play the layer at its time stretch? Reversed layers (negative stretch) are +/// silent for now; the Timeline waveform shares this rule so it draws what is heard. +pub fn stretch_is_mixed(l: &Layer) -> bool { + l.stretch > 0.0 +} + +/// Does an enabled audio effect (Backwards) play the layer's [in, out) span reversed? +pub fn plays_backwards(l: &Layer) -> bool { + audio_effect_groups(l).any(|(id, _)| audio_fx::reverses(id)) +} + /// Does the layer contribute to the mix (Audio switch on and something to hear)? pub fn audible(project: &Project, l: &Layer) -> bool { l.switches.audio @@ -210,7 +221,7 @@ impl MixEnv<'_> { if fx.is_empty() { return self.layer_raw(l, i0, n, false); } - let reversed = fx.iter().any(|(id, _, _)| audio_fx::reverses(id)); + let reversed = plays_backwards(l); let pre_s: f64 = fx.iter().map(|(id, _, p)| audio_fx::preroll(id, p)).sum(); let pre = (pre_s * self.rate as f64).ceil() as usize; let b0 = i0 - pre as i64; @@ -291,7 +302,7 @@ fn mix_into(sources: &AudioSources<'_>, comp_id: ItemId, start: Tick, out: &mut let any_solo = comp.layers.iter().any(|l| l.switches.solo && audible(project, l)); let s0 = start.to_units_floor(rate as i64); for l in &comp.layers { - if !audible(project, l) || (any_solo && !l.switches.solo) || l.stretch <= 0.0 { + if !audible(project, l) || (any_solo && !l.switches.solo) || !stretch_is_mixed(l) { continue; } // Sample range of the block that falls inside the layer's [in, out). diff --git a/crates/ui-egui/src/panels/waveform.rs b/crates/ui-egui/src/panels/waveform.rs index 4e355f951..aa4c218e5 100644 --- a/crates/ui-egui/src/panels/waveform.rs +++ b/crates/ui-egui/src/panels/waveform.rs @@ -8,7 +8,7 @@ use std::collections::HashMap; use std::sync::{Arc, Mutex}; use effectcraft_engine::project::{ItemId, ItemKind, Layer, LayerSource, Project, Property}; -use effectcraft_engine::render::audio::db_to_gain; +use effectcraft_engine::render::audio::{self, db_to_gain}; use effectcraft_engine::time::Tick; use egui::{Color32, Painter, Rect, Stroke, pos2}; @@ -39,6 +39,39 @@ pub fn audio_item(project: &Project, l: &Layer) -> Option { } } +/// How the layer plays its audio, as far as its waveform goes: `None` when it is silent +/// (reversed, see [`audio::stretch_is_mixed`]), else whether the Backwards effect plays its +/// [in, out) span mirrored ([`audio::plays_backwards`]). The Audio switch and solo are not +/// followed: a muted layer still shows its waveform. +fn played(layer: &Layer) -> Option { + audio::stretch_is_mixed(layer).then(|| audio::plays_backwards(layer)) +} + +/// The summary bins under the Timeline column for comp times `ta .. tb` (seconds, limited to +/// the layer's [in, out) span), as the layer plays them: mirrored over that span when `mirror` +/// (see [`played`]), so the first column shows the last samples. +fn column_bins<'a>(layer: &Layer, s: &'a Summary, ta: f64, tb: f64, mirror: bool) -> Option<&'a [[f32; 4]]> { + let (i, o) = (layer.in_point.seconds(), layer.out_point.seconds()); + let (ta, tb) = (ta.max(i).min(o), tb.max(i).min(o)); + if tb <= ta { + return None; + } + let span = i + o; + let src = |t: f64| { + let t = if mirror { span - t } else { t }; + layer.layer_time(Tick::from_seconds_f64(t)).seconds() * s.bins_per_sec as f64 + }; + let (u, v) = (src(ta), src(tb)); + let n = s.peaks.len() as i64; + let ba = u.min(v).floor() as i64; + let bb = (u.max(v).ceil() as i64).max(ba.saturating_add(1)); + let (ba, bb) = (ba.clamp(0, n), bb.clamp(0, n)); + if ba >= bb { + return None; + } + s.peaks.get(ba as usize..bb as usize) +} + /// The summary for `item`, starting its computation on first request. pub fn summary(app: &EffectcraftApp, ctx: &egui::Context, item: ItemId) -> Option> { let mut m = app.waveforms.map.lock().ok()?; @@ -88,27 +121,23 @@ fn level_gains(levels: Option<&Property>, t: Tick) -> [f32; 2] { } /// Draw `layer`'s waveform in `rect` (left channel above right), columns mapped through the -/// timeline's time map and the layer's time mapping, limited to its [in, out) span. +/// timeline's time map and the layer's time mapping, limited to its [in, out) span and drawn as +/// the layer plays (see [`played`]): only the baselines for a silent layer. pub(crate) fn draw(p: &Painter, rect: Rect, tm: &TMap, layer: &Layer, s: &Summary, color: Color32) { let mid = [rect.min.y + rect.height() * 0.25, rect.min.y + rect.height() * 0.75]; let half = rect.height() * 0.25 - 1.0; let x0 = tm.x(layer.in_point.seconds()).max(rect.min.x).floor() as i32; let x1 = tm.x(layer.out_point.seconds()).min(rect.max.x).ceil() as i32; - let n = s.peaks.len() as i64; let levels = layer.props.sub("audio").and_then(|g| g.get("levels")); for c in 0..2 { p.line_segment([pos2(x0 as f32, mid[c]), pos2(x1 as f32, mid[c])], Stroke::new(1.0, color.gamma_multiply(0.5))); } + let Some(mirror) = played(layer) else { return }; for x in x0..x1 { let (ta, tb) = (tm.t(x as f32), tm.t(x as f32 + 1.0)); - let src = |t: f64| layer.layer_time(Tick::from_seconds_f64(t)).seconds() * s.bins_per_sec as f64; - let (ba, bb) = (src(ta).floor() as i64, src(tb).ceil() as i64); - let (ba, bb) = (ba.min(bb).clamp(0, n), ba.max(bb).max(ba + 1).clamp(0, n)); - if ba >= bb { - continue; - } + let Some(bins) = column_bins(layer, s, ta, tb, mirror) else { continue }; let mut agg = [0.0f32; 4]; - for b in &s.peaks[ba as usize..bb as usize] { + for b in bins { agg[0] = agg[0].min(b[0]); agg[1] = agg[1].max(b[1]); agg[2] = agg[2].min(b[2]); @@ -137,3 +166,131 @@ mod tests { assert_eq!(level_gains(None, Tick::ZERO), [1.0, 1.0]); } } + +#[cfg(test)] +mod played_tests { + use super::*; + use effectcraft_engine::color::Label; + use effectcraft_engine::project::{Comp, Footage, FootageKind, GroupKind, build}; + use effectcraft_engine::render::audio::{footage_peaks, mix_comp}; + use effectcraft_engine::render::{FootageSource, Image}; + use effectcraft_engine::time::FrameRate; + + /// Footage audio equal to its source time (seconds) on both channels over [0, 2) s. + struct Ramp; + impl FootageSource for Ramp { + fn frame(&self, _: ItemId, _: &Footage, _: Tick) -> Option> { + None + } + fn audio(&self, _: ItemId, _: &Footage, start: Tick, frames: usize, rate: u32) -> Option> { + let t0 = start.seconds(); + Some( + (0..frames) + .flat_map(|k| { + let t = t0 + k as f64 / rate as f64; + let v = if (0.0..2.0).contains(&t) { t as f32 } else { 0.0 }; + [v, v] + }) + .collect(), + ) + } + } + + /// A project with a 2 s ramp clip and a comp holding one layer of it (start and in 0 s, + /// out 1 s) changed by `edit`, and the clip's peak summary. + fn setup(edit: &dyn Fn(&mut Layer)) -> (Project, ItemId, Layer, Summary) { + let mut p = Project::default(); + let f = Footage { + path: "ramp.wav".into(), + kind: FootageKind::Audio, + has_audio: true, + frame_rate: FrameRate::new(25, 1), + duration: Tick::from_seconds_f64(2.0), + ..Default::default() + }; + let fid = p.add_item("ramp.wav", Label::SeaFoam, None, ItemKind::Footage(f.clone())); + let mut comp = Comp::new(64, 64, FrameRate::new(25, 1), Tick::from_seconds_f64(2.0)); + let mut l = build::layer(&mut p, &comp, "a", LayerSource::Footage { item: fid }, (0, 0), None); + (l.start_time, l.in_point, l.out_point) = (Tick::ZERO, Tick::ZERO, Tick::from_seconds_f64(1.0)); + edit(&mut l); + comp.layers = vec![l.clone()].into(); + let cid = p.add_item("C", Label::Sandstone, None, ItemKind::Comp(comp.into())); + let peaks = footage_peaks(&Ramp, fid, &f, f.duration, BINS_PER_SEC); + (p, cid, l, Summary { bins_per_sec: BINS_PER_SEC, peaks }) + } + + fn add_backwards(l: &mut Layer, enabled: bool) { + let mut n = 1_000_000; + let mut g = build::Ids(&mut n).group("backwards", "Backwards"); + g.kind = GroupKind::Effect { effect: "ec.audio.backwards".into() }; + g.enabled = enabled; + l.props.group_mut("effects").expect("effects group").children.push(g.into()); + } + + /// The loudest left-channel peak drawn in the column for comp times `ta .. tb`. + fn drawn(l: &Layer, s: &Summary, ta: f64, tb: f64) -> Option { + played(l).and_then(|mirror| column_bins(l, s, ta, tb, mirror)).map(|bins| bins.iter().fold(f32::MIN, |m, b| m.max(b[1]))) + } + + /// The left-channel sample the mix plays at comp time `t`. + fn heard(p: &Project, cid: ItemId, t: f64) -> f32 { + mix_comp(p, &Ramp, None, cid, Tick::from_seconds_f64(t), 1, 8000).first().copied().unwrap_or(f32::NAN) + } + + /// #3238: a time-reversed layer (Time-Reverse Layer: stretch -100 %, start time at its out + /// point) is silent in the mix, so the Timeline draws no waveform columns for it. + #[test] + fn a_reversed_layer_draws_no_waveform_as_the_mix_is_silent() { + let (p, cid, l, s) = setup(&|l| { + l.stretch = -100.0; + l.start_time = Tick::from_seconds_f64(1.0); + }); + for k in 0..200 { + let (ta, tb) = (k as f64 / 200.0, (k + 1) as f64 / 200.0); + assert_eq!(drawn(&l, &s, ta, tb), None, "column at {ta} s"); + } + for t in [0.1, 0.5, 0.9] { + assert_eq!(heard(&p, cid, t), 0.0, "the mix plays the reversed layer at {t} s"); + } + } + + /// #3238: with the Backwards audio effect the first column shows the clip's last samples + /// and the last column its first, matching what the mix plays there. + #[test] + fn backwards_draws_the_waveform_mirrored_as_the_mix_plays_it() { + let (p, cid, l, s) = setup(&|l| add_backwards(l, true)); + let first = drawn(&l, &s, 0.0, 0.005).expect("first column"); + let h = heard(&p, cid, 0.0); + assert!(first > 0.98, "first column draws {first}, not the clip's last samples"); + assert!((first - h).abs() < 0.01, "first column {first}, heard {h}"); + let last = drawn(&l, &s, 0.995, 1.0).expect("last column"); + let h = heard(&p, cid, 0.995); + assert!(last < 0.02, "last column draws {last}, not the clip's first samples"); + assert!((last - h).abs() < 0.01, "last column {last}, heard {h}"); + } + + /// No Backwards effect, a disabled one, or the layer's Effects switch off: the mix plays + /// forwards, and so the waveform is drawn. + #[test] + fn without_an_active_backwards_effect_the_waveform_runs_forwards() { + let edits: [(&str, &dyn Fn(&mut Layer)); 3] = [ + ("no effect", &|_| {}), + ("effect disabled", &|l| add_backwards(l, false)), + ("effects switch off", &|l| { + add_backwards(l, true); + l.switches.effects = false; + }), + ]; + for (name, edit) in edits { + let (p, cid, l, s) = setup(edit); + let first = drawn(&l, &s, 0.0, 0.005).expect("first column"); + let h = heard(&p, cid, 0.004); + assert!(first < 0.02, "{name}: first column draws {first}"); + assert!((first - h).abs() < 0.01, "{name}: first column {first}, heard {h}"); + // A column reaching past the out point draws only up to it. + let edge = drawn(&l, &s, 0.998, 1.003).expect("edge column"); + assert!(edge < 1.001, "{name}: the edge column draws {edge}, past the out point"); + assert_eq!(drawn(&l, &s, 1.0, 1.005), None, "{name}: a column after the out point"); + } + } +} From 2d547200c02dc612ce6b125f3ea395430bdb55f7 Mon Sep 17 00:00:00 2001 From: vangel76 Date: Sat, 7 Nov 2026 16:13:20 +0100 Subject: [PATCH 040/451] Effect Controls: Alt-click on a stopwatch adds an expression and edits it in the Timeline Refs #1460. As in After Effects, Alt-click (Option-click) on a stopwatch in Effect Controls adds an expression (it toggled keyframing instead) and Alt-click again removes it. Effect Controls has no expression field, so the property is revealed in the Timeline (the same reveal as a double-click on its name, #1497) and the new expression's editor takes the keyboard with the expression selected. The Timeline's stopwatch and Effect Controls share one helper for that focus request (expression_toggled). The editor takes a request from the pass after the one it was made in: drawn in the same pass as the Alt-click in another panel, its text field gave the keyboard straight back as a click elsewhere. --- .../src/panels/effect_controls/rows.rs | 30 +++++++++--- crates/ui-egui/src/panels/timeline.rs | 33 +++++++++---- crates/ui-egui/tests/it/ui_inline_edit.rs | 48 +++++++++++++++++++ 3 files changed, 94 insertions(+), 17 deletions(-) diff --git a/crates/ui-egui/src/panels/effect_controls/rows.rs b/crates/ui-egui/src/panels/effect_controls/rows.rs index c14630af4..e7f1bfee5 100644 --- a/crates/ui-egui/src/panels/effect_controls/rows.rs +++ b/crates/ui-egui/src/panels/effect_controls/rows.rs @@ -128,6 +128,18 @@ impl PropCx<'_> { } } +/// Shows property `uid` of layer `layer` in the Timeline: its layer and groups twirled open, the +/// property scrolled to and the Timeline brought forward (After Effects' Reveal in Timeline, +/// which a double-click on the property's name does; #1497). +fn reveal_in_timeline(app: &mut EffectcraftApp, ctx: &egui::Context, layer: u64, uid: u64) { + app.ui.timeline.search.clear(); + app.ui.timeline.scroll_to = Some(crate::state::ScrollTo::Property(uid)); + if let Err(e) = crate::menus::frontend(app, ctx, "timeline.revealProps", json!({"props": [{"layer": layer, "prop": uid}]})) { + app.ui.status = e; + } + app.show_panel(crate::dock::PanelKind::Timeline); +} + /// One property row: stopwatch, name, value control (and the keyframe navigator). Returns the /// value fields of a vector, one per dimension, for the pick whip. #[allow(clippy::too_many_arguments)] @@ -167,7 +179,16 @@ fn prop_row( }, ); app.auto.add(&format!("effectControls.prop.{uid}.stopwatch"), swr, &prop.name); - if resp.clicked() { + if resp.clicked() && ui.input(|i| i.modifiers.alt) { + // Alt+click adds an expression (or removes it), as in the Timeline. Effect Controls + // has no expression field: the property shows in the Timeline with its new + // expression's editor taking the keyboard, as After Effects does (#1460). + actions.push(("prop.setExpression".into(), json!({"layer": layer.id.0, "prop": uid}))); + if prop.expr.is_none() { + reveal_in_timeline(app, ui.ctx(), layer.id.0, uid); + } + crate::panels::timeline::expression_toggled(app, ui.ctx(), prop); + } else if resp.clicked() { actions.push(("prop.toggleAnimation".into(), json!({"layer": layer.id.0, "prop": uid, "selected": true}))); } } @@ -201,12 +222,7 @@ fn prop_row( p.with_clip_rect(name_clip.intersect(p.clip_rect())).text(pos2(swr.max.x + 6.0, cy), Align2::LEFT_CENTER, &prop.name, Tokens::ui(12.0), t.text); let name_response = ui.interact(name_clip, egui::Id::unique(("ec-prop-name", uid)), Sense::click()); if name_response.double_clicked() { - app.ui.timeline.search.clear(); - app.ui.timeline.scroll_to = Some(crate::state::ScrollTo::Property(uid)); - if let Err(e) = crate::menus::frontend(app, ui.ctx(), "timeline.revealProps", json!({"props": [{"layer": layer.id.0, "prop": uid}]})) { - app.ui.status = e; - } - app.show_panel(crate::dock::PanelKind::Timeline); + reveal_in_timeline(app, ui.ctx(), layer.id.0, uid); } app.auto.add(&format!("effectControls.prop.{uid}.name"), name_clip, &prop.name); // With several layers selected the edit applies to the same effect property of each (#491). diff --git a/crates/ui-egui/src/panels/timeline.rs b/crates/ui-egui/src/panels/timeline.rs index 038dcc9b9..e7f8311c0 100644 --- a/crates/ui-egui/src/panels/timeline.rs +++ b/crates/ui-egui/src/panels/timeline.rs @@ -323,9 +323,27 @@ fn expr_focus_id() -> egui::Id { egui::Id::unique("tl-expr-focus") } +/// Asks the expression editor of property `prop` to take the keyboard when the Timeline next +/// draws it, selecting `select` (counts of characters before the end). fn focus_expression(ctx: &egui::Context, prop: u64, select: [usize; 2]) { let pass = ctx.cumulative_pass_nr(); ctx.data_mut(|d| d.insert_temp(expr_focus_id(), ExprFocus { prop, select, pass })); + // The editor takes it in a later pass: make sure one comes without waiting for input. + ctx.request_repaint(); +} + +/// After a `prop.setExpression` toggle of `prop` was queued (an Alt-click on its stopwatch, in the +/// Timeline or in Effect Controls): adding one, its editor opens, comes into view and takes the +/// keyboard with the new expression selected (#1072, #1460); removing it, a pending request for +/// its editor goes, as nothing is left to take the keyboard. +pub(crate) fn expression_toggled(app: &mut EffectcraftApp, ctx: &egui::Context, prop: &Property) { + let uid = prop.uid; + if prop.expr.is_none() { + app.ui.timeline.expr_closed.remove(&uid); + focus_expression(ctx, uid, [usize::MAX, 0]); + } else if ctx.data(|d| d.get_temp::(expr_focus_id())).is_some_and(|f| f.prop == uid) { + ctx.data_mut(|d| d.remove::(expr_focus_id())); + } } #[derive(Clone, Debug)] @@ -3927,7 +3945,10 @@ fn expr_editor_cell(app: &mut EffectcraftApp, ui: &mut egui::Ui, g: &mut Rw, rc: gp.rect_filled(Rect::from_min_max(pos2(graph_x0, r.min.y), r.max), 0.0, t.expr_bg); let er = Rect::from_min_max(pos2(graph_x0 + 8.0, r.min.y + 3.0), pos2(rect.max.x - 14.0, r.max.y - 3.0)); let mut buf: String = ctx.data(|d| d.get_temp(buf_id)).unwrap_or_else(|| ex.text.clone()); - if let Some(f) = ctx.data(|d| d.get_temp::(expr_focus_id())).filter(|f| f.prop == *uid) { + // Not in the pass it was asked for in: a click that asked for it from another panel (an + // Alt-click on a stopwatch in Effect Controls, drawn before the Timeline) would take the + // keyboard straight back as a click elsewhere (#1460). + if let Some(f) = ctx.data(|d| d.get_temp::(expr_focus_id())).filter(|f| f.prop == *uid && ctx.cumulative_pass_nr() > f.pass) { // Asked for once (a pick whip put a reference in, or an Alt-click added the // expression): editing starts in the expression as it is now. ctx.data_mut(|d| d.remove::(expr_focus_id())); @@ -4079,15 +4100,7 @@ fn prop_stopwatch(app: &mut EffectcraftApp, ui: &mut egui::Ui, g: &mut Rw, rc: & if ui.input(|i| i.modifiers.alt) { if resp.clicked() { actions.push(("prop.setExpression".into(), json!({"layer": layer.id.0, "prop": uid}))); - if prop.expr.is_none() { - // Adding one: its editor opens, comes into view and takes the - // keyboard with the new expression selected (#1072). - app.ui.timeline.expr_closed.remove(uid); - focus_expression(&ctx, *uid, [usize::MAX, 0]); - } else if ctx.data(|d| d.get_temp::(expr_focus_id())).is_some_and(|f| f.prop == *uid) { - // Removing it: nothing is left to take the keyboard. - ctx.data_mut(|d| d.remove::(expr_focus_id())); - } + expression_toggled(app, &ctx, prop); } } else if let Some((value, merge)) = switch_gesture(ui, &resp, r, "stopwatch", prop.is_animated()) { actions.push(("prop.toggleAnimation".into(), json!({"layer": layer.id.0, "prop": uid, "value": value, "merge": merge}))); diff --git a/crates/ui-egui/tests/it/ui_inline_edit.rs b/crates/ui-egui/tests/it/ui_inline_edit.rs index 6c29045bb..8271e2f9e 100644 --- a/crates/ui-egui/tests/it/ui_inline_edit.rs +++ b/crates/ui-egui/tests/it/ui_inline_edit.rs @@ -634,6 +634,54 @@ fn an_expression_added_at_the_bottom_of_the_timeline_comes_into_view() { assert_eq!(expression(&h, layer, opacity).as_deref(), Some("25")); } +/// #1460: Alt-clicking an effect property's stopwatch in Effect Controls adds an expression, as in +/// the Timeline (it toggled the animation instead). Effect Controls has no expression field, so, +/// as in After Effects, the property shows in the Timeline (its layer and effect twirled open, +/// scrolled into view) with the new expression's editor taking the keyboard: typing replaces +/// it. Another Alt-click removes it and leaves nothing holding the keyboard. +#[test] +fn alt_clicking_a_stopwatch_in_effect_controls_edits_the_expression_in_the_timeline() { + let (mut h, _) = harness(); + let (layer, slider) = { + let s = &mut h.state_mut().session; + let l = s.execute("layer.newSolid", json!({"name": "Plate", "color": "#406080"})).unwrap()["layer"].as_u64().unwrap(); + s.execute("effect.apply", json!({"layers": [l], "effect": "Slider Control"})).unwrap(); + // Layers above push it below the bottom of the Timeline. + for i in 0..40 { + s.execute("layer.newSolid", json!({"name": format!("Layer {i}"), "color": "#204060"})).unwrap(); + } + s.execute("layer.select", json!({"layers": [l]})).unwrap(); + let slider = s.active_comp().unwrap().layer(effectcraft_engine::project::LayerId(l)).unwrap().props.prop("effects/#1/slider").unwrap().uid; + (l, slider) + }; + h.state_mut().show_panel(effectcraft_ui_egui::dock::PanelKind::EffectControls); + h.run_steps(3); + let editor = format!("timeline.prop.{slider}.expression"); + assert!(h.state().auto.find(&format!("timeline.prop.{slider}.row")).is_none(), "the property is not in the Timeline yet"); + let alt = Modifiers { alt: true, ..Modifiers::NONE }; + let at = center(&h, &format!("effectControls.prop.{slider}.stopwatch")); + click_with(&mut h, at, alt); + assert!(expression(&h, layer, slider).is_some(), "an expression was added"); + let key = h.state().session.active_comp().unwrap().layer(effectcraft_engine::project::LayerId(layer)).unwrap().props.find(slider).unwrap().is_animated(); + assert!(!key, "Alt-click doesn't turn on keyframing"); + assert!(h.state().ui.timeline.reveal_props.contains(&slider), "the property is revealed in the Timeline"); + let rows = h.state().auto.find("timeline.scroll").expect("the Timeline is shown").rect; + let e = h.state().auto.find(&editor).expect("the Timeline draws the expression editor").rect; + assert!(e[1] >= rows[1] - 0.5 && e[1] + e[3] <= rows[1] + rows[3] + 0.5, "the editor is in view: {e:?} in {rows:?}"); + type_text(&mut h, "42"); + commit_expression(&mut h); + assert_eq!(expression(&h, layer, slider).as_deref(), Some("42"), "typing replaced the new expression"); + // Alt-click again removes the expression and its editor with it (the keyboard stays free; + // the editor's focus request was taken when it was added, so this doesn't exercise the + // cancel path). + let at = center(&h, &format!("effectControls.prop.{slider}.stopwatch")); + click_with(&mut h, at, alt); + h.run_steps(5); + assert_eq!(expression(&h, layer, slider), None); + assert!(h.state().auto.find(&editor).is_none(), "the expression editor is gone"); + assert!(!h.ctx.egui_wants_keyboard_input(), "nothing has the keyboard"); +} + /// A primary-button drag from `from` to `to` with `modifiers` held from the press to the release. fn drag_with(h: &mut Harness<'_, EffectcraftApp>, from: Pos2, to: Pos2, modifiers: Modifiers) { h.input_mut().events.push(Event::PointerMoved(from)); From 932326ced681040605017ee064fdbef0d4805fe1 Mon Sep 17 00:00:00 2001 From: vangel76 Date: Sat, 7 Nov 2026 19:50:44 +0100 Subject: [PATCH 041/451] Doc comments for the functions this PR touches --- crates/ui-egui/src/panels/viewer.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/ui-egui/src/panels/viewer.rs b/crates/ui-egui/src/panels/viewer.rs index f17d11795..cc3666d6a 100644 --- a/crates/ui-egui/src/panels/viewer.rs +++ b/crates/ui-egui/src/panels/viewer.rs @@ -1130,6 +1130,7 @@ fn led_by_a_moved_ancestor(comp: &Comp, layers: &[MoveLayer]) -> Vec { layers.iter().map(|l| led(l.0)).collect() } +/// Starts the viewer drag gesture for the active tool from the press point, picking the layer, vertex or handle under it. fn phase_dragstart(app: &mut EffectcraftApp, ui: &mut egui::Ui, ectx: &EvalCtx, resp: &egui::Response, v: &mut Vw<'_>) { let comp_rect = v.comp_rect; let zoom = v.zoom; From 8a479a4922dc246462556bce030aa669a052a3ef Mon Sep 17 00:00:00 2001 From: vangel76 Date: Sat, 7 Nov 2026 19:52:49 +0100 Subject: [PATCH 042/451] Doc comments for the functions this PR touches --- apps/effectcraft-web/src/store.rs | 1 + crates/automation/src/confine.rs | 14 ++++++++++++++ crates/engine/src/background/remote.rs | 1 + crates/engine/src/cmd/path_nulls.rs | 2 ++ crates/engine/src/cmd/prop.rs | 2 ++ crates/engine/src/cmd/rig3d.rs | 1 + crates/engine/src/cmd/three_d.rs | 1 + crates/expr/src/host.rs | 1 + crates/expr/src/sample.rs | 2 ++ crates/media/src/pool.rs | 4 ++++ crates/media/src/reads.rs | 3 +++ crates/media/src/stream.rs | 2 ++ crates/project/src/reach.rs | 2 ++ crates/render/src/cache.rs | 8 ++++++++ crates/render/src/disk_cache.rs | 9 +++++++++ crates/render/src/disk_cache/entry_files.rs | 11 +++++++++++ crates/render/src/eval.rs | 1 + crates/render/src/footage.rs | 2 ++ crates/render/src/fx_host.rs | 1 + crates/render/src/pipeline.rs | 4 ++++ crates/render/src/reads.rs | 7 +++++++ crates/render/src/three_d/adv/scene.rs | 3 +++ crates/text/src/fonts.rs | 2 ++ crates/ui-egui/src/frames.rs | 9 +++++++++ crates/ui-egui/src/panels/viewer.rs | 1 + crates/ui-egui/src/panels/viewer/shapes.rs | 1 + 26 files changed, 95 insertions(+) diff --git a/apps/effectcraft-web/src/store.rs b/apps/effectcraft-web/src/store.rs index abda69a77..a4947600b 100644 --- a/apps/effectcraft-web/src/store.rs +++ b/apps/effectcraft-web/src/store.rs @@ -189,6 +189,7 @@ pub struct Store { } impl Default for Store { + /// An empty store with no mirror contents, change callback or clock. fn default() -> Self { Self { mirror: Mutex::default(), on_change: OnceLock::new(), clock: OnceLock::new() } } diff --git a/crates/automation/src/confine.rs b/crates/automation/src/confine.rs index 55fa8043c..570726932 100644 --- a/crates/automation/src/confine.rs +++ b/crates/automation/src/confine.rs @@ -363,32 +363,41 @@ thread_local! { static REFUSED_READS: std::cell::Cell = const { std::cell::Cell::new(0) }; } +/// The number of reads this thread has refused for lying outside the allowed roots. fn refused_reads() -> u64 { REFUSED_READS.try_with(std::cell::Cell::get).unwrap_or(0) } impl FootageSource for ConfinedFootage { + /// The frame from the inner source, or `None` when the footage lies outside the allowed roots. fn frame(&self, item: ItemId, footage: &Footage, t: Tick) -> Option> { self.readable(footage).then(|| self.inner.frame(item, footage, t)).flatten() } + /// The frame scaled to `width` by `height`, or `None` when the footage lies outside the allowed roots. fn frame_at_size(&self, item: ItemId, footage: &Footage, t: Tick, width: u32, height: u32) -> Option> { self.readable(footage).then(|| self.inner.frame_at_size(item, footage, t, width, height)).flatten() } + /// The frame with an explicit size and float curve, or `None` when the footage lies outside the allowed roots. fn frame_with(&self, item: ItemId, footage: &Footage, t: Tick, size: Option<(u32, u32)>, float: FloatCurve) -> Option> { self.readable(footage).then(|| self.inner.frame_with(item, footage, t, size, float)).flatten() } + /// The footage audio from the inner source, or `None` when the footage lies outside the allowed roots. fn audio(&self, item: ItemId, footage: &Footage, t: Tick, frames: usize, rate: u32) -> Option> { self.readable(footage).then(|| self.inner.audio(item, footage, t, frames, rate)).flatten() } + /// The auxiliary channels of the footage frame, or `None` when the footage lies outside the allowed roots. fn aux(&self, item: ItemId, footage: &Footage, t: Tick) -> Option> { self.readable(footage).then(|| self.inner.aux(item, footage, t)).flatten() } + /// Forwards the auxiliary footage paths to the inner source. fn set_aux_footage(&self, paths: &[String]) { self.inner.set_aux_footage(paths) } + /// The 3D model for the footage, or `None` when the footage lies outside the allowed roots. fn model(&self, item: ItemId, footage: &Footage) -> Option> { self.readable(footage).then(|| self.inner.model(item, footage)).flatten() } + /// The rasterised vector footage at `scale`, or `None` when the footage lies outside the allowed roots. fn vector_frame(&self, item: ItemId, footage: &Footage, scale: f64) -> Option> { self.readable(footage).then(|| self.inner.vector_frame(item, footage, scale)).flatten() } @@ -411,12 +420,15 @@ impl FootageSource for ConfinedFootage { fn set_conform_folder(&self, folder: Option) { self.inner.set_conform_folder(folder) } + /// The inner source's cache budget. fn cache_budget(&self) -> Option { self.inner.cache_budget() } + /// Runs `f` under the inner source's cancel flag. fn cancellable(&self, cancel: &Arc, f: &mut dyn FnMut()) { self.inner.cancellable(cancel, f) } + /// Whether the inner source has been called off. fn called_off(&self) -> bool { self.inner.called_off() } @@ -632,10 +644,12 @@ mod tests { /// Reads every file, noting it. struct Noting; impl FootageSource for Noting { + /// Returns a 1x1 frame and notes the footage path it was asked for. fn frame(&self, _: ItemId, f: &Footage, _: Tick) -> Option> { NOTED.with(|n| n.borrow_mut().push(f.path.clone())); Some(Arc::new(Image::new(1, 1))) } + /// Runs `f`, then reports every path noted meanwhile to `reads` as a file with a missing stamp. fn recording(&self, reads: &ReadLog, f: &mut dyn FnMut()) { f(); for p in NOTED.with(|n| std::mem::take(&mut *n.borrow_mut())) { diff --git a/crates/engine/src/background/remote.rs b/crates/engine/src/background/remote.rs index 153bb324b..aea210ec5 100644 --- a/crates/engine/src/background/remote.rs +++ b/crates/engine/src/background/remote.rs @@ -289,6 +289,7 @@ struct Pending { pub const MAX_PASSES: u32 = 24; impl FrameServer { + /// A frame server over `footage` and the optional expression host, with an empty layer cache. pub fn new(footage: Arc, expr: Option>) -> FrameServer { FrameServer { footage, diff --git a/crates/engine/src/cmd/path_nulls.rs b/crates/engine/src/cmd/path_nulls.rs index a6b51c763..6da43afde 100644 --- a/crates/engine/src/cmd/path_nulls.rs +++ b/crates/engine/src/cmd/path_nulls.rs @@ -73,6 +73,8 @@ struct PathInfo { span: (f64, f64), } +/// Reads a mask or shape path at the current time and returns its comp-space vertices, value, expression reference and layer name. +/// Errors when the property is missing, is not a path or has no vertices. fn info(s: &Session, cid: ItemId, lid: LayerId, uid: Uid, cmd: &str) -> Result { let comp = s.project.comp(cid).ok_or(EngineError::NoComp)?; let layer = comp.layer(lid).ok_or(EngineError::NoComp)?; diff --git a/crates/engine/src/cmd/prop.rs b/crates/engine/src/cmd/prop.rs index 70d123957..b23e73575 100644 --- a/crates/engine/src/cmd/prop.rs +++ b/crates/engine/src/cmd/prop.rs @@ -1380,6 +1380,8 @@ fn convert_expr_to_keys(s: &mut Session, p: &Value) -> Result { convert_one_expr(s, cid, lid, uid) } +/// Replaces the expression on one property with keyframes sampled from its evaluated values. +/// Returns the number of properties converted. fn convert_one_expr(s: &mut Session, cid: ItemId, lid: LayerId, uid: Uid) -> Result { let comp = s.project.comp(cid).ok_or(EngineError::NoComp)?.clone(); let layer = comp.layer(lid).ok_or(EngineError::NoComp)?.clone(); diff --git a/crates/engine/src/cmd/rig3d.rs b/crates/engine/src/cmd/rig3d.rs index e7852fbd2..58a4281a8 100644 --- a/crates/engine/src/cmd/rig3d.rs +++ b/crates/engine/src/cmd/rig3d.rs @@ -47,6 +47,7 @@ impl Env { fn of(s: &Session, cid: ItemId) -> Env { Env { time: s.time_of(cid), expr: s.expr.clone(), footage: s.footage.clone() } } + /// The evaluation context of `comp` in `proj` at the session's current time. fn ctx<'a>(&'a self, proj: &'a Project, cid: ItemId, comp: &'a Comp) -> EvalCtx<'a> { EvalCtx { project: proj, diff --git a/crates/engine/src/cmd/three_d.rs b/crates/engine/src/cmd/three_d.rs index de6bc4d7a..58d5d3bc2 100644 --- a/crates/engine/src/cmd/three_d.rs +++ b/crates/engine/src/cmd/three_d.rs @@ -418,6 +418,7 @@ fn set_view_camera(s: &mut Session, p: &Value) -> Result { Ok(json!({"view": v.id()})) } +/// Returns the active comp's 3D view state, with the comp size, for the 3D view commands. fn get_3d(s: &mut Session, p: &Value) -> Result { let cid = comp_id(s, p)?; let comp = s.project.comp(cid).ok_or(EngineError::NoComp)?; diff --git a/crates/expr/src/host.rs b/crates/expr/src/host.rs index b0abcaafa..43400ea1d 100644 --- a/crates/expr/src/host.rs +++ b/crates/expr/src/host.rs @@ -297,6 +297,7 @@ impl<'a> Resolver<'a> { } self.comp(c)?.layer(LayerId(l)) } + /// The evaluation context for comp `c` at time `t` seconds, or `None` when the comp does not exist. fn ctx_at(&self, c: u64, t: f64) -> Option> { let comp = self.comp(c)?; let same_comp = c == self.ctx.comp_id.0; diff --git a/crates/expr/src/sample.rs b/crates/expr/src/sample.rs index e097691de..38f617289 100644 --- a/crates/expr/src/sample.rs +++ b/crates/expr/src/sample.rs @@ -46,6 +46,8 @@ fn fingerprint(layer: &Layer) -> u64 { h.finish() } +/// Renders `layer` of `comp` at time `t` for an expression sample, before or after effects as `post` says. +/// Returns `None` once the nesting depth limit is reached. fn render(ctx: EvalCtx, comp: ItemId, layer: &Layer, post: bool, t: f64) -> Option { let depth = DEPTH.with(|d| *d.borrow()); if depth >= MAX_DEPTH { diff --git a/crates/media/src/pool.rs b/crates/media/src/pool.rs index 4b7b05603..ab4a47568 100644 --- a/crates/media/src/pool.rs +++ b/crates/media/src/pool.rs @@ -110,6 +110,7 @@ struct Lru { } impl Lru { + /// The cached image and its read files for `k`, marking the entry as most recently used. fn get(&mut self, k: &Key) -> Option<(Arc, Arc)> { let e = self.map.get_mut(k)?; self.order.remove(&e.stamp); @@ -118,6 +119,7 @@ impl Lru { self.order.insert(e.stamp, k.clone()); Some((e.img.clone(), e.files.clone())) } + /// Stores an image with its read files under `k` and evicts the least recently used entries until the cache fits `budget` bytes. fn insert(&mut self, k: Key, img: Arc, files: Arc, budget: usize) { let bytes = img.data.len() * std::mem::size_of::() + 64; self.clock += 1; @@ -905,6 +907,8 @@ impl Inner { } } + /// Decodes the still image at `loc` and applies the footage alpha and float handling. + /// A placeholder path decodes to colour bars. fn decode_still(&self, loc: &Loc, footage: &Footage) -> Result { let op = AlphaOp::of(footage, loc.float); let path = &loc.key.path; diff --git a/crates/media/src/reads.rs b/crates/media/src/reads.rs index 29b2fafac..43ea209b8 100644 --- a/crates/media/src/reads.rs +++ b/crates/media/src/reads.rs @@ -64,6 +64,8 @@ enum Out<'a> { } impl Scope<'_> { + /// Starts collecting the files read on this thread into `out`. + /// At the nesting limit the scope stays closed and reports an incomplete list. fn open(out: Out<'_>) -> Scope<'_> { let opened = SCOPES .try_with(|s| match s.try_borrow_mut() { @@ -79,6 +81,7 @@ impl Scope<'_> { } impl Drop for Scope<'_> { + /// Ends the scope and hands the collected files to its output, marked incomplete when the scope could not be opened. fn drop(&mut self) { let files = if self.opened { SCOPES.try_with(|s| s.try_borrow_mut().ok().and_then(|mut s| s.pop())).ok().flatten() } else { None }; // A scope that could not open saw nothing: what it made can't name its files. diff --git a/crates/media/src/stream.rs b/crates/media/src/stream.rs index 99b1cb774..0155b4acd 100644 --- a/crates/media/src/stream.rs +++ b/crates/media/src/stream.rs @@ -26,6 +26,7 @@ pub(crate) struct FileReader { #[cfg(any(unix, windows))] impl FileReader { + /// Opens `path` for reading and records its length and modification time. pub(crate) fn open(path: &Path) -> std::io::Result { #[cfg(test)] crate::count_open(path); @@ -87,6 +88,7 @@ pub(crate) fn open_source(path: &Path) -> Option<(Result, FileStam Some((opened.map_err(Into::into), stamp)) } +/// Without a native file system there is no in-place source: always `None`. #[cfg(not(any(unix, windows)))] pub(crate) fn open_source(_path: &Path) -> Option<(Result, FileStamp)> { None diff --git a/crates/project/src/reach.rs b/crates/project/src/reach.rs index dd510f9db..4cfde8385 100644 --- a/crates/project/src/reach.rs +++ b/crates/project/src/reach.rs @@ -197,6 +197,8 @@ pub fn expression_reach(text: &str) -> ExprReach { expression_names(text).map_or(ExprReach::Anything, |(comps, footage)| ExprReach::Names { comps, footage }) } +/// The comp names and footage names an expression references by literal name. +/// Returns `None` when it can reach anything by a computed name or cannot be tokenised. fn expression_names(text: &str) -> Option<(Vec, Vec)> { let toks = tokens(text)?; let (mut comps, mut footage) = (Vec::new(), Vec::new()); diff --git a/crates/render/src/cache.rs b/crates/render/src/cache.rs index 692a80576..a1bd85290 100644 --- a/crates/render/src/cache.rs +++ b/crates/render/src/cache.rs @@ -117,6 +117,7 @@ impl LayerCache { } } + /// The attached disk cache, if any. pub fn disk(&self) -> Option> { self.disk.lock().ok()?.clone() } @@ -137,6 +138,7 @@ impl LayerCache { } } + /// The attached virtual-file identity lookup, if any. fn virtual_id(&self) -> Option { self.virtual_id.lock().ok()?.clone() } @@ -329,6 +331,7 @@ struct Fetched { used: u64, } +/// The memory a buffer's pixels take, in bytes. fn buf_bytes(b: &Buf) -> usize { b.img.data.len().saturating_mul(std::mem::size_of::()) } @@ -346,12 +349,14 @@ struct Prefetched { } impl Prefetched { + /// Records a missed key for prefetching, up to a fixed bound. fn note_miss(&mut self, key: u128) { if !self.misses.contains(&key) && self.misses.len() < 1024 { self.misses.push(key); } } + /// Drops the prefetched entry for `key` and frees its bytes. fn remove(&mut self, key: u128) { if let Some(f) = self.ready.remove(&key) { self.bytes = self.bytes.saturating_sub(buf_bytes(&f.buf)); @@ -425,6 +430,7 @@ impl PrefetchStore { } impl LayerStore for PrefetchStore { + /// The prefetched layer for `key` with its read files, or `None` when it is not ready. fn get_layer(&self, key: u128, virtual_id: Option>) -> Option<(Arc, ReadFiles)> { let found = { let mut s = self.st.lock().ok()?; @@ -459,6 +465,7 @@ impl LayerStore for PrefetchStore { Some((buf, files.to_read_files())) } + /// Queues the layer for writing to the persistent store the first time `key` is seen. fn put_layer(&self, key: u128, buf: &Buf, files: &EntryFiles, _since: u64) { let Ok(mut s) = self.st.lock() else { return }; if s.known.insert(key) { @@ -810,6 +817,7 @@ fn key_any(ctx: &EvalCtx, layer: &Layer, scale: f64, draft: bool, blur: bool, fo /// Set Matte…)? Those layers are drawn by the reading layer's renderer, so the switches it /// passes down belong in the key (`Renderer::nested_look`). pub(crate) fn reads_layers(ctx: &EvalCtx, layer: &Layer) -> bool { + /// Whether any enabled layer-valued property of `layer` points at another layer. fn reads(ctx: &EvalCtx, layer: &Layer, g: &PropGroup, depth: usize) -> bool { depth < 32 && g.children.iter().any(|n| match n { diff --git a/crates/render/src/disk_cache.rs b/crates/render/src/disk_cache.rs index 67fbc4a7c..c334c2011 100644 --- a/crates/render/src/disk_cache.rs +++ b/crates/render/src/disk_cache.rs @@ -300,6 +300,7 @@ struct Drops { } impl Drops { + /// Notes that the given paths were dropped, bumping the generation and tracking them for later checks. fn record(&mut self, paths: &[Arc]) { self.generation = self.generation.saturating_add(1); if self.last.len().saturating_add(paths.len()) > MAX_DROPPED_PATHS { @@ -320,6 +321,7 @@ impl Drops { } impl Queue { + /// Takes the next queued job, frames first, and releases the bytes it held. #[cfg(not(target_arch = "wasm32"))] fn pop(&mut self) -> Option { if let Some(j) = self.frames.pop_front() { @@ -1081,6 +1083,7 @@ fn with_files(files: &EntryFiles, pixels: Vec) -> Vec { out } +/// The writer thread: evicts to the limit at open, then drains the job queue until the cache is dropped. #[cfg(not(target_arch = "wasm32"))] fn writer(dc: std::sync::Weak, q: Arc<(Mutex, Condvar)>) { let (m, cv) = &*q; @@ -1208,12 +1211,15 @@ impl effectcraft_effects::roto::SegStore for DiskCache { } impl crate::cache::LayerStore for DiskCache { + /// The layer for `key` from the disk cache, or `None` when it is missing or stale. fn get_layer(&self, key: u128, virtual_id: Option>) -> Option<(Arc, ReadFiles)> { DiskCache::get_layer(self, key, virtual_id).map(|(b, f)| (Arc::new(b), f)) } + /// Queues a layer write on the disk cache. fn put_layer(&self, key: u128, buf: &Buf, files: &EntryFiles, since: u64) { DiskCache::put_layer(self, key, buf, files, since); } + /// The current drop generation of the disk cache. fn drop_generation(&self) -> u64 { DiskCache::drop_generation(self) } @@ -1325,6 +1331,7 @@ fn encode_layer(b: &Buf) -> Vec { out } +/// Decodes a stored layer payload into a buffer, or `None` when it is too short or damaged. fn decode_layer(p: &[u8]) -> Option { if p.len() < 32 { return None; @@ -1357,6 +1364,7 @@ fn decode_layer(p: &[u8]) -> Option { /// Bump when rendering changes in a way that makes old disk entries wrong. const RENDER_VERSION: &str = "effectcraft-render-6"; +/// Feeds the `Debug` form of `v` into the hash, followed by a separator byte. fn hash_debug(h: &mut Hash128, v: &impl std::fmt::Debug) { h.write(format!("{v:?}").as_bytes()); h.write(&[0xff]); @@ -1401,6 +1409,7 @@ pub fn comp_content_key(project: &effectcraft_project::Project, comp: effectcraf comp_content_key_for_renderer(project, comp, RENDER_VERSION) } +/// The content key of `comp` for one renderer: its settings, the comps and footage it uses, and the renderer name. fn comp_content_key_for_renderer(project: &effectcraft_project::Project, comp: effectcraft_project::ItemId, renderer: &str) -> u128 { use effectcraft_project::ItemKind; let mut h = Hash128::default(); diff --git a/crates/render/src/disk_cache/entry_files.rs b/crates/render/src/disk_cache/entry_files.rs index 4ebd1f2e6..a36ca1033 100644 --- a/crates/render/src/disk_cache/entry_files.rs +++ b/crates/render/src/disk_cache/entry_files.rs @@ -63,14 +63,17 @@ impl EntryFiles { Some(EntryFiles(out)) } + /// The listed files. pub fn files(&self) -> &[EntryFile] { &self.0 } + /// The number of listed files. pub fn len(&self) -> usize { self.0.len() } + /// Whether no files are listed. pub fn is_empty(&self) -> bool { self.0.is_empty() } @@ -96,6 +99,7 @@ impl EntryFiles { self.0.iter().all(|f| file_unchanged(f, virtual_id)) } + /// Appends the list to `out` in little-endian binary form. pub(super) fn encode(&self, out: &mut Vec) { out.extend_from_slice(&(self.0.len() as u32).to_le_bytes()); for f in &self.0 { @@ -153,6 +157,7 @@ impl EntryFiles { } } +/// Whether the file still matches its stored stamp, by its native stamp or by its in-memory identity. fn file_unchanged(f: &EntryFile, virtual_id: Option>) -> bool { let from_memory = || virtual_id.and_then(|id| id(&f.path)); match f.stamp { @@ -167,20 +172,25 @@ fn file_unchanged(f: &EntryFile, virtual_id: Option>) -> bool struct Reader<'a>(&'a [u8]); impl<'a> Reader<'a> { + /// Takes the next `n` bytes, or `None` when fewer remain. fn take(&mut self, n: usize) -> Option<&'a [u8]> { let head = self.0.get(..n)?; self.0 = self.0.get(n..)?; Some(head) } + /// Reads one byte. fn u8(&mut self) -> Option { self.take(1)?.first().copied() } + /// Reads a little-endian `u32`. fn u32(&mut self) -> Option { Some(u32::from_le_bytes(self.take(4)?.try_into().ok()?)) } + /// Reads a little-endian `u64`. fn u64(&mut self) -> Option { Some(u64::from_le_bytes(self.take(8)?.try_into().ok()?)) } + /// Reads a little-endian `i128`. fn i128(&mut self) -> Option { Some(i128::from_le_bytes(self.take(16)?.try_into().ok()?)) } @@ -190,6 +200,7 @@ impl<'a> Reader<'a> { mod tests { use super::*; + /// A sample list of native, missing and virtual files for the tests. fn files() -> ReadFiles { [ ReadFile::new("/a.png", FileStamp::Native { len: 3, modified: Some(9) }), diff --git a/crates/render/src/eval.rs b/crates/render/src/eval.rs index e900ffa6e..5a0a3dea3 100644 --- a/crates/render/src/eval.rs +++ b/crates/render/src/eval.rs @@ -50,6 +50,7 @@ pub struct EvalCtx<'a> { } impl<'a> EvalCtx<'a> { + /// A context for `comp` at `time` with no expressions, footage, overrides or read log. pub fn new(project: &'a Project, comp_id: ItemId, comp: &'a Comp, time: Tick) -> EvalCtx<'a> { EvalCtx { project, comp_id, comp, time, expr: None, footage: None, property_overrides: &[], media_overrides: &[], reads: None } } diff --git a/crates/render/src/footage.rs b/crates/render/src/footage.rs index 04957b34e..0e17f152d 100644 --- a/crates/render/src/footage.rs +++ b/crates/render/src/footage.rs @@ -204,6 +204,7 @@ impl FootageSource for CancellableFootage<'_> { fn called_off(&self) -> bool { self.cancel.load(Ordering::Relaxed) || self.inner.called_off() } + /// Runs `f` with the inner source, collecting the files it reads into `reads`. fn recording(&self, reads: &ReadLog, f: &mut dyn FnMut()) { self.inner.recording(reads, f) } @@ -224,6 +225,7 @@ pub fn is_vector_footage(f: &Footage) -> bool { pub struct NoFootage; impl FootageSource for NoFootage { + /// Always `None`: there is no footage. fn frame(&self, _: ItemId, _: &Footage, _: Tick) -> Option> { None } diff --git a/crates/render/src/fx_host.rs b/crates/render/src/fx_host.rs index 9b1700df8..3a6f1a34c 100644 --- a/crates/render/src/fx_host.rs +++ b/crates/render/src/fx_host.rs @@ -95,6 +95,7 @@ impl EffectHost for FxHost<'_, '_, '_> { Some(self.pixels(other, buf, false)) } + /// The audio of footage layer `id` from `start`, or `None` when the layer is not footage. fn audio(&self, id: u64, start: f64, frames: usize, rate: u32) -> Option> { let other = self.ctx.layer(effectcraft_project::LayerId(id))?; let LayerSource::Footage { item } = &other.source else { return None }; diff --git a/crates/render/src/pipeline.rs b/crates/render/src/pipeline.rs index 6a0be930d..be3c3da8f 100644 --- a/crates/render/src/pipeline.rs +++ b/crates/render/src/pipeline.rs @@ -102,6 +102,7 @@ fn collapsed_instance(ctx: &EvalCtx, layer: &Layer, item: ItemId) -> Option<(Vec } impl<'a> Renderer<'a> { + /// A renderer over `project` and `footage` with the given options. pub fn new(project: &'a Project, footage: &'a dyn FootageSource, opts: RenderOpts) -> Renderer<'a> { Renderer { project, @@ -446,6 +447,7 @@ impl<'a> Renderer<'a> { } } + /// The evaluation context of `comp` at `t`, carrying this renderer's expressions, footage and read log. pub(crate) fn ctx(&self, comp_id: ItemId, comp: &'a Comp, t: Tick) -> EvalCtx<'a> { EvalCtx { project: self.project, @@ -936,6 +938,8 @@ impl<'a> Renderer<'a> { if per_pixel { Some(Arc::new(interpret_pixels(&img, f, self.pipe.linear_footage_space(f)))) } else { Some(img) } } + /// The footage frame at source time `t` after frame blending: the average of the source frames one comp frame spans, else a blend of the two neighbouring frames, else the plain frame. + /// Log scans are converted first, and blended frames are cached. fn footage_frame_raw(&self, ctx: &EvalCtx, layer: &Layer, item: ItemId, f: &Footage, t: Tick, size: Option<(u32, u32)>) -> Option> { let mode = frame_blend_mode(ctx, layer); let float = self.pipe.float_curve(f); diff --git a/crates/render/src/reads.rs b/crates/render/src/reads.rs index 91a0b10bf..326554c5b 100644 --- a/crates/render/src/reads.rs +++ b/crates/render/src/reads.rs @@ -59,6 +59,7 @@ pub struct ReadFile { } impl ReadFile { + /// A file read with the given path and stamp. pub fn new(path: impl Into>, stamp: FileStamp) -> ReadFile { ReadFile { path: path.into(), stamp } } @@ -128,16 +129,19 @@ impl ReadFiles { self.files.get(i).map(|f| f.stamp) } + /// The number of files in the list. pub fn len(&self) -> usize { self.files.len() } + /// Whether the list holds no files. pub fn is_empty(&self) -> bool { self.files.is_empty() } } impl FromIterator for ReadFiles { + /// Collects files into a list, adding each in turn. fn from_iter>(iter: I) -> Self { let mut out = ReadFiles::default(); for f in iter { @@ -155,10 +159,12 @@ pub struct ReadLog { } impl ReadLog { + /// An empty read log. pub fn new() -> ReadLog { ReadLog::default() } + /// Locks the file list, recovering from a poisoned lock. fn lock(&self) -> std::sync::MutexGuard<'_, ReadFiles> { self.files.lock().unwrap_or_else(PoisonError::into_inner) } @@ -196,6 +202,7 @@ impl ReadLog { mod tests { use super::*; + /// A native file with the given length for the tests. fn file(path: &str, len: u64) -> ReadFile { ReadFile::new(path, FileStamp::Native { len, modified: Some(7) }) } diff --git a/crates/render/src/three_d/adv/scene.rs b/crates/render/src/three_d/adv/scene.rs index 9166dc4a4..6d2b071d5 100644 --- a/crates/render/src/three_d/adv/scene.rs +++ b/crates/render/src/three_d/adv/scene.rs @@ -477,6 +477,7 @@ fn clip_start(ctx: &EvalCtx, layer: &Layer, prop: &Property, lt: Tick) -> Tick { start } +/// Adds a model layer to the Advanced 3D scene with its material options, opacity and world transform. fn model_layer(r: &Renderer, ctx: &EvalCtx, layer: &Layer, b: &mut Builder) { let lin = b.s.linear_io; let (opts, prim_mat) = model_options(ctx, layer, lin); @@ -651,6 +652,7 @@ pub fn extruded_meshes(ctx: &EvalCtx, layer: &Layer, p: &model::extrude::Extrude out } +/// Adds an extruded layer to the Advanced 3D scene with its card material, opacity and world transform. fn extruded_layer(r: &Renderer, ctx: &EvalCtx, layer: &Layer, p: &model::extrude::ExtrudeParams, b: &mut Builder) { let base = card_material(ctx, layer); let opacity = (ctx.opacity(layer) as f32 * r.opacity_mul()).clamp(0.0, 1.0); @@ -694,6 +696,7 @@ fn card(b: &mut Builder, buf: &Buf, world: Mat4, mut mat: Material) { b.emit(&p, m, &|_| world); } +/// Adds a flat card layer to the Advanced 3D scene with its material, opacity and world transform. fn card_layer(r: &Renderer, ctx: &EvalCtx, layer: &Layer, b: &mut Builder) { let mut mat = card_material(ctx, layer); mat.opacity = (ctx.opacity(layer) as f32 * r.opacity_mul()).clamp(0.0, 1.0); diff --git a/crates/text/src/fonts.rs b/crates/text/src/fonts.rs index f9ad858eb..d199bf0ff 100644 --- a/crates/text/src/fonts.rs +++ b/crates/text/src/fonts.rs @@ -208,6 +208,7 @@ pub struct VMetrics { } impl Face { + /// The font file bytes, loaded once on first use, or `None` when they cannot be read. fn bytes(&self) -> Option<&[u8]> { self.bytes .get_or_init(|| match &self.info.data { @@ -356,6 +357,7 @@ fn db() -> &'static RwLock { }) } +/// Adds a face to the database and returns its id. fn push(db: &mut Db, info: FaceInfo) -> FaceId { let id = db.faces.len(); db.faces.push(Arc::new(Face { id, info, bytes: OnceLock::new(), file_meta: OnceLock::new(), shaper: OnceLock::new() })); diff --git a/crates/ui-egui/src/frames.rs b/crates/ui-egui/src/frames.rs index 14c3f32ef..c369d8194 100644 --- a/crates/ui-egui/src/frames.rs +++ b/crates/ui-egui/src/frames.rs @@ -180,6 +180,7 @@ struct Cached { struct DiskSince(std::sync::Weak, u64); impl DiskSince { + /// A marker for the drop generation of `dc` at the time of a render. fn of(dc: &Arc, generation: u64) -> DiskSince { DiskSince(Arc::downgrade(dc), generation) } @@ -294,6 +295,7 @@ impl Cache { self.gpu_bytes = self.gpu_bytes.saturating_sub(img.bytes()); } } + /// Removes the entry for `k` and releases its image. fn remove(&mut self, k: &FrameKey) { if let Some(i) = self.map.remove(k) { self.forget(&i.img); @@ -371,6 +373,7 @@ struct ContentKeyJobs { pending: VecDeque<(Arc, u64, u64)>, } +/// The content key of `comp` at `revision`, memoised per revision. fn content_key(keys: &ContentKeys, project: &Project, revision: u64, comp: u64) -> u128 { if let Some(k) = keys.lock().ok().and_then(|m| m.get(&(revision, comp)).copied()) { return k; @@ -1183,6 +1186,7 @@ impl Frames { } } + /// Queues a background hash of `comp` at `revision`, coalescing rapid edits so only a bounded number of snapshots are kept. #[cfg(not(target_arch = "wasm32"))] fn request_content_key(&self, project: Arc, revision: u64, comp: u64) { let mut jobs = self.content_key_jobs.lock().unwrap_or_else(std::sync::PoisonError::into_inner); @@ -1235,6 +1239,7 @@ impl Frames { self.cache.lock().map(|c| c.budget).unwrap_or(0) } + /// Drops every cached frame and purges the remote server, if there is one. pub fn clear(&self) { if let Some(r) = &self.remote { r.purge(); @@ -1428,6 +1433,7 @@ impl Frames { } } + /// A render worker sharing this cache's queue, cache and in-flight set. fn worker(&self) -> Worker { Worker { queue: self.queue.clone(), @@ -1701,6 +1707,7 @@ impl Worker { self.finish_key(job.key, job.urgent, img, files, since, t0); } + /// Stores a finished frame in the cache with its read files, records the render time for urgent jobs, then releases the job. fn finish_key(&self, key: FrameKey, urgent: bool, img: FrameImage, files: Option>, since: Option, t0: web_time::Instant) { if urgent && let Ok(mut l) = self.last.lock() { *l = t0.elapsed().as_secs_f64() * 1000.0; @@ -1769,12 +1776,14 @@ impl Worker { } } + /// Tells the cache that a GPU render succeeded. fn gpu_succeeded(&self) { if let Ok(mut c) = self.cache.lock() { c.gpu_succeeded(); } } + /// Whether GPU rendering is available and has not been retired. fn gpu_ready(&self) -> bool { !self.gpu_retired.load(Ordering::Acquire) && self.cache.lock().is_ok_and(|c| c.gpu_ready()) } diff --git a/crates/ui-egui/src/panels/viewer.rs b/crates/ui-egui/src/panels/viewer.rs index 1e214ab53..cd0006c0f 100644 --- a/crates/ui-egui/src/panels/viewer.rs +++ b/crates/ui-egui/src/panels/viewer.rs @@ -143,6 +143,7 @@ struct Vw<'a> { puppet_layers: Vec<(&'a Layer, super::puppet_tool::Overlay)>, } +/// Draws the viewer panel in `rect` for the active comp and handles its input. pub fn show(app: &mut EffectcraftApp, ui: &mut egui::Ui, rect: Rect) { let t = app.tokens; let ctx = ui.ctx().clone(); diff --git a/crates/ui-egui/src/panels/viewer/shapes.rs b/crates/ui-egui/src/panels/viewer/shapes.rs index 903abd42f..76892cbaf 100644 --- a/crates/ui-egui/src/panels/viewer/shapes.rs +++ b/crates/ui-egui/src/panels/viewer/shapes.rs @@ -200,6 +200,7 @@ fn bounds_of(pts: &[Pos2]) -> Option { Some(r) } +/// Creates the shape for a drag from `a` to `b` with the given tool, as a mask or as a shape layer. pub(super) fn create_shape(app: &mut EffectcraftApp, tool: Tool, a: [f64; 2], b: [f64; 2], mods: egui::Modifiers) { let Some(d) = shape_drag(app, tool, a, b, mods) else { return }; let (kind, (w, h), (cx, cy)) = (d.kind, (d.size[0], d.size[1]), (d.centre[0], d.centre[1])); From 4295717ca7f6e6d6285d01e8dd7feaf70f45cb4c Mon Sep 17 00:00:00 2001 From: vangel76 Date: Sat, 7 Nov 2026 23:24:43 +0100 Subject: [PATCH 043/451] Disk cache: cap the free-space reserve at 10 GB, skip encodes the limit refuses The reserve the cache leaves free on its disk was max(2 GB, 5% of the disk) (#2551). On a 4 TB disk with 190 GB free that is 200 GB, so a cache set to 20 GB had a limit of 0: every write was refused, the cache never held anything, and only a log warning said so. The reserve is now clamp(5% of the disk, 2 GB, 10 GB). It is there to keep the cache from filling the disk, not to keep a share of a large disk free: 10 GB leaves the system room to work on any disk, a small disk still keeps 2 GB, and a 100 GB disk keeps 5 GB as before. After Effects has only a maximum cache size and no reserve; a clamp keeps the floor for small disks, where a fixed 10 GB would take most of the space. Writes the limit refuses cost no work: DiskCache::accepts_writes (one atomic read) is checked before a frame is converted (put_disk_frame) and before frames and layers are compressed (put_frame, put_frame_f16, put_layer). The frame workers spent about 8 ms per frame and 14 ms per layer on encodes that were then refused. persist_missing returns at once at limit 0 instead of converting the RAM frames on every idle pass. Settings > Disk shows the limit in effect in MB under Maximum Disk Cache Size, with a note when free disk space lowers it (settings.disk.cacheLimit). --- crates/render/src/disk_cache.rs | 139 +++++++++++++++++++++++--- crates/ui-egui/src/frames.rs | 13 ++- crates/ui-egui/src/frames/tests.rs | 65 ++++++++++++ crates/ui-egui/src/panels/settings.rs | 82 ++++++++++++++- docs/preferences.md | 6 +- 5 files changed, 288 insertions(+), 17 deletions(-) diff --git a/crates/render/src/disk_cache.rs b/crates/render/src/disk_cache.rs index c334c2011..ef35a2415 100644 --- a/crates/render/src/disk_cache.rs +++ b/crates/render/src/disk_cache.rs @@ -353,6 +353,8 @@ pub struct DiskCache { failed: AtomicU64, /// Source files looked at to check frame and layer entries ([`DiskCache::file_checks`]). file_checks: AtomicU64, + /// Frame and layer entries compressed for a queued write ([`DiskCache::encodes`]). + encodes: AtomicU64, tmp_counter: AtomicU64, queue: Arc<(Mutex, Condvar)>, /// Layer buffers that took less than this to render are not written (ms). @@ -396,6 +398,19 @@ fn checksum(data: &[u8]) -> u64 { h } +/// The least free space the disk cache leaves on its disk. +const MIN_DISK_RESERVE: u64 = 2 << 30; +/// The most free space the disk cache leaves on its disk: 5% of a large disk is far more than +/// the system needs to keep working (on a 4 TB disk it held a 20 GB cache at 0 with 190 GB free). +const MAX_DISK_RESERVE: u64 = 10 << 30; + +/// The free space the disk cache leaves on a disk of `total` bytes: 5% of it, at least 2 GB and +/// at most 10 GB. It keeps the cache from filling the disk; the cache's size is the user's +/// Maximum Disk Cache Size (After Effects has that maximum and no reserve). +pub fn disk_reserve(total: u64) -> u64 { + (total / 20).clamp(MIN_DISK_RESERVE, MAX_DISK_RESERVE) +} + /// The platform's default disk cache folder. pub fn default_folder() -> PathBuf { let home = std::env::var_os("HOME").map(PathBuf::from); @@ -433,6 +448,7 @@ impl DiskCache { dropped: AtomicU64::new(0), failed: AtomicU64::new(0), file_checks: AtomicU64::new(0), + encodes: AtomicU64::new(0), tmp_counter: AtomicU64::new(0), queue: Arc::new(( Mutex::new(Queue { @@ -519,13 +535,14 @@ impl DiskCache { self.max_bytes().min(self.disk_cap.load(Ordering::Relaxed)) } - /// The cache's disk: `(total, available)` bytes, `None` = unknown. The cache leaves at least - /// 2 GB or 5% of the disk free, whichever is more (evicting when it must). + /// The cache's disk: `(total, available)` bytes, `None` = unknown. The cache leaves + /// [`disk_reserve`] free (5% of the disk, at least 2 GB and at most 10 GB), evicting when it + /// must. pub fn set_disk_space(&self, space: Option<(u64, u64)>) { let cap = match space { // (a disk reported as 0 bytes, such as an automount map, is unknown) Some((total, available)) if total > 0 => { - let reserve = (2u64 << 30).max(total / 20); + let reserve = disk_reserve(total); let used = self.index.lock().map(|g| g.total()).unwrap_or_default(); // The cache's own files count as free: below the reserve it gives space back. used.saturating_add(available).saturating_sub(reserve) @@ -540,6 +557,25 @@ impl DiskCache { self.evict(); } + /// Whether a write can be stored at all now: `false` while free disk space holds the limit + /// at 0. One atomic read, so frame and layer writes check it before they spend time + /// converting and compressing pixels that [`DiskCache::write_format`] would refuse anyway. + /// (Whether a given entry fits is known only once it is compressed: `write_format` decides.) + pub fn accepts_writes(&self) -> bool { + self.limit_bytes() > 0 + } + + /// Frame and layer entries compressed for writing so far (tests: a write refused up front + /// costs no encode). + pub fn encodes(&self) -> u64 { + self.encodes.load(Ordering::Relaxed) + } + + /// Count one entry compressed for a queued write. + fn count_encode(&self) { + self.encodes.fetch_add(1, Ordering::Relaxed); + } + /// Layer buffers faster to render than this are not worth a disk write. pub fn set_min_layer_ms(&self, ms: u64) { self.min_layer_ms.store(ms, Ordering::Relaxed); @@ -950,8 +986,9 @@ impl DiskCache { /// Queue a half-float frame for writing (`width * height * 4` binary16 values) with the /// source files it was made of. `true` when it is on disk or queued; `false` when refused - /// (wrong size, a full queue, files that can't be checked later: see [`EntryFiles::of`]; - /// a file dropped after `since`, the [`DiskCache::drop_generation`] the render started at). + /// (wrong size, a full queue, no room on the disk, files that can't be checked later: see + /// [`EntryFiles::of`]; a file dropped after `since`, the [`DiskCache::drop_generation`] the + /// render started at). #[allow(clippy::too_many_arguments)] pub fn put_frame_f16( &self, @@ -967,8 +1004,16 @@ impl DiskCache { return false; } let Some(files) = EntryFiles::of(files, virtual_id) else { return false }; + if self.contains(Kind::Frame, key) { + return true; + } + // (no room on the disk: refused before the pixels are compressed) + if !self.accepts_writes() { + return false; + } + self.count_encode(); let payload = with_files(&files, encode_frame_f16(width, height, rgba)); - self.contains(Kind::Frame, key) || self.enqueue_format(Kind::Frame, key, FORMAT_F16_FILES, payload, Some((&files, since))) + self.enqueue_format(Kind::Frame, key, FORMAT_F16_FILES, payload, Some((&files, since))) } /// Write a half-float frame synchronously (tests); a list that can't be stored is not. @@ -980,16 +1025,25 @@ impl DiskCache { /// Queue a frame for writing (8-bit premultiplied RGBA, `width * height * 4` bytes) with the /// source files it was made of. `true` when it is on disk or queued; `false` when refused - /// (wrong size, a full queue, files that can't be checked later: see [`EntryFiles::of`]; - /// a file dropped after `since`, the [`DiskCache::drop_generation`] the render started at). + /// (wrong size, a full queue, no room on the disk, files that can't be checked later: see + /// [`EntryFiles::of`]; a file dropped after `since`, the [`DiskCache::drop_generation`] the + /// render started at). #[allow(clippy::too_many_arguments)] pub fn put_frame(&self, key: u128, width: u32, height: u32, rgba: &[u8], files: &ReadFiles, virtual_id: Option>, since: u64) -> bool { if rgba.len() as u64 != width as u64 * height as u64 * 4 { return false; } let Some(files) = EntryFiles::of(files, virtual_id) else { return false }; + if self.contains(Kind::Frame, key) { + return true; + } + // (no room on the disk: refused before the pixels are compressed) + if !self.accepts_writes() { + return false; + } + self.count_encode(); let payload = with_files(&files, encode_frame(width, height, rgba)); - self.contains(Kind::Frame, key) || self.enqueue_format(Kind::Frame, key, FORMAT_RGBA8_FILES, payload, Some((&files, since))) + self.enqueue_format(Kind::Frame, key, FORMAT_RGBA8_FILES, payload, Some((&files, since))) } /// A layer buffer (key: [`layer_disk_key`]) whose source files are unchanged, with those @@ -1005,10 +1059,12 @@ impl DiskCache { /// when one of them was dropped after `since`, the [`DiskCache::drop_generation`] its render /// started at. pub fn put_layer(&self, key: u128, buf: &Buf, files: &EntryFiles, since: u64) { - if self.contains(Kind::Layer, key) { + // (no room on the disk: refused before the buffer is compressed) + if self.contains(Kind::Layer, key) || !self.accepts_writes() { return; } - let _ = self.enqueue_format(Kind::Layer, key, FORMAT_LAYER_FILES, with_files(files, encode_layer(buf)), Some((files, since))); + self.count_encode(); + let _ =self.enqueue_format(Kind::Layer, key, FORMAT_LAYER_FILES, with_files(files, encode_layer(buf)), Some((files, since))); } /// Write a layer buffer synchronously (tests); a list that can't be stored is not. @@ -1785,7 +1841,8 @@ mod tests { // A disk reported as 0 bytes is unknown. dc.set_disk_space(Some((0, 0))); assert_eq!(dc.stats().limit_bytes, 1 << 30); - // 100 GB disk, 5 GB reserved, exactly 5 GB free: the cache may not grow. + // 100 GB disk, 5 GB reserved (5%, between the 2 GB floor and the 10 GB cap), exactly + // 5 GB free: the cache may not grow. dc.set_disk_space(Some((100 << 30, 5 << 30))); let st = dc.stats(); assert_eq!((st.max_bytes, st.limit_bytes), (1 << 30, used)); @@ -1804,6 +1861,64 @@ mod tests { let _ = std::fs::remove_dir_all(&dir); } + /// The reserve is 5% of the disk, at least 2 GB and at most 10 GB: a large disk with plenty + /// free keeps the user's size. (A 4 TB disk with 190 GB free reserved 200 GB, held a 20 GB + /// cache at 0, and every write was refused.) + #[test] + fn a_large_disk_reserves_at_most_ten_gb() { + const GB: u64 = 1 << 30; + assert_eq!(disk_reserve(4096 * GB), 10 * GB); + assert_eq!(disk_reserve(100 * GB), 5 * GB); + assert_eq!(disk_reserve(32 * GB), 2 * GB); + assert_eq!(disk_reserve(1), 2 * GB); + let dir = tmpdir("space-large"); + let dc = DiskCache::open(&dir, 20 * GB).unwrap(); + dc.set_disk_space(Some((4096 * GB, 190 * GB))); + let st = dc.stats(); + assert_eq!((st.max_bytes, st.limit_bytes), (20 * GB, 20 * GB), "{st:?}"); + assert!(dc.accepts_writes()); + // Just above the 10 GB reserve: the cache may use what is left above it. + dc.set_disk_space(Some((4096 * GB, 15 * GB))); + assert_eq!(dc.stats().limit_bytes, 5 * GB); + // A small disk still keeps 2 GB free: 3 GB free leaves 1 GB for the cache. + dc.set_disk_space(Some((32 * GB, 3 * GB))); + assert_eq!(dc.stats().limit_bytes, GB); + // Below the floor: nothing. + dc.set_disk_space(Some((32 * GB, GB))); + assert_eq!(dc.stats().limit_bytes, 0); + assert!(!dc.accepts_writes()); + let _ = std::fs::remove_dir_all(&dir); + } + + /// A write the free disk space refuses is refused before its pixels are compressed: the + /// frame workers spent about 8 ms per frame and 14 ms per layer encoding entries that were + /// then refused (`limit_bytes=0`). + #[test] + fn no_encode_while_the_disk_has_no_room() { + const GB: u64 = 1 << 30; + let dir = tmpdir("space-no-encode"); + let dc = DiskCache::open(&dir, 20 * GB).unwrap(); + // 4 TB disk, 1 GB free: under the 10 GB reserve, the limit is 0. + dc.set_disk_space(Some((4096 * GB, GB))); + assert_eq!(dc.stats().limit_bytes, 0); + let rgba = vec![7u8; 16 * 16 * 4]; + assert!(!dc.put_frame(1, 16, 16, &rgba, &ReadFiles::default(), None, 0), "refused"); + assert!(!dc.put_frame_f16(2, 16, 16, &[0x3c00u16; 16 * 16 * 4], &ReadFiles::default(), None, 0), "refused"); + dc.put_layer(3, &buf(3, 16, 16), &EntryFiles::default(), 0); + dc.flush(); + assert_eq!(dc.encodes(), 0, "nothing compressed"); + assert_eq!(dc.stats().entries, 0); + // Room again: the same writes are compressed and stored. + dc.set_disk_space(Some((4096 * GB, 500 * GB))); + assert!(dc.put_frame(1, 16, 16, &rgba, &ReadFiles::default(), None, 0)); + assert!(dc.put_frame_f16(2, 16, 16, &[0x3c00u16; 16 * 16 * 4], &ReadFiles::default(), None, 0)); + dc.put_layer(3, &buf(3, 16, 16), &EntryFiles::default(), 0); + dc.flush(); + assert_eq!(dc.encodes(), 3); + assert_eq!(dc.stats().entries, 3); + let _ = std::fs::remove_dir_all(&dir); + } + #[test] fn failed_writes_are_counted() { let dir = tmpdir("failed"); diff --git a/crates/ui-egui/src/frames.rs b/crates/ui-egui/src/frames.rs index c369d8194..6bca00ff9 100644 --- a/crates/ui-egui/src/frames.rs +++ b/crates/ui-egui/src/frames.rs @@ -477,9 +477,10 @@ fn frame_disk_key(keys: &ContentKeys, project: &Project, key: &FrameKey, opts_ha /// Queue `img` for the disk cache under `dk` with the source files it was made of. `false` when /// refused: a GPU frame (no CPU pixels), files that can't be checked when the entry is read /// (an incomplete list, #3184: the frame is shown, not stored), a full queue, a file dropped -/// (File ▸ Reload Footage) after `since`, the drop generation its render started at. +/// (File ▸ Reload Footage) after `since`, the drop generation its render started at; no room on +/// the disk (checked first: the conversion and compression would be wasted). fn put_disk_frame(dc: &DiskCache, dk: u128, img: &FrameImage, files: &ReadFiles, virtual_id: Option>, since: u64) -> bool { - if !files.is_complete() { + if !files.is_complete() || !dc.accepts_writes() { return false; } match img { @@ -1057,7 +1058,13 @@ impl Frames { let oh = opts_hash(opts); self.note_disk_series(base.comp, base.scale, base.view ^ oh); self.carry_disk(src); - let known = self.content_keys.lock().unwrap_or_else(std::sync::PoisonError::into_inner).get(&(base.revision, base.comp)).copied(); + // Free disk space holds the cache at 0: nothing would be stored, so nothing is converted + // (a refusal doesn't count as a try, so every idle pass would convert them all again). + // A later idle pass writes them once there is room. + if !dc.accepts_writes() { + return false; + } + let known =self.content_keys.lock().unwrap_or_else(std::sync::PoisonError::into_inner).get(&(base.revision, base.comp)).copied(); let Some(content) = known else { self.request_content_key(src.project.clone(), base.revision, base.comp); return true; diff --git a/crates/ui-egui/src/frames/tests.rs b/crates/ui-egui/src/frames/tests.rs index 13fda15e8..9f8c55a64 100644 --- a/crates/ui-egui/src/frames/tests.rs +++ b/crates/ui-egui/src/frames/tests.rs @@ -1732,6 +1732,71 @@ fn ram_frames_missing_on_disk_are_written_as(half: bool) { let _ = std::fs::remove_dir_all(&dir); } +/// While free disk space holds the disk cache at 0, frames are not converted or compressed for +/// it (the frame workers spent about 8 ms per frame on writes that were then refused), and idle +/// passes don't keep converting the RAM frames; with room again they are written. +#[test] +fn no_frame_is_encoded_while_the_disk_has_no_room() { + use effectcraft_engine::Session; + use serde_json::json; + const GB: u64 = 1 << 30; + let dir = std::env::temp_dir().join(format!("ec-persist-full-{}", std::process::id())); + let _ = std::fs::remove_dir_all(&dir); + let disk = DiskCache::open(&dir, 20 * GB).unwrap(); + // 4 TB disk, 1 GB free: under the 10 GB reserve. + disk.set_disk_space(Some((4096 * GB, GB))); + assert!(!disk.accepts_writes()); + // The frame worker's write: refused up front. + assert!(!put_disk_frame(&disk, 1, &img(), &ReadFiles::default(), None, disk.drop_generation())); + let mut s = Session::default(); + let cid = ItemId(s.execute("comp.new", json!({"name": "A", "width": 8, "height": 8, "duration": 1})).unwrap()["comp"].as_u64().unwrap()); + s.execute("layer.newSolid", json!({})).unwrap(); + let src = RenderSource { + project: s.project.clone(), + footage: Arc::new(effectcraft_engine::render::NoFootage), + expr: None, + layer_cache: Arc::default(), + gpu: None, + gpu_display: false, + disk: Some(disk.clone()), + }; + let f = Frames::default(); + let series = + FrameKey { revision: 1, content: f.content_of(&src.project, 1, cid), comp: cid.0, opts: opts_hash(&RenderOpts::default()) ^ 1, ..key(0, 0, 0) }; + for fr in 0..10 { + f.cache.lock().unwrap().insert_with(FrameKey { frame: fr, ..series }, img(), Some(Arc::default()), Some(DiskSince::of(&disk, disk.drop_generation()))); + } + // Idle passes: nothing to do, nothing converted. + for _ in 0..20 { + assert!(!f.persist_missing(&src, &series, &RenderOpts::default()), "no idle passes while there is no room"); + std::thread::sleep(std::time::Duration::from_millis(2)); + } + disk.flush(); + assert!(f.persisted.lock().unwrap().is_empty()); + assert_eq!((disk.encodes(), disk.stats().entries), (0, 0)); + // Room again: the RAM frames are written. + disk.set_disk_space(Some((4096 * GB, 500 * GB))); + let on_disk = |fr: i64| { + disk.contains( + disk_cache::Kind::Frame, + frame_disk_key(&f.content_keys, &src.project, &FrameKey { frame: fr, ..series }, opts_hash(&RenderOpts::default())), + ) + }; + let mut written = false; + for _ in 0..1000 { + f.persist_missing(&src, &series, &RenderOpts::default()); + disk.flush(); + if (0..10).all(on_disk) && f.persisted.lock().unwrap().is_empty() { + written = true; + break; + } + std::thread::sleep(std::time::Duration::from_millis(5)); + } + assert!(written, "every RAM frame written once there is room"); + assert_eq!(disk.encodes(), 10); + let _ = std::fs::remove_dir_all(&dir); +} + /// Audio changes pixels only where something draws it: a clip's Audio Levels, audio effects and /// Audio switch keep every frame, in RAM and on disk, until a waveform picks the clip (on another /// layer, on itself, or through a precomp of it); then the frames of the reader render again. diff --git a/crates/ui-egui/src/panels/settings.rs b/crates/ui-egui/src/panels/settings.rs index 72564f112..2dba45855 100644 --- a/crates/ui-egui/src/panels/settings.rs +++ b/crates/ui-egui/src/panels/settings.rs @@ -5,7 +5,8 @@ //! //! Automation ids: `settings.page.`, `settings.` (e.g. `settings.general.undoLevels`), //! `settings.labels..name` / `.color`, `settings.button.

xy;iMsxRNT%zw4l0v=V6 zg|`)jnBuNNhcvEkEAX{_r$hE>x!i+lDBl?%G-XLk@wNW~d=l~o3@G`uBvZ(}hV-k^elh|rIOfW$#0D^NvusXH(gZz*qr>q!VTAW|tUsIt416HLL8G~;&#_ZTkb38{=hDM<9Ge4^ZkPhefnxXCeIbwz5Uk*i9n`ta-Yk7 z{I%Of6yhgf6GcnZ#=@a@8d7DC};q zmr~EwCZ-*ntHXNF`<5{4mJi9~lnf;Si074Oulx*!D&gDlmfH^umvtx&D)?<%loAxR ziwMAk`Px4GhBIB19HxA#e$r1Beb5L^2&0+3{lOE`lmrZX#eQ7IFr8!ZGB7iJ`ao!p9uEY8r5A0Q@Bl(6dC~W0+t{sB5Q{X6sO>$ z>#pU?qwxT5$B8M>p8L)F0bh3G%l8J#a>GP1gwDW6x8bq-K&Bo{0_cPw;do&bEkTBl zsQ|{=dTZRtNC;hriIf6RvE; z0?^G_o8@IawOWgVs`!Hxn$PmluWBX^Qz*#UUCQSMdSgC%%Uei?KhzNRS-;`iGknOIomb?Mfe5`B-aG@|$ zJ|`xIBhOenJ4-_~JKgYI>T%8;fd76;PnM&M^7@ug|G5MD<$@I=#g2J79M}7u$V{ST zTmC-z&U~Q!Y8yN;ZV4QXLf`NNPP%|QwrIe3n^r((wLE9H&lF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pFh) z0#8(2sw%9Ojl8IH+CAn9SrlZ+NV5V0;>8|EoyoRBeb^+u%4zeWVe*XiIHk5`o%(?A zCPXCL{}oY^0}P!T1qDR~H&mD+`dL25!@=WTc4a1wgMOHURKD+Hu@4Vx-XzeOw&EJ_ zuw51VY2d!yD-g!}&rM7e?JV|qX`S!)m%TqXgK-yGz3aUg-Ygqqc&m_&w)vf(e3kH2 zj7#$y-g3dp5s{9w5>CjQdlSyW+XR6GpeB($QB6uwefFz+Cn{X3u1!?@Y^vXp#`b2- zbOvjvfntFl-v*0g#g{o}=c>;vF5V6x%?D`Djua#V=240;qtG<&L@zN{VaF^~Vl0P~ zgbpHF@(Q)JIUgHi2ajk99Vij01Uum|8oQvR^2<|JZ#p0KzI>48P_1Wqsk>ApyuJ8j ziA>6ZwD$*_D?H~p9Ho_Q1rTcf=gPft#oPG+BLFV6 zSG#WM)BlMQzo!94n_#AT=KN#U0;w+cQ?1FoI=O?xI203<3luHGv)kjrIUzwP37gFy zExWq`n0kcmEt94>8+C30Mtopnx4Cksl;#?MYn@H|7=RbYgZBu+MFqF6Ig ztD=O;&(}`DbZb9XmJ0Gp7HC#$!Bz7YQ&3k>fzd~S|$1Wn|Z+0I&`4u!c2~y ztdpWyI`x4_o*|`Sov3!0(SA(|+_BqC*=oYcv9`G11nnG+Uh*{8-?$PIX;0I!yJf{d zbVZisq6>aZMEZ$*gSFMk#o6ZL*N$booOwg^1A@Wu$nr@sKJ~{h-JCBNzuDiL2rLd8 zU(mJ4dnMs<)9!6^4RS%~gR5a+R7XbE0^evgYDMhJ;9>jZ1}zz1Wi^gGC6`OJ*_lY? e*pl5P0qF976hunC>nOJ44?ek!#0{X^+W!CyG+68a literal 0 HcmV?d00001 diff --git a/crates/media/tests/fixtures/pce61-ffmpeg.aac-fixture.attribution b/crates/media/tests/fixtures/pce61-ffmpeg.aac-fixture.attribution new file mode 100644 index 000000000..3f385a1e4 --- /dev/null +++ b/crates/media/tests/fixtures/pce61-ffmpeg.aac-fixture.attribution @@ -0,0 +1,7 @@ +asset: pce61-ffmpeg.aac-fixture +title: Synthetic seven-channel AAC PCE tone fixture +author: Dylan M. Taylor +source: crates/media/tests/fixtures/README.md (reproducible generation recipe) +license: MIT OR Apache-2.0 +added: 2026-11-16 +notes: Original sine-wave signals, no recorded audio or copied assets. Encoded using FFmpeg 7.1.5. SHA-256 07c460636dce4aa4163df8ef35f3b76f1214c38bf217aacd23243e608d87071e. diff --git a/crates/media/tests/it/aac_layout.rs b/crates/media/tests/it/aac_layout.rs index 896e4f0a7..5adf762b2 100644 --- a/crates/media/tests/it/aac_layout.rs +++ b/crates/media/tests/it/aac_layout.rs @@ -1,7 +1,8 @@ //! Multichannel AAC reaches stereo by where each channel plays, whatever order its channel -//! configuration decodes in (#1701). Fixtures are tones encoded with craft-audio's AAC encoder (no -//! ffmpeg needed, so nothing is skipped), with the configuration rewritten where the coded -//! elements fit another: configurations 11 and 12 code the same elements as the encoder's 7- and +//! configuration decodes in (#1701). Fixtures are tones encoded with craft-audio's AAC encoder, +//! plus a checked-in genuine FFmpeg-generated 6.1-channel fixture (no external tool at test time, nothing skipped). +//! The configuration is rewritten only where the coded elements fit another: configurations 11 +//! and 12 code the same elements as the encoder's 7- and //! 8-channel output, and a program config element can name any of them. use std::f64::consts::PI; @@ -9,7 +10,7 @@ use std::io::Cursor; use std::path::PathBuf; use std::sync::Arc; -use craft_audio::aac::{AudioSpecificConfig, Encoder, EncoderConfig, ProgramConfig}; +use craft_audio::aac::{AudioSpecificConfig, Encoder, EncoderConfig}; use effectcraft_media::{MediaPool, probe, probe_bytes}; use effectcraft_time::Tick; @@ -59,13 +60,6 @@ fn lc(config: u8) -> Option { Some(AudioSpecificConfig::lc(3, config)) } -fn pce(front: Vec<(bool, u8)>, side: Vec<(bool, u8)>, back: Vec<(bool, u8)>, lfe: Vec, comment: &[u8]) -> Option { - let pce = ProgramConfig { object_type: 1, sf_index: 3, front, side, back, lfe, comment: comment.to_vec(), ..Default::default() }; - let mut asc = AudioSpecificConfig::lc(3, 0); - asc.pce = Some(pce); - Some(asc) -} - use Ch::*; fn cases() -> Vec { @@ -80,15 +74,9 @@ fn cases() -> Vec { Case { name: "config12", content: &[C, L, R, Ls, Rs, Ls, Rs, Lfe], asc: lc(12) }, // the encoder's own 6.1: a PCE listing the centre first Case { name: "pce61-centre-first", content: &[C, L, R, Ls, Rs, Cs, Lfe], asc: None }, - // ffmpeg's 6.1 PCE: front pair and centre, a side SCE, a back pair and SCE, no LFE - // element, its channels in ffmpeg's order L R C LFE Cs Ls Rs. The decoder places the - // encoder's SCE 0 in the front SCE, pair 0 front, pair 1 back, SCE 1 in the back SCE (tag - // 1) and the LFE in the side SCE left over (tag 5). - Case { - name: "pce61-ffmpeg", - content: &[C, L, R, Cs, Ls, Rs, Lfe], - asc: pce(vec![(true, 0), (false, 0)], vec![(false, 5)], vec![(true, 1), (false, 1)], vec![], b"Lavc62.28.102"), - }, + // A genuine FFmpeg-generated 6.1-channel PCE and matching coded elements; rewriting only the ASC of + // our encoder's LFE0 stream to claim a side SCE5 would make an invalid access unit. + Case { name: "pce61-ffmpeg", content: &[C, L, R, Cs, Ls, Rs, Lfe], asc: None }, ] } @@ -110,6 +98,32 @@ fn encode(content: &[Ch], adts: bool) -> (Vec, Vec>) { (enc.audio_specific_config(), units) } +/// Preserve the fixture's real element types/tags instead of changing only its ASC. +/// The envelope and reproducible tone-generation recipe are in `tests/fixtures/README.md`. +fn encode_case(case: &Case) -> (Vec, Vec>) { + if case.name == "pce61-ffmpeg" { + let bytes = include_bytes!("../fixtures/pce61-ffmpeg.aac-fixture"); + assert_eq!(&bytes[..4], b"PCE1"); + let mut rest = &bytes[4..]; + let mut record = || { + let len = u32::from_be_bytes(rest[..4].try_into().unwrap()) as usize; + let (data, tail) = rest[4..].split_at(len); + rest = tail; + data.to_vec() + }; + let asc = record(); + let mut units = Vec::new(); + // The generated fixture contains 95 access units (including encoder priming). + for _ in 0..95 { + units.push(record()); + } + assert!(rest.is_empty(), "fixture has no unparsed records"); + return (asc, units); + } + let (asc, units) = encode(case.content, false); + (case.asc.as_ref().map_or(asc, |a| a.to_bytes().expect("ASC")), units) +} + fn mp4(asc: Vec, channels: u32, units: &[Vec]) -> Vec { mp4_after(None, asc, channels, units) } @@ -211,8 +225,7 @@ fn lfe_is_coded(case: &Case, bytes: Vec) { #[test] fn every_aac_layout_mixes_by_speaker_in_mp4() { for case in cases() { - let (asc, units) = encode(case.content, false); - let asc = case.asc.as_ref().map_or(asc, |a| a.to_bytes().expect("ASC")); + let (asc, units) = encode_case(&case); let bytes = mp4(asc, case.content.len() as u32, &units); lfe_is_coded(&case, bytes.clone()); let p = write(&format!("{}.mp4", case.name), &bytes); @@ -228,8 +241,7 @@ fn every_aac_layout_mixes_by_speaker_in_mp4() { #[test] fn matroska_aac_layouts_mix_by_speaker() { for case in cases().into_iter().filter(|c| matches!(c.name, "config12" | "pce61-centre-first" | "pce61-ffmpeg")) { - let (asc, units) = encode(case.content, false); - let asc = case.asc.as_ref().map_or(asc, |a| a.to_bytes().expect("ASC")); + let (asc, units) = encode_case(&case); let p = write(&format!("{}.mkv", case.name), &mkv(asc, case.content.len() as u32, &units)); check(case.name, case.content, &mix(&MediaPool::new(), &probe(&p).expect("probe"))); } @@ -254,8 +266,7 @@ fn an_empty_audio_track_lends_its_configuration_to_no_other() { let case = cases().into_iter().find(|c| c.name == name).expect("case"); let n = case.content.len() as u32; let empty = Some((AudioSpecificConfig::lc(3, empty).to_bytes().expect("ASC"), n)); - let (asc, units) = encode(case.content, false); - let asc = case.asc.as_ref().map_or(asc, |a| a.to_bytes().expect("ASC")); + let (asc, units) = encode_case(&case); let p = write(&format!("{name}-after-empty.mp4"), &mp4_after(empty.clone(), asc.clone(), n, &units)); check(&format!("{name} MP4"), case.content, &mix(&MediaPool::new(), &probe(&p).expect("probe"))); let p = write(&format!("{name}-after-empty.mkv"), &mkv_after(empty, asc, n, &units)); From b6d2598b3f217b2bbeb8b6ec86302941cfe21bc5 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Mon, 16 Nov 2026 11:27:30 -0500 Subject: [PATCH 204/451] interchange: delegate lexical depth preflight to craft-timeline --- Cargo.lock | 18 ++++++++ Cargo.toml | 1 + crates/interchange/Cargo.toml | 1 + crates/interchange/src/import.rs | 73 +------------------------------- 4 files changed, 21 insertions(+), 72 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a38c653da..397da745e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1603,6 +1603,15 @@ dependencies = [ "thiserror 2.0.21", ] +[[package]] +name = "craft-time" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=a2560df05b4c58631f53a57e65fb05f0e0e6cf76#a2560df05b4c58631f53a57e65fb05f0e0e6cf76" +dependencies = [ + "serde", + "thiserror 2.0.21", +] + [[package]] name = "craft-time" version = "0.1.0" @@ -1623,6 +1632,14 @@ dependencies = [ "serde_json", ] +[[package]] +name = "craft-timeline" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=a2560df05b4c58631f53a57e65fb05f0e0e6cf76#a2560df05b4c58631f53a57e65fb05f0e0e6cf76" +dependencies = [ + "craft-time 0.1.0 (git+https://github.com/storytold/craft-libs?rev=a2560df05b4c58631f53a57e65fb05f0e0e6cf76)", +] + [[package]] name = "craft-timeline" version = "0.1.0" @@ -2252,6 +2269,7 @@ dependencies = [ name = "effectcraft-interchange" version = "0.24.1" dependencies = [ + "craft-timeline 0.1.0 (git+https://github.com/storytold/craft-libs?rev=a2560df05b4c58631f53a57e65fb05f0e0e6cf76)", "effectcraft-color", "effectcraft-keyframe", "effectcraft-project", diff --git a/Cargo.toml b/Cargo.toml index 6c0fc585d..a7441a26b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,6 +11,7 @@ rust-version = "1.95" repository = "https://github.com/storytold/effectcraft" [workspace.dependencies] +craft-timeline = { git = "https://github.com/storytold/craft-libs", rev = "a2560df05b4c58631f53a57e65fb05f0e0e6cf76", default-features = false } craft-mime = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" } craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "808730f49b9637b7909fe2ae56f9d63fdb100cae", version = "=0.1.0", default-features = false, features = ["read"] } craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" } diff --git a/crates/interchange/Cargo.toml b/crates/interchange/Cargo.toml index 11dfec333..e2caa613d 100644 --- a/crates/interchange/Cargo.toml +++ b/crates/interchange/Cargo.toml @@ -10,6 +10,7 @@ rust-version.workspace = true workspace = true [dependencies] +craft-timeline = { workspace = true } effectcraft-time = { workspace = true } effectcraft-color = { workspace = true } effectcraft-keyframe = { workspace = true } diff --git a/crates/interchange/src/import.rs b/crates/interchange/src/import.rs index 5dd5642ac..a5336f406 100644 --- a/crates/interchange/src/import.rs +++ b/crates/interchange/src/import.rs @@ -49,78 +49,7 @@ pub struct ImportResult { /// a few levels per nested sequence; parsing several thousand levels overflowed the stack. pub const MAX_DEPTH: usize = 256; -/// The deepest element nesting of an XML document (a quick scan that skips comments, CDATA, -/// processing instructions, declarations and quoted attribute values). -pub(crate) fn xml_depth(b: &[u8]) -> usize { - let (mut i, mut depth, mut max) = (0usize, 0usize, 0usize); - let skip_to = |from: usize, end: &[u8]| b.get(from..).and_then(|r| r.windows(end.len()).position(|w| w == end)).map_or(b.len(), |p| from + p + end.len()); - while let Some(&c) = b.get(i) { - if c != b'<' { - i += 1; - continue; - } - let rest = b.get(i..).unwrap_or_default(); - if rest.starts_with(b""); - } else if rest.starts_with(b""); - } else if rest.starts_with(b""); - } else if rest.starts_with(b""); - } else if rest.starts_with(b""); - } else { - // A start tag: find its end outside quotes; `/>` closes it at once. - let mut j = i + 1; - let mut quote = None; - while let Some(&c) = b.get(j) { - match quote { - Some(q) if c == q => quote = None, - Some(_) => {} - None if c == b'"' || c == b'\'' => quote = Some(c), - None if c == b'>' => break, - None => {} - } - j += 1; - } - if b.get(j.wrapping_sub(1)) != Some(&b'/') { - depth += 1; - max = max.max(depth); - } - i = j + 1; - } - } - max -} - -/// The deepest array / object nesting of a JSON document (strings skipped). -pub(crate) fn json_depth(b: &[u8]) -> usize { - let (mut depth, mut max, mut in_str, mut esc) = (0usize, 0usize, false, false); - for &c in b { - if in_str { - if esc { - esc = false; - } else if c == b'\\' { - esc = true; - } else if c == b'"' { - in_str = false; - } - continue; - } - match c { - b'"' => in_str = true, - b'[' | b'{' => { - depth += 1; - max = max.max(depth); - } - b']' | b'}' => depth = depth.saturating_sub(1), - _ => {} - } - } - max -} +pub(crate) use craft_timeline::preflight::{json_depth, xml_depth}; pub fn import( project: &mut Project, From ee6f04c4fc7e62c79db0c1b00add1b70b4cdc356 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Mon, 16 Nov 2026 11:40:58 -0500 Subject: [PATCH 205/451] refactor: pin merged PSD prediction scratch API --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5d5411483..121b3b510 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1359,7 +1359,7 @@ dependencies = [ [[package]] name = "craft-psd" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=c864e1e8c9e0f7e2c9f24fca1faa6f298a068bca#c864e1e8c9e0f7e2c9f24fca1faa6f298a068bca" +source = "git+https://github.com/storytold/craft-libs?rev=ce2ec507c2e6a6a078a5f450f641487f8931816d#ce2ec507c2e6a6a078a5f450f641487f8931816d" dependencies = [ "encoding_rs", "flate2", diff --git a/Cargo.toml b/Cargo.toml index 55ba9d0c2..34da549e6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,7 +20,7 @@ craft-dpx = { version = "0.1.0", git = "https://github.com/storytold/craft-libs" craft-ps = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "808730f49b9637b7909fe2ae56f9d63fdb100cae", default-features = false, features = ["read"] } craft-exr = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" } craft-gif = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" } -craft-psd = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "c864e1e8c9e0f7e2c9f24fca1faa6f298a068bca" } +craft-psd = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "ce2ec507c2e6a6a078a5f450f641487f8931816d" } craft-svg = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" } craft-webp = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" } craft-lottie = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" } From a998f04903177e66f5d3a4e56a3c79a823d2041e Mon Sep 17 00:00:00 2001 From: vangel76 Date: Mon, 16 Nov 2026 17:49:20 +0100 Subject: [PATCH 206/451] 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. --- crates/media/src/exr_planes.rs | 58 ++++++++++++++------- crates/media/src/exr_planes/tests.rs | 78 +++++++++++++++++++++++++++- crates/media/src/exr_read.rs | 25 ++++++--- 3 files changed, 133 insertions(+), 28 deletions(-) diff --git a/crates/media/src/exr_planes.rs b/crates/media/src/exr_planes.rs index edfea4ea8..584ea76c9 100644 --- a/crates/media/src/exr_planes.rs +++ b/crates/media/src/exr_planes.rs @@ -907,6 +907,26 @@ fn run(path: &str, source: &ExrSource, flight: &Arc, base: Option Refused { + match e { + ReadError::Cancelled => Refused::Cancelled, + // (a read that failed just now: the next request reads again) + ReadError::Io(why) => { + log::warn!("media: {path}: {why}"); + Refused::Stopped + } + ReadError::TooLarge(why) => { + log::warn!("media: {path}: {why}"); + Refused::TooLarge(why) + } + ReadError::Unreadable(why) => { + log::warn!("media: {path}: {why}"); + Refused::Unreadable + } + } +} + /// Decode what `flight` asks for and `base` doesn't hold, and make the union of both. fn decode(path: &str, source: &ExrSource, flight: &Arc, base: Option>, opened: Option) -> Result, Refused> { let _decoding = Decoding::new(); @@ -947,10 +967,25 @@ fn decode(path: &str, source: &ExrSource, flight: &Arc, base: Option = wanted.into_iter().filter(|i| *i < index.channels.len()).collect(); - let base = base.filter(|b| Arc::ptr_eq(&b.index, &index)); - let missing: Vec = wanted.iter().copied().filter(|id| !base.as_ref().is_some_and(|b| b.ids.binary_search(id).is_ok())).collect(); - let names: Vec = missing.iter().filter_map(|i| index.channels.get(*i)).map(|c| c.name.clone()).collect(); + let mut base = base.filter(|b| Arc::ptr_eq(&b.index, &index)); + let mut missing: Vec = wanted.iter().copied().filter(|id| !base.as_ref().is_some_and(|b| b.ids.binary_search(id).is_ok())).collect(); let (w, h) = index.size(); + // The planes the request ends with (those held plus those missing, whether they come from the + // disk cache or the file) must fit the limit, asked before any of them is allocated (#3749). + // The planes held are only kept for later requests: when they don't fit with the missing + // ones, they are let go and the request is read on its own. + if !missing.is_empty() { + let held = base.as_ref().map_or(0, |b| b.ids.len()); + let together = crate::exr_read::check_total(w, h, held.saturating_add(missing.len()), cap_of(path)); + if together.is_err() && base.is_some() { + base = None; + missing = wanted.clone(); + } + if base.is_none() { + crate::exr_read::check_total(w, h, missing.len(), cap_of(path)).map_err(|e| refused(path, e))?; + } + } + let names: Vec = missing.iter().filter_map(|i| index.channels.get(*i)).map(|c| c.name.clone()).collect(); // The disk tier first (#3271): what an earlier session or a decode RAM let go of kept, one // entry per channel (any request is assembled from them, whatever was asked before). // (a file naming two channels alike can't tell their entries apart: not kept) @@ -984,22 +1019,7 @@ fn decode(path: &str, source: &ExrSource, flight: &Arc, base: Option> = read.map_err(|e| match e { - ReadError::Cancelled => Refused::Cancelled, - // (a read that failed just now: the next request reads again) - ReadError::Io(why) => { - log::warn!("media: {path}: {why}"); - Refused::Stopped - } - ReadError::TooLarge(why) => { - log::warn!("media: {path}: {why}"); - Refused::TooLarge(why) - } - ReadError::Unreadable(why) => { - log::warn!("media: {path}: {why}"); - Refused::Unreadable - } - })?; + let read: Vec> = read.map_err(|e| refused(path, e))?; let mut read = read.into_iter(); let planes: Vec> = kept.iter_mut().map(|k| k.take().or_else(|| read.next()).unwrap_or_default()).collect(); // The union, in file order: the planes held and the ones just read. diff --git a/crates/media/src/exr_planes/tests.rs b/crates/media/src/exr_planes/tests.rs index 1dcde8aae..f1f35dc5c 100644 --- a/crates/media/src/exr_planes/tests.rs +++ b/crates/media/src/exr_planes/tests.rs @@ -1473,18 +1473,92 @@ fn a_refusal_for_size_is_decided_anew_when_the_decode_limit_changes() { let source = ExrSource::Bytes(bytes); let index = crate::exr_index::get(path, &source).unwrap(); let want = Want { all: false, ids: (0..4).collect() }; + // (the refusal is made before anything is read: the decodes are counted as they begin) + let begun = Arc::new(AtomicU64::new(0)); + { + let begun = begun.clone(); + set_before_read( + path, + Some(Arc::new(move |_: &str| { + begun.fetch_add(1, Ordering::SeqCst); + })), + ); + } let refused = || matches!(store.get(path, &source, &index, &want, Use::Other), Err(Refused::TooLarge(_))); assert!(refused()); assert!(refused()); - assert_eq!(decodes_of(path).len(), 1, "the second refusal came from memory"); + assert_eq!(begun.load(Ordering::SeqCst), 1, "the second refusal came from memory"); // (figures under the fixed floor: only the change counts, no other test's limit moves) effectcraft_render::memory::set_decode_limit(Some(1000)); effectcraft_render::memory::set_decode_limit(Some(2000)); assert!(refused(), "still over the caller's own limit"); - assert_eq!(decodes_of(path).len(), 2, "decided anew after the limit changed"); + assert_eq!(begun.load(Ordering::SeqCst), 2, "decided anew after the limit changed"); + set_before_read(path, None); effectcraft_render::memory::set_decode_limit(None); } +/// A file of an 8×8 picture and a depth plane: five planes of 256 bytes. +fn picture_and_depth() -> Vec { + write(vec![part(None, &[("R", true), ("G", true), ("B", true), ("A", true), ("Z", false)], (8, 8), Compression::ZIP1)], (8, 8)) +} + +/// #3749 (#3301 review): the limit is for the planes a request ends with, not for the ones read +/// just now: channels added to the planes held count with them. When together they are over +/// the limit the planes held are let go and the request is read on its own (it fits alone); a +/// request that doesn't fit alone is refused, whatever is held. +#[test] +fn channels_added_to_the_planes_held_count_toward_the_limit() { + let path = "/3749-held-and-added.exr"; + // Room for four planes: the picture fits, one more with it is five. + set_cap(path, 4 * 8 * 8 * 4); + let store = PlaneStore::new(CACHE_BUDGET); + let source = ExrSource::Bytes(picture_and_depth().into()); + let index = crate::exr_index::get(path, &source).unwrap(); + let picture = Want { all: false, ids: index.picture_ids().unwrap().into_iter().collect() }; + store.get(path, &source, &index, &picture, Use::Other).expect("the picture fits"); + let rest = Want { all: true, ids: Default::default() }; + let depth = store.get(path, &source, &index, &rest, Use::Other).expect("the depth plane fits alone"); + assert!(depth.aux.get("Z").is_some()); + assert!(depth.aux.get("R").is_none(), "the picture's planes were let go: four held and one more are five"); + // The picture again: it fits alone, the depth plane is let go in turn. + let again = store.get(path, &source, &index, &picture, Use::Other).expect("the picture fits alone"); + assert!(again.aux.get("R").is_some() && again.aux.get("Z").is_none()); + // Everything at once is five planes: refused, however it is asked. + let everything = Want { all: true, ids: (0..5).collect() }; + assert!(matches!(store.get(path, &source, &index, &everything, Use::Other).err(), Some(Refused::TooLarge(_)))); +} + +/// #3749 (#3301 review): planes the disk cache gives back count toward the limit of a request +/// like the ones read from the file. +#[test] +fn planes_from_the_disk_cache_count_toward_the_limit() { + use effectcraft_render::disk_cache::DiskCache; + let dir = std::env::temp_dir().join(format!("ec-3749-disk-union-{}", std::process::id())); + std::fs::create_dir_all(&dir).unwrap(); + let file = dir.join("union_0001.exr"); + std::fs::write(&file, picture_and_depth()).unwrap(); + let dc = DiskCache::open(dir.join("cache"), 1 << 30).unwrap(); + dc.set_read_us_per_mb(0); + use_disk_for(&dir.to_string_lossy()); + set_disk_cache(Some(&dc)); + let path = file.to_string_lossy().to_string(); + let source = ExrSource::File(file.clone()); + let index = crate::exr_index::get(&path, &source).unwrap(); + let all = Want { all: true, ids: (0..5).collect() }; + let first = PlaneStore::new(CACHE_BUDGET).get(&path, &source, &index, &all, Use::Other).is_ok(); + dc.flush(); + // All five planes are in the disk cache (a store without them in RAM reads them back)... + let warm = PlaneStore::new(CACHE_BUDGET).get(&path, &source, &index, &all, Use::Other).is_ok(); + let from_disk = decodes_of(&path).last().is_some_and(|d| d.from_disk); + // ...and a request may use four. + set_cap(&path, 4 * 8 * 8 * 4); + let refused = PlaneStore::new(CACHE_BUDGET).get(&path, &source, &index, &all, Use::Other).err(); + set_disk_cache(None); + let _ = std::fs::remove_dir_all(&dir); + assert!(first && warm && from_disk, "decoded without a limit, then read back from the disk cache"); + assert!(matches!(refused, Some(Refused::TooLarge(_))), "{refused:?}"); +} + /// #3749: a plane the system cannot give is a refusal, not an aborted process (the allocation /// is asked for first). #[test] diff --git a/crates/media/src/exr_read.rs b/crates/media/src/exr_read.rs index d0ff02b29..9bdc7c048 100644 --- a/crates/media/src/exr_read.rs +++ b/crates/media/src/exr_read.rs @@ -282,6 +282,23 @@ pub(crate) fn plane(n: usize, fill: f32) -> Option> { Some(samples) } +fn too_large(w: usize, h: usize, need: usize, most: usize) -> ReadError { + ReadError::TooLarge(format!("its {}×{} OpenEXR channels need {:.1} GB of memory, more than the {:.1} GB one file may use", w, h, gb(need), gb(most))) +} + +/// Refuse a request whose planes together, those already in hand (held in memory or read back +/// from the disk cache) and those still to read, `planes` of a `w` × `h` display window, need +/// more memory than one file may use: the limit is for what a file's request ends with, not +/// for the part of it read just now ([`effectcraft_render::memory::decode_limit`], #3749). +pub(crate) fn check_total(w: usize, h: usize, planes: usize, max_bytes: usize) -> Result<(), ReadError> { + let need = w.saturating_mul(h).saturating_mul(planes).saturating_mul(std::mem::size_of::()); + let most = max_bytes.min(effectcraft_render::memory::decode_limit(MAX_DECODE_BYTES, need)); + if need > most { + return Err(too_large(w, h, need, most)); + } + Ok(()) +} + fn read_into(src: &mut dyn ReadSeek, index: &ExrIndex, req: &ReadRequest, stats: &mut ReadStats) -> Result>, ReadError> { let level = req.level.min(16); let stride = 1i64 << level; @@ -291,13 +308,7 @@ fn read_into(src: &mut dyn ReadSeek, index: &ExrIndex, req: &ReadRequest, stats: let need = n.saturating_mul(req.channels.len()).saturating_mul(std::mem::size_of::()); let most = req.max_bytes.min(effectcraft_render::memory::decode_limit(req.floor, need)); if need > most { - return Err(ReadError::TooLarge(format!( - "its {}×{} OpenEXR channels need {:.1} GB of memory, more than the {:.1} GB one file may use", - w, - h, - gb(need), - gb(most) - ))); + return Err(too_large(w, h, need, most)); } // Per part: the plane slot of each of its channels (`None`: not requested). let mut slots: Vec>> = index.meta.headers.iter().map(|h| vec![None; h.channels.list.len()]).collect(); From de0843b193fa68708504161275f57c2eca418604 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Mon, 16 Nov 2026 12:32:32 -0500 Subject: [PATCH 207/451] interchange: pin merged optional marker-color parity fix --- Cargo.lock | 36 ++++++++++++++++++------------------ Cargo.toml | 16 ++++++++-------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a38c653da..3a070ac11 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1541,9 +1541,9 @@ dependencies = [ [[package]] name = "craft-raw" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=402dfe46ad568a97f660bcbe30e3a80429b9e1fe#402dfe46ad568a97f660bcbe30e3a80429b9e1fe" +source = "git+https://github.com/storytold/craft-libs?rev=bea91b1861eea3889bec9d26338076f2ff31c4ac#bea91b1861eea3889bec9d26338076f2ff31c4ac" dependencies = [ - "craft-tiff 0.1.0 (git+https://github.com/storytold/craft-libs?rev=402dfe46ad568a97f660bcbe30e3a80429b9e1fe)", + "craft-tiff 0.1.0 (git+https://github.com/storytold/craft-libs?rev=bea91b1861eea3889bec9d26338076f2ff31c4ac)", "miniz_oxide 0.9.1", "rayon", "serde", @@ -1579,7 +1579,7 @@ dependencies = [ [[package]] name = "craft-tiff" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=402dfe46ad568a97f660bcbe30e3a80429b9e1fe#402dfe46ad568a97f660bcbe30e3a80429b9e1fe" +source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" dependencies = [ "serde", "thiserror 2.0.21", @@ -1588,7 +1588,7 @@ dependencies = [ [[package]] name = "craft-tiff" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" +source = "git+https://github.com/storytold/craft-libs?rev=bea91b1861eea3889bec9d26338076f2ff31c4ac#bea91b1861eea3889bec9d26338076f2ff31c4ac" dependencies = [ "serde", "thiserror 2.0.21", @@ -3002,7 +3002,7 @@ dependencies = [ [[package]] name = "filmcraft-bitstream" version = "0.20.1" -source = "git+https://github.com/storytold/filmcraft?rev=6e561687f0efc9a674c4bfb1c8251da178d1fb55#6e561687f0efc9a674c4bfb1c8251da178d1fb55" +source = "git+https://github.com/storytold/filmcraft?rev=3f137a7ed420cac79b32145f5243b7f98b31f71c#3f137a7ed420cac79b32145f5243b7f98b31f71c" dependencies = [ "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=82062077bba679ba5236e2d1a391f02d1533cbab)", ] @@ -3010,7 +3010,7 @@ dependencies = [ [[package]] name = "filmcraft-cfb" version = "0.20.1" -source = "git+https://github.com/storytold/filmcraft?rev=6e561687f0efc9a674c4bfb1c8251da178d1fb55#6e561687f0efc9a674c4bfb1c8251da178d1fb55" +source = "git+https://github.com/storytold/filmcraft?rev=3f137a7ed420cac79b32145f5243b7f98b31f71c#3f137a7ed420cac79b32145f5243b7f98b31f71c" dependencies = [ "craft-cfb 0.1.0 (git+https://github.com/storytold/craft-libs?rev=7f3fdc0dfebd03f33a241f91f916e9a78d3e5c93)", ] @@ -3018,7 +3018,7 @@ dependencies = [ [[package]] name = "filmcraft-codecs" version = "0.20.1" -source = "git+https://github.com/storytold/filmcraft?rev=6e561687f0efc9a674c4bfb1c8251da178d1fb55#6e561687f0efc9a674c4bfb1c8251da178d1fb55" +source = "git+https://github.com/storytold/filmcraft?rev=3f137a7ed420cac79b32145f5243b7f98b31f71c#3f137a7ed420cac79b32145f5243b7f98b31f71c" dependencies = [ "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=82062077bba679ba5236e2d1a391f02d1533cbab)", "craft-jpeg 0.1.0 (git+https://github.com/storytold/craft-libs?rev=937ac93c5cf3cd4b6a81e195b078fe161eb081b9)", @@ -3042,7 +3042,7 @@ dependencies = [ [[package]] name = "filmcraft-color" version = "0.20.1" -source = "git+https://github.com/storytold/filmcraft?rev=6e561687f0efc9a674c4bfb1c8251da178d1fb55#6e561687f0efc9a674c4bfb1c8251da178d1fb55" +source = "git+https://github.com/storytold/filmcraft?rev=3f137a7ed420cac79b32145f5243b7f98b31f71c#3f137a7ed420cac79b32145f5243b7f98b31f71c" dependencies = [ "serde", ] @@ -3050,10 +3050,10 @@ dependencies = [ [[package]] name = "filmcraft-dng" version = "0.20.1" -source = "git+https://github.com/storytold/filmcraft?rev=6e561687f0efc9a674c4bfb1c8251da178d1fb55#6e561687f0efc9a674c4bfb1c8251da178d1fb55" +source = "git+https://github.com/storytold/filmcraft?rev=3f137a7ed420cac79b32145f5243b7f98b31f71c#3f137a7ed420cac79b32145f5243b7f98b31f71c" dependencies = [ "craft-raw", - "craft-tiff 0.1.0 (git+https://github.com/storytold/craft-libs?rev=402dfe46ad568a97f660bcbe30e3a80429b9e1fe)", + "craft-tiff 0.1.0 (git+https://github.com/storytold/craft-libs?rev=bea91b1861eea3889bec9d26338076f2ff31c4ac)", "image", "rayon", "thiserror 2.0.21", @@ -3062,7 +3062,7 @@ dependencies = [ [[package]] name = "filmcraft-frame" version = "0.20.1" -source = "git+https://github.com/storytold/filmcraft?rev=6e561687f0efc9a674c4bfb1c8251da178d1fb55#6e561687f0efc9a674c4bfb1c8251da178d1fb55" +source = "git+https://github.com/storytold/filmcraft?rev=3f137a7ed420cac79b32145f5243b7f98b31f71c#3f137a7ed420cac79b32145f5243b7f98b31f71c" dependencies = [ "filmcraft-color", "filmcraft-time", @@ -3073,7 +3073,7 @@ dependencies = [ [[package]] name = "filmcraft-geom" version = "0.20.1" -source = "git+https://github.com/storytold/filmcraft?rev=6e561687f0efc9a674c4bfb1c8251da178d1fb55#6e561687f0efc9a674c4bfb1c8251da178d1fb55" +source = "git+https://github.com/storytold/filmcraft?rev=3f137a7ed420cac79b32145f5243b7f98b31f71c#3f137a7ed420cac79b32145f5243b7f98b31f71c" dependencies = [ "serde", ] @@ -3081,7 +3081,7 @@ dependencies = [ [[package]] name = "filmcraft-interchange" version = "0.20.1" -source = "git+https://github.com/storytold/filmcraft?rev=6e561687f0efc9a674c4bfb1c8251da178d1fb55#6e561687f0efc9a674c4bfb1c8251da178d1fb55" +source = "git+https://github.com/storytold/filmcraft?rev=3f137a7ed420cac79b32145f5243b7f98b31f71c#3f137a7ed420cac79b32145f5243b7f98b31f71c" dependencies = [ "craft-aaf", "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=82062077bba679ba5236e2d1a391f02d1533cbab)", @@ -3100,7 +3100,7 @@ dependencies = [ [[package]] name = "filmcraft-isobmff" version = "0.20.1" -source = "git+https://github.com/storytold/filmcraft?rev=6e561687f0efc9a674c4bfb1c8251da178d1fb55#6e561687f0efc9a674c4bfb1c8251da178d1fb55" +source = "git+https://github.com/storytold/filmcraft?rev=3f137a7ed420cac79b32145f5243b7f98b31f71c#3f137a7ed420cac79b32145f5243b7f98b31f71c" dependencies = [ "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=82062077bba679ba5236e2d1a391f02d1533cbab)", ] @@ -3108,7 +3108,7 @@ dependencies = [ [[package]] name = "filmcraft-matroska" version = "0.20.1" -source = "git+https://github.com/storytold/filmcraft?rev=6e561687f0efc9a674c4bfb1c8251da178d1fb55#6e561687f0efc9a674c4bfb1c8251da178d1fb55" +source = "git+https://github.com/storytold/filmcraft?rev=3f137a7ed420cac79b32145f5243b7f98b31f71c#3f137a7ed420cac79b32145f5243b7f98b31f71c" dependencies = [ "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=82062077bba679ba5236e2d1a391f02d1533cbab)", ] @@ -3116,7 +3116,7 @@ dependencies = [ [[package]] name = "filmcraft-media" version = "0.20.1" -source = "git+https://github.com/storytold/filmcraft?rev=6e561687f0efc9a674c4bfb1c8251da178d1fb55#6e561687f0efc9a674c4bfb1c8251da178d1fb55" +source = "git+https://github.com/storytold/filmcraft?rev=3f137a7ed420cac79b32145f5243b7f98b31f71c#3f137a7ed420cac79b32145f5243b7f98b31f71c" dependencies = [ "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=82062077bba679ba5236e2d1a391f02d1533cbab)", "craft-dpx 0.1.0 (git+https://github.com/storytold/craft-libs?rev=82062077bba679ba5236e2d1a391f02d1533cbab)", @@ -3135,7 +3135,7 @@ dependencies = [ [[package]] name = "filmcraft-project" version = "0.20.1" -source = "git+https://github.com/storytold/filmcraft?rev=6e561687f0efc9a674c4bfb1c8251da178d1fb55#6e561687f0efc9a674c4bfb1c8251da178d1fb55" +source = "git+https://github.com/storytold/filmcraft?rev=3f137a7ed420cac79b32145f5243b7f98b31f71c#3f137a7ed420cac79b32145f5243b7f98b31f71c" dependencies = [ "filmcraft-color", "filmcraft-geom", @@ -3150,7 +3150,7 @@ dependencies = [ [[package]] name = "filmcraft-time" version = "0.20.1" -source = "git+https://github.com/storytold/filmcraft?rev=6e561687f0efc9a674c4bfb1c8251da178d1fb55#6e561687f0efc9a674c4bfb1c8251da178d1fb55" +source = "git+https://github.com/storytold/filmcraft?rev=3f137a7ed420cac79b32145f5243b7f98b31f71c#3f137a7ed420cac79b32145f5243b7f98b31f71c" dependencies = [ "craft-timeline 0.1.0 (git+https://github.com/storytold/craft-libs?rev=57288edafdc45552e30481cc649021de446abfa0)", ] diff --git a/Cargo.toml b/Cargo.toml index 6c0fc585d..35d8d78ec 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -98,15 +98,15 @@ craft-video = { version = "0.1.0", git = "https://github.com/storytold/craft-lib # footage decoding: FilmCraft's pure-Rust crates, pinned to a revision (plan/adr/0001). # Only `crates/media`, `crates/export` and `crates/interchange` may depend on these. -filmcraft-codecs = { git = "https://github.com/storytold/filmcraft", rev = "6e561687f0efc9a674c4bfb1c8251da178d1fb55" } -filmcraft-media = { git = "https://github.com/storytold/filmcraft", rev = "6e561687f0efc9a674c4bfb1c8251da178d1fb55" } -filmcraft-frame = { git = "https://github.com/storytold/filmcraft", rev = "6e561687f0efc9a674c4bfb1c8251da178d1fb55" } -filmcraft-color = { git = "https://github.com/storytold/filmcraft", rev = "6e561687f0efc9a674c4bfb1c8251da178d1fb55" } -filmcraft-time = { git = "https://github.com/storytold/filmcraft", rev = "6e561687f0efc9a674c4bfb1c8251da178d1fb55" } +filmcraft-codecs = { git = "https://github.com/storytold/filmcraft", rev = "3f137a7ed420cac79b32145f5243b7f98b31f71c" } +filmcraft-media = { git = "https://github.com/storytold/filmcraft", rev = "3f137a7ed420cac79b32145f5243b7f98b31f71c" } +filmcraft-frame = { git = "https://github.com/storytold/filmcraft", rev = "3f137a7ed420cac79b32145f5243b7f98b31f71c" } +filmcraft-color = { git = "https://github.com/storytold/filmcraft", rev = "3f137a7ed420cac79b32145f5243b7f98b31f71c" } +filmcraft-time = { git = "https://github.com/storytold/filmcraft", rev = "3f137a7ed420cac79b32145f5243b7f98b31f71c" } # timeline interchange (EDL, FCP7 XML, FCPXML, OTIO) for Premiere Pro interop (crates/interchange only) -filmcraft-interchange = { git = "https://github.com/storytold/filmcraft", rev = "6e561687f0efc9a674c4bfb1c8251da178d1fb55" } -filmcraft-project = { git = "https://github.com/storytold/filmcraft", rev = "6e561687f0efc9a674c4bfb1c8251da178d1fb55" } -filmcraft-geom = { git = "https://github.com/storytold/filmcraft", rev = "6e561687f0efc9a674c4bfb1c8251da178d1fb55" } +filmcraft-interchange = { git = "https://github.com/storytold/filmcraft", rev = "3f137a7ed420cac79b32145f5243b7f98b31f71c" } +filmcraft-project = { git = "https://github.com/storytold/filmcraft", rev = "3f137a7ed420cac79b32145f5243b7f98b31f71c" } +filmcraft-geom = { git = "https://github.com/storytold/filmcraft", rev = "3f137a7ed420cac79b32145f5243b7f98b31f71c" } # gpu (the same wgpu eframe / egui-wgpu use) wgpu = { version = "30.0.1", features = ["fragile-send-sync-non-atomic-wasm"] } From e57aa567b9fa408c7506917607eb3d2dbb0cba91 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Mon, 16 Nov 2026 13:33:08 -0500 Subject: [PATCH 208/451] interchange: pin merged shared nesting preflight --- Cargo.lock | 22 +++++++++++----------- Cargo.toml | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6f1bb26e5..73d74ecb5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1597,7 +1597,7 @@ dependencies = [ [[package]] name = "craft-time" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57288edafdc45552e30481cc649021de446abfa0#57288edafdc45552e30481cc649021de446abfa0" +source = "git+https://github.com/storytold/craft-libs?rev=0d6dd8bed815b8366869a800d2bf22588ca62dcb#0d6dd8bed815b8366869a800d2bf22588ca62dcb" dependencies = [ "serde", "thiserror 2.0.21", @@ -1606,7 +1606,7 @@ dependencies = [ [[package]] name = "craft-time" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=a2560df05b4c58631f53a57e65fb05f0e0e6cf76#a2560df05b4c58631f53a57e65fb05f0e0e6cf76" +source = "git+https://github.com/storytold/craft-libs?rev=57288edafdc45552e30481cc649021de446abfa0#57288edafdc45552e30481cc649021de446abfa0" dependencies = [ "serde", "thiserror 2.0.21", @@ -1621,6 +1621,14 @@ dependencies = [ "thiserror 2.0.21", ] +[[package]] +name = "craft-timeline" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=0d6dd8bed815b8366869a800d2bf22588ca62dcb#0d6dd8bed815b8366869a800d2bf22588ca62dcb" +dependencies = [ + "craft-time 0.1.0 (git+https://github.com/storytold/craft-libs?rev=0d6dd8bed815b8366869a800d2bf22588ca62dcb)", +] + [[package]] name = "craft-timeline" version = "0.1.0" @@ -1632,14 +1640,6 @@ dependencies = [ "serde_json", ] -[[package]] -name = "craft-timeline" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=a2560df05b4c58631f53a57e65fb05f0e0e6cf76#a2560df05b4c58631f53a57e65fb05f0e0e6cf76" -dependencies = [ - "craft-time 0.1.0 (git+https://github.com/storytold/craft-libs?rev=a2560df05b4c58631f53a57e65fb05f0e0e6cf76)", -] - [[package]] name = "craft-timeline" version = "0.1.0" @@ -2269,7 +2269,7 @@ dependencies = [ name = "effectcraft-interchange" version = "0.24.1" dependencies = [ - "craft-timeline 0.1.0 (git+https://github.com/storytold/craft-libs?rev=a2560df05b4c58631f53a57e65fb05f0e0e6cf76)", + "craft-timeline 0.1.0 (git+https://github.com/storytold/craft-libs?rev=0d6dd8bed815b8366869a800d2bf22588ca62dcb)", "effectcraft-color", "effectcraft-keyframe", "effectcraft-project", diff --git a/Cargo.toml b/Cargo.toml index 62d4d6287..2889bdc34 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ rust-version = "1.95" repository = "https://github.com/storytold/effectcraft" [workspace.dependencies] -craft-timeline = { git = "https://github.com/storytold/craft-libs", rev = "a2560df05b4c58631f53a57e65fb05f0e0e6cf76", default-features = false } +craft-timeline = { git = "https://github.com/storytold/craft-libs", rev = "0d6dd8bed815b8366869a800d2bf22588ca62dcb", default-features = false } craft-mime = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" } craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "808730f49b9637b7909fe2ae56f9d63fdb100cae", version = "=0.1.0", default-features = false, features = ["read"] } craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" } From 58038903bd0a37f753fe074804b9e307f283aa7b Mon Sep 17 00:00:00 2001 From: vangel76 Date: Mon, 16 Nov 2026 21:45:05 +0100 Subject: [PATCH 209/451] 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). --- crates/media/Cargo.toml | 3 +- crates/media/src/exr_channels.rs | 20 +- crates/media/src/exr_index.rs | 307 +++++++------------------ crates/media/src/exr_planes.rs | 2 +- crates/media/src/exr_planes/tests.rs | 43 ++-- crates/media/src/exr_read.rs | 320 ++++----------------------- 6 files changed, 159 insertions(+), 536 deletions(-) diff --git a/crates/media/Cargo.toml b/crates/media/Cargo.toml index 497dbd9fa..d8f9c63f6 100644 --- a/crates/media/Cargo.toml +++ b/crates/media/Cargo.toml @@ -31,7 +31,6 @@ craft-media = { workspace = true, features = ["mpegts"] } filmcraft-frame = { workspace = true } filmcraft-color = { workspace = true } filmcraft-time = { workspace = true } -exr = { workspace = true } half = { workspace = true } image = { workspace = true, features = ["gif", "webp", "tiff", "bmp", "exr", "tga", "hdr"] } rayon = { workspace = true } @@ -40,6 +39,8 @@ thiserror = { workspace = true } log = { workspace = true } [dev-dependencies] +# Writes the OpenEXR files of the tests (reading is craft-exr's). +exr = { workspace = true } # Writes the animated GIFs of the tests. gif = { workspace = true } tempfile = { workspace = true } diff --git a/crates/media/src/exr_channels.rs b/crates/media/src/exr_channels.rs index 812c612c7..4c67df8c9 100644 --- a/crates/media/src/exr_channels.rs +++ b/crates/media/src/exr_channels.rs @@ -1,5 +1,5 @@ //! Auxiliary channels from multi-layer OpenEXR files (depth, object / material IDs, normals, -//! Cryptomatte, …) for the 3D Channel effects, read with the pure-Rust `exr` crate. +//! Cryptomatte, …) for the 3D Channel effects, read with `craft-exr`. //! //! Every channel of every layer becomes a plane named `layer.channel` (or just `channel` for //! the unnamed layer), placed in the display window (pixels outside a layer's data window are @@ -12,10 +12,10 @@ //! which the picture of an EXR footage item shares with EXtractoR / Cryptomatte (#474, #3271). //! This module holds the naming and picture rules they share, and whole-file reads of bytes. +use craft_exr::decode::PartInfo; use effectcraft_raster::channels3d::split_channel; use effectcraft_raster::{AuxChannels, Image}; use effectcraft_render::reads::FileStamp; -use exr::meta::header::Header; use crate::convert::{AlphaOp, float_to_image}; use crate::exr_index::ExrIndex; @@ -30,16 +30,16 @@ pub(crate) use craft_exr::channels::{is_depth, part_channel_name as channel_name pub use craft_exr::cryptomatte::parse_manifest; /// The part name channels are prefixed with (`None`: unnamed). -pub(crate) fn part_name(header: &Header) -> Option { - header.own_attributes.layer_name.as_ref().map(|t| t.to_string()).filter(|s| !s.is_empty()) +pub(crate) fn part_name(part: &PartInfo) -> Option { + part.name.clone().filter(|s| !s.is_empty()) } /// Why an OpenEXR file's pixels can't be decoded when its headers name a compression this build /// can't decompress (HTJ2K, OpenEXR 3.4's High-Throughput JPEG 2000): the decoders only said /// "no non-deep rgb channels" or showed a transparent frame (#482). `None` for other files. pub fn unsupported_compression(bytes: &[u8]) -> Option<&'static str> { - let meta = exr::meta::MetaData::read_from_buffered(std::io::Cursor::new(bytes), false).ok()?; - crate::exr_index::unsupported(&meta) + let parts = craft_exr::decode::parts(bytes, &craft_exr::decode::Limits::none()).ok()?; + parts.iter().any(|p| p.compression.starts_with("HTJ2K")).then_some(crate::exr_index::HTJ2K) } /// How the `image` crate's OpenEXR decoder would show a file: the first part with exact `R`, `G` @@ -75,7 +75,7 @@ pub const WEB_CACHE_CAP: usize = 256 << 20; /// not a readable EXR or the planes need too much memory. fn read_bytes(bytes: &[u8], ids: Option>) -> Option<(ExrIndex, Vec, Vec>)> { let mut src = std::io::Cursor::new(bytes); - let index = crate::exr_index::build(&mut src, bytes.len() as u64, FileStamp::Virtual).ok()?; + let index = crate::exr_index::build(&mut src, FileStamp::Virtual).ok()?; let ids = ids.unwrap_or_else(|| (0..index.channels.len()).collect()); let (planes, _) = read_planes(&mut src, &index, &ReadRequest::full(ids.clone())); Some((index, ids, planes.ok()?)) @@ -159,7 +159,7 @@ pub(crate) fn picture_names(aux: &AuxChannels) -> Option<([String; 3], Option Option { let mut src = std::io::Cursor::new(bytes); - let index = crate::exr_index::build(&mut src, bytes.len() as u64, FileStamp::Virtual).ok()?; + let index = crate::exr_index::build(&mut src, FileStamp::Virtual).ok()?; let (ids, rgb, a) = index.picture.clone()?; let (planes, _) = read_planes(&mut src, &index, &ReadRequest::full(ids.clone())); let aux = aux_of(&index, &ids, planes.ok()?); @@ -186,7 +186,7 @@ pub fn layered_image(bytes: &[u8]) -> Option { /// (import). `None` when it is not a readable EXR. pub(crate) fn layered_size(bytes: &[u8]) -> Option<(u32, u32, bool)> { let mut src = std::io::Cursor::new(bytes); - let index = crate::exr_index::build(&mut src, bytes.len() as u64, FileStamp::Virtual).ok()?; + let index = crate::exr_index::build(&mut src, FileStamp::Virtual).ok()?; let (_, _, a) = index.picture.as_ref()?; let (w, h) = index.size(); Some((w as u32, h as u32, a.is_some())) @@ -341,7 +341,7 @@ mod tests { let layer = Layer::new((1, 1), LayerAttributes::default(), Encoding::FAST_LOSSLESS, AnyChannels::sort(list.into())); let bytes = file(vec![layer], IntegerBounds::new((0, 0), (16384, 16384))); let mut src = std::io::Cursor::new(bytes.as_slice()); - let index = crate::exr_index::build(&mut src, bytes.len() as u64, FileStamp::Virtual).unwrap(); + let index = crate::exr_index::build(&mut src, FileStamp::Virtual).unwrap(); let all = ReadRequest::full((0..index.channels.len()).collect()); match read_planes(&mut src, &index, &all).0 { Err(crate::exr_read::ReadError::TooLarge(why)) => assert!(why.contains("16384×16384") && why.contains("GB"), "{why}"), diff --git a/crates/media/src/exr_index.rs b/crates/media/src/exr_index.rs index b642aba89..dccfc3542 100644 --- a/crates/media/src/exr_index.rs +++ b/crates/media/src/exr_index.rs @@ -1,25 +1,28 @@ //! [`ExrIndex`]: what an OpenEXR file holds, read from its headers and offset tables only -//! (#3271): the parts, every channel by its plane name, where each chunk lies and which rows it -//! holds, the Cryptomatte manifests and the channels its picture is made of. +//! (#3271): the parts, every channel by its plane name, the Cryptomatte manifests and the +//! channels its picture is made of. //! -//! An index is a few kilobytes and is kept per file ([`get`]): the channel popups, -//! `layer.channels`, the Cryptomatte layer lists, import and the planning of a read use it -//! and never decode pixels. The reader ([`crate::exr_read`]) fetches the chunks it lists. +//! The headers and offset tables are read and checked by `craft-exr` +//! ([`craft_exr::seek::Index`]), which also knows where each chunk lies; this index adds the +//! app's view of the file: the plane names and aliases, the manifests, the picture's channels and +//! the file's identity. An index is a few kilobytes and is kept per file ([`get`]): the channel +//! popups, `layer.channels`, the Cryptomatte layer lists, import and the planning of a read use +//! it and never decode pixels. The reader ([`crate::exr_read`]) fetches the chunks it lists. //! //! Everything is validated before anything is sized by it: the display window -//! ([`crate::exr_channels::MAX_DISPLAY_PIXELS`]), the chunk count (eight bytes of offset table -//! each, so never more than the file can hold), and every offset (inside the chunk area; a chunk -//! with a bad offset is never read). +//! ([`crate::exr_channels::MAX_DISPLAY_PIXELS`]), the data windows (four times that), the blocks, +//! the chunk count (eight bytes of offset table each, so never more than the file can hold), and +//! every offset (inside the chunk area; a chunk with a bad offset is never read). use std::collections::{HashMap, VecDeque}; -use std::io::{Read, SeekFrom}; +use std::io::SeekFrom; use std::sync::{Arc, Mutex, PoisonError}; +use craft_exr::decode::{Limits, PartInfo, Window}; +use craft_exr::seek; use effectcraft_raster::AuxChannels; use effectcraft_raster::channels3d::BACKGROUND_DEPTH; use effectcraft_render::reads::FileStamp; -use exr::meta::MetaData; -use exr::meta::attribute::{AttributeValue, IntegerBounds, Text}; use crate::exr_channels::{MAX_DISPLAY_PIXELS, Rgb, channel_name, is_depth, parse_manifest, part_name, picture_names}; use crate::exr_read::{ExrSource, Opened, ReadSeek}; @@ -37,37 +40,14 @@ pub(crate) struct IndexChannel { pub(crate) fill: f32, } -/// One chunk of a part, in offset-table order. -#[derive(Clone, Copy, Debug)] -pub(crate) struct IndexChunk { - /// Where it starts in the file, and how many bytes to read for it (0: its offset is not - /// valid, it is never read). - pub(crate) offset: u64, - pub(crate) len: u64, - /// Its first row in the part's data window and how many rows it holds. - pub(crate) y: i64, - pub(crate) rows: usize, - /// Of the full-resolution level (tiled files also store reduced levels). - pub(crate) largest: bool, -} - -/// One part of the file. -#[derive(Clone, Debug)] -pub(crate) struct IndexPart { - /// The part's data window position in the display window, and the data window's size. - pub(crate) offset: (i64, i64), - pub(crate) layer: (usize, usize), - pub(crate) chunks: Vec, -} - /// What an OpenEXR file holds ([`get`]). pub(crate) struct ExrIndex { - pub(crate) meta: MetaData, + /// The headers and chunk tables, as `craft-exr` reads them. + pub(crate) file: seek::Index, /// The file's identity when indexed: a read of another identity indexes it again. pub(crate) stamp: FileStamp, /// The first part's display window: every plane covers it. - pub(crate) display: IntegerBounds, - pub(crate) parts: Vec, + pub(crate) display: Window, pub(crate) channels: Vec, /// How the `image` crate's decoder would show the file (indices into `channels`). pub(crate) rgb: Rgb, @@ -83,7 +63,7 @@ pub(crate) struct ExrIndex { impl ExrIndex { /// The display window's size. pub(crate) fn size(&self) -> (usize, usize) { - (self.display.size.0, self.display.size.1) + (self.display.width as usize, self.display.height as usize) } /// The channels the picture is made of: the image crate's choice ([`Rgb::Planes`]) or the @@ -108,6 +88,14 @@ impl ExrIndex { let names: std::collections::HashSet<&str> = names.into_iter().collect(); self.channels.iter().enumerate().filter(|(_, c)| names.contains(c.name.as_str())).map(|(i, _)| i).collect() } + + /// About the bytes it holds: `craft-exr`'s index (its chunks and header facts), the channels + /// and the manifests. + pub(crate) fn bytes(&self) -> usize { + let names: usize = self.channels.iter().map(|c| c.name.len() * 2 + 64).sum(); + let manifests: usize = self.names.manifests.iter().map(|(l, m)| l.len() + m.iter().map(|(n, _)| n.len() + 32).sum::()).sum(); + self.file.bytes().saturating_add(names).saturating_add(manifests.saturating_mul(2)) + } } /// Why a file has no index. @@ -121,173 +109,59 @@ pub(crate) enum IndexError { Io, } -/// Bytes counted as they are read (the offset tables start where the headers end). -struct Counted<'r> { - inner: &'r mut dyn Read, - read: u64, -} - -impl Read for Counted<'_> { - fn read(&mut self, buf: &mut [u8]) -> std::io::Result { - let n = self.inner.read(buf)?; - self.read = self.read.saturating_add(n as u64); - Ok(n) - } -} - -/// The headers of the file in `src` as the high-level reader takes them (headers read strictly, -/// then validated leniently: the files that opened before open now), checked before anything is -/// sized by them, and the offset tables: the headers, the tables and where the chunks start. -/// Read through one buffer (attribute names are read a byte at a time); the bytes taken from it -/// are counted, so the chunk area's start is exact. -fn headers_and_tables(src: &mut dyn ReadSeek, len: u64) -> Result<(MetaData, exr::meta::OffsetTables, u64), IndexError> { - let strict = { - let mut buffered = std::io::BufReader::with_capacity(64 << 10, &mut *src); - let mut counted = Counted { inner: &mut buffered, read: 0 }; - match MetaData::read_from_buffered(&mut counted, true).and_then(|meta| MetaData::validate(&meta.headers, false).map(|_| meta)) { - Ok(meta) => { - let header_end = counted.read; - check(&meta, len, header_end)?; - let tables = MetaData::read_offset_tables(&mut exr::io::PeekRead::new(&mut counted), &meta.headers).map_err(|_| IndexError::Unreadable)?; - Some((meta, tables, counted.read)) - } - Err(_) => None, - } - }; - match strict { - Some(parsed) => Ok(parsed), - None => { - // (an HTJ2K file fails here: say why) - src.seek(SeekFrom::Start(0)).map_err(|_| IndexError::Io)?; - match MetaData::read_from_buffered(std::io::BufReader::new(&mut *src), false).ok().as_ref().and_then(unsupported) { - Some(why) => Err(IndexError::Unsupported(why)), - None => Err(IndexError::Unreadable), - } - } - } -} - -/// The most bytes one uncompressed block of a part may take: the decompressor allocates that -/// much for a block before it looks at the data, so a hostile header (a data window a billion -/// pixels wide over one tiny chunk) would ask for gigabytes. -pub(crate) const MAX_BLOCK_BYTES: usize = 256 << 20; +/// Why an HTJ2K file (OpenEXR 3.4's High-Throughput JPEG 2000) isn't read. +pub(crate) const HTJ2K: &str = "OpenEXR HTJ2K compression isn't supported yet: re-save the file with ZIP, PIZ or DWAA compression"; /// The most pixels of a part's data window (the display window's limit, four times over: data /// windows may reach past it). const MAX_DATA_PIXELS: usize = 4 * MAX_DISPLAY_PIXELS; -/// The bytes of one uncompressed block of `h` (its pixel bytes times a block's pixels, checked): -/// `None` past [`MAX_BLOCK_BYTES`] or when it doesn't fit in a `usize`. -pub(crate) fn block_bytes(h: &exr::meta::header::Header) -> Option { - let (w, rows) = match h.blocks { - exr::meta::BlockDescription::Tiles(t) => (t.tile_size.0, t.tile_size.1), - exr::meta::BlockDescription::ScanLines => (h.layer_size.0, h.compression.scan_lines_per_block().min(h.layer_size.1.max(1))), - }; - let per_pixel = h.channels.list.iter().map(|c| c.sample_type.bytes_per_sample()).try_fold(0usize, usize::checked_add)?; - per_pixel.checked_mul(w)?.checked_mul(rows).filter(|b| *b <= MAX_BLOCK_BYTES) +/// What `craft-exr` may index: data windows of at most [`MAX_DATA_PIXELS`], of any width or +/// height (the display window is checked against [`MAX_DISPLAY_PIXELS`] in [`build`]). +/// `craft-exr` bounds every block itself (256 MiB uncompressed). +fn limits() -> Limits { + let mut limits = Limits::none(); + limits.max_pixels = MAX_DATA_PIXELS as u64; + limits } -/// Every part of `meta` is safe to decode: its data window and its blocks within bounds. -pub(crate) fn parts_in_bounds(meta: &MetaData) -> bool { - meta.headers.iter().all(|h| h.layer_size.0.checked_mul(h.layer_size.1).is_some_and(|n| n <= MAX_DATA_PIXELS) && block_bytes(h).is_some()) +/// The headers and offset tables of the OpenEXR file in `src`, read and checked by `craft-exr`. +fn index_file(src: &mut dyn ReadSeek) -> Result { + src.seek(SeekFrom::Start(0)).map_err(|e| seek::Error::Io(e.to_string()))?; + // (an index is shared by every request for the file: building one is never called off) + seek::Index::build(src, &limits(), &|| false) } -/// The headers of the OpenEXR `bytes` (read leniently) are safe to hand to a decoder -/// ([`parts_in_bounds`]); `false` for anything else. +/// The headers of the OpenEXR `bytes` are safe to hand to a decoder: no part's data window or +/// block is larger than this reader takes. Damaged headers are left to the decoder to report. pub(crate) fn safe_to_decode(bytes: &[u8]) -> bool { - MetaData::read_from_buffered(std::io::Cursor::new(bytes), false).is_ok_and(|meta| parts_in_bounds(&meta)) + !matches!(index_file(&mut std::io::Cursor::new(bytes)), Err(seek::Error::LimitExceeded(_))) } -/// Refuse headers this reader doesn't take or that ask for more than the file can hold. -fn check(meta: &MetaData, len: u64, header_end: u64) -> Result<(), IndexError> { - if !parts_in_bounds(meta) { - return Err(IndexError::Unreadable); - } - if let Some(why) = unsupported(meta) { - return Err(IndexError::Unsupported(why)); - } - let first = meta.headers.first().ok_or(IndexError::Unreadable)?; +/// Index the OpenEXR file in `src` (identity `stamp`), reading its headers and offset tables +/// only. +pub(crate) fn build(src: &mut dyn ReadSeek, stamp: FileStamp) -> Result { + let file = index_file(src).map_err(|e| match e { + seek::Error::Unsupported(why) if why.contains("HTJ2K") => IndexError::Unsupported(HTJ2K), + seek::Error::Io(_) => IndexError::Io, + _ => IndexError::Unreadable, + })?; + let parts = file.parts(); // Deep data isn't read (the whole file was refused before). - if meta.headers.iter().any(|h| h.deep) { + if parts.iter().any(|p| p.deep) { return Err(IndexError::Unreadable); } - let display = first.shared_attributes.display_window; + let display = file.display(); // Each plane covers the display window: a 60000² window over a 1×1 data window was a // multi-gigabyte allocation per channel (#2141). - display.size.0.checked_mul(display.size.1).filter(|n| *n > 0 && *n <= MAX_DISPLAY_PIXELS).ok_or(IndexError::Unreadable)?; - // Eight bytes of offset table per chunk: a header can't claim more chunks than that. - let chunks: usize = meta.headers.iter().map(|h| h.chunk_count).fold(0, usize::saturating_add); - if (chunks as u64).saturating_mul(8) > len.saturating_sub(header_end) { - return Err(IndexError::Unreadable); - } - Ok(()) -} - -/// [`crate::exr_channels::unsupported_compression`] of parsed headers. -pub(crate) fn unsupported(meta: &MetaData) -> Option<&'static str> { - use exr::compression::Compression; - meta.headers - .iter() - .any(|h| matches!(h.compression, Compression::HTJ2K32 | Compression::HTJ2K256)) - .then_some("OpenEXR HTJ2K compression isn't supported yet: re-save the file with ZIP, PIZ or DWAA compression") -} - -/// Index the OpenEXR file in `src` (`len` bytes, identity `stamp`), reading its headers and -/// offset tables only. -pub(crate) fn build(src: &mut dyn ReadSeek, len: u64, stamp: FileStamp) -> Result { - src.seek(SeekFrom::Start(0)).map_err(|_| IndexError::Io)?; - let (mut meta, tables, chunks_start) = headers_and_tables(&mut *src, len)?; - // The manifests are parsed, and the other attributes (and previews) aren't kept: an index - // stays small however much a renderer writes into the headers. - let manifests = manifests(&meta); - for h in meta.headers.iter_mut() { - h.shared_attributes.other.clear(); - h.own_attributes.other.clear(); - h.own_attributes.preview = None; - } - let first = meta.headers.first().ok_or(IndexError::Unreadable)?; - let display = first.shared_attributes.display_window; - // Where each chunk ends: at the next chunk's start, or at the end of the file. - let mut starts: Vec = tables.iter().flatten().copied().filter(|o| *o >= chunks_start && *o < len).collect(); - starts.sort_unstable(); - starts.dedup(); - let end_of = |offset: u64| match starts.binary_search(&offset) { - Ok(i) => starts.get(i + 1).copied().unwrap_or(len), - Err(_) => offset, - }; - let mut parts = Vec::with_capacity(meta.headers.len()); - for (pi, h) in meta.headers.iter().enumerate() { - let table = tables.get(pi).ok_or(IndexError::Unreadable)?; - // A chunk is at most its block's bytes plus its own small header (part number, position - // and sizes): never read more for one. - let most = (block_bytes(h).ok_or(IndexError::Unreadable)? as u64).saturating_add(64); - let mut list = Vec::with_capacity(h.chunk_count); - for (i, tile) in h.blocks_increasing_y_order().enumerate() { - let bounds = h.get_absolute_block_pixel_coordinates(tile.location).map_err(|_| IndexError::Unreadable)?; - let offset = table.get(i).copied().unwrap_or(0); - let valid = offset >= chunks_start && offset < len; - let bytes = if valid { end_of(offset).saturating_sub(offset).min(most) } else { 0 }; - list.push(IndexChunk { - offset, - len: bytes, - y: i64::from(bounds.position.1), - rows: bounds.size.1, - largest: tile.location.is_largest_resolution_level(), - }); - } - let pos = h.own_attributes.layer_position; - parts.push(IndexPart { - offset: (i64::from(pos.0) - i64::from(display.position.0), i64::from(pos.1) - i64::from(display.position.1)), - layer: (h.layer_size.0, h.layer_size.1), - chunks: list, - }); - } + (display.width as usize).checked_mul(display.height as usize).filter(|n| *n > 0 && *n <= MAX_DISPLAY_PIXELS).ok_or(IndexError::Unreadable)?; + let manifests = manifests(parts); let mut channels = vec![]; let mut aliases = vec![]; - for (pi, h) in meta.headers.iter().enumerate() { - let prefix = part_name(h); - for (ci, ch) in h.channels.list.iter().enumerate() { - let stored = ch.name.to_string(); + for (pi, p) in parts.iter().enumerate() { + let prefix = part_name(p); + for (ci, ch) in p.channels.iter().enumerate() { + let stored = ch.name.clone(); let name = channel_name(prefix.as_deref(), &stored); // A stored `layer.channel` name inside a part named otherwise is also found as stored // (`Crypto_Material00.R` in part `Crypto_Material`); bare names (`R`) are not. @@ -298,8 +172,8 @@ pub(crate) fn build(src: &mut dyn ReadSeek, len: u64, stamp: FileStamp) -> Resul channels.push(IndexChannel { name, part: pi, channel: ci, fill }); } } - let rgb = rgb_of(&meta, &channels); - let mut names = AuxChannels::new(display.size.0 as u32, display.size.1 as u32, 1.0); + let rgb = rgb_of(parts, display, &channels); + let mut names = AuxChannels::new(display.width, display.height, 1.0); names.channels = channels.iter().map(|c| (c.name.clone(), vec![])).collect(); names.manifests = manifests; names.aliases = aliases; @@ -308,32 +182,22 @@ pub(crate) fn build(src: &mut dyn ReadSeek, len: u64, stamp: FileStamp) -> Resul let ids = channels.iter().enumerate().filter(|(_, c)| rgb.iter().chain(&a).any(|k| k.eq_ignore_ascii_case(&c.name))).map(|(i, _)| i).collect(); (ids, rgb, a) }); - Ok(ExrIndex { meta, stamp, display, parts, channels, rgb, picture, names: Arc::new(names) }) + Ok(ExrIndex { file, stamp, display, channels, rgb, picture, names: Arc::new(names) }) } -/// The Cryptomatte manifests of the headers (`cryptomatte//name` and `…/manifest`), sorted. -fn manifests(meta: &MetaData) -> Vec<(String, Vec<(String, u32)>)> { +/// The Cryptomatte manifests of the headers (`cryptomatte//name` and `…/manifest`, in any +/// part), sorted. +fn manifests(parts: &[PartInfo]) -> Vec<(String, Vec<(String, u32)>)> { let mut crypto: HashMap, Option)> = HashMap::new(); - let mut collect = |other: &HashMap| { - for (k, v) in other { - let key = k.to_string(); - let Some(rest) = key.strip_prefix("cryptomatte/") else { continue }; - let Some((id, field)) = rest.split_once('/') else { continue }; - let AttributeValue::Text(t) = v else { continue }; - let e = crypto.entry(id.to_string()).or_default(); - match field { - "name" => e.0 = Some(t.to_string()), - "manifest" => e.1 = Some(t.to_string()), - _ => {} - } + for (key, value) in parts.iter().flat_map(|p| &p.text_attributes) { + let Some(rest) = key.strip_prefix("cryptomatte/") else { continue }; + let Some((id, field)) = rest.split_once('/') else { continue }; + let e = crypto.entry(id.to_string()).or_default(); + match field { + "name" => e.0 = Some(value.clone()), + "manifest" => e.1 = Some(value.clone()), + _ => {} } - }; - // (the image's attributes are the first part's shared ones, as the decoder reports them) - if let Some(first) = meta.headers.first() { - collect(&first.shared_attributes.other); - } - for h in meta.headers.iter() { - collect(&h.own_attributes.other); } let mut out: Vec<(String, Vec<(String, u32)>)> = crypto.into_values().filter_map(|(name, manifest)| Some((name?, parse_manifest(&manifest?)))).collect(); out.sort(); @@ -344,10 +208,9 @@ fn manifests(meta: &MetaData) -> Vec<(String, Vec<(String, u32)>)> { /// `B` channels (alpha `A` when it has one), unless its planes can't stand in for it (a /// depth-named channel, filled with the background depth outside the data window, or a part /// with its own display window). -fn rgb_of(meta: &MetaData, channels: &[IndexChannel]) -> Rgb { - let Some(display) = meta.headers.first().map(|h| h.shared_attributes.display_window) else { return Rgb::None }; - for (pi, h) in meta.headers.iter().enumerate() { - let find = |c: &str| h.channels.find_index_of_channel(&Text::from(c)); +fn rgb_of(parts: &[PartInfo], display: Window, channels: &[IndexChannel]) -> Rgb { + for (pi, p) in parts.iter().enumerate() { + let find = |c: &str| p.channels.iter().position(|ch| ch.name == c); let (Some(r), Some(g), Some(b)) = (find("R"), find("G"), find("B")) else { continue }; let id = |ci: usize| channels.iter().position(|c| c.part == pi && c.channel == ci); let picked = [Some(r), Some(g), Some(b), find("A")]; @@ -355,7 +218,7 @@ fn rgb_of(meta: &MetaData, channels: &[IndexChannel]) -> Rgb { let (Some(Some(r)), Some(Some(g)), Some(Some(b))) = (ids.first(), ids.get(1), ids.get(2)) else { return Rgb::Unsupported }; let a = ids.get(3).copied().flatten(); let depth = [Some(*r), Some(*g), Some(*b), a].iter().flatten().any(|i| channels.get(*i).is_some_and(|c| is_depth(&c.name))); - if depth || h.shared_attributes.display_window != display { + if depth || p.display_window != display { return Rgb::Unsupported; } return Rgb::Planes([*r, *g, *b], a); @@ -368,18 +231,6 @@ fn rgb_of(meta: &MetaData, channels: &[IndexChannel]) -> Rgb { const INDEXED_FILES: usize = 4096; const INDEXED_BYTES: usize = 64 << 20; -impl ExrIndex { - /// About the bytes it holds: its chunks, channels and manifests (the headers' other - /// attributes are dropped when it is built). - pub(crate) fn bytes(&self) -> usize { - let chunks: usize = self.parts.iter().map(|p| p.chunks.len()).sum(); - let names: usize = self.channels.iter().map(|c| c.name.len() * 2 + 64).sum(); - let manifests: usize = self.names.manifests.iter().map(|(l, m)| l.len() + m.iter().map(|(n, _)| n.len() + 32).sum::()).sum(); - let headers = self.meta.headers.len().saturating_mul(1024); - (chunks * std::mem::size_of::()).saturating_add(names).saturating_add(manifests.saturating_mul(2)).saturating_add(headers) - } -} - /// Indexed files by path. struct Indexes { map: HashMap>, @@ -448,7 +299,7 @@ pub(crate) fn get_opened(path: &str, source: &ExrSource) -> Result<(Arc, base: Option>>, size: (usize, usize)) -> V bytes.into_inner() } +/// Each part's chunks of the OpenEXR `bytes`, in offset-table order: where each starts and how +/// many bytes it takes (up to the next chunk, or the end of the file). Read with the `exr` crate: +/// `craft-exr`'s index keeps them to itself. +fn chunk_table(bytes: &[u8]) -> Vec> { + let mut src = bytes; + let meta = exr::meta::MetaData::read_from_buffered(&mut src, false).unwrap(); + let tables = exr::meta::MetaData::read_offset_tables(&mut exr::io::PeekRead::new(&mut src), &meta.headers).unwrap(); + let mut starts: Vec = tables.iter().flatten().copied().collect(); + starts.sort_unstable(); + let end = |at: u64| starts.iter().copied().find(|s| *s > at).unwrap_or(bytes.len() as u64); + tables.iter().map(|t| t.iter().map(|at| (*at, end(*at) - at)).collect()).collect() +} + const SIZE: (usize, usize) = (64, 64); const RGBA: [(&str, bool); 4] = [("R", true), ("G", true), ("B", true), ("A", true)]; const CRYPTO: [(&str, bool); 4] = @@ -134,8 +147,7 @@ fn a_picture_reads_only_its_part() { assert_eq!(d.len(), 1, "{d:?}"); assert_eq!(d[0].channels, ["beauty.A", "beauty.B", "beauty.G", "beauty.R"]); assert_eq!(d[0].stats.chunks, [SIZE.1, 0, 0], "only the beauty part's chunks"); - let index = crate::exr_index::cached(&path).unwrap(); - let beauty: u64 = index.parts[0].chunks.iter().map(|c| c.len).sum(); + let beauty: u64 = chunk_table(&bytes)[0].iter().map(|(_, len)| len).sum(); assert_eq!(d[0].stats.bytes, beauty, "the beauty part's bytes and nothing else"); } @@ -210,7 +222,7 @@ fn picture_and_aux_share_one_read_and_one_decode() { /// The index and an in-memory source of `bytes`. fn indexed(bytes: &[u8]) -> (Arc, std::io::Cursor>) { let mut src = std::io::Cursor::new(bytes.to_vec()); - let ix = crate::exr_index::build(&mut src, bytes.len() as u64, FileStamp::Virtual).unwrap(); + let ix = crate::exr_index::build(&mut src, FileStamp::Virtual).unwrap(); (Arc::new(ix), src) } @@ -832,7 +844,7 @@ fn a_hostile_data_window_is_refused_not_allocated() { let bytes = with_data_window_x_max(small, (1 << 30) - 3); let path = format!("/3271-hostile-{compression:?}.exr"); assert!(!crate::exr_index::safe_to_decode(&bytes)); - assert!(crate::exr_index::build(&mut std::io::Cursor::new(bytes.as_slice()), bytes.len() as u64, FileStamp::Virtual).is_err()); + assert!(crate::exr_index::build(&mut std::io::Cursor::new(bytes.as_slice()), FileStamp::Virtual).is_err()); assert!(crate::exr_channels::read_exr_channels(&bytes).is_none()); assert!(crate::exr_channels::layered_image(&bytes).is_none()); let b: Arc<[u8]> = bytes.into(); @@ -852,13 +864,7 @@ fn a_hostile_data_window_is_refused_not_allocated() { fn damaged_files_never_panic() { let files = [single_part_zips(), multipart(), write(vec![part(None, &RGBA, (16, 40), Compression::PIZ)], (16, 40))]; for good in &files { - let start = crate::exr_index::build(&mut std::io::Cursor::new(good.as_slice()), good.len() as u64, FileStamp::Virtual) - .unwrap() - .parts - .iter() - .flat_map(|p| p.chunks.iter().map(|c| c.offset)) - .min() - .unwrap() as usize; + let start = chunk_table(good).iter().flatten().map(|(at, _)| *at).min().unwrap() as usize; // From a little before the chunks (the offset tables) to the end, in steps. let from = start.saturating_sub(64); for (i, at) in (from..good.len()).step_by(((good.len() - from) / 150).max(1)).enumerate() { @@ -867,7 +873,7 @@ fn damaged_files_never_panic() { let _ = crate::exr_channels::read_exr_channels(&bad); let _ = crate::exr_channels::layered_image(&bad); let mut src = std::io::Cursor::new(bad.as_slice()); - if let Ok(ix) = crate::exr_index::build(&mut src, bad.len() as u64, FileStamp::Virtual) { + if let Ok(ix) = crate::exr_index::build(&mut src, FileStamp::Virtual) { let req = ReadRequest { rows: Some(3..9), level: 1, ..ReadRequest::full((0..ix.channels.len()).collect()) }; let _ = crate::exr_read::read_planes(&mut src, &ix, &req); } @@ -1229,19 +1235,20 @@ fn a_read_in_several_batches_is_whole_and_stops_between_them() { // Called off while the first batch is read: it stops before the next. let flag = Arc::new(std::sync::atomic::AtomicBool::new(false)); let mut flaky = Flaky { inner: std::io::Cursor::new(bytes.clone()), reads: 0, cancel_after: Some((1, flag.clone())), fail_from: None }; - let (got, stats) = filmcraft_media::cancel::with_cancel(&flag, || crate::exr_read::read_planes(&mut flaky, &ix, &all)); + let (got, _) = filmcraft_media::cancel::with_cancel(&flag, || crate::exr_read::read_planes(&mut flaky, &ix, &all)); assert_eq!(got.err(), Some(ReadError::Cancelled)); - assert!(stats.lines < h, "stopped early: {} lines", stats.lines); // Chunks that follow each other in the file are read in one go, not one read per chunk. let mut counted = Flaky { inner: std::io::Cursor::new(bytes.clone()), reads: 0, cancel_after: None, fail_from: None }; assert!(crate::exr_read::read_planes(&mut counted, &ix, &all).0.is_ok()); assert!(counted.reads <= 12, "{} reads for {h} chunks", counted.reads); - // A read failing in a later batch (at chunk 300): an I/O error after the first was decoded. - let at = ix.parts[0].chunks[300].offset; + // (a failed read has no stats: the reads it made tell how far it went) + assert!(flaky.reads < counted.reads, "stopped early: {} of {} reads", flaky.reads, counted.reads); + // A read failing in a later batch (at chunk 300): an I/O error after the first was read. + let at = chunk_table(&bytes)[0][300].0; let mut flaky = Flaky { inner: std::io::Cursor::new(bytes), reads: 0, cancel_after: None, fail_from: Some(at) }; - let (got, stats) = crate::exr_read::read_planes(&mut flaky, &ix, &all); + let (got, _) = crate::exr_read::read_planes(&mut flaky, &ix, &all); assert!(matches!(got, Err(ReadError::Io(_))), "{got:?}"); - assert!(stats.lines > 0, "the batches before it were decoded"); + assert!(flaky.reads > 1, "the batches before it were read"); } /// #3271: dropping entries for bytes (a decode over the budget, the memory accountant) drops diff --git a/crates/media/src/exr_read.rs b/crates/media/src/exr_read.rs index dcad343f8..6e719c464 100644 --- a/crates/media/src/exr_read.rs +++ b/crates/media/src/exr_read.rs @@ -1,7 +1,7 @@ -//! The OpenEXR reader (#3271): only the chunks a request needs, fetched by the offset table in -//! file order (part by part as the file stores them), decompressed with the `exr` crate's block -//! API on the thread pool the caller runs on (the footage decode threads), and only the -//! requested channels converted, straight into their display-window planes. +//! The OpenEXR reader (#3271): where a file's bytes come from ([`ExrSource`], its identity and +//! how it is opened) and the app's side of a read ([`ReadRequest`] of the index's channels, the +//! memory one read may take, cancellation and the errors shown). The reading itself is +//! `craft-exr`'s ([`craft_exr::seek`]): //! //! - **No whole-file read.** A request reads the headers it is given ([`ExrIndex`]) and then //! exactly the bytes of the chunks it needs; a multi-part file's other parts are never read. @@ -9,20 +9,16 @@ //! column). With one scan line per chunk (NONE, RLE, ZIPS) a chunk is a line and the lines not //! needed are not read or decompressed; with larger chunks (ZIP, PIZ, DWA, tiles) whole chunks //! are skipped and the rows within a chunk are only skipped when converting. -//! - **Cancellable** between batches of chunks ([`filmcraft_media::cancel::cancelled`]). -//! - **Bit-identical** to the high-level reader: the same decompression, and each line placed -//! as `exr_channels`' planes reader placed it (clipped to the display window, the fill value -//! outside the data window, `u32` samples as `f32`). +//! - **Cancellable** while chunks are read ([`filmcraft_media::cancel::cancelled`]). +//! - **Bit-identical** to the high-level reader: the same decompression, each line clipped to +//! the display window, the fill value outside the data window, `u32` samples as `f32`. -use std::io::{Read, Seek, SeekFrom}; +use std::io::{Read, Seek}; use std::ops::Range; use std::sync::Arc; +use craft_exr::seek; use effectcraft_render::reads::FileStamp; -use exr::block::UncompressedBlock; -use exr::block::chunk::Chunk; -use exr::meta::attribute::SampleType; -use rayon::prelude::*; use crate::exr_index::ExrIndex; @@ -45,7 +41,6 @@ pub(crate) enum ExrSource { /// An opened [`ExrSource`]. pub(crate) struct Opened { pub(crate) reader: Box, - pub(crate) len: u64, pub(crate) stamp: FileStamp, } @@ -144,7 +139,7 @@ impl ExrSource { /// #2134), with its identity from the open file. pub(crate) fn open(&self) -> std::io::Result { match self { - ExrSource::Bytes(b) => Ok(Opened { len: b.len() as u64, reader: Box::new(std::io::Cursor::new(b.clone())), stamp: FileStamp::Virtual }), + ExrSource::Bytes(b) => Ok(Opened { reader: Box::new(std::io::Cursor::new(b.clone())), stamp: FileStamp::Virtual }), ExrSource::File(path) => { #[cfg(test)] crate::count_open(path); @@ -153,7 +148,7 @@ impl ExrSource { if !meta.is_file() { return Err(std::io::Error::new(std::io::ErrorKind::InvalidInput, format!("{} is not a file", path.display()))); } - Ok(Opened { len: meta.len(), stamp: FileStamp::of_metadata(&meta), reader: Box::new(file) }) + Ok(Opened { stamp: FileStamp::of_metadata(&meta), reader: Box::new(file) }) } ExrSource::Localized { original, copy, stamp } => { let local = || -> std::io::Result { @@ -166,7 +161,7 @@ impl ExrSource { if !meta.is_file() || !complete { return Err(std::io::Error::new(std::io::ErrorKind::InvalidData, format!("{}: not a complete copy", copy.display()))); } - Ok(Opened { len: meta.len(), stamp: *stamp, reader: Box::new(file) }) + Ok(Opened { stamp: *stamp, reader: Box::new(file) }) }; // (a copy evicted or damaged meanwhile: the share) local().or_else(|_| ExrSource::File(original.clone()).open()) @@ -226,49 +221,26 @@ pub(crate) const MAX_DECODE_BYTES: usize = 8 << 30; #[cfg(not(target_pointer_width = "64"))] pub(crate) const MAX_DECODE_BYTES: usize = 512 << 20; -/// At most this many chunks, or bytes of them, are read before they are decompressed (and the -/// request is checked for being called off). The first batch takes at most [`FIRST_BATCH_BYTES`] -/// and each one after twice the one before, so decoding starts early. -const BATCH_CHUNKS: usize = 256; -const BATCH_BYTES: u64 = 64 << 20; -const FIRST_BATCH_BYTES: u64 = 1 << 20; - -/// The raw chunks of a batch: their bytes one after another, and each chunk's part and bytes. -#[derive(Default)] -struct Raw { - data: Vec, - chunks: Vec<(usize, Range)>, -} - -/// Samples of one line placed in a plane. -struct Placed { - /// The requested channel's position in the request. - slot: usize, - /// The first sample's index in the plane. - start: usize, - values: Vec, -} - /// The size of the planes of a read at `level` of a `w` × `h` display window. -pub(crate) fn level_size((w, h): (usize, usize), level: u32) -> (usize, usize) { - let stride = 1usize << level.min(16); - (w.div_ceil(stride), h.div_ceil(stride)) +#[cfg(test)] +pub(crate) fn level_size(size: (usize, usize), level: u32) -> (usize, usize) { + seek::level_size(size, level) } /// Read `req` from `src` (the file `index` describes): one plane per requested channel, in /// request order, covering the display window at the request's level (the channel's fill value -/// where the file has no samples or the request no rows). +/// where the file has no samples or the request no rows). The stats are a failed read's +/// defaults: `craft-exr` reports none for it. pub(crate) fn read_planes(src: &mut dyn ReadSeek, index: &ExrIndex, req: &ReadRequest) -> (Result>, ReadError>, ReadStats) { - let mut stats = ReadStats { chunks: vec![0; index.parts.len()], ..Default::default() }; - let planes = read_into(src, index, req, &mut stats); - (planes, stats) + match read(src, index, req) { + Ok((planes, stats)) => (Ok(planes), stats), + Err(e) => (Err(e), ReadStats { chunks: vec![0; index.file.parts().len()], ..Default::default() }), + } } -fn read_into(src: &mut dyn ReadSeek, index: &ExrIndex, req: &ReadRequest, stats: &mut ReadStats) -> Result>, ReadError> { - let level = req.level.min(16); - let stride = 1i64 << level; +fn read(src: &mut dyn ReadSeek, index: &ExrIndex, req: &ReadRequest) -> Result<(Vec>, ReadStats), ReadError> { let (w, h) = index.size(); - let (ow, oh) = level_size((w, h), level); + let (ow, oh) = seek::level_size((w, h), req.level.min(16)); let n = ow.checked_mul(oh).ok_or_else(|| ReadError::Unreadable("display window".into()))?; let need = n.saturating_mul(req.channels.len()).saturating_mul(std::mem::size_of::()); let most = req.max_bytes.min(MAX_DECODE_BYTES); @@ -282,233 +254,25 @@ fn read_into(src: &mut dyn ReadSeek, index: &ExrIndex, req: &ReadRequest, stats: gb(most) ))); } - // Per part: the plane slot of each of its channels (`None`: not requested). - let mut slots: Vec>> = index.meta.headers.iter().map(|h| vec![None; h.channels.list.len()]).collect(); - let mut planes = Vec::with_capacity(req.channels.len()); - for (slot, id) in req.channels.iter().enumerate() { + let mut channels = Vec::with_capacity(req.channels.len()); + let mut fill = Vec::with_capacity(req.channels.len()); + for id in &req.channels { let c = index.channels.get(*id).ok_or_else(|| ReadError::Unreadable("no such channel".into()))?; - if let Some(s) = slots.get_mut(c.part).and_then(|p| p.get_mut(c.channel)) { - *s = Some(slot); - } - planes.push(vec![c.fill; n]); + channels.push((c.part, c.channel)); + fill.push(c.fill); } - let rows = req.rows.clone().unwrap_or(0..h as i64); - let (r0, r1) = (rows.start.max(0), rows.end.min(h as i64)); - // A display row is read: in the rows, on the level's grid. - let wanted = move |ty: i64| ty >= r0 && ty < r1 && ty.rem_euclid(stride) == 0; - // A chunk holding display rows `a..b` has a row read. - let any_wanted = move |a: i64, b: i64| { - let first = a.max(r0); - let first = first + (stride - first.rem_euclid(stride)) % stride; - first < b.min(r1) - }; - // The chunks to read, in file order. - let mut jobs: Vec<(usize, u64, u64)> = vec![]; - for (pi, part) in index.parts.iter().enumerate() { - if !slots.get(pi).is_some_and(|s| s.iter().any(Option::is_some)) { - continue; - } - for c in &part.chunks { - let ty0 = c.y.saturating_add(part.offset.1); - if !c.largest || !any_wanted(ty0, ty0.saturating_add(c.rows as i64)) { - continue; - } - if c.len == 0 { - return Err(ReadError::Unreadable("a chunk offset outside the file".into())); - } - jobs.push((pi, c.offset, c.len)); - } - } - jobs.sort_by_key(|(_, offset, _)| *offset); - let geometry = Geometry { size: (w, h), out: (ow, oh), stride, wanted: &wanted }; - let mut pos: Option = None; - let mut rest = jobs.as_slice(); - let mut raw = Raw::default(); - let mut most = FIRST_BATCH_BYTES; - loop { - if filmcraft_media::cancel::cancelled() { - return Err(ReadError::Cancelled); - } - // The next batch is read on this thread while the one read before decompresses and - // converts on this pool's other threads (a network read overlaps the decoding). - let (batch, more) = rest.split_at(batch_len(rest, most)); - rest = more; - most = most.saturating_mul(2).min(BATCH_BYTES); - let decode = std::mem::take(&mut raw); - let (next, done) = rayon::join( - || read_batch(&mut *src, batch, &mut pos, stats), - || -> Vec, usize), String>> { - let data = &decode.data; - decode - .chunks - .par_iter() - .map(|(pi, r)| chunk_lines(index, *pi, data.get(r.clone()).unwrap_or_default(), slots.get(*pi).map_or(&[][..], Vec::as_slice), &geometry)) - .collect() - }, - ); - // Placed plane by plane, the planes in parallel. - let mut by_slot: Vec> = (0..planes.len()).map(|_| vec![]).collect(); - for d in done { - let (placed, lines) = d.map_err(ReadError::Unreadable)?; - stats.lines = stats.lines.saturating_add(lines); - for p in placed { - if let Some(s) = by_slot.get_mut(p.slot) { - s.push(p); - } - } - } - planes.par_iter_mut().zip(by_slot).for_each(|(plane, placed)| { - for p in placed { - let end = p.start.saturating_add(p.values.len()); - if let Some(dst) = plane.get_mut(p.start..end) { - dst.copy_from_slice(&p.values); - } - } - }); - raw = next?; - if raw.chunks.is_empty() { - break; - } - } - Ok(planes) -} - -/// How many of `jobs` (chunks in file order) the next batch takes: up to [`BATCH_CHUNKS`] chunks -/// or `most` bytes, at least one. -fn batch_len(jobs: &[(usize, u64, u64)], most: u64) -> usize { - let mut take = 0; - let mut bytes = 0u64; - while let Some((_, _, len)) = jobs.get(take) { - if take > 0 && (take >= BATCH_CHUNKS || bytes.saturating_add(*len) > most) { - break; - } - bytes = bytes.saturating_add(*len); - take += 1; - } - take -} - -/// The raw bytes of the chunks `batch` (part, offset, length; in file order): chunks that follow -/// each other in the file are read in one go (one request to a network share, not one per -/// chunk), with one seek per gap (`pos`: where the source stands). A chunk the file ends in -/// keeps the bytes there are. -fn read_batch(src: &mut dyn ReadSeek, batch: &[(usize, u64, u64)], pos: &mut Option, stats: &mut ReadStats) -> Result { - let total = batch.iter().map(|(_, _, len)| *len).fold(0u64, u64::saturating_add); - let mut raw = Raw::default(); - raw.data.try_reserve_exact(usize::try_from(total).map_err(|_| ReadError::Unreadable("chunk size".into()))?).map_err(|e| ReadError::Io(e.to_string()))?; - let mut i = 0; - while let Some((_, start, _)) = batch.get(i) { - // A run of chunks, each starting where the one before ends. - let (start, mut end, mut j) = (*start, *start, i); - while let Some((_, offset, len)) = batch.get(j) - && *offset == end - { - end = offset.saturating_add(*len); - j += 1; - } - if *pos != Some(start) { - src.seek(SeekFrom::Start(start)).map_err(|e| ReadError::Io(e.to_string()))?; - } - let at = raw.data.len(); - (&mut *src).take(end.saturating_sub(start)).read_to_end(&mut raw.data).map_err(|e| ReadError::Io(e.to_string()))?; - let got = raw.data.len().saturating_sub(at); - *pos = Some(start.saturating_add(got as u64)); - for (pi, offset, len) in batch.get(i..j).unwrap_or_default() { - let a = usize::try_from(offset.saturating_sub(start)).map_or(raw.data.len(), |o| at.saturating_add(o)).min(raw.data.len()); - let b = usize::try_from(*len).map_or(raw.data.len(), |l| a.saturating_add(l)).min(raw.data.len()); - raw.chunks.push((*pi, a..b)); - if let Some(c) = stats.chunks.get_mut(*pi) { - *c += 1; - } - } - stats.bytes = stats.bytes.saturating_add(got as u64); - i = j.max(i + 1); - } - Ok(raw) -} - -/// The planes' geometry for [`chunk_lines`]. -struct Geometry<'w> { - /// The display window's size, and the planes' (at the level). - size: (usize, usize), - out: (usize, usize), - stride: i64, - wanted: &'w (dyn Fn(i64) -> bool + Sync), -} - -/// Decompress the chunk `buf` of part `pi` and convert the lines of the requested channels -/// (`slots`: each channel's plane slot): the samples to place, and the scan lines decompressed. -/// A chunk that names another part than its offset-table slot's is not placed. -fn chunk_lines(index: &ExrIndex, pi: usize, buf: &[u8], slots: &[Option], g: &Geometry) -> Result<(Vec, usize), String> { - let meta = &index.meta; - let mut read = buf; - let chunk = Chunk::read(&mut read, meta).map_err(|e| e.to_string())?; - if chunk.layer_index != pi { - return Ok((vec![], 0)); - } - let block = UncompressedBlock::decompress_chunk(chunk, meta, false).map_err(|e| e.to_string())?; - let (Some(header), Some(part)) = (meta.headers.get(pi), index.parts.get(pi)) else { return Ok((vec![], 0)) }; - let lines = block.index.pixel_size.1; - let ((lw, lh), (w, h)) = (part.layer, g.size); - let (ow, _) = g.out; - let mut out = vec![]; - let (mut f16s, mut f32s, mut u32s) = (vec![], vec![], vec![]); - for line in block.lines(&header.channels) { - let Some(Some(slot)) = slots.get(line.location.channel).copied() else { continue }; - let Some(kind) = header.channels.list.get(line.location.channel).map(|c| c.sample_type) else { continue }; - let (x0, y, count) = (line.location.position.0, line.location.position.1, line.location.sample_count); - // The samples of data-window row `y`, columns `x0..x0 + count`, at display row `ty` - // from display column `tx0`; clipped to the display window. - if y >= lh || x0.checked_add(count).is_none_or(|end| end > lw) { - continue; - } - let Some(ty) = usize::try_from(y as i64 + part.offset.1).ok().filter(|ty| *ty < h) else { continue }; - if !(g.wanted)(ty as i64) { - continue; - } - let tx0 = x0 as i64 + part.offset.0; - let skip = usize::try_from(-tx0).unwrap_or(0).min(count); - let tx = usize::try_from(tx0.max(0)).unwrap_or(usize::MAX); - let take = (count - skip).min(w.saturating_sub(tx)); - if take == 0 { - continue; - } - let samples: Vec = match kind { - SampleType::F16 => { - f16s.resize(count, exr::prelude::f16::ZERO); - line.read_samples_into_slice(&mut f16s).map_err(|e| e.to_string())?; - // (the slice conversion runs the same per-value conversion, in vector steps) - let mut out = vec![0.0; take]; - if let Some(src) = f16s.get(skip..skip + take) { - half::slice::HalfFloatSliceExt::convert_to_f32_slice(src, &mut out); - } - out - } - SampleType::F32 => { - f32s.resize(count, 0.0); - line.read_samples_into_slice(&mut f32s).map_err(|e| e.to_string())?; - f32s.iter().skip(skip).take(take).copied().collect() - } - SampleType::U32 => { - u32s.resize(count, 0); - line.read_samples_into_slice(&mut u32s).map_err(|e| e.to_string())?; - u32s.iter().skip(skip).take(take).map(|s| *s as f32).collect() - } - }; - if g.stride == 1 { - let Some(start) = ty.checked_mul(w).and_then(|row| row.checked_add(tx)) else { continue }; - out.push(Placed { slot, start, values: samples }); - continue; - } - // A reduced level: every stride-th column of the row, on the level's grid. - let stride = g.stride as usize; - let first = tx.div_ceil(stride) * stride; - let values: Vec = samples.iter().enumerate().filter(|(j, _)| (tx + j) % stride == 0).map(|(_, v)| *v).collect(); - if values.is_empty() { - continue; - } - let Some(start) = (ty / stride).checked_mul(ow).and_then(|row| row.checked_add(first / stride)) else { continue }; - out.push(Placed { slot, start, values }); - } - Ok((out, lines)) + let mut request = seek::Request::new(&channels, most); + request.fill = &fill; + request.rows = req.rows.clone(); + request.level = req.level; + // (as many decoding threads as the pool the caller runs on: the footage decode threads) + request.workers = Some(rayon::current_num_threads()); + let planes = seek::read_planes(src, &index.file, &request, &filmcraft_media::cancel::cancelled).map_err(|e| match e { + seek::Error::Cancelled => ReadError::Cancelled, + seek::Error::Io(why) => ReadError::Io(why), + seek::Error::LimitExceeded(why) => ReadError::TooLarge(format!("its OpenEXR channels need more memory than one file may use ({why})")), + seek::Error::Malformed(why) | seek::Error::Unsupported(why) => ReadError::Unreadable(why), + })?; + let stats = ReadStats { chunks: planes.stats.chunks, bytes: planes.stats.bytes, lines: planes.stats.lines }; + Ok((planes.planes, stats)) } From ccd4c75f4f4d18228eb611c6cc4a47919752f405 Mon Sep 17 00:00:00 2001 From: vangel76 Date: Mon, 16 Nov 2026 22:02:29 +0100 Subject: [PATCH 210/451] 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. --- crates/media/src/exr_index.rs | 23 +++++++--- crates/media/src/exr_planes/tests.rs | 65 +++++++++++++++++++++++++++- crates/media/src/exr_read.rs | 3 +- 3 files changed, 84 insertions(+), 7 deletions(-) diff --git a/crates/media/src/exr_index.rs b/crates/media/src/exr_index.rs index dccfc3542..bce3dd920 100644 --- a/crates/media/src/exr_index.rs +++ b/crates/media/src/exr_index.rs @@ -132,23 +132,36 @@ fn index_file(src: &mut dyn ReadSeek) -> Result { seek::Index::build(src, &limits(), &|| false) } -/// The headers of the OpenEXR `bytes` are safe to hand to a decoder: no part's data window or -/// block is larger than this reader takes. Damaged headers are left to the decoder to report. +/// The headers of the OpenEXR `bytes` are safe to hand to a decoder: they can be read and no +/// part's data window or block is larger than this reader takes (#3271 review). A file this +/// reader doesn't cover (deep parts, HTJ2K) is left to the decoder; damaged headers, a part too +/// large and a failed read are refused. pub(crate) fn safe_to_decode(bytes: &[u8]) -> bool { - !matches!(index_file(&mut std::io::Cursor::new(bytes)), Err(seek::Error::LimitExceeded(_))) + matches!(index_file(&mut std::io::Cursor::new(bytes)), Ok(_) | Err(seek::Error::Unsupported(_) | seek::Error::UnsupportedCompression(_))) +} + +/// The channel list of `part` as the `exr` crate's validation took it (#3271): sorted by name, +/// every sampling factor non-zero and dividing the data window's position and size. The headers +/// are read leniently, and the crate's decompressors divide by the sampling of every channel of +/// a chunk, requested or not (where panics abort, in the browser, that would end the app). +fn channels_valid(part: &PartInfo) -> bool { + let w = part.data_window; + let divides = |s: usize, pos: i32, size: u32| i64::try_from(s).ok().filter(|s| *s > 0).is_some_and(|s| i64::from(pos) % s == 0 && i64::from(size) % s == 0); + let sorted = part.channels.windows(2).all(|pair| pair.first().zip(pair.get(1)).is_some_and(|(a, b)| a.name.as_bytes() <= b.name.as_bytes())); + sorted && part.channels.iter().all(|c| divides(c.sampling.0, w.x, w.width) && divides(c.sampling.1, w.y, w.height)) } /// Index the OpenEXR file in `src` (identity `stamp`), reading its headers and offset tables /// only. pub(crate) fn build(src: &mut dyn ReadSeek, stamp: FileStamp) -> Result { let file = index_file(src).map_err(|e| match e { - seek::Error::Unsupported(why) if why.contains("HTJ2K") => IndexError::Unsupported(HTJ2K), + seek::Error::UnsupportedCompression(name) if name.contains("HTJ2K") => IndexError::Unsupported(HTJ2K), seek::Error::Io(_) => IndexError::Io, _ => IndexError::Unreadable, })?; let parts = file.parts(); // Deep data isn't read (the whole file was refused before). - if parts.iter().any(|p| p.deep) { + if parts.iter().any(|p| p.deep || !channels_valid(p)) { return Err(IndexError::Unreadable); } let display = file.display(); diff --git a/crates/media/src/exr_planes/tests.rs b/crates/media/src/exr_planes/tests.rs index 263723ec9..95b41e4b9 100644 --- a/crates/media/src/exr_planes/tests.rs +++ b/crates/media/src/exr_planes/tests.rs @@ -864,9 +864,15 @@ fn a_hostile_data_window_is_refused_not_allocated() { fn damaged_files_never_panic() { let files = [single_part_zips(), multipart(), write(vec![part(None, &RGBA, (16, 40), Compression::PIZ)], (16, 40))]; for good in &files { + // (the good file indexes and reads whole through the same path) + let (ix, mut src) = indexed(good); + let all = ReadRequest::full((0..ix.channels.len()).collect()); + assert!(crate::exr_read::read_planes(&mut src, &ix, &all).0.is_ok()); + assert!(crate::exr_channels::read_exr_channels(good).is_some()); let start = chunk_table(good).iter().flatten().map(|(at, _)| *at).min().unwrap() as usize; // From a little before the chunks (the offset tables) to the end, in steps. let from = start.saturating_sub(64); + let (mut reads, mut read_ok) = (0, 0); for (i, at) in (from..good.len()).step_by(((good.len() - from) / 150).max(1)).enumerate() { let mut bad = good.clone(); bad[at] ^= [0xff, 0x80, 0x01, 0x7f][i % 4]; @@ -875,9 +881,66 @@ fn damaged_files_never_panic() { let mut src = std::io::Cursor::new(bad.as_slice()); if let Ok(ix) = crate::exr_index::build(&mut src, FileStamp::Virtual) { let req = ReadRequest { rows: Some(3..9), level: 1, ..ReadRequest::full((0..ix.channels.len()).collect()) }; - let _ = crate::exr_read::read_planes(&mut src, &ix, &req); + reads += 1; + read_ok += usize::from(crate::exr_read::read_planes(&mut src, &ix, &req).0.is_ok()); } } + // Most damage lies in the chunks: the index stands and the reader meets the damage. + assert!(reads > 50 && read_ok > 0, "{reads} damaged files indexed, {read_ok} read"); + } +} + +/// #3271 review (never crash): damaged headers are refused before a decoder sees them +/// ([`crate::exr_index::safe_to_decode`] guards the `image` crate's decoder), and so is a part +/// larger than this reader takes; a file the reader doesn't cover but whose headers are sound +/// (HTJ2K) is left to the decoders to report. +#[test] +fn damaged_headers_are_not_safe_to_decode() { + let good = write(vec![part(None, &RGBA, (8, 8), Compression::ZIP1)], (8, 8)); + assert!(crate::exr_index::safe_to_decode(&good)); + // Cut inside the headers. + let cut = good.windows(11).position(|w| w == b"compression").unwrap(); + assert!(!crate::exr_index::safe_to_decode(&good[..cut]), "headers cut short"); + // Not an OpenEXR file. + let mut magic = good.clone(); + magic[0] ^= 0xff; + assert!(!crate::exr_index::safe_to_decode(&magic), "no signature"); + // Offset tables longer than the file. + let first_chunk = chunk_table(&good)[0][0].0 as usize; + assert!(!crate::exr_index::safe_to_decode(&good[..first_chunk - 8]), "tables cut short"); + assert!(!crate::exr_index::safe_to_decode(&with_data_window_x_max(good.clone(), (1 << 30) - 3)), "a part too large"); + // HTJ2K (compression 11): sound headers, left to the decoders. + let mut htj2k = good.clone(); + let tag = b"compression\0compression\0\x01\0\0\0"; + let at = htj2k.windows(tag.len()).position(|w| w == tag).unwrap() + tag.len(); + htj2k[at] = 11; + assert_eq!( + crate::exr_index::build(&mut std::io::Cursor::new(htj2k.as_slice()), FileStamp::Virtual).err(), + Some(crate::exr_index::IndexError::Unsupported(crate::exr_index::HTJ2K)) + ); + assert!(crate::exr_index::safe_to_decode(&htj2k)); +} + +/// #3271 review (never crash): the headers are read leniently, so a channel list the `exr` +/// crate's validation refused (a zero sampling factor, which its decompressors divide by, or +/// channels out of order) is refused when indexing, before any chunk is decompressed. +#[test] +fn an_invalid_channel_list_is_refused() { + let good = write(vec![part(None, &[("G", true), ("R", true)], (4, 4), Compression::ZIP1)], (4, 4)); + let tag = b"channels\0chlist\0"; + let list = good.windows(tag.len()).position(|w| w == tag).unwrap() + tag.len() + 4; + // Each entry: name, NUL, pixel type (4), linear (1), reserved (3), x and y sampling (4 + 4). + let mut zero = good.clone(); + let x_sampling = list + 2 + 4 + 1 + 3; + zero[x_sampling..x_sampling + 4].copy_from_slice(&0i32.to_le_bytes()); + let mut swapped = good.clone(); + swapped[list] = b'R'; + swapped[list + 2 + 16] = b'G'; + assert!(crate::exr_index::build(&mut std::io::Cursor::new(good.as_slice()), FileStamp::Virtual).is_ok()); + for bad in [zero, swapped] { + assert!(crate::exr_index::build(&mut std::io::Cursor::new(bad.as_slice()), FileStamp::Virtual).is_err()); + assert!(crate::exr_channels::read_exr_channels(&bad).is_none()); + assert!(crate::exr_channels::layered_image(&bad).is_none()); } } diff --git a/crates/media/src/exr_read.rs b/crates/media/src/exr_read.rs index 6e719c464..3fe4f544e 100644 --- a/crates/media/src/exr_read.rs +++ b/crates/media/src/exr_read.rs @@ -271,7 +271,8 @@ fn read(src: &mut dyn ReadSeek, index: &ExrIndex, req: &ReadRequest) -> Result<( seek::Error::Cancelled => ReadError::Cancelled, seek::Error::Io(why) => ReadError::Io(why), seek::Error::LimitExceeded(why) => ReadError::TooLarge(format!("its OpenEXR channels need more memory than one file may use ({why})")), - seek::Error::Malformed(why) | seek::Error::Unsupported(why) => ReadError::Unreadable(why), + seek::Error::Malformed(why) | seek::Error::Unsupported(why) | seek::Error::UnsupportedCompression(why) => ReadError::Unreadable(why), + other => ReadError::Unreadable(other.to_string()), })?; let stats = ReadStats { chunks: planes.stats.chunks, bytes: planes.stats.bytes, lines: planes.stats.lines }; Ok((planes.planes, stats)) From fa542829e93005433b353f5f42b6be5eb2a0649c Mon Sep 17 00:00:00 2001 From: vangel76 Date: Mon, 16 Nov 2026 22:05:56 +0100 Subject: [PATCH 211/451] #3793: build the OCIO test's expected LUT path from its parts join("luts/grade.cube") keeps the forward slash on Windows, while the code resolves the config's LUT as luts\grade.cube, so the test's text lookup in the read log missed there. The code under test is unchanged. --- crates/engine/src/tests/lut_files.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/engine/src/tests/lut_files.rs b/crates/engine/src/tests/lut_files.rs index 98c95652a..6f6818b23 100644 --- a/crates/engine/src/tests/lut_files.rs +++ b/crates/engine/src/tests/lut_files.rs @@ -192,7 +192,7 @@ fn an_overridden_lut_file_renders_again() { #[test] fn ocio_files_render_again_from_warm_caches() { let dir = tempfile::tempdir().unwrap(); - let (lut, config, grade) = (dir.path().join("file.cube"), dir.path().join("config.ocio"), dir.path().join("luts/grade.cube")); + let (lut, config, grade) = (dir.path().join("file.cube"), dir.path().join("config.ocio"), dir.path().join("luts").join("grade.cube")); std::fs::create_dir_all(dir.path().join("luts")).unwrap(); write(&lut, BLACK, 1_000); write(&grade, BLACK, 1_000); From d671f6e45bbf993a2900c66a21584f9da9c9210f Mon Sep 17 00:00:00 2001 From: vangel76 Date: Mon, 16 Nov 2026 22:30:45 +0100 Subject: [PATCH 212/451] 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. --- crates/host/tests/it/exr_layers.rs | 5 +- crates/media/src/exr_channels.rs | 176 +++++++++++---------------- crates/media/src/exr_index.rs | 98 ++++++++------- crates/media/src/exr_planes.rs | 67 +++++----- crates/media/src/exr_planes/tests.rs | 52 ++++++-- crates/media/src/pool.rs | 4 +- crates/media/src/probe.rs | 7 +- crates/media/tests/it/exr_golden.rs | 107 ++++++++-------- docs/agents.md | 5 +- docs/footage.md | 11 +- docs/target-app-parity.md | 2 +- 11 files changed, 273 insertions(+), 261 deletions(-) diff --git a/crates/host/tests/it/exr_layers.rs b/crates/host/tests/it/exr_layers.rs index 39ea95e22..ebed80b35 100644 --- a/crates/host/tests/it/exr_layers.rs +++ b/crates/host/tests/it/exr_layers.rs @@ -39,8 +39,9 @@ fn extractor_shows_the_chosen_layer_and_channels_of_a_layered_exr() { assert_eq!(r["errors"], json!([]), "the file imports: {r}"); s.execute("comp.new", json!({"name": "EXR", "width": 8, "height": 4, "frameRate": 24, "duration": 1})).unwrap(); let layer = s.execute("layer.addItem", json!({"item": r["items"][0]})).unwrap()["layer"].clone(); - // The picture is the colour layer (diffuse: orange). - assert!(near(px(&s), [1.0, 0.735, 0.0]), "{:?}", px(&s)); + // No unnamed R, G, B: no main picture, black as in After Effects (the layers are reached by + // name, below). + assert!(near(px(&s), [0.0, 0.0, 0.0]), "{:?}", px(&s)); let ch = s.execute("layer.channels", json!({"layer": layer})).unwrap(); let names: Vec<&str> = ch["layers"].as_array().unwrap().iter().filter_map(|l| l["name"].as_str()).collect(); diff --git a/crates/media/src/exr_channels.rs b/crates/media/src/exr_channels.rs index 4c67df8c9..cd2f5b7ce 100644 --- a/crates/media/src/exr_channels.rs +++ b/crates/media/src/exr_channels.rs @@ -13,7 +13,6 @@ //! This module holds the naming and picture rules they share, and whole-file reads of bytes. use craft_exr::decode::PartInfo; -use effectcraft_raster::channels3d::split_channel; use effectcraft_raster::{AuxChannels, Image}; use effectcraft_render::reads::FileStamp; @@ -42,21 +41,6 @@ pub fn unsupported_compression(bytes: &[u8]) -> Option<&'static str> { parts.iter().any(|p| p.compression.starts_with("HTJ2K")).then_some(crate::exr_index::HTJ2K) } -/// How the `image` crate's OpenEXR decoder would show a file: the first part with exact `R`, `G` -/// and `B` channels (alpha `A` when it has one, else opaque), placed in the display window with -/// 0 outside the data window. -#[derive(Clone, Copy, Debug, PartialEq)] -pub(crate) enum Rgb { - /// No part has R, G and B: the decoder refuses the file (a multi-layer file, shown with - /// [`layered_image`]'s rule). - None, - /// The channels (indices into [`ExrIndex::channels`]) hold exactly what it would show. - Planes([usize; 3], Option), - /// The planes can't stand in for it (a depth-named channel, whose plane is filled with the - /// background depth, or another display window): decode with the `image` crate. - Unsupported, -} - /// How many bytes of decoded planes the plane store keeps by itself until the caches' budget is /// set (then it follows the footage frames' cap, see [`crate::exr_planes::set_budget`]: the whole /// common budget on the desktop, #3298), like the frame cache's default @@ -97,79 +81,37 @@ pub fn read_exr_channels(bytes: &[u8]) -> Option { Some(aux_of(&index, &ids, planes)) } -/// Names of the beauty pass, most preferred first, matched against the last part of a layer's -/// name (Blender's `ViewLayer.Combined` is `Combined`): Blender's Combined pass and its -/// compositor's File Output default `Image`, the beauty / rgba / rgb / color of Nuke, Arnold and -/// V-Ray. -const BEAUTY: [&str; 7] = ["combined", "beauty", "image", "rgba", "rgb", "color", "colour"]; - -/// A data pass, never the picture: Cryptomatte (`CryptoMaterial00`), depth, mist, normals, -/// motion vectors, positions, UVs and object / material indices. -fn is_data_layer(layer: &str) -> bool { - let last = layer.rsplit('.').next().unwrap_or(layer).to_ascii_lowercase(); - last.starts_with("crypto") - || ["z", "uv", "id", "mist", "indexob", "indexma"].contains(&last.as_str()) - || ["depth", "normal", "vector", "position", "velocity", "motion", "objectid", "materialid"].iter().any(|k| last.contains(k)) -} - -/// The layer whose colour a multi-layer file shows (see [`layered_image`]). -fn picture_layer<'a>(aux: &AuxChannels, layers: &[&'a str]) -> Option<&'a str> { - // Colour layers: three different channels (not one channel, such as depth, shown in all). - let rgb: Vec<&str> = layers - .iter() - .copied() - .filter(|l| { - let [r, g, b, _] = aux.layer_rgba(l); - !r.is_empty() && !g.is_empty() && !b.is_empty() && r != g - }) - .collect(); - let last = |l: &str| l.rsplit('.').next().unwrap_or(l).to_ascii_lowercase(); - let pictures = || rgb.iter().filter(|l| !is_data_layer(l)); - // The unnamed layer (plain R, G, B), then the beauty pass by name. - rgb.iter() - .find(|l| l.is_empty()) - .or_else(|| BEAUTY.iter().find_map(|k| rgb.iter().find(|l| last(l) == *k))) - .or_else(|| pictures().find(|l| ["combined", "beauty"].iter().any(|k| last(l).contains(k)))) - .or_else(|| pictures().next()) - .or_else(|| layers.iter().find(|l| !is_data_layer(l))) - .or_else(|| rgb.first()) - .or_else(|| layers.first()) - .copied() -} - -/// The planes a multi-layer file's picture is made of (see [`layered_image`]): red, green, blue -/// (one channel thrice for grey) and alpha, by name. Only the names of `aux` are read. -pub(crate) fn picture_names(aux: &AuxChannels) -> Option<([String; 3], Option)> { - let layers = aux.layers(); - let colour = picture_layer(aux, &layers)?; - let names = aux.layer_rgba(colour); - // A layer without R, G and B channels shows its first channel as grey. - let first = aux.names().into_iter().find(|n| split_channel(n).0 == colour).unwrap_or_default(); - let pick = |k: usize| names.get(k).map(String::as_str).filter(|n| !n.is_empty()).unwrap_or(first).to_string(); - let a = names.get(3).filter(|n| !n.is_empty() && aux.get(n).is_some()).cloned(); - Some(([pick(0), pick(1), pick(2)], a)) -} - -/// The picture of a multi-layer OpenEXR file without an unnamed RGB layer (Blender's -/// `ViewLayer.Combined.R`, the compositor's `Image.R`, Nuke's `beauty.R`, …), which the image -/// decoder rejects. After Effects shows a file's main RGBA channels and leaves the other layers -/// to EXtractoR; here that is the beauty pass by name (`BEAUTY`), else the first colour layer -/// that is not a data pass (never Cryptomatte, depth or normals, #412), else the first channel -/// as grey. Linear, straight RGBA as the file stores it. `None` when it is not a readable EXR. -/// Only the picture's channels are decoded (in a multi-part file the other parts aren't read). -pub fn layered_image(bytes: &[u8]) -> Option { +/// The main picture of an OpenEXR file's bytes ([`crate::exr_index::MainPicture`]), linear, +/// straight RGB(A) as the file stores it (a `Y` picture as grey); a file without one (named +/// layers only, as Blender's `ViewLayer.Combined.R`) is black at its display window's size, as +/// After Effects shows it (its layers are reached by name, EXtractoR). Only the picture's +/// channels are decoded (in a multi-part file the other parts aren't read). `None` when it is +/// not a readable EXR. +pub fn picture_image(bytes: &[u8]) -> Option { let mut src = std::io::Cursor::new(bytes); let index = crate::exr_index::build(&mut src, FileStamp::Virtual).ok()?; - let (ids, rgb, a) = index.picture.clone()?; + let (w, h) = index.size(); + let (w, h) = (u32::try_from(w).ok()?, u32::try_from(h).ok()?); + let n = (w as usize).checked_mul(h as usize)?; + let Some(picture) = &index.picture else { + let len = n.checked_mul(3)?; + let mut data: Vec = Vec::new(); + data.try_reserve_exact(len).ok()?; + data.resize(len, 0.0); + return image::Rgb32FImage::from_raw(w, h, data).map(image::DynamicImage::ImageRgb32F); + }; + let ([r, g, b], a) = picture.rgba()?; + let ids = index.picture_ids(); let (planes, _) = read_planes(&mut src, &index, &ReadRequest::full(ids.clone())); - let aux = aux_of(&index, &ids, planes.ok()?); - let [r, g, b] = [aux.get(&rgb[0])?, aux.get(&rgb[1])?, aux.get(&rgb[2])?]; - let a = match &a { - Some(n) => Some(aux.get(n)?), + let planes = planes.ok()?; + let plane = |id: usize| ids.iter().position(|i| *i == id).and_then(|at| planes.get(at)); + let (r, g, b) = (plane(r)?, plane(g)?, plane(b)?); + let a = match a { + Some(a) => Some(plane(a)?), None => None, }; - let n = (aux.width as usize).checked_mul(aux.height as usize)?; - let mut data = Vec::with_capacity(n.checked_mul(4)?); + let mut data = Vec::new(); + data.try_reserve_exact(n.checked_mul(if a.is_some() { 4 } else { 3 })?).ok()?; for i in 0..n { data.extend([r.get(i)?, g.get(i)?, b.get(i)?].map(|v| *v)); if let Some(a) = a { @@ -177,19 +119,24 @@ pub fn layered_image(bytes: &[u8]) -> Option { } } match a { - Some(_) => image::Rgba32FImage::from_raw(aux.width, aux.height, data).map(image::DynamicImage::ImageRgba32F), - None => image::Rgb32FImage::from_raw(aux.width, aux.height, data).map(image::DynamicImage::ImageRgb32F), + Some(_) => image::Rgba32FImage::from_raw(w, h, data).map(image::DynamicImage::ImageRgba32F), + None => image::Rgb32FImage::from_raw(w, h, data).map(image::DynamicImage::ImageRgb32F), } } -/// The size and alpha of a layered file's picture ([`layered_image`]) from its headers alone -/// (import). `None` when it is not a readable EXR. -pub(crate) fn layered_size(bytes: &[u8]) -> Option<(u32, u32, bool)> { +/// The size and alpha of an OpenEXR file's main picture ([`picture_image`]) from its headers +/// alone (import; a file without one is its display window, opaque). `None` when it is not a +/// readable EXR. +pub(crate) fn picture_size(bytes: &[u8]) -> Option<(u32, u32, bool)> { let mut src = std::io::Cursor::new(bytes); let index = crate::exr_index::build(&mut src, FileStamp::Virtual).ok()?; - let (_, _, a) = index.picture.as_ref()?; let (w, h) = index.size(); - Some((w as u32, h as u32, a.is_some())) + Some((u32::try_from(w).ok()?, u32::try_from(h).ok()?, index.picture.as_ref().is_some_and(|p| p.has_alpha()))) +} + +/// The black picture of a file without a main picture, `w` × `h`, opaque (no alpha channel). +pub(crate) fn black_picture(w: u32, h: u32, op: AlphaOp) -> Image { + float_to_image(w, h, op, |_| [0.0, 0.0, 0.0, 1.0]) } /// The picture made of planes `rgb` and `a` (opaque without one) of `aux`, as @@ -375,8 +322,11 @@ mod tests { assert!(read_exr_channels(&bytes.into_inner()).is_none()); } + /// A file of named layers only (Blender's single-part multilayer) imports at its display + /// window's size and shows black, opaque, as After Effects does; its layers stay readable by + /// effects (EXtractoR, Cryptomatte) and nothing is an error. #[test] - fn layered_exr_without_an_unnamed_rgb_layer_imports() { + fn layered_exr_without_an_unnamed_rgb_layer_imports_black() { use exr::prelude::*; let (w, h) = (4usize, 2usize); let ch = |n: &str, v: f32| AnyChannel::new(n, FlatSamples::F32(vec![v; w * h])); @@ -389,8 +339,13 @@ mod tests { assert_eq!((f.width, f.height, f.alpha), (4, 2, effectcraft_project::AlphaMode::Ignore)); let pool = crate::MediaPool::new(); pool.add_bytes("/layers.exr", b.clone()); - let px = pool.frame_at(&f, effectcraft_time::Tick::ZERO).unwrap().get(1, 1); - assert!((px[0] - 1.0).abs() < 1e-4 && px[1] > 0.3 && px[1] < 0.6 && px[2] < 1e-4 && px[3] == 1.0, "diffuse, sRGB-encoded: {px:?}"); + let img = pool.frame_at(&f, effectcraft_time::Tick::ZERO).unwrap(); + assert_eq!((img.width, img.height), (4, 2)); + assert_eq!(img.get(1, 1), [0.0, 0.0, 0.0, 1.0], "black, opaque"); + use effectcraft_render::FootageSource; + let effects = pool.aux(effectcraft_project::ItemId(1), &f, effectcraft_time::Tick::ZERO).expect("the layers, for effects"); + assert_eq!(effects.get("diffuse.R").unwrap(), [1.0; 8].as_slice()); + assert_eq!(effects.get("depth.Z").unwrap(), [7.0; 8].as_slice()); let aux = read_exr_channels(&b).unwrap(); assert_eq!(aux.layers(), ["depth", "diffuse"]); assert_eq!(aux.layer_rgba("diffuse"), ["diffuse.R", "diffuse.G", "diffuse.B", ""].map(String::from)); @@ -427,7 +382,7 @@ mod tests { assert!(aux.get("ViewLayer.Combined.R").is_some()); } - /// Straight RGBA of [`layered_image`] at pixel 0 for a file of single-value channels. + /// Straight RGBA of [`picture_image`] at pixel 0 for a file of single-value channels. fn picture>(channels: &[(S, f32)]) -> Vec { use exr::prelude::*; let (w, h) = (2usize, 2usize); @@ -435,15 +390,17 @@ mod tests { let image = Image::from_layer(Layer::new((w, h), LayerAttributes::default(), Encoding::FAST_LOSSLESS, AnyChannels::sort(list.into()))); let mut bytes = std::io::Cursor::new(Vec::new()); image.write().to_buffered(&mut bytes).unwrap(); - let img = layered_image(bytes.get_ref()).unwrap().to_rgba32f(); + let img = picture_image(bytes.get_ref()).unwrap().to_rgba32f(); + assert_eq!(img.dimensions(), (2, 2), "the display window's size"); img.get_pixel(0, 0).0.to_vec() } - /// #412: a Blender compositor File Output (multilayer) names its beauty pass `Image`, and its - /// Cryptomatte layers (lowercase `r, g, b, a`) sort first. The picture was CryptoMaterial00; - /// it is the Image layer, and data passes are never the picture. + /// The main picture is After Effects': the unprefixed `R`, `G`, `B` (`A`), else `Y` (`A`) as + /// grey. A file of named layers only (Blender's multilayer `ViewLayer.Combined.R`, a + /// compositor's `Image.R`, Cryptomatte, depth) has none and shows black, opaque (#412 chose a + /// beauty pass by name before; its layers are reached by name, EXtractoR). #[test] - fn layered_exr_shows_the_beauty_pass_not_cryptomatte() { + fn the_picture_is_the_unprefixed_channels_else_black() { let mut blender = vec![]; for layer in ["CryptoMaterial00", "CryptoMaterial01", "CryptoMaterial02"] { blender.extend(["r", "g", "b", "a"].map(|c| (format!("{layer}.{c}"), 0.9))); @@ -452,8 +409,8 @@ mod tests { blender.extend(["R", "G", "B", "A"].map(|c| (format!("{layer}.{c}"), v))); } blender.push(("Mist.Z".into(), 0.7)); - assert_eq!(picture(&blender), [0.5; 4], "the Image layer"); - // Blender's render-layer names and Nuke's beauty. + let black = [0.0, 0.0, 0.0, 1.0]; + assert_eq!(picture(&blender), black, "named layers only: no Image or beauty pass by name"); assert_eq!( picture(&[ ("ViewLayer.CryptoObject00.r", 0.9), @@ -463,12 +420,15 @@ mod tests { ("ViewLayer.Combined.G", 0.2), ("ViewLayer.Combined.B", 0.2) ]), - [0.2, 0.2, 0.2, 1.0] + black, + "Blender's Combined pass" ); - // No beauty name: the first colour layer that isn't a data pass. - let no_beauty: Vec<(String, f32)> = blender.iter().filter(|(n, _)| !n.starts_with("Image")).cloned().collect(); - assert_eq!(picture(&no_beauty), [0.3; 4], "GlossCol, not Cryptomatte"); - // Only data and a grey pass: the grey pass, not depth. - assert_eq!(picture(&[("Depth.Z", 9.0), ("AO.Y", 0.25)]), [0.25, 0.25, 0.25, 1.0]); + assert_eq!(picture(&[("Depth.Z", 9.0), ("AO.Y", 0.25)]), black, "a layer's Y is not the picture"); + // Unprefixed channels are, whatever the named layers beside them. + assert_eq!(picture(&[("R", 0.1), ("G", 0.2), ("B", 0.3), ("Image.R", 0.9)]), [0.1, 0.2, 0.3, 1.0]); + assert_eq!(picture(&[("R", 0.1), ("G", 0.2), ("B", 0.3), ("A", 0.5)]), [0.1, 0.2, 0.3, 0.5]); + // Luminance: grey, with its alpha. + assert_eq!(picture(&[("Y", 0.25)]), [0.25, 0.25, 0.25, 1.0]); + assert_eq!(picture(&[("A", 0.5), ("Y", 0.25), ("diffuse.R", 0.9)]), [0.25, 0.25, 0.25, 0.5]); } } diff --git a/crates/media/src/exr_index.rs b/crates/media/src/exr_index.rs index bce3dd920..9de4e2b42 100644 --- a/crates/media/src/exr_index.rs +++ b/crates/media/src/exr_index.rs @@ -18,13 +18,14 @@ use std::collections::{HashMap, VecDeque}; use std::io::SeekFrom; use std::sync::{Arc, Mutex, PoisonError}; +use craft_exr::channels::ColorLayout; use craft_exr::decode::{Limits, PartInfo, Window}; use craft_exr::seek; use effectcraft_raster::AuxChannels; use effectcraft_raster::channels3d::BACKGROUND_DEPTH; use effectcraft_render::reads::FileStamp; -use crate::exr_channels::{MAX_DISPLAY_PIXELS, Rgb, channel_name, is_depth, parse_manifest, part_name, picture_names}; +use crate::exr_channels::{MAX_DISPLAY_PIXELS, channel_name, is_depth, parse_manifest, part_name}; use crate::exr_read::{ExrSource, Opened, ReadSeek}; /// One channel of the file, in file order (parts in order, each part's channels as its header @@ -40,6 +41,30 @@ pub(crate) struct IndexChannel { pub(crate) fill: f32, } +/// A file's main picture: its channels (indices into [`ExrIndex::channels`]) in the layout's +/// order, `R`, `G`, `B` (`A`) or `Y` (`A`). +#[derive(Clone, Debug, PartialEq)] +pub(crate) struct MainPicture { + pub(crate) layout: ColorLayout, + pub(crate) ids: Vec, +} + +impl MainPicture { + /// The red, green, blue and alpha channels (a `Y` picture is grey: `Y` three times). + pub(crate) fn rgba(&self) -> Option<([usize; 3], Option)> { + let id = |i: usize| self.ids.get(i).copied(); + match self.layout { + ColorLayout::Rgb | ColorLayout::Rgba => Some(([id(0)?, id(1)?, id(2)?], id(3))), + ColorLayout::Y | ColorLayout::YA => Some(([id(0)?; 3], id(1))), + } + } + + /// It has an alpha channel. + pub(crate) fn has_alpha(&self) -> bool { + matches!(self.layout, ColorLayout::Rgba | ColorLayout::YA) + } +} + /// What an OpenEXR file holds ([`get`]). pub(crate) struct ExrIndex { /// The headers and chunk tables, as `craft-exr` reads them. @@ -49,12 +74,10 @@ pub(crate) struct ExrIndex { /// The first part's display window: every plane covers it. pub(crate) display: Window, pub(crate) channels: Vec, - /// How the `image` crate's decoder would show the file (indices into `channels`). - pub(crate) rgb: Rgb, - /// A file the decoder refuses ([`Rgb::None`]): the channels its picture is made of - /// ([`picture_names`]: red, green, blue and alpha by name) and every channel answering to - /// one of those names (lookups ignore case). - pub(crate) picture: Option<(Vec, [String; 3], Option)>, + /// The file's main picture ([`craft_exr::channels::main_picture`]), as After Effects shows + /// it: `None` for a file of named layers only (it shows black; effects reach its layers by + /// name). + pub(crate) picture: Option, /// The names only (planes empty), manifests and aliases: for the channel lists and for /// resolving what effects declare. Never handed to an effect. pub(crate) names: Arc, @@ -66,20 +89,19 @@ impl ExrIndex { (self.display.width as usize, self.display.height as usize) } - /// The channels the picture is made of: the image crate's choice ([`Rgb::Planes`]) or the - /// layered rule's. `None`: the planes can't make it (decode with the `image` crate). - pub(crate) fn picture_ids(&self) -> Option> { - match self.rgb { - Rgb::Planes([r, g, b], a) => Some([Some(r), Some(g), Some(b), a].into_iter().flatten().collect()), - Rgb::None => self.picture.as_ref().map(|(ids, _, _)| ids.clone()), - Rgb::Unsupported => None, - } + /// The channels the picture is made of, in file order (none for a file without a main + /// picture). + pub(crate) fn picture_ids(&self) -> Vec { + let mut ids = self.picture.as_ref().map(|p| p.ids.clone()).unwrap_or_default(); + ids.sort_unstable(); + ids.dedup(); + ids } /// Every channel but the picture's (what [`crate::exr_planes`] means by all channels: the /// picture is kept converted, by the media pool, not as planes too). pub(crate) fn aux_ids(&self) -> Vec { - let picture = self.picture_ids().unwrap_or_default(); + let picture = self.picture_ids(); (0..self.channels.len()).filter(|i| !picture.contains(i)).collect() } @@ -185,17 +207,19 @@ pub(crate) fn build(src: &mut dyn ReadSeek, stamp: FileStamp) -> Result/name` and `…/manifest`, in any @@ -217,26 +241,14 @@ fn manifests(parts: &[PartInfo]) -> Vec<(String, Vec<(String, u32)>)> { out } -/// How the `image` crate's decoder would show the file: the first part with exact `R`, `G` and -/// `B` channels (alpha `A` when it has one), unless its planes can't stand in for it (a -/// depth-named channel, filled with the background depth outside the data window, or a part -/// with its own display window). -fn rgb_of(parts: &[PartInfo], display: Window, channels: &[IndexChannel]) -> Rgb { - for (pi, p) in parts.iter().enumerate() { - let find = |c: &str| p.channels.iter().position(|ch| ch.name == c); - let (Some(r), Some(g), Some(b)) = (find("R"), find("G"), find("B")) else { continue }; - let id = |ci: usize| channels.iter().position(|c| c.part == pi && c.channel == ci); - let picked = [Some(r), Some(g), Some(b), find("A")]; - let ids: Vec> = picked.iter().map(|c| c.and_then(id)).collect(); - let (Some(Some(r)), Some(Some(g)), Some(Some(b))) = (ids.first(), ids.get(1), ids.get(2)) else { return Rgb::Unsupported }; - let a = ids.get(3).copied().flatten(); - let depth = [Some(*r), Some(*g), Some(*b), a].iter().flatten().any(|i| channels.get(*i).is_some_and(|c| is_depth(&c.name))); - if depth || p.display_window != display { - return Rgb::Unsupported; - } - return Rgb::Planes([*r, *g, *b], a); - } - Rgb::None +/// The file's main picture by the OpenEXR convention, as After Effects shows it +/// ([`craft_exr::channels::main_picture`]: the unprefixed `R`, `G`, `B` (`A`) of the first part +/// that has them, else the first unprefixed `Y` (`A`)), as channel ids. The parts' channels are +/// matched as stored (a part's own `R`, not the `part.R` plane name). +fn main_picture(parts: &[PartInfo], channels: &[IndexChannel]) -> Option { + let (part, layout, picked) = craft_exr::channels::main_picture(parts.iter().map(|p| p.channels.iter().map(|c| c.name.as_str())))?; + let ids = picked.iter().map(|ci| channels.iter().position(|c| c.part == part && c.channel == *ci)).collect::>>()?; + Some(MainPicture { layout, ids }) } /// At most this many files are indexed, and their indexes take at most [`INDEXED_BYTES`]; the diff --git a/crates/media/src/exr_planes.rs b/crates/media/src/exr_planes.rs index 1a102c2d0..40b111d9f 100644 --- a/crates/media/src/exr_planes.rs +++ b/crates/media/src/exr_planes.rs @@ -34,7 +34,7 @@ use effectcraft_render::reads::ReadFile; use crate::convert::AlphaOp; use crate::exr_channels::CACHE_BUDGET; -use crate::exr_channels::{Rgb, planes_picture}; +use crate::exr_channels::{black_picture, planes_picture}; use crate::exr_index::{self, ExrIndex, IndexError}; use crate::exr_read::{ExrSource, Opened, ReadError, ReadRequest, read_planes}; @@ -1139,10 +1139,10 @@ pub(crate) enum Picture { Legacy, } -/// The picture of the OpenEXR at `path` made of its planes: the channels the `image` crate's -/// decoder would show, or a multi-layer file's colour layer (see -/// [`crate::exr_channels::layered_image`]). With `extra` (an effect reads the footage's -/// channels) those channels are read in the same pass and kept for the effects. +/// The picture of the OpenEXR at `path` made of its planes: its main picture +/// ([`crate::exr_index::MainPicture`]), or black for a file without one (named layers only). +/// With `extra` (an effect reads the footage's channels) those channels are read in the same +/// pass and kept for the effects. pub(crate) fn picture(path: &str, source: &ExrSource, op: AlphaOp, extra: Option<&AuxNeed>) -> Picture { let mut extra = extra; for _ in 0..3 { @@ -1153,14 +1153,17 @@ pub(crate) fn picture(path: &str, source: &ExrSource, op: AlphaOp, extra: Option Err(IndexError::Unsupported(why)) => return Picture::Done(Err(why.to_string())), Err(_) => return Picture::Legacy, }; - let Some(ids) = index.picture_ids() else { return Picture::Legacy }; - let mut want = Want { all: false, ids: ids.into_iter().collect() }; + let mut want = Want { all: false, ids: index.picture_ids().into_iter().collect() }; if let Some(need) = extra { match need_ids(&index, need) { Some(more) => want.ids.extend(more), None => want.all = true, } } + // (no main picture and nothing for the effects: black, nothing read) + if !want.all && want.ids.is_empty() { + return Picture::Done(picture_of(&index, None, op).ok_or_else(|| "the picture can't be made".to_string())); + } let by = if extra.is_some() { Use::Picture } else { Use::Other }; let batch = match store().get_opened(path, source, &index, &want, by, opened, since) { Ok(b) => b, @@ -1175,12 +1178,12 @@ pub(crate) fn picture(path: &str, source: &ExrSource, op: AlphaOp, extra: Option // (the whole file's decode says why) Err(Refused::Stopped | Refused::Unreadable) => return Picture::Legacy, }; - let img = picture_of(&index, &batch, op); + let img = picture_of(&index, Some(&batch), op); // The picture is kept by the pool once converted, not twice: its planes go, but for those // an effect names (EXtractoR reading "R"). if img.is_some() { let named = extra.and_then(|n| need_ids(&index, n)).unwrap_or_default(); - let picture: BTreeSet = index.picture_ids().unwrap_or_default().into_iter().filter(|id| !named.contains(id)).collect(); + let picture: BTreeSet = index.picture_ids().into_iter().filter(|id| !named.contains(id)).collect(); let keep: BTreeSet = batch.ids.iter().copied().filter(|id| !picture.contains(id)).collect(); store().keep_only(path, batch, &keep); } @@ -1192,27 +1195,20 @@ pub(crate) fn picture(path: &str, source: &ExrSource, op: AlphaOp, extra: Option Picture::Legacy } -/// The picture of the file `index` describes, made of the planes of `batch`. -fn picture_of(index: &ExrIndex, batch: &Batch, op: AlphaOp) -> Option { - let aux = &batch.aux; - match index.rgb { - Rgb::Planes([r, g, b], a) => { - let a = match a { - Some(a) => Some(batch.plane(a)?), - None => None, - }; - planes_picture(aux, [batch.plane(r)?, batch.plane(g)?, batch.plane(b)?], a, op) - } - Rgb::None => { - let (_, rgb, a) = index.picture.as_ref()?; - let a = match a { - Some(n) => Some(aux.get(n)?), - None => None, - }; - planes_picture(aux, [aux.get(&rgb[0])?, aux.get(&rgb[1])?, aux.get(&rgb[2])?], a, op) - } - Rgb::Unsupported => None, - } +/// The picture of the file `index` describes, made of the planes of `batch` (black, opaque, for +/// a file without a main picture, which needs no planes). +fn picture_of(index: &ExrIndex, batch: Option<&Batch>, op: AlphaOp) -> Option { + let Some(main) = &index.picture else { + let (w, h) = index.size(); + return Some(black_picture(u32::try_from(w).ok()?, u32::try_from(h).ok()?, op)); + }; + let batch = batch?; + let ([r, g, b], a) = main.rgba()?; + let a = match a { + Some(a) => Some(batch.plane(a)?), + None => None, + }; + planes_picture(&batch.aux, [batch.plane(r)?, batch.plane(g)?, batch.plane(b)?], a, op) } /// The picture of the OpenEXR at `path` (as [`picture`]) of only the display rows `rows`: those @@ -1225,10 +1221,11 @@ pub(crate) fn picture_rows(path: &str, source: &ExrSource, op: AlphaOp, rows: (i Err(IndexError::Unsupported(why)) => return Picture::Done(Err(why.to_string())), Err(_) => return Picture::Legacy, }; - let Some(mut ids) = index.picture_ids() else { return Picture::Legacy }; // (in file order: the planes are looked up by id) - ids.sort_unstable(); - ids.dedup(); + let ids = index.picture_ids(); + if ids.is_empty() { + return Picture::Done(picture_of(&index, None, op).ok_or_else(|| "the picture can't be made".to_string())); + } let opened = match opened { Some(o) => Ok(o), None => source.open(), @@ -1257,7 +1254,7 @@ pub(crate) fn picture_rows(path: &str, source: &ExrSource, op: AlphaOp, rows: (i let file = ReadFile::new(path, opened.stamp); crate::reads::note(file.clone()); let batch = Batch { index: index.clone(), ids, all: false, aux: Arc::new(aux), file }; - match picture_of(&index, &batch, op) { + match picture_of(&index, Some(&batch), op) { Some(img) => Picture::Done(Ok(img)), None => Picture::Legacy, } @@ -1286,7 +1283,7 @@ fn aux_of(path: &str, source: &ExrSource, need: &AuxNeed, with_picture: bool) -> None => Want { all: true, ids: BTreeSet::new() }, }; if with_picture { - want.ids.extend(index.picture_ids().unwrap_or_default()); + want.ids.extend(index.picture_ids()); } match store().get_opened(path, source, &index, &want, Use::Other, opened, since) { Ok(b) => return Some(b.aux.clone()), diff --git a/crates/media/src/exr_planes/tests.rs b/crates/media/src/exr_planes/tests.rs index 95b41e4b9..f11985f7a 100644 --- a/crates/media/src/exr_planes/tests.rs +++ b/crates/media/src/exr_planes/tests.rs @@ -197,6 +197,42 @@ fn multipart_channels_are_found_by_their_stored_names() { assert!(names.channels.iter().all(|(_, p)| p.is_empty()), "no pixels decoded"); } +/// The main picture is the first part with unprefixed `R`, `G`, `B`: a depth part before it +/// isn't the picture (nor read for it), the second part's RGBA is. +#[test] +fn a_depth_part_first_leaves_the_picture_to_the_rgba_part() { + let bytes = write(vec![part(Some("depth"), &[("Z", false)], SIZE, Compression::ZIP1), part(Some("beauty"), &RGBA, SIZE, Compression::ZIP1)], SIZE); + let file = Temp::new("depth-first", &bytes); + let f = crate::probe(&file.0).unwrap(); + assert_eq!((f.width, f.height), (SIZE.0 as u32, SIZE.1 as u32)); + let index = crate::exr_index::get(&f.path, &ExrSource::Bytes(bytes.as_slice().into())).unwrap(); + let names: Vec<&str> = index.picture.as_ref().unwrap().ids.iter().map(|i| index.channels[*i].name.as_str()).collect(); + assert_eq!(names, ["beauty.R", "beauty.G", "beauty.B", "beauty.A"]); + let img = crate::MediaPool::new().frame_at(&f, Tick::ZERO).unwrap(); + assert_eq!(bits(&img), bits(&image_crates(&bytes, &f)), "the RGBA part, as the image crate shows it"); + let d = decodes_of(&f.path); + assert_eq!(d.last().unwrap().stats.chunks, [0, SIZE.1], "only the RGBA part's chunks"); +} + +/// A luminance file (`Y` only, no `R`, `G`, `B`) is grey, as before. +#[test] +fn a_luminance_file_is_grey() { + let bytes = write(vec![part(None, &[("Y", true)], SIZE, Compression::ZIP1)], SIZE); + let file = Temp::new("luminance", &bytes); + let f = crate::probe(&file.0).unwrap(); + let path = f.path.clone(); + let source = ExrSource::Bytes(bytes.as_slice().into()); + let Picture::Done(Ok(img)) = picture(&path, &source, AlphaOp::of(&f, FloatCurve::Linear), None) else { panic!("a picture") }; + for (i, px) in img.data.iter().enumerate() { + let y = f16::from_f32(value(i, 0, false)).to_f32(); + assert_eq!([px[0], px[1], px[2], px[3]], [y, y, y, 1.0], "pixel {i}"); + } + assert_eq!( + bits(&crate::MediaPool::new().frame_at(&f, Tick::ZERO).unwrap()), + bits(&crate::convert::dynamic_to_image(&crate::exr_channels::picture_image(&bytes).unwrap(), AlphaOp::of(&f, FloatCurve::Srgb))) + ); +} + /// #3271: footage whose effects read 3 channels decodes its picture with them in one pass: one /// read of the file's chunks, one decode, for the picture and the effect. #[test] @@ -302,7 +338,7 @@ fn a_request_not_covered_decodes_only_what_is_missing() { let source = ExrSource::Bytes(bytes); let store = PlaneStore::new(CACHE_BUDGET); let index = crate::exr_index::get(path, &source).unwrap(); - let picture: BTreeSet = index.picture_ids().unwrap().into_iter().collect(); + let picture: BTreeSet = index.picture_ids().into_iter().collect(); let normal: BTreeSet = index.ids_named(["normal.R", "normal.G"]).into_iter().collect(); store.get(path, &source, &index, &Want { all: false, ids: picture.clone() }, Use::Other).unwrap(); let b = store.get(path, &source, &index, &Want { all: false, ids: normal.clone() }, Use::Other).unwrap(); @@ -570,7 +606,7 @@ fn picture_from_planes_is_the_image_crates() { for (k, bytes) in files.iter().enumerate() { let path = format!("/3271-planes-{k}.exr"); let source = ExrSource::Bytes(bytes.as_slice().into()); - assert!(matches!(crate::exr_index::get(&path, &source).unwrap().rgb, Rgb::Planes(..)), "file {k}"); + assert!(crate::exr_index::get(&path, &source).unwrap().picture.is_some(), "file {k}"); let img = crate::probe::load_oriented(bytes, Some(image::ImageFormat::OpenExr)).unwrap(); for alpha in [AlphaMode::Straight, AlphaMode::Premultiplied, AlphaMode::Ignore] { for curve in [FloatCurve::Srgb, FloatCurve::Linear, FloatCurve::Gamma24] { @@ -761,7 +797,7 @@ fn picture_from_planes_with_data_window_offsets_is_the_image_crates() { for (k, bytes) in files.iter().enumerate() { let path = format!("/3271-offsets-{k}.exr"); let source = ExrSource::Bytes(bytes.as_slice().into()); - assert!(matches!(crate::exr_index::get(&path, &source).unwrap().rgb, Rgb::Planes(..)), "file {k}"); + assert!(crate::exr_index::get(&path, &source).unwrap().picture.is_some(), "file {k}"); let f = Footage::default(); let Picture::Done(Ok(got)) = picture(&path, &source, AlphaOp::of(&f, FloatCurve::Linear), None) else { panic!("file {k}: a picture") }; let img = crate::probe::load_oriented(bytes, Some(image::ImageFormat::OpenExr)).unwrap(); @@ -780,7 +816,7 @@ fn a_failed_request_fails_only_requests_as_large() { let source = ExrSource::Bytes(bytes.into()); let store = PlaneStore::new(CACHE_BUDGET); let index = crate::exr_index::get(path, &source).unwrap(); - let picture = Want { all: false, ids: index.picture_ids().unwrap().into_iter().collect() }; + let picture = Want { all: false, ids: index.picture_ids().into_iter().collect() }; let all = Want { all: true, ids: (0..4).collect() }; let held = store.get(path, &source, &index, &picture, Use::Picture).unwrap(); assert_eq!(store.get(path, &source, &index, &all, Use::Other).err(), Some(Refused::Unreadable)); @@ -846,7 +882,7 @@ fn a_hostile_data_window_is_refused_not_allocated() { assert!(!crate::exr_index::safe_to_decode(&bytes)); assert!(crate::exr_index::build(&mut std::io::Cursor::new(bytes.as_slice()), FileStamp::Virtual).is_err()); assert!(crate::exr_channels::read_exr_channels(&bytes).is_none()); - assert!(crate::exr_channels::layered_image(&bytes).is_none()); + assert!(crate::exr_channels::picture_image(&bytes).is_none()); let b: Arc<[u8]> = bytes.into(); assert!(crate::probe_bytes(&path, b.clone()).is_err(), "import refuses it"); let pool = crate::MediaPool::new(); @@ -877,7 +913,7 @@ fn damaged_files_never_panic() { let mut bad = good.clone(); bad[at] ^= [0xff, 0x80, 0x01, 0x7f][i % 4]; let _ = crate::exr_channels::read_exr_channels(&bad); - let _ = crate::exr_channels::layered_image(&bad); + let _ = crate::exr_channels::picture_image(&bad); let mut src = std::io::Cursor::new(bad.as_slice()); if let Ok(ix) = crate::exr_index::build(&mut src, FileStamp::Virtual) { let req = ReadRequest { rows: Some(3..9), level: 1, ..ReadRequest::full((0..ix.channels.len()).collect()) }; @@ -940,7 +976,7 @@ fn an_invalid_channel_list_is_refused() { for bad in [zero, swapped] { assert!(crate::exr_index::build(&mut std::io::Cursor::new(bad.as_slice()), FileStamp::Virtual).is_err()); assert!(crate::exr_channels::read_exr_channels(&bad).is_none()); - assert!(crate::exr_channels::layered_image(&bad).is_none()); + assert!(crate::exr_channels::picture_image(&bad).is_none()); } } @@ -1497,7 +1533,7 @@ fn a_failed_picture_leaves_the_other_channels_readable() { let store = PlaneStore::new(CACHE_BUDGET); let source = ExrSource::Bytes(bytes); let index = crate::exr_index::get(path, &source).unwrap(); - let picture = Want { all: false, ids: index.picture_ids().unwrap().into_iter().collect() }; + let picture = Want { all: false, ids: index.picture_ids().into_iter().collect() }; assert!(matches!(store.get(path, &source, &index, &picture, Use::Other), Err(Refused::TooLarge(_)))); assert!(store.get(path, &source, &index, &picture, Use::Other).is_err(), "remembered"); let rest = store.get(path, &source, &index, &Want { all: true, ids: Default::default() }, Use::Other).expect("the other channels"); diff --git a/crates/media/src/pool.rs b/crates/media/src/pool.rs index b110b5079..7b3644722 100644 --- a/crates/media/src/pool.rs +++ b/crates/media/src/pool.rs @@ -1668,8 +1668,8 @@ impl Inner { Ok(img) => Ok(dynamic_to_image(&img, op)), // Over the size limit: the layered fallback would allocate its planes anyway. Err(e @ image::ImageError::Limits(_)) => Err(MediaError::Decode(format!("{path}: {e}"))), - // A multi-layer OpenEXR file without an unnamed RGB layer: its colour layer. - Err(e) => match crate::exr_channels::layered_image(&bytes) { + // An OpenEXR file the decoder refuses (no unnamed RGB): its main picture, or black. + Err(e) => match crate::exr_channels::picture_image(&bytes) { Some(img) => Ok(dynamic_to_image(&img, op)), None => Err(MediaError::Decode(format!("{path}: {e}"))), }, diff --git a/crates/media/src/probe.rs b/crates/media/src/probe.rs index 3e4682577..789043325 100644 --- a/crates/media/src/probe.rs +++ b/crates/media/src/probe.rs @@ -292,9 +292,10 @@ fn probe_still_bytes(path: &str, bytes: &[u8], fmt: image::ImageFormat) -> Resul (w, h, dec.color_type().has_alpha()) } Err(e) => { - // A multi-layer OpenEXR file without an unnamed RGB layer: its picture's size and - // alpha from the headers alone (#3271), no pixels decoded. - let size = (fmt == image::ImageFormat::OpenExr).then(|| crate::exr_channels::layered_size(bytes)).flatten(); + // An OpenEXR file without an unnamed RGB part (a `Y` picture, or named layers only, + // shown black): its picture's size and alpha from the headers alone (#3271), no + // pixels decoded. + let size = (fmt == image::ImageFormat::OpenExr).then(|| crate::exr_channels::picture_size(bytes)).flatten(); size.ok_or_else(|| MediaError::Decode(format!("{path}: {e}")))? } }; diff --git a/crates/media/tests/it/exr_golden.rs b/crates/media/tests/it/exr_golden.rs index f760ed7c2..e420de1a3 100644 --- a/crates/media/tests/it/exr_golden.rs +++ b/crates/media/tests/it/exr_golden.rs @@ -248,8 +248,8 @@ fn files() -> Vec<(&'static str, Vec, bool)> { true, ), ( - // The image crate shows the part "depth" (the first with R, G and B), whose planes are - // filled with the background depth outside its data window: decoded by the image crate. + // The picture is the part "depth" (the first with R, G and B, as the image crate shows + // it): its channels are colour, 0 outside the data window, despite the part's name. "multipart_depth_named_rgb_zip16", write( vec![ @@ -336,7 +336,10 @@ fn hashes(name: &str, bytes: &[u8], aux_first: bool) -> Vec<(String, u64, bool)> out } -/// Hashes taken on main before #474's shared decode (`EXR_GOLDEN_PRINT=1`). +/// Hashes taken on main before #474's shared decode (`EXR_GOLDEN_PRINT=1`). The pictures of +/// the files of named layers only (`layered_*`, `multipart_blender5_rle`) were re-pinned when the +/// picture became After Effects' main picture (black for those files, their channels unchanged), +/// and `multipart_depth_named_rgb_zip16`'s channels when the picture's channels kept a fill of 0. const PINNED: &[(&str, &str, u64)] = &[ ("rgba_half_zip16", "probe", 0x0a32e074a28c1f66), ("rgba_half_zip16", "probed/linear", 0xa84600283dce98f6), @@ -352,12 +355,12 @@ const PINNED: &[(&str, &str, u64)] = &[ ("rgb_float_piz", "ignore/linear", 0xa6e8fbbad371a2ae), ("rgb_float_piz", "preserve_rgb", 0xa6e8fbbad371a2ae), ("rgb_float_piz", "aux", 0x554623d237c2e5ef), - ("layered_rle", "probe", 0x0a32e074a28c1f66), - ("layered_rle", "probed/linear", 0xa84600283dce98f6), - ("layered_rle", "straight/linear", 0xf028e1367a2fbb30), - ("layered_rle", "premul/linear", 0xa84600283dce98f6), - ("layered_rle", "ignore/linear", 0xa90a57f9a67f7468), - ("layered_rle", "preserve_rgb", 0xc8e0050f5efe75b7), + ("layered_rle", "probe", 0x6a38346c4c5662d5), + ("layered_rle", "probed/linear", 0x63d9c6245f75ef06), + ("layered_rle", "straight/linear", 0x63d9c6245f75ef06), + ("layered_rle", "premul/linear", 0x63d9c6245f75ef06), + ("layered_rle", "ignore/linear", 0x63d9c6245f75ef06), + ("layered_rle", "preserve_rgb", 0x63d9c6245f75ef06), ("layered_rle", "aux", 0xa6b9bd9f02c192ad), ("unnamed_rgb_plus_layers_zip1", "probe", 0x0a32e074a28c1f66), ("unnamed_rgb_plus_layers_zip1", "probed/linear", 0xa84600283dce98f6), @@ -380,12 +383,12 @@ const PINNED: &[(&str, &str, u64)] = &[ ("multipart_diffuse_then_beauty_zip1", "ignore/linear", 0xa90a57f9a67f7468), ("multipart_diffuse_then_beauty_zip1", "preserve_rgb", 0xa90a57f9a67f7468), ("multipart_diffuse_then_beauty_zip1", "aux", 0x6724d6dfd56a04cb), - ("multipart_blender5_rle", "probe", 0x0a32e074a28c1f66), - ("multipart_blender5_rle", "probed/linear", 0xa84600283dce98f6), - ("multipart_blender5_rle", "straight/linear", 0xf028e1367a2fbb30), - ("multipart_blender5_rle", "premul/linear", 0xa84600283dce98f6), - ("multipart_blender5_rle", "ignore/linear", 0xa90a57f9a67f7468), - ("multipart_blender5_rle", "preserve_rgb", 0xc8e0050f5efe75b7), + ("multipart_blender5_rle", "probe", 0x6a38346c4c5662d5), + ("multipart_blender5_rle", "probed/linear", 0x63d9c6245f75ef06), + ("multipart_blender5_rle", "straight/linear", 0x63d9c6245f75ef06), + ("multipart_blender5_rle", "premul/linear", 0x63d9c6245f75ef06), + ("multipart_blender5_rle", "ignore/linear", 0x63d9c6245f75ef06), + ("multipart_blender5_rle", "preserve_rgb", 0x63d9c6245f75ef06), ("multipart_blender5_rle", "aux", 0x522ae4819dd92e89), ("unnamed_rgb_window_smaller_zip16", "probe", 0x0a32e074a28c1f66), ("unnamed_rgb_window_smaller_zip16", "probed/linear", 0x19eb3b1a88d108a7), @@ -401,19 +404,19 @@ const PINNED: &[(&str, &str, u64)] = &[ ("rgb_float_window_larger_piz", "ignore/linear", 0x8e3847d48f9967a6), ("rgb_float_window_larger_piz", "preserve_rgb", 0x8e3847d48f9967a6), ("rgb_float_window_larger_piz", "aux", 0x7ccc9f86e6ff6140), - ("layered_window_smaller_zip16", "probe", 0x0a32e074a28c1f66), - ("layered_window_smaller_zip16", "probed/linear", 0x19eb3b1a88d108a7), - ("layered_window_smaller_zip16", "straight/linear", 0x2c73f9acaa936420), - ("layered_window_smaller_zip16", "premul/linear", 0x19eb3b1a88d108a7), - ("layered_window_smaller_zip16", "ignore/linear", 0x3b86057d18a16bf0), - ("layered_window_smaller_zip16", "preserve_rgb", 0x5b999014e4a64bb2), + ("layered_window_smaller_zip16", "probe", 0x6a38346c4c5662d5), + ("layered_window_smaller_zip16", "probed/linear", 0x63d9c6245f75ef06), + ("layered_window_smaller_zip16", "straight/linear", 0x63d9c6245f75ef06), + ("layered_window_smaller_zip16", "premul/linear", 0x63d9c6245f75ef06), + ("layered_window_smaller_zip16", "ignore/linear", 0x63d9c6245f75ef06), + ("layered_window_smaller_zip16", "preserve_rgb", 0x63d9c6245f75ef06), ("layered_window_smaller_zip16", "aux", 0x443480a1d789e63c), - ("layered_window_larger_piz", "probe", 0x0a32e074a28c1f66), - ("layered_window_larger_piz", "probed/linear", 0x443afe4029748836), - ("layered_window_larger_piz", "straight/linear", 0xb32b44880f746826), - ("layered_window_larger_piz", "premul/linear", 0x443afe4029748836), - ("layered_window_larger_piz", "ignore/linear", 0xaa01706accce2cc4), - ("layered_window_larger_piz", "preserve_rgb", 0xb2cbb40b10bc56b4), + ("layered_window_larger_piz", "probe", 0x6a38346c4c5662d5), + ("layered_window_larger_piz", "probed/linear", 0x63d9c6245f75ef06), + ("layered_window_larger_piz", "straight/linear", 0x63d9c6245f75ef06), + ("layered_window_larger_piz", "premul/linear", 0x63d9c6245f75ef06), + ("layered_window_larger_piz", "ignore/linear", 0x63d9c6245f75ef06), + ("layered_window_larger_piz", "preserve_rgb", 0x63d9c6245f75ef06), ("layered_window_larger_piz", "aux", 0xb7d91c8eea56a772), ("unnamed_rgb_plus_layers_tiled_zip16", "probe", 0x0a32e074a28c1f66), ("unnamed_rgb_plus_layers_tiled_zip16", "probed/linear", 0x7612f20634fe957e), @@ -422,12 +425,12 @@ const PINNED: &[(&str, &str, u64)] = &[ ("unnamed_rgb_plus_layers_tiled_zip16", "ignore/linear", 0xbbf236635dcaac90), ("unnamed_rgb_plus_layers_tiled_zip16", "preserve_rgb", 0x15b555a243d79613), ("unnamed_rgb_plus_layers_tiled_zip16", "aux", 0x3d1439eed2202e41), - ("layered_tiled_rle", "probe", 0x0a32e074a28c1f66), - ("layered_tiled_rle", "probed/linear", 0xa84600283dce98f6), - ("layered_tiled_rle", "straight/linear", 0xf028e1367a2fbb30), - ("layered_tiled_rle", "premul/linear", 0xa84600283dce98f6), - ("layered_tiled_rle", "ignore/linear", 0xa90a57f9a67f7468), - ("layered_tiled_rle", "preserve_rgb", 0xc8e0050f5efe75b7), + ("layered_tiled_rle", "probe", 0x6a38346c4c5662d5), + ("layered_tiled_rle", "probed/linear", 0x63d9c6245f75ef06), + ("layered_tiled_rle", "straight/linear", 0x63d9c6245f75ef06), + ("layered_tiled_rle", "premul/linear", 0x63d9c6245f75ef06), + ("layered_tiled_rle", "ignore/linear", 0x63d9c6245f75ef06), + ("layered_tiled_rle", "preserve_rgb", 0x63d9c6245f75ef06), ("layered_tiled_rle", "aux", 0xa6b9bd9f02c192ad), ("unnamed_rgb_plus_layers_mipmapped_zip16", "probe", 0x0a32e074a28c1f66), ("unnamed_rgb_plus_layers_mipmapped_zip16", "probed/linear", 0xa84600283dce98f6), @@ -436,12 +439,12 @@ const PINNED: &[(&str, &str, u64)] = &[ ("unnamed_rgb_plus_layers_mipmapped_zip16", "ignore/linear", 0xa90a57f9a67f7468), ("unnamed_rgb_plus_layers_mipmapped_zip16", "preserve_rgb", 0xc8e0050f5efe75b7), ("unnamed_rgb_plus_layers_mipmapped_zip16", "aux", 0x27cc9b53d0862db1), - ("layered_mipmapped_piz", "probe", 0x0a32e074a28c1f66), - ("layered_mipmapped_piz", "probed/linear", 0xa84600283dce98f6), - ("layered_mipmapped_piz", "straight/linear", 0xf028e1367a2fbb30), - ("layered_mipmapped_piz", "premul/linear", 0xa84600283dce98f6), - ("layered_mipmapped_piz", "ignore/linear", 0xa90a57f9a67f7468), - ("layered_mipmapped_piz", "preserve_rgb", 0xc8e0050f5efe75b7), + ("layered_mipmapped_piz", "probe", 0x6a38346c4c5662d5), + ("layered_mipmapped_piz", "probed/linear", 0x63d9c6245f75ef06), + ("layered_mipmapped_piz", "straight/linear", 0x63d9c6245f75ef06), + ("layered_mipmapped_piz", "premul/linear", 0x63d9c6245f75ef06), + ("layered_mipmapped_piz", "ignore/linear", 0x63d9c6245f75ef06), + ("layered_mipmapped_piz", "preserve_rgb", 0x63d9c6245f75ef06), ("layered_mipmapped_piz", "aux", 0xa6b9bd9f02c192ad), ("unnamed_rgb_plus_layers_decreasing_zip1", "probe", 0x0a32e074a28c1f66), ("unnamed_rgb_plus_layers_decreasing_zip1", "probed/linear", 0x19eb3b1a88d108a7), @@ -450,12 +453,12 @@ const PINNED: &[(&str, &str, u64)] = &[ ("unnamed_rgb_plus_layers_decreasing_zip1", "ignore/linear", 0x3b86057d18a16bf0), ("unnamed_rgb_plus_layers_decreasing_zip1", "preserve_rgb", 0x5b999014e4a64bb2), ("unnamed_rgb_plus_layers_decreasing_zip1", "aux", 0x8f78d3233450acf3), - ("layered_decreasing_rle", "probe", 0x0a32e074a28c1f66), - ("layered_decreasing_rle", "probed/linear", 0xa84600283dce98f6), - ("layered_decreasing_rle", "straight/linear", 0xf028e1367a2fbb30), - ("layered_decreasing_rle", "premul/linear", 0xa84600283dce98f6), - ("layered_decreasing_rle", "ignore/linear", 0xa90a57f9a67f7468), - ("layered_decreasing_rle", "preserve_rgb", 0xc8e0050f5efe75b7), + ("layered_decreasing_rle", "probe", 0x6a38346c4c5662d5), + ("layered_decreasing_rle", "probed/linear", 0x63d9c6245f75ef06), + ("layered_decreasing_rle", "straight/linear", 0x63d9c6245f75ef06), + ("layered_decreasing_rle", "premul/linear", 0x63d9c6245f75ef06), + ("layered_decreasing_rle", "ignore/linear", 0x63d9c6245f75ef06), + ("layered_decreasing_rle", "preserve_rgb", 0x63d9c6245f75ef06), ("layered_decreasing_rle", "aux", 0xa6b9bd9f02c192ad), ("unnamed_rgb_plus_layers_uncompressed", "probe", 0x0a32e074a28c1f66), ("unnamed_rgb_plus_layers_uncompressed", "probed/linear", 0xa27668bf31d9426b), @@ -464,12 +467,12 @@ const PINNED: &[(&str, &str, u64)] = &[ ("unnamed_rgb_plus_layers_uncompressed", "ignore/linear", 0xb3276cc5126776d4), ("unnamed_rgb_plus_layers_uncompressed", "preserve_rgb", 0xdee1105fa6e6822a), ("unnamed_rgb_plus_layers_uncompressed", "aux", 0x854a5e84e7aaa5c2), - ("layered_uncompressed", "probe", 0x0a32e074a28c1f66), - ("layered_uncompressed", "probed/linear", 0xa84600283dce98f6), - ("layered_uncompressed", "straight/linear", 0xf028e1367a2fbb30), - ("layered_uncompressed", "premul/linear", 0xa84600283dce98f6), - ("layered_uncompressed", "ignore/linear", 0xa90a57f9a67f7468), - ("layered_uncompressed", "preserve_rgb", 0xc8e0050f5efe75b7), + ("layered_uncompressed", "probe", 0x6a38346c4c5662d5), + ("layered_uncompressed", "probed/linear", 0x63d9c6245f75ef06), + ("layered_uncompressed", "straight/linear", 0x63d9c6245f75ef06), + ("layered_uncompressed", "premul/linear", 0x63d9c6245f75ef06), + ("layered_uncompressed", "ignore/linear", 0x63d9c6245f75ef06), + ("layered_uncompressed", "preserve_rgb", 0x63d9c6245f75ef06), ("layered_uncompressed", "aux", 0xa6b9bd9f02c192ad), ("uint_rgb_zip16", "probe", 0x0a32e074a28c1f66), ("uint_rgb_zip16", "probed/linear", 0xed89310ef0cdb9fd), @@ -484,7 +487,7 @@ const PINNED: &[(&str, &str, u64)] = &[ ("multipart_depth_named_rgb_zip16", "premul/linear", 0x869374e9b0384cea), ("multipart_depth_named_rgb_zip16", "ignore/linear", 0x3b86057d18a16bf0), ("multipart_depth_named_rgb_zip16", "preserve_rgb", 0x3b86057d18a16bf0), - ("multipart_depth_named_rgb_zip16", "aux", 0x0fa56884e83b4417), + ("multipart_depth_named_rgb_zip16", "aux", 0x6651502f552749d5), ]; #[test] diff --git a/docs/agents.md b/docs/agents.md index aff59e00a..a83432f04 100644 --- a/docs/agents.md +++ b/docs/agents.md @@ -340,8 +340,9 @@ build real projects through these interfaces; they are worked examples of everyt * **OCIO effects**: with Configuration ▸ Custom, `configFile` is a `.ocio` path or the config's text; `effect.warning {layer, effect}` says what Effect Controls warns about (a config it can't read, a colour space it lacks, transforms that pass colours through) or `null`. -* **Multi-layer OpenEXR**: the footage shows the beauty pass (an unnamed RGBA layer, else - Combined / Beauty / Image / RGBA…, never Cryptomatte or depth). `layer.channels {layer}` +* **Multi-layer OpenEXR**: the footage shows the main picture as After Effects does (the + unprefixed `R`, `G`, `B` (`A`) of the first part with them, else `Y` as grey; a file of named + layers only, such as Blender's `ViewLayer.Combined.R`, is black). `layer.channels {layer}` lists a footage layer's EXR layers and channels (`{"layers":[{"name":"diffuse","rgba":["diffuse.R","diffuse.G","diffuse.B",""]}]}`); EXtractoR shows them when its `red` / `green` / `blue` / `alpha` are set to those names diff --git a/docs/footage.md b/docs/footage.md index aa9023224..b0477af56 100644 --- a/docs/footage.md +++ b/docs/footage.md @@ -117,11 +117,12 @@ false` goes back to Use Source File Timecode). Cineon Settings: `{"logConversion Float OpenEXR renders hold linear light; EffectCraft sRGB-encodes them as they are read, like After Effects with Interpret As Linear Light for 32 bpc, unless the item preserves RGB (above). -A multi-layer file shows its main RGBA channels, as in After Effects. Renders that keep every -pass in named layers (Blender's `ViewLayer.Combined`, its compositor's File Output `Image`, -Nuke's `beauty`) show the beauty pass: the layer named Combined, Beauty, Image, RGBA, RGB or -Color, else the first colour layer that isn't a data pass. Cryptomatte, depth, mist, normals, -vectors, positions and IDs are never the picture. EXtractoR reads every other layer and channel. +A multi-layer file shows its main picture, as in After Effects: the channels without a layer +prefix, `R`, `G`, `B` (and `A`) of the first part that has all three, else the first part's `Y` +(and `A`) as grey. Renders that keep every pass in named layers (Blender's +`ViewLayer.Combined`, its compositor's File Output `Image`, Nuke's `beauty.R`) have no main +picture and show black at the file's size, as After Effects shows them; EXtractoR (and +Cryptomatte and the 3D Channel effects) read every layer and channel by name. Footage on its own keeps only the channels of its picture (a single-part file still decompresses all of its pixels to read them). Once an effect reads an item's channels diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 09f9df6bc..4abfadb74 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -454,7 +454,7 @@ Mocha and Cineware are third-party and not counted. | Category | Effects | Notes | |---|---|---| -| 3D Channel | 3D Channel Extract, Cryptomatte, Depth Matte, Depth of Field, EXtractoR, Fog 3D, ID Matte, IDentifier | Read auxiliary channels: multi-layer OpenEXR (any `layer.channel`, Cryptomatte manifests from the header; EXtractoR picks a layer and channels from popups of the footage's layers and channels, `layer.channels`, #295; the footage itself shows the beauty pass, never Cryptomatte or depth, #412) or the compositor's own depth / layer-ID / normal / UV / Cryptomatte pass for precomps of 3D comps. | +| 3D Channel | 3D Channel Extract, Cryptomatte, Depth Matte, Depth of Field, EXtractoR, Fog 3D, ID Matte, IDentifier | Read auxiliary channels: multi-layer OpenEXR (any `layer.channel`, Cryptomatte manifests from the header; EXtractoR picks a layer and channels from popups of the footage's layers and channels, `layer.channels`, #295; the footage itself shows After Effects' main picture: the unprefixed RGB(A), else Y, else black) or the compositor's own depth / layer-ID / normal / UV / Cryptomatte pass for precomps of 3D comps. | | Immersive Video | VR Blur, VR Chromatic Aberrations, VR Color Gradients, VR Converter, VR De-Noise, VR Digital Glitch, VR Fractal Noise, VR Glow, VR Plane to Sphere, VR Rotate Sphere, VR Sharpen, VR Sphere to Plane | Seam-aware equirectangular processing (wrap-around, pole continuation, latitude-scaled filters), mono / over-under / side-by-side layouts; VR Converter between equirectangular, cube maps (4:3, 3:2, 6:1), sphere map and 2D. | | Color Correction | OCIO CDL / Color Space / Display / File / Look Transform, Color Stabilizer | Built-in minimal OCIO-style config (ACES2065-1, ACEScg, ACEScct, sRGB, Rec.709, Rec.2020, Display P3, linear variants, XYZ) from published matrices and transfer functions; `.cube` / `.3dl` / `.csp` / `.spi1d` / `.spi3d` / `.spimtx` LUTs and ASC `.cc` / `.ccc` / `.cdl`. Custom `.ocio` config files are read from the OCIO v2 documentation (Configuration ▸ Custom: colorspaces and display colorspaces with the scene / display reference spaces joined by the default view transform, roles, displays with v1 and v2 views, view transforms, looks; Matrix, File, Exponent, ExponentWithLinear, Log, LogAffine, CDL, Range, Allocation, ColorSpace, Look, DisplayView, Builtin (matrices and display curves) and Group transforms), so Blender 4.x / 5.x configs give the Standard, AgX, Filmic and False Color views (#410). Grading Primary / Tone transforms, the ACES output and gamut-compression builtins and HLG pass colours through, and the effect shows a warning naming them (`effect.warning`). | | Distort | CC Flo Motion, Liquify, Rolling Shutter Repair | Liquify strokes are effect data replayed into a displacement mesh (`liquify.stroke` / `liquify.clear` commands; no interactive viewer brush yet). Rolling Shutter Repair uses the KLT tracker. | From c1aea6d65af78c53d24dc820a08ecae8b020d165 Mon Sep 17 00:00:00 2001 From: vangel76 Date: Mon, 16 Nov 2026 22:59:38 +0100 Subject: [PATCH 213/451] 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. --- crates/media/src/exr_channels.rs | 22 +++++++++++++++----- crates/media/src/exr_index.rs | 31 +++++++++++++++++++--------- crates/media/src/exr_planes.rs | 24 ++++++++++++++++++++- crates/media/src/exr_planes/tests.rs | 21 +++++++++++++++++++ crates/media/src/exr_read.rs | 11 ++++++++-- crates/media/src/probe.rs | 7 ++++++- crates/media/tests/it/exr_golden.rs | 10 ++++----- docs/footage.md | 4 ++-- 8 files changed, 104 insertions(+), 26 deletions(-) diff --git a/crates/media/src/exr_channels.rs b/crates/media/src/exr_channels.rs index cd2f5b7ce..422502c5f 100644 --- a/crates/media/src/exr_channels.rs +++ b/crates/media/src/exr_channels.rs @@ -93,6 +93,10 @@ pub fn picture_image(bytes: &[u8]) -> Option { let (w, h) = index.size(); let (w, h) = (u32::try_from(w).ok()?, u32::try_from(h).ok()?); let n = (w as usize).checked_mul(h as usize)?; + // (the caller converts it to a float RGBA picture: a still's bound) + if n as u64 > crate::probe::MAX_STILL_PIXELS { + return None; + } let Some(picture) = &index.picture else { let len = n.checked_mul(3)?; let mut data: Vec = Vec::new(); @@ -112,10 +116,15 @@ pub fn picture_image(bytes: &[u8]) -> Option { }; let mut data = Vec::new(); data.try_reserve_exact(n.checked_mul(if a.is_some() { 4 } else { 3 })?).ok()?; + // (0 outside the picture part's data window where its planes hold another fill) + let width = w as usize; + let shown = |i: usize| picture.inside.is_none_or(|[x0, y0, x1, y1]| (x0..x1).contains(&(i % width.max(1))) && (y0..y1).contains(&(i / width.max(1)))); for i in 0..n { - data.extend([r.get(i)?, g.get(i)?, b.get(i)?].map(|v| *v)); + let on = shown(i); + let pick = |v: &f32| if on { *v } else { 0.0 }; + data.extend([r.get(i)?, g.get(i)?, b.get(i)?].map(pick)); if let Some(a) = a { - data.push(*a.get(i)?); + data.push(pick(a.get(i)?)); } } match a { @@ -142,13 +151,16 @@ pub(crate) fn black_picture(w: u32, h: u32, op: AlphaOp) -> Image { /// The picture made of planes `rgb` and `a` (opaque without one) of `aux`, as /// [`crate::convert::dynamic_to_image`] makes it of the same values. `None` when a plane is /// missing or short. -pub(crate) fn planes_picture(aux: &AuxChannels, rgb: [&[f32]; 3], a: Option<&[f32]>, op: AlphaOp) -> Option { - let n = (aux.width as usize).checked_mul(aux.height as usize)?; +pub(crate) fn planes_picture(aux: &AuxChannels, rgb: [&[f32]; 3], a: Option<&[f32]>, inside: Option<[usize; 4]>, op: AlphaOp) -> Option { + let w = aux.width as usize; + let n = w.checked_mul(aux.height as usize)?; if rgb.iter().chain(&a).any(|p| p.len() < n) { return None; } let [r, g, b] = rgb; - let at = |p: &[f32], i: usize| p.get(i).copied().unwrap_or(0.0); + // (0 outside `inside`, the picture part's data window, where the planes hold another fill) + let shown = |i: usize| inside.is_none_or(|[x0, y0, x1, y1]| (x0..x1).contains(&(i % w.max(1))) && (y0..y1).contains(&(i / w.max(1)))); + let at = |p: &[f32], i: usize| if shown(i) { p.get(i).copied().unwrap_or(0.0) } else { 0.0 }; Some(float_to_image(aux.width, aux.height, op, |i| [at(r, i), at(g, i), at(b, i), a.map_or(1.0, |a| at(a, i))])) } diff --git a/crates/media/src/exr_index.rs b/crates/media/src/exr_index.rs index 9de4e2b42..cd9a7ef2d 100644 --- a/crates/media/src/exr_index.rs +++ b/crates/media/src/exr_index.rs @@ -47,6 +47,11 @@ pub(crate) struct IndexChannel { pub(crate) struct MainPicture { pub(crate) layout: ColorLayout, pub(crate) ids: Vec, + /// When a picture channel's plane isn't 0 outside the part's data window (a part whose name + /// reads as depth, `depth.R`: its planes keep the background depth for effects), the data + /// window in display pixels, `[x0, y0, x1, y1)`: the picture is 0 outside it, as the `image` + /// crate and After Effects show it. + pub(crate) inside: Option<[usize; 4]>, } impl MainPicture { @@ -207,14 +212,7 @@ pub(crate) fn build(src: &mut dyn ReadSeek, stamp: FileStamp) -> Result Vec<(String, Vec<(String, u32)>)> { /// ([`craft_exr::channels::main_picture`]: the unprefixed `R`, `G`, `B` (`A`) of the first part /// that has them, else the first unprefixed `Y` (`A`)), as channel ids. The parts' channels are /// matched as stored (a part's own `R`, not the `part.R` plane name). -fn main_picture(parts: &[PartInfo], channels: &[IndexChannel]) -> Option { +fn main_picture(parts: &[PartInfo], display: Window, channels: &[IndexChannel]) -> Option { let (part, layout, picked) = craft_exr::channels::main_picture(parts.iter().map(|p| p.channels.iter().map(|c| c.name.as_str())))?; let ids = picked.iter().map(|ci| channels.iter().position(|c| c.part == part && c.channel == *ci)).collect::>>()?; - Some(MainPicture { layout, ids }) + let filled = ids.iter().any(|id| channels.get(*id).is_some_and(|c| c.fill != 0.0)); + let inside = match filled { + true => Some(data_window_in_display(parts.get(part)?.data_window, display)), + false => None, + }; + Some(MainPicture { layout, ids, inside }) +} + +/// The part of `data` inside `display`, in display pixels from its top left: `[x0, y0, x1, y1)`. +fn data_window_in_display(data: Window, display: Window) -> [usize; 4] { + let clamp = |v: i64, size: u32| usize::try_from(v.clamp(0, i64::from(size))).unwrap_or(0); + let (x0, y0) = (i64::from(data.x) - i64::from(display.x), i64::from(data.y) - i64::from(display.y)); + let (x1, y1) = (x0.saturating_add(i64::from(data.width)), y0.saturating_add(i64::from(data.height))); + [clamp(x0, display.width), clamp(y0, display.height), clamp(x1, display.width), clamp(y1, display.height)] } /// At most this many files are indexed, and their indexes take at most [`INDEXED_BYTES`]; the diff --git a/crates/media/src/exr_planes.rs b/crates/media/src/exr_planes.rs index 40b111d9f..bf261491b 100644 --- a/crates/media/src/exr_planes.rs +++ b/crates/media/src/exr_planes.rs @@ -1153,6 +1153,9 @@ pub(crate) fn picture(path: &str, source: &ExrSource, op: AlphaOp, extra: Option Err(IndexError::Unsupported(why)) => return Picture::Done(Err(why.to_string())), Err(_) => return Picture::Legacy, }; + if let Err(why) = picture_fits(path, &index) { + return Picture::Done(Err(why)); + } let mut want = Want { all: false, ids: index.picture_ids().into_iter().collect() }; if let Some(need) = extra { match need_ids(&index, need) { @@ -1208,7 +1211,23 @@ fn picture_of(index: &ExrIndex, batch: Option<&Batch>, op: AlphaOp) -> Option Some(batch.plane(a)?), None => None, }; - planes_picture(&batch.aux, [batch.plane(r)?, batch.plane(g)?, batch.plane(b)?], a, op) + planes_picture(&batch.aux, [batch.plane(r)?, batch.plane(g)?, batch.plane(b)?], a, main.inside, op) +} + +/// The picture of the file `index` describes (float RGBA, 16 bytes a pixel, allocated whole) is +/// no larger than a still may decode to ([`crate::probe::MAX_STILL_PIXELS`]) nor than one read of +/// the file may allocate: else why not, to show. Checked before anything is read, also for the +/// black picture of a file without a main picture. +fn picture_fits(path: &str, index: &ExrIndex) -> Result<(), String> { + let (w, h) = index.size(); + let pixels = (w as u64).saturating_mul(h as u64); + let need = pixels.saturating_mul(16); + let most = (cap_of(path) as u64).min(crate::probe::MAX_STILL_PIXELS.saturating_mul(16)); + if need <= most { + return Ok(()); + } + let gb = |b: u64| b as f64 / f64::from(1u32 << 30); + Err(format!("its {w}×{h} OpenEXR picture needs {:.1} GB of memory, more than the {:.1} GB one file may use", gb(need), gb(most))) } /// The picture of the OpenEXR at `path` (as [`picture`]) of only the display rows `rows`: those @@ -1221,6 +1240,9 @@ pub(crate) fn picture_rows(path: &str, source: &ExrSource, op: AlphaOp, rows: (i Err(IndexError::Unsupported(why)) => return Picture::Done(Err(why.to_string())), Err(_) => return Picture::Legacy, }; + if let Err(why) = picture_fits(path, &index) { + return Picture::Done(Err(why)); + } // (in file order: the planes are looked up by id) let ids = index.picture_ids(); if ids.is_empty() { diff --git a/crates/media/src/exr_planes/tests.rs b/crates/media/src/exr_planes/tests.rs index f11985f7a..d4fd2d824 100644 --- a/crates/media/src/exr_planes/tests.rs +++ b/crates/media/src/exr_planes/tests.rs @@ -214,6 +214,27 @@ fn a_depth_part_first_leaves_the_picture_to_the_rgba_part() { assert_eq!(d.last().unwrap().stats.chunks, [0, SIZE.1], "only the RGBA part's chunks"); } +/// The black picture of a file without a main picture is allocated whole like any picture: one +/// larger than one read of the file may allocate is refused with the reason, not allocated (an +/// abort in the browser); within it, it is black at the file's size. +#[test] +fn a_black_picture_too_large_is_refused_not_allocated() { + let bytes = write(vec![part(None, &[("depth.Z", false)], (8, 8), Compression::ZIP1)], (8, 8)); + let path = "/no-picture-too-large.exr"; + let source = ExrSource::Bytes(bytes.as_slice().into()); + let op = AlphaOp::of(&Footage::default(), FloatCurve::Linear); + set_cap(path, 8 * 8 * 16 - 1); + match picture(path, &source, op, None) { + Picture::Done(Err(why)) => assert!(why.contains("8×8") && why.contains("GB"), "{why}"), + _ => panic!("refused"), + } + let fits = "/no-picture-fits.exr"; + set_cap(fits, 8 * 8 * 16); + let Picture::Done(Ok(img)) = picture(fits, &source, op, None) else { panic!("a black picture") }; + assert_eq!((img.width, img.height), (8, 8)); + assert!(img.data.iter().all(|p| *p == [0.0, 0.0, 0.0, 1.0])); +} + /// A luminance file (`Y` only, no `R`, `G`, `B`) is grey, as before. #[test] fn a_luminance_file_is_grey() { diff --git a/crates/media/src/exr_read.rs b/crates/media/src/exr_read.rs index 3fe4f544e..611e9e5fb 100644 --- a/crates/media/src/exr_read.rs +++ b/crates/media/src/exr_read.rs @@ -221,6 +221,11 @@ pub(crate) const MAX_DECODE_BYTES: usize = 8 << 30; #[cfg(not(target_pointer_width = "64"))] pub(crate) const MAX_DECODE_BYTES: usize = 512 << 20; +/// The most threads one read decompresses on (beside the caller's), and the size of a file +/// whose chunks are decompressed on the calling thread alone. +const READ_WORKERS: usize = 4; +const SMALL_FILE: u64 = 1 << 20; + /// The size of the planes of a read at `level` of a `w` × `h` display window. #[cfg(test)] pub(crate) fn level_size(size: (usize, usize), level: u32) -> (usize, usize) { @@ -265,8 +270,10 @@ fn read(src: &mut dyn ReadSeek, index: &ExrIndex, req: &ReadRequest) -> Result<( request.fill = &fill; request.rows = req.rows.clone(); request.level = req.level; - // (as many decoding threads as the pool the caller runs on: the footage decode threads) - request.workers = Some(rayon::current_num_threads()); + // craft-exr decompresses on threads of its own, started for this read, beside the decode + // pool the caller runs on: a few at most, and none for a small file (its chunks are + // decompressed on the calling thread). + request.workers = Some(if index.file.file_len() < SMALL_FILE { 0 } else { rayon::current_num_threads().min(READ_WORKERS) }); let planes = seek::read_planes(src, &index.file, &request, &filmcraft_media::cancel::cancelled).map_err(|e| match e { seek::Error::Cancelled => ReadError::Cancelled, seek::Error::Io(why) => ReadError::Io(why), diff --git a/crates/media/src/probe.rs b/crates/media/src/probe.rs index 789043325..cf62eb910 100644 --- a/crates/media/src/probe.rs +++ b/crates/media/src/probe.rs @@ -296,7 +296,12 @@ fn probe_still_bytes(path: &str, bytes: &[u8], fmt: image::ImageFormat) -> Resul // shown black): its picture's size and alpha from the headers alone (#3271), no // pixels decoded. let size = (fmt == image::ImageFormat::OpenExr).then(|| crate::exr_channels::picture_size(bytes)).flatten(); - size.ok_or_else(|| MediaError::Decode(format!("{path}: {e}")))? + let (w, h, alpha) = size.ok_or_else(|| MediaError::Decode(format!("{path}: {e}")))?; + // (as every still: no larger than the renderer can hold as floats) + if u64::from(w) * u64::from(h) > MAX_STILL_PIXELS { + return Err(MediaError::Decode(format!("{path}: a {w}×{h} OpenEXR picture is larger than a still may be"))); + } + (w, h, alpha) } }; Ok(still_footage(path, w, h, fmt, has_alpha)) diff --git a/crates/media/tests/it/exr_golden.rs b/crates/media/tests/it/exr_golden.rs index e420de1a3..ff860c326 100644 --- a/crates/media/tests/it/exr_golden.rs +++ b/crates/media/tests/it/exr_golden.rs @@ -248,8 +248,9 @@ fn files() -> Vec<(&'static str, Vec, bool)> { true, ), ( - // The picture is the part "depth" (the first with R, G and B, as the image crate shows - // it): its channels are colour, 0 outside the data window, despite the part's name. + // The picture is the part "depth" (the first with R, G and B), 0 outside its data window + // as the image crate shows it, while its planes keep the background depth there for + // effects (the part's name reads as depth). "multipart_depth_named_rgb_zip16", write( vec![ @@ -338,8 +339,7 @@ fn hashes(name: &str, bytes: &[u8], aux_first: bool) -> Vec<(String, u64, bool)> /// Hashes taken on main before #474's shared decode (`EXR_GOLDEN_PRINT=1`). The pictures of /// the files of named layers only (`layered_*`, `multipart_blender5_rle`) were re-pinned when the -/// picture became After Effects' main picture (black for those files, their channels unchanged), -/// and `multipart_depth_named_rgb_zip16`'s channels when the picture's channels kept a fill of 0. +/// picture became After Effects' main picture (black for those files, their channels unchanged). const PINNED: &[(&str, &str, u64)] = &[ ("rgba_half_zip16", "probe", 0x0a32e074a28c1f66), ("rgba_half_zip16", "probed/linear", 0xa84600283dce98f6), @@ -487,7 +487,7 @@ const PINNED: &[(&str, &str, u64)] = &[ ("multipart_depth_named_rgb_zip16", "premul/linear", 0x869374e9b0384cea), ("multipart_depth_named_rgb_zip16", "ignore/linear", 0x3b86057d18a16bf0), ("multipart_depth_named_rgb_zip16", "preserve_rgb", 0x3b86057d18a16bf0), - ("multipart_depth_named_rgb_zip16", "aux", 0x6651502f552749d5), + ("multipart_depth_named_rgb_zip16", "aux", 0x0fa56884e83b4417), ]; #[test] diff --git a/docs/footage.md b/docs/footage.md index b0477af56..abab92161 100644 --- a/docs/footage.md +++ b/docs/footage.md @@ -118,8 +118,8 @@ false` goes back to Use Source File Timecode). Cineon Settings: `{"logConversion Float OpenEXR renders hold linear light; EffectCraft sRGB-encodes them as they are read, like After Effects with Interpret As Linear Light for 32 bpc, unless the item preserves RGB (above). A multi-layer file shows its main picture, as in After Effects: the channels without a layer -prefix, `R`, `G`, `B` (and `A`) of the first part that has all three, else the first part's `Y` -(and `A`) as grey. Renders that keep every pass in named layers (Blender's +prefix, `R`, `G`, `B` (and `A`) of the first part that has all three, else the first part that +has a `Y` (its `Y` and `A`) as grey. Renders that keep every pass in named layers (Blender's `ViewLayer.Combined`, its compositor's File Output `Image`, Nuke's `beauty.R`) have no main picture and show black at the file's size, as After Effects shows them; EXtractoR (and Cryptomatte and the 3D Channel effects) read every layer and channel by name. From ea4ac2e5edb4199d007873781a4c25c757132d69 Mon Sep 17 00:00:00 2001 From: vangel76 Date: Mon, 16 Nov 2026 23:07:23 +0100 Subject: [PATCH 214/451] 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. --- crates/media/src/exr_index.rs | 37 +++++++++++++++++++--------- crates/media/src/exr_planes/tests.rs | 19 ++++++++++++++ crates/media/src/exr_read.rs | 21 ++++++++++------ 3 files changed, 59 insertions(+), 18 deletions(-) diff --git a/crates/media/src/exr_index.rs b/crates/media/src/exr_index.rs index cd9a7ef2d..988c3b370 100644 --- a/crates/media/src/exr_index.rs +++ b/crates/media/src/exr_index.rs @@ -10,9 +10,11 @@ //! it and never decode pixels. The reader ([`crate::exr_read`]) fetches the chunks it lists. //! //! Everything is validated before anything is sized by it: the display window -//! ([`crate::exr_channels::MAX_DISPLAY_PIXELS`]), the data windows (four times that), the blocks, -//! the chunk count (eight bytes of offset table each, so never more than the file can hold), and -//! every offset (inside the chunk area; a chunk with a bad offset is never read). +//! ([`crate::exr_channels::MAX_DISPLAY_PIXELS`]), the data windows (four times that), the chunk +//! count (eight bytes of offset table each, so never more than the file can hold), and every +//! offset (inside the chunk area; a chunk with a bad offset is never read). Every block is held +//! to what its chunk's bytes can decompress to ([`limits`]) when the file is indexed and before +//! it is handed to another decoder ([`safe_to_decode`]); each read checks it again. use std::collections::{HashMap, VecDeque}; use std::io::SeekFrom; @@ -144,11 +146,15 @@ pub(crate) const HTJ2K: &str = "OpenEXR HTJ2K compression isn't supported yet: r const MAX_DATA_PIXELS: usize = 4 * MAX_DISPLAY_PIXELS; /// What `craft-exr` may index: data windows of at most [`MAX_DATA_PIXELS`], of any width or -/// height (the display window is checked against [`MAX_DISPLAY_PIXELS`] in [`build`]). -/// `craft-exr` bounds every block itself (256 MiB uncompressed). +/// height (the display window is checked against [`MAX_DISPLAY_PIXELS`] in [`build`]), and +/// blocks of at most `craft-exr`'s default ratio of bytes per byte of their chunk (four times +/// that for DWA, plus 1 MiB): a hostile header declaring a block of gigabytes over a chunk of a +/// few bytes is refused, by every read and by [`safe_to_decode`]. A read's planes are bounded by +/// its own cap ([`crate::exr_read::MAX_DECODE_BYTES`]). fn limits() -> Limits { let mut limits = Limits::none(); limits.max_pixels = MAX_DATA_PIXELS as u64; + limits.max_ratio = Limits::default().max_ratio; limits } @@ -159,12 +165,17 @@ fn index_file(src: &mut dyn ReadSeek) -> Result { seek::Index::build(src, &limits(), &|| false) } -/// The headers of the OpenEXR `bytes` are safe to hand to a decoder: they can be read and no -/// part's data window or block is larger than this reader takes (#3271 review). A file this -/// reader doesn't cover (deep parts, HTJ2K) is left to the decoder; damaged headers, a part too -/// large and a failed read are refused. +/// The headers of the OpenEXR `bytes` are safe to hand to a decoder (the `image` crate, which +/// allocates every block by its header): they can be read, no part's data window is larger than +/// this reader takes, and no block is larger than its chunk can decompress to ([`limits`]) +/// (#3271 review). A file this reader doesn't cover (deep parts, HTJ2K) is left to the decoder; +/// damaged headers, a part or a block too large, and a failed read are refused. pub(crate) fn safe_to_decode(bytes: &[u8]) -> bool { - matches!(index_file(&mut std::io::Cursor::new(bytes)), Ok(_) | Err(seek::Error::Unsupported(_) | seek::Error::UnsupportedCompression(_))) + match index_file(&mut std::io::Cursor::new(bytes)) { + Ok(index) => index.check_blocks().is_ok(), + Err(seek::Error::Unsupported(_) | seek::Error::UnsupportedCompression(_)) => true, + Err(_) => false, + } } /// The channel list of `part` as the `exr` crate's validation took it (#3271): sorted by name, @@ -183,9 +194,13 @@ fn channels_valid(part: &PartInfo) -> bool { pub(crate) fn build(src: &mut dyn ReadSeek, stamp: FileStamp) -> Result { let file = index_file(src).map_err(|e| match e { seek::Error::UnsupportedCompression(name) if name.contains("HTJ2K") => IndexError::Unsupported(HTJ2K), - seek::Error::Io(_) => IndexError::Io, + // (memory refused just now: another attempt may succeed, nothing is remembered) + seek::Error::Io(_) | seek::Error::OutOfMemory(_) => IndexError::Io, _ => IndexError::Unreadable, })?; + // A block larger than its chunk can decompress to (a hostile header): the file is refused + // as a whole, as every read of it would refuse that chunk. + file.check_blocks().map_err(|_| IndexError::Unreadable)?; let parts = file.parts(); // Deep data isn't read (the whole file was refused before). if parts.iter().any(|p| p.deep || !channels_valid(p)) { diff --git a/crates/media/src/exr_planes/tests.rs b/crates/media/src/exr_planes/tests.rs index d4fd2d824..02f99a2c1 100644 --- a/crates/media/src/exr_planes/tests.rs +++ b/crates/media/src/exr_planes/tests.rs @@ -1544,6 +1544,25 @@ fn a_failure_is_forgotten_once_the_file_changes() { /// #3271 review: a failed picture request (too large here) doesn't refuse a later request for /// the other channels: "all channels" is every channel but the picture's, so it doesn't ask for /// what failed. +/// Memory the system refuses during a read is a read that failed just now, not a file too large: +/// it isn't remembered, and the next request reads again (a file too large is remembered). +#[test] +fn an_allocation_failure_is_not_remembered() { + use crate::exr_read::{ReadError, read_error}; + assert_eq!(read_error(craft_exr::seek::Error::OutOfMemory("planes".into())), ReadError::Io("planes".into())); + assert!(matches!(read_error(craft_exr::seek::Error::LimitExceeded("planes".into())), ReadError::TooLarge(_))); + // A read that failed just now (here: the file can't be opened) is a stop, and the next + // request for the same channels reads them. + let bytes: Arc<[u8]> = single_part_zips().into(); + let path = "/oom-not-remembered.exr"; + let store = PlaneStore::new(CACHE_BUDGET); + let index = crate::exr_index::get(path, &ExrSource::Bytes(bytes.clone())).unwrap(); + let want = Want { all: false, ids: index.picture_ids().into_iter().collect() }; + let gone = ExrSource::File(std::env::temp_dir().join("ec-oom-not-remembered-missing.exr")); + assert_eq!(store.get(path, &gone, &index, &want, Use::Other).err(), Some(Refused::Stopped)); + assert!(store.get(path, &ExrSource::Bytes(bytes), &index, &want, Use::Other).is_ok(), "read again, not refused from memory"); +} + #[test] fn a_failed_picture_leaves_the_other_channels_readable() { let bytes: Arc<[u8]> = diff --git a/crates/media/src/exr_read.rs b/crates/media/src/exr_read.rs index 611e9e5fb..ca30f6994 100644 --- a/crates/media/src/exr_read.rs +++ b/crates/media/src/exr_read.rs @@ -221,6 +221,19 @@ pub(crate) const MAX_DECODE_BYTES: usize = 8 << 30; #[cfg(not(target_pointer_width = "64"))] pub(crate) const MAX_DECODE_BYTES: usize = 512 << 20; +/// What a failed `craft-exr` read means here. Memory the system refused just now is a read that +/// failed ([`ReadError::Io`]: the plane store doesn't remember it, another read may succeed), +/// not a file too large (remembered until the file changes). +pub(crate) fn read_error(e: seek::Error) -> ReadError { + match e { + seek::Error::Cancelled => ReadError::Cancelled, + seek::Error::Io(why) | seek::Error::OutOfMemory(why) => ReadError::Io(why), + seek::Error::LimitExceeded(why) => ReadError::TooLarge(format!("its OpenEXR channels need more memory than one file may use ({why})")), + seek::Error::Malformed(why) | seek::Error::Unsupported(why) | seek::Error::UnsupportedCompression(why) => ReadError::Unreadable(why), + other => ReadError::Unreadable(other.to_string()), + } +} + /// The most threads one read decompresses on (beside the caller's), and the size of a file /// whose chunks are decompressed on the calling thread alone. const READ_WORKERS: usize = 4; @@ -274,13 +287,7 @@ fn read(src: &mut dyn ReadSeek, index: &ExrIndex, req: &ReadRequest) -> Result<( // pool the caller runs on: a few at most, and none for a small file (its chunks are // decompressed on the calling thread). request.workers = Some(if index.file.file_len() < SMALL_FILE { 0 } else { rayon::current_num_threads().min(READ_WORKERS) }); - let planes = seek::read_planes(src, &index.file, &request, &filmcraft_media::cancel::cancelled).map_err(|e| match e { - seek::Error::Cancelled => ReadError::Cancelled, - seek::Error::Io(why) => ReadError::Io(why), - seek::Error::LimitExceeded(why) => ReadError::TooLarge(format!("its OpenEXR channels need more memory than one file may use ({why})")), - seek::Error::Malformed(why) | seek::Error::Unsupported(why) | seek::Error::UnsupportedCompression(why) => ReadError::Unreadable(why), - other => ReadError::Unreadable(other.to_string()), - })?; + let planes = seek::read_planes(src, &index.file, &request, &filmcraft_media::cancel::cancelled).map_err(read_error)?; let stats = ReadStats { chunks: planes.stats.chunks, bytes: planes.stats.bytes, lines: planes.stats.lines }; Ok((planes.planes, stats)) } From b591f95ce48c75e876a36319760d13efd15bc47d Mon Sep 17 00:00:00 2001 From: vangel76 Date: Sun, 15 Nov 2026 21:49:18 +0100 Subject: [PATCH 215/451] 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. --- .../engine/src/settings/session_settings.rs | 5 ++ crates/host/src/lib.rs | 10 +++ crates/media/src/exr_index.rs | 3 +- crates/media/src/exr_planes.rs | 5 +- crates/media/src/exr_planes/tests.rs | 35 ++++++++ crates/media/src/exr_read.rs | 22 +++-- crates/render/src/memory.rs | 82 +++++++++++++++++++ 7 files changed, 153 insertions(+), 9 deletions(-) diff --git a/crates/engine/src/settings/session_settings.rs b/crates/engine/src/settings/session_settings.rs index cc25f35ea..9a76dd84a 100644 --- a/crates/engine/src/settings/session_settings.rs +++ b/crates/engine/src/settings/session_settings.rs @@ -122,6 +122,11 @@ impl Session { let layers: std::sync::Arc = self.layer_cache.clone(); accountant.register(&layers); accountant.set_budget(b.bytes); + // (what one file's decoded planes may take follows it once the RAM is read, at least the + // fixed limit; until then the host's reader asks when a request is over that, #3749) + if b.installed.is_some() { + effectcraft_render::memory::set_decode_limit(Some(b.bytes)); + } // The process's measured memory as well (#3301: memory nobody accounts for, such as GPU // staging, effect buffers and the allocator's fragmentation): over the purge limit the // caches give way by what it is over, over the hard limit also the frames a playing diff --git a/crates/host/src/lib.rs b/crates/host/src/lib.rs index 295476df0..159156a24 100644 --- a/crates/host/src/lib.rs +++ b/crates/host/src/lib.rs @@ -117,9 +117,19 @@ pub fn session() -> Session { // the settings, and the caches have no limits of their own below it. Without a memory // reading yet, the budget for unknown RAM. s.apply_cache_budgets(); + // The CLI and the MCP server read no memory: a request for a file's planes over the fixed + // limit asks for it once (#3749). + effectcraft_engine::render::memory::set_decode_limit_source(Some(installed_memory_budget)); s } +/// The memory budget of the installed RAM with the default settings: what one file's decoded +/// planes may take when a request is over the fixed limit and the session read no memory. +fn installed_memory_budget() -> Option { + let memory = effectcraft_engine::sysinfo::memory()?; + Some(effectcraft_engine::prefs::Prefs::default().memory_budget(Some(memory), false).bytes) +} + /// External effect helpers run as child processes: native builds only. #[cfg(not(target_arch = "wasm32"))] fn helper_hooks() -> Option { diff --git a/crates/media/src/exr_index.rs b/crates/media/src/exr_index.rs index 988c3b370..425077c0a 100644 --- a/crates/media/src/exr_index.rs +++ b/crates/media/src/exr_index.rs @@ -150,7 +150,8 @@ const MAX_DATA_PIXELS: usize = 4 * MAX_DISPLAY_PIXELS; /// blocks of at most `craft-exr`'s default ratio of bytes per byte of their chunk (four times /// that for DWA, plus 1 MiB): a hostile header declaring a block of gigabytes over a chunk of a /// few bytes is refused, by every read and by [`safe_to_decode`]. A read's planes are bounded by -/// its own cap ([`crate::exr_read::MAX_DECODE_BYTES`]). +/// its own cap ([`crate::exr_read::MAX_DECODE_BYTES`], or more with more memory: +/// [`effectcraft_render::memory::decode_limit`]). fn limits() -> Limits { let mut limits = Limits::none(); limits.max_pixels = MAX_DATA_PIXELS as u64; diff --git a/crates/media/src/exr_planes.rs b/crates/media/src/exr_planes.rs index bf261491b..8b6daf167 100644 --- a/crates/media/src/exr_planes.rs +++ b/crates/media/src/exr_planes.rs @@ -434,14 +434,15 @@ pub(crate) fn set_cap(path: &str, bytes: usize) { CAPS.lock().unwrap_or_else(PoisonError::into_inner).push((path.to_string(), bytes)); } -/// The most bytes of planes one read of `path` may allocate. +/// The most bytes of planes one read of `path` may allocate by the caller's own limit (none: the +/// system's, [`effectcraft_render::memory::decode_limit`]). fn cap_of(path: &str) -> usize { #[cfg(test)] if let Some((_, c)) = CAPS.lock().unwrap_or_else(PoisonError::into_inner).iter().find(|(p, _)| p == path) { return *c; } let _ = path; - crate::exr_read::MAX_DECODE_BYTES + usize::MAX } impl PlaneStore { diff --git a/crates/media/src/exr_planes/tests.rs b/crates/media/src/exr_planes/tests.rs index 02f99a2c1..febc926ba 100644 --- a/crates/media/src/exr_planes/tests.rs +++ b/crates/media/src/exr_planes/tests.rs @@ -1580,6 +1580,41 @@ fn a_failed_picture_leaves_the_other_channels_readable() { assert!(rest.aux.get("Z").is_some()); } +/// #3749: a read over the fixed floor is allowed up to what the system's memory gives (the +/// session's figure), never under the floor, and refused with a reason beyond it. The floor is +/// small here: the real one is 8 GiB. +#[test] +fn a_read_over_the_floor_is_allowed_up_to_the_systems_memory() { + let bytes = write(vec![part(None, &RGBA, (8, 8), Compression::ZIP1)], (8, 8)); + let mut src = std::io::Cursor::new(bytes.as_slice()); + let index = crate::exr_index::build(&mut src, FileStamp::Virtual).unwrap(); + // Four channels of 8×8 f32 are 1024 bytes; the floor is 512. + let request = ReadRequest { floor: 512, ..ReadRequest::full(vec![0, 1, 2, 3]) }; + let read = |src: &mut std::io::Cursor<&[u8]>| crate::exr_read::read_planes(src, &index, &request).0; + effectcraft_render::memory::set_decode_limit(None); + effectcraft_render::memory::set_decode_limit_source(None); + assert!(matches!(read(&mut src), Err(crate::exr_read::ReadError::TooLarge(_))), "over the floor, memory unknown"); + effectcraft_render::memory::set_decode_limit(Some(2048)); + assert_eq!(read(&mut src).map(|p| p.len()).ok(), Some(4), "the system's memory allows it"); + effectcraft_render::memory::set_decode_limit(Some(800)); + assert!(matches!(read(&mut src), Err(crate::exr_read::ReadError::TooLarge(_))), "still more than the system's memory"); + effectcraft_render::memory::set_decode_limit(None); +} + +/// #3749: a plane the system cannot give is not an aborted process: `craft-exr` asks for the +/// planes' memory first and reports what it can't get, a read that failed just now (asked again, +/// not remembered); a plane over the read's limit (the decode limit handed to it) is a refusal +/// for size with `craft-exr`'s reason. +#[test] +fn a_plane_the_system_cannot_give_is_refused_not_allocated() { + use crate::exr_read::{ReadError, read_error}; + use craft_exr::seek::Error; + let gone = read_error(Error::OutOfMemory("4096 bytes of planes".into())); + assert!(matches!(&gone, ReadError::Io(why) if why.contains("4096 bytes of planes")), "{gone:?}"); + let over = read_error(Error::LimitExceeded("the requested rows need 4096 bytes".into())); + assert!(matches!(&over, ReadError::TooLarge(why) if why.contains("4096 bytes")), "{over:?}"); +} + /// A two-rank Cryptomatte file of `size` with a picture: "cube" and "sphere" meet along a /// diagonal whose pixels hold both IDs (rank 00 the nearer, 55-75 %, rank 01 the other one with /// the rest), IDs and coverage stored as 32-bit floats. diff --git a/crates/media/src/exr_read.rs b/crates/media/src/exr_read.rs index ca30f6994..5f9151049 100644 --- a/crates/media/src/exr_read.rs +++ b/crates/media/src/exr_read.rs @@ -178,14 +178,17 @@ pub(crate) struct ReadRequest { pub(crate) rows: Option>, /// Every 2^level-th row and column of the display window (0: full resolution). pub(crate) level: u32, - /// The most bytes of planes the read may allocate. + /// The most bytes of planes the read may allocate (the caller's own limit; `usize::MAX`: only + /// the system's, [`effectcraft_render::memory::decode_limit`]). pub(crate) max_bytes: usize, + /// The fixed limit the system's memory may raise ([`MAX_DECODE_BYTES`]). + pub(crate) floor: usize, } impl ReadRequest { /// Every row of `channels` at full resolution. pub(crate) fn full(channels: Vec) -> ReadRequest { - ReadRequest { channels, rows: None, level: 0, max_bytes: MAX_DECODE_BYTES } + ReadRequest { channels, rows: None, level: 0, max_bytes: usize::MAX, floor: MAX_DECODE_BYTES } } } @@ -214,8 +217,10 @@ pub(crate) enum ReadError { Cancelled, } -/// The most bytes of planes one read allocates (every requested channel is a display-window -/// plane of f32): a header can ask for far more than the file holds. +/// The most bytes of planes one read allocates at least (every requested channel is a +/// display-window plane of f32): a header can ask for far more than the file holds, and a file's +/// size on disk says nothing about it. With more memory in the machine the limit is higher +/// ([`effectcraft_render::memory::decode_limit`], #3749). #[cfg(target_pointer_width = "64")] pub(crate) const MAX_DECODE_BYTES: usize = 8 << 30; #[cfg(not(target_pointer_width = "64"))] @@ -256,14 +261,19 @@ pub(crate) fn read_planes(src: &mut dyn ReadSeek, index: &ExrIndex, req: &ReadRe } } +fn gb(bytes: usize) -> f64 { + bytes as f64 / f64::from(1u32 << 30) +} + fn read(src: &mut dyn ReadSeek, index: &ExrIndex, req: &ReadRequest) -> Result<(Vec>, ReadStats), ReadError> { let (w, h) = index.size(); let (ow, oh) = seek::level_size((w, h), req.level.min(16)); let n = ow.checked_mul(oh).ok_or_else(|| ReadError::Unreadable("display window".into()))?; let need = n.saturating_mul(req.channels.len()).saturating_mul(std::mem::size_of::()); - let most = req.max_bytes.min(MAX_DECODE_BYTES); + // (the limit is decided here and handed to `craft-exr` as the read's `max_bytes`: the planes + // it reserves, fallibly, and the largest block it decompresses follow it) + let most = req.max_bytes.min(effectcraft_render::memory::decode_limit(req.floor, need)); if need > most { - let gb = |b: usize| b as f64 / f64::from(1u32 << 30); return Err(ReadError::TooLarge(format!( "its {}×{} OpenEXR channels need {:.1} GB of memory, more than the {:.1} GB one file may use", w, diff --git a/crates/render/src/memory.rs b/crates/render/src/memory.rs index 7859be071..9c2cab435 100644 --- a/crates/render/src/memory.rs +++ b/crates/render/src/memory.rs @@ -419,6 +419,44 @@ impl Accountant { } } +/// What the system's memory allows one request for a file's decoded planes (an OpenEXR's +/// channels) to take; 0: not known yet ([`decode_limit`]). +static DECODE_LIMIT: AtomicUsize = AtomicUsize::new(0); + +/// Reads that limit from the system when nothing set it ([`set_decode_limit_source`]). +static DECODE_SOURCE: Mutex Option>> = Mutex::new(None); + +/// Set what the system's memory allows one request for a file's decoded planes to take +/// (`None`: unknown again). The session sets it with the memory budget once the installed RAM +/// is read. +pub fn set_decode_limit(bytes: Option) { + DECODE_LIMIT.store(bytes.unwrap_or(0), Ordering::Relaxed); +} + +/// Where [`decode_limit`] reads the limit from while nothing set it: the CLI and the MCP server +/// read no memory otherwise. The reading may take a second, so it is only asked for when a +/// request is over the fixed floor. +pub fn set_decode_limit_source(source: Option Option>) { + *DECODE_SOURCE.lock().unwrap_or_else(PoisonError::into_inner) = source; +} + +/// The most bytes one request of `need` bytes for a file's decoded planes may take: `floor` +/// (the fixed limit), or what the system's memory allows when that is more. The system is +/// asked only when `need` is over `floor` (and once: the answer is kept, also "unknown", which +/// leaves `floor`). The browser keeps `floor`. +pub fn decode_limit(floor: usize, need: usize) -> usize { + if need <= floor || cfg!(target_arch = "wasm32") { + return floor; + } + let mut known = DECODE_LIMIT.load(Ordering::Relaxed); + if known == 0 { + let source = *DECODE_SOURCE.lock().unwrap_or_else(PoisonError::into_inner); + known = source.and_then(|read| read()).unwrap_or(floor); + DECODE_LIMIT.store(known, Ordering::Relaxed); + } + floor.max(known) +} + #[cfg(test)] mod tests { use super::*; @@ -831,4 +869,48 @@ mod tests { acc.set_process_memory(process_now, 1_000, 2_000); assert!(preview.held() <= 200, "{}", preview.held()); } + + static ASKED: AtomicUsize = AtomicUsize::new(0); + + fn ram_says() -> Option { + ASKED.fetch_add(1, Ordering::SeqCst); + Some(300) + } + + fn ram_unknown() -> Option { + ASKED.fetch_add(1, Ordering::SeqCst); + None + } + + /// #3749: a request for a file's planes may take the fixed floor, or the system's memory + /// when that is more: the system is asked only for a request over the floor, once. + #[test] + fn a_request_over_the_floor_is_limited_by_the_systems_memory() { + let _serial = PROCESS_SERIAL.lock().unwrap_or_else(PoisonError::into_inner); + set_decode_limit(None); + set_decode_limit_source(Some(ram_says)); + ASKED.store(0, Ordering::SeqCst); + // Under the floor: nobody is asked. + assert_eq!(decode_limit(100, 50), 100); + assert_eq!(ASKED.load(Ordering::SeqCst), 0, "a request under the floor reads no memory"); + // Over it: the system's 300, asked once. + assert_eq!(decode_limit(100, 200), 300); + assert_eq!(decode_limit(100, 250), 300); + assert_eq!(ASKED.load(Ordering::SeqCst), 1, "asked once, then kept"); + // A smaller figure than the floor never lowers it. + set_decode_limit(Some(40)); + assert_eq!(decode_limit(100, 200), 100); + // The session's figure replaces the asked one. + set_decode_limit(Some(900)); + assert_eq!(decode_limit(100, 200), 900); + // Unknown memory leaves the floor, and is not asked again. + set_decode_limit(None); + set_decode_limit_source(Some(ram_unknown)); + ASKED.store(0, Ordering::SeqCst); + assert_eq!(decode_limit(100, 200), 100); + assert_eq!(decode_limit(100, 200), 100); + assert_eq!(ASKED.load(Ordering::SeqCst), 1, "an unknown reading is kept too"); + set_decode_limit(None); + set_decode_limit_source(None); + } } From bdf500f4bad552790dc9decb4af840c928cefe76 Mon Sep 17 00:00:00 2001 From: vangel76 Date: Sun, 15 Nov 2026 21:52:34 +0100 Subject: [PATCH 216/451] OpenEXR limit: a refusal for size is decided anew when the limit changes; a failed reading is asked twice (#3749 review) --- crates/media/src/exr_planes.rs | 17 +++++-- crates/media/src/exr_planes/tests.rs | 30 ++++++++++++ crates/render/src/memory.rs | 71 +++++++++++++++++++++++----- 3 files changed, 100 insertions(+), 18 deletions(-) diff --git a/crates/media/src/exr_planes.rs b/crates/media/src/exr_planes.rs index 8b6daf167..5b08d67ec 100644 --- a/crates/media/src/exr_planes.rs +++ b/crates/media/src/exr_planes.rs @@ -183,6 +183,10 @@ struct Flight { /// When the decode was asked for ([`effectcraft_render::memory::tick`]): what it took is the /// planes' cost to the memory accountant. asked: u64, + /// The decode limit's generation when the decode was asked for + /// ([`effectcraft_render::memory::decode_limit_generation`]): a refusal for its size holds + /// only while the limit stays as it was. + limit_generation: u64, } /// [`Flight::phase`] values. @@ -219,6 +223,7 @@ impl Flight { since, hints: filmcraft_media::cancel::Context::current(), asked: effectcraft_render::memory::tick(), + limit_generation: effectcraft_render::memory::decode_limit_generation(), }) } @@ -276,8 +281,9 @@ struct Entry { flight: Option>, /// Requests that failed for good (unreadable, too large), the index they were made with, and /// why: a request of that index (the file as it was) asking for at - /// least as much fails the same way until the file is forgotten. - failed: Vec<(Arc, Want, Refused)>, + /// least as much fails the same way until the file is forgotten, or the decode limit changed + /// (the last number: its generation when the request was made). + failed: Vec<(Arc, Want, Refused, u64)>, bytes: usize, /// When it was last asked for or finished decoding ([`effectcraft_render::memory::tick`]). used: u64, @@ -522,7 +528,8 @@ impl PlaneStore { return Step::Done(Ok(b)); } // (a failure of the file as it was before: the file changed since, it is read again) - if let Some((_, _, why)) = e.failed.iter().find(|(of, failed, _)| Arc::ptr_eq(of, index) && asks_at_least(index, want, failed)) { + let limit = effectcraft_render::memory::decode_limit_generation(); + if let Some((_, _, why, _)) = e.failed.iter().find(|(of, failed, _, made_at)| Arc::ptr_eq(of, index) && *made_at == limit && asks_at_least(index, want, failed)) { return Step::Done(Err(why.clone())); } if let Some(flight) = e.flight.clone() { @@ -671,11 +678,11 @@ impl PlaneStore { (fs.index.clone(), fs.want.clone()) }; // (failures of another version of the file no longer apply) - e.failed.retain(|(of, _, _)| Arc::ptr_eq(of, &index)); + e.failed.retain(|(of, _, _, made_at)| Arc::ptr_eq(of, &index) && *made_at == flight.limit_generation); if e.failed.len() >= FAILED_KEPT { e.failed.remove(0); } - e.failed.push((index, want, why.clone())); + e.failed.push((index, want, why.clone(), flight.limit_generation)); } // (the file changed: what is held is of the old one) Err(Refused::Changed) => { diff --git a/crates/media/src/exr_planes/tests.rs b/crates/media/src/exr_planes/tests.rs index febc926ba..76b02d4cb 100644 --- a/crates/media/src/exr_planes/tests.rs +++ b/crates/media/src/exr_planes/tests.rs @@ -1580,11 +1580,16 @@ fn a_failed_picture_leaves_the_other_channels_readable() { assert!(rest.aux.get("Z").is_some()); } +/// The tests that move the process-wide decode limit take turns (it also dates the remembered +/// refusals). +static LIMIT_TESTS: Mutex<()> = Mutex::new(()); + /// #3749: a read over the fixed floor is allowed up to what the system's memory gives (the /// session's figure), never under the floor, and refused with a reason beyond it. The floor is /// small here: the real one is 8 GiB. #[test] fn a_read_over_the_floor_is_allowed_up_to_the_systems_memory() { + let _only = LIMIT_TESTS.lock().unwrap_or_else(PoisonError::into_inner); let bytes = write(vec![part(None, &RGBA, (8, 8), Compression::ZIP1)], (8, 8)); let mut src = std::io::Cursor::new(bytes.as_slice()); let index = crate::exr_index::build(&mut src, FileStamp::Virtual).unwrap(); @@ -1601,6 +1606,31 @@ fn a_read_over_the_floor_is_allowed_up_to_the_systems_memory() { effectcraft_render::memory::set_decode_limit(None); } +/// #3749: a refusal for the request's size is remembered only while the decode limit stays as it +/// was: when the system's memory figure arrives or changes, the request is decided anew. +#[test] +fn a_refusal_for_size_is_decided_anew_when_the_decode_limit_changes() { + let _only = LIMIT_TESTS.lock().unwrap_or_else(PoisonError::into_inner); + let bytes: Arc<[u8]> = write(vec![part(None, &RGBA, (8, 8), Compression::ZIP1)], (8, 8)).into(); + let path = "/3749-refusal-generation.exr"; + // Room for one plane of 8×8 f32: four are refused. + set_cap(path, 8 * 8 * 4); + let store = PlaneStore::new(CACHE_BUDGET); + let source = ExrSource::Bytes(bytes); + let index = crate::exr_index::get(path, &source).unwrap(); + let want = Want { all: false, ids: (0..4).collect() }; + let refused = || matches!(store.get(path, &source, &index, &want, Use::Other), Err(Refused::TooLarge(_))); + assert!(refused()); + assert!(refused()); + assert_eq!(decodes_of(path).len(), 1, "the second refusal came from memory"); + // (figures under the fixed floor: only the change counts, no other test's limit moves) + effectcraft_render::memory::set_decode_limit(Some(1000)); + effectcraft_render::memory::set_decode_limit(Some(2000)); + assert!(refused(), "still over the caller's own limit"); + assert_eq!(decodes_of(path).len(), 2, "decided anew after the limit changed"); + effectcraft_render::memory::set_decode_limit(None); +} + /// #3749: a plane the system cannot give is not an aborted process: `craft-exr` asks for the /// planes' memory first and reports what it can't get, a read that failed just now (asked again, /// not remembered); a plane over the read's limit (the decode limit handed to it) is a refusal diff --git a/crates/render/src/memory.rs b/crates/render/src/memory.rs index 9c2cab435..ae8d02104 100644 --- a/crates/render/src/memory.rs +++ b/crates/render/src/memory.rs @@ -423,14 +423,40 @@ impl Accountant { /// channels) to take; 0: not known yet ([`decode_limit`]). static DECODE_LIMIT: AtomicUsize = AtomicUsize::new(0); +/// Counts the changes of that limit: a refusal made under an older one is out of date +/// ([`decode_limit_generation`]). +static DECODE_GENERATION: std::sync::atomic::AtomicU64 = std::sync::atomic::AtomicU64::new(0); + +/// How often the system was asked for the limit without an answer ([`decode_limit`]). +static DECODE_UNANSWERED: AtomicUsize = AtomicUsize::new(0); + /// Reads that limit from the system when nothing set it ([`set_decode_limit_source`]). static DECODE_SOURCE: Mutex Option>> = Mutex::new(None); +/// One reading of the system at a time: the second asker takes the first one's answer. +static DECODE_ASKING: Mutex<()> = Mutex::new(()); + +/// The system is asked this often at most for the limit when it does not answer. +const DECODE_ASKS: usize = 2; + +fn store_decode_limit(bytes: usize) { + if DECODE_LIMIT.swap(bytes, Ordering::Relaxed) != bytes { + DECODE_GENERATION.fetch_add(1, Ordering::Relaxed); + } +} + /// Set what the system's memory allows one request for a file's decoded planes to take /// (`None`: unknown again). The session sets it with the memory budget once the installed RAM /// is read. pub fn set_decode_limit(bytes: Option) { - DECODE_LIMIT.store(bytes.unwrap_or(0), Ordering::Relaxed); + store_decode_limit(bytes.unwrap_or(0)); + DECODE_UNANSWERED.store(0, Ordering::Relaxed); +} + +/// Changes whenever [`decode_limit`] gives another answer: a request refused for its size is +/// asked again after that. +pub fn decode_limit_generation() -> u64 { + DECODE_GENERATION.load(Ordering::Relaxed) } /// Where [`decode_limit`] reads the limit from while nothing set it: the CLI and the MCP server @@ -438,23 +464,31 @@ pub fn set_decode_limit(bytes: Option) { /// request is over the fixed floor. pub fn set_decode_limit_source(source: Option Option>) { *DECODE_SOURCE.lock().unwrap_or_else(PoisonError::into_inner) = source; + DECODE_UNANSWERED.store(0, Ordering::Relaxed); } /// The most bytes one request of `need` bytes for a file's decoded planes may take: `floor` /// (the fixed limit), or what the system's memory allows when that is more. The system is -/// asked only when `need` is over `floor` (and once: the answer is kept, also "unknown", which -/// leaves `floor`). The browser keeps `floor`. +/// asked only when `need` is over `floor`, and the answer is kept; when it gives none (a reading +/// that failed) it is asked once more later, then `floor` stays. The browser keeps `floor`. pub fn decode_limit(floor: usize, need: usize) -> usize { if need <= floor || cfg!(target_arch = "wasm32") { return floor; } - let mut known = DECODE_LIMIT.load(Ordering::Relaxed); - if known == 0 { - let source = *DECODE_SOURCE.lock().unwrap_or_else(PoisonError::into_inner); - known = source.and_then(|read| read()).unwrap_or(floor); - DECODE_LIMIT.store(known, Ordering::Relaxed); + if DECODE_LIMIT.load(Ordering::Relaxed) == 0 && DECODE_UNANSWERED.load(Ordering::Relaxed) < DECODE_ASKS { + let _asking = DECODE_ASKING.lock().unwrap_or_else(PoisonError::into_inner); + // (another thread may have just read it) + if DECODE_LIMIT.load(Ordering::Relaxed) == 0 { + let source = *DECODE_SOURCE.lock().unwrap_or_else(PoisonError::into_inner); + match source.and_then(|read| read()) { + Some(bytes) => store_decode_limit(bytes), + None => { + DECODE_UNANSWERED.fetch_add(1, Ordering::Relaxed); + } + } + } } - floor.max(known) + floor.max(DECODE_LIMIT.load(Ordering::Relaxed)) } #[cfg(test)] @@ -903,13 +937,24 @@ mod tests { // The session's figure replaces the asked one. set_decode_limit(Some(900)); assert_eq!(decode_limit(100, 200), 900); - // Unknown memory leaves the floor, and is not asked again. + // Unknown memory leaves the floor; a reading that failed once is tried once more, then + // not asked again (and what is not known is never kept as the floor). set_decode_limit(None); set_decode_limit_source(Some(ram_unknown)); ASKED.store(0, Ordering::SeqCst); - assert_eq!(decode_limit(100, 200), 100); - assert_eq!(decode_limit(100, 200), 100); - assert_eq!(ASKED.load(Ordering::SeqCst), 1, "an unknown reading is kept too"); + for _ in 0..4 { + assert_eq!(decode_limit(100, 200), 100); + } + assert_eq!(ASKED.load(Ordering::SeqCst), 2, "a failed reading is tried twice"); + // A source that answers later is not shut out by the floor kept earlier. + set_decode_limit_source(Some(ram_says)); + assert_eq!(decode_limit(7, 200), 300, "a limit is not tied to the floor of an earlier request"); + // The generation tells that the limit changed. + let before = decode_limit_generation(); + set_decode_limit(Some(300)); + assert_eq!(decode_limit_generation(), before, "the same figure is no change"); + set_decode_limit(Some(500)); + assert_ne!(decode_limit_generation(), before); set_decode_limit(None); set_decode_limit_source(None); } From a7e7cb6b6a688a2191d05a03f6d4b77fd1cc0d33 Mon Sep 17 00:00:00 2001 From: vangel76 Date: Sun, 15 Nov 2026 21:53:52 +0100 Subject: [PATCH 217/451] OpenEXR limit: only a refusal for size depends on the limit's generation; sequentially consistent counters (#3749 review) --- crates/media/src/exr_planes.rs | 8 ++++++-- crates/render/src/memory.rs | 16 +++++++++------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/crates/media/src/exr_planes.rs b/crates/media/src/exr_planes.rs index 5b08d67ec..a7a3c62cc 100644 --- a/crates/media/src/exr_planes.rs +++ b/crates/media/src/exr_planes.rs @@ -529,7 +529,9 @@ impl PlaneStore { } // (a failure of the file as it was before: the file changed since, it is read again) let limit = effectcraft_render::memory::decode_limit_generation(); - if let Some((_, _, why, _)) = e.failed.iter().find(|(of, failed, _, made_at)| Arc::ptr_eq(of, index) && *made_at == limit && asks_at_least(index, want, failed)) { + if let Some((_, _, why, _)) = e.failed.iter().find(|(of, failed, refusal, made_at)| { + Arc::ptr_eq(of, index) && (!matches!(refusal, Refused::TooLarge(_)) || *made_at == limit) && asks_at_least(index, want, failed) + }) { return Step::Done(Err(why.clone())); } if let Some(flight) = e.flight.clone() { @@ -678,7 +680,9 @@ impl PlaneStore { (fs.index.clone(), fs.want.clone()) }; // (failures of another version of the file no longer apply) - e.failed.retain(|(of, _, _, made_at)| Arc::ptr_eq(of, &index) && *made_at == flight.limit_generation); + // (a refusal for the size counts under the limit it was made under only) + e.failed + .retain(|(of, _, old, made_at)| Arc::ptr_eq(of, &index) && (!matches!(old, Refused::TooLarge(_)) || *made_at == flight.limit_generation)); if e.failed.len() >= FAILED_KEPT { e.failed.remove(0); } diff --git a/crates/render/src/memory.rs b/crates/render/src/memory.rs index ae8d02104..d1600551b 100644 --- a/crates/render/src/memory.rs +++ b/crates/render/src/memory.rs @@ -440,8 +440,10 @@ static DECODE_ASKING: Mutex<()> = Mutex::new(()); const DECODE_ASKS: usize = 2; fn store_decode_limit(bytes: usize) { - if DECODE_LIMIT.swap(bytes, Ordering::Relaxed) != bytes { - DECODE_GENERATION.fetch_add(1, Ordering::Relaxed); + // (the limit before its generation, both sequentially consistent: whoever sees the new + // generation sees the new limit) + if DECODE_LIMIT.swap(bytes, Ordering::SeqCst) != bytes { + DECODE_GENERATION.fetch_add(1, Ordering::SeqCst); } } @@ -456,7 +458,7 @@ pub fn set_decode_limit(bytes: Option) { /// Changes whenever [`decode_limit`] gives another answer: a request refused for its size is /// asked again after that. pub fn decode_limit_generation() -> u64 { - DECODE_GENERATION.load(Ordering::Relaxed) + DECODE_GENERATION.load(Ordering::SeqCst) } /// Where [`decode_limit`] reads the limit from while nothing set it: the CLI and the MCP server @@ -475,10 +477,10 @@ pub fn decode_limit(floor: usize, need: usize) -> usize { if need <= floor || cfg!(target_arch = "wasm32") { return floor; } - if DECODE_LIMIT.load(Ordering::Relaxed) == 0 && DECODE_UNANSWERED.load(Ordering::Relaxed) < DECODE_ASKS { + if DECODE_LIMIT.load(Ordering::SeqCst) == 0 { let _asking = DECODE_ASKING.lock().unwrap_or_else(PoisonError::into_inner); - // (another thread may have just read it) - if DECODE_LIMIT.load(Ordering::Relaxed) == 0 { + // (another thread may have just read it, or have used up the asks) + if DECODE_LIMIT.load(Ordering::SeqCst) == 0 && DECODE_UNANSWERED.load(Ordering::Relaxed) < DECODE_ASKS { let source = *DECODE_SOURCE.lock().unwrap_or_else(PoisonError::into_inner); match source.and_then(|read| read()) { Some(bytes) => store_decode_limit(bytes), @@ -488,7 +490,7 @@ pub fn decode_limit(floor: usize, need: usize) -> usize { } } } - floor.max(DECODE_LIMIT.load(Ordering::Relaxed)) + floor.max(DECODE_LIMIT.load(Ordering::SeqCst)) } #[cfg(test)] From f08a2290c223f50797a01d0dae1e79da0272d1d3 Mon Sep 17 00:00:00 2001 From: vangel76 Date: Mon, 16 Nov 2026 17:49:20 +0100 Subject: [PATCH 218/451] 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. --- crates/media/src/exr_planes.rs | 58 ++++++++++++++------- crates/media/src/exr_planes/tests.rs | 78 +++++++++++++++++++++++++++- crates/media/src/exr_read.rs | 25 ++++++--- 3 files changed, 133 insertions(+), 28 deletions(-) diff --git a/crates/media/src/exr_planes.rs b/crates/media/src/exr_planes.rs index a7a3c62cc..917dab4e3 100644 --- a/crates/media/src/exr_planes.rs +++ b/crates/media/src/exr_planes.rs @@ -907,6 +907,26 @@ fn run(path: &str, source: &ExrSource, flight: &Arc, base: Option Refused { + match e { + ReadError::Cancelled => Refused::Cancelled, + // (a read that failed just now: the next request reads again) + ReadError::Io(why) => { + log::warn!("media: {path}: {why}"); + Refused::Stopped + } + ReadError::TooLarge(why) => { + log::warn!("media: {path}: {why}"); + Refused::TooLarge(why) + } + ReadError::Unreadable(why) => { + log::warn!("media: {path}: {why}"); + Refused::Unreadable + } + } +} + /// Decode what `flight` asks for and `base` doesn't hold, and make the union of both. fn decode(path: &str, source: &ExrSource, flight: &Arc, base: Option>, opened: Option) -> Result, Refused> { let _decoding = Decoding::new(); @@ -947,10 +967,25 @@ fn decode(path: &str, source: &ExrSource, flight: &Arc, base: Option = wanted.into_iter().filter(|i| *i < index.channels.len()).collect(); - let base = base.filter(|b| Arc::ptr_eq(&b.index, &index)); - let missing: Vec = wanted.iter().copied().filter(|id| !base.as_ref().is_some_and(|b| b.ids.binary_search(id).is_ok())).collect(); - let names: Vec = missing.iter().filter_map(|i| index.channels.get(*i)).map(|c| c.name.clone()).collect(); + let mut base = base.filter(|b| Arc::ptr_eq(&b.index, &index)); + let mut missing: Vec = wanted.iter().copied().filter(|id| !base.as_ref().is_some_and(|b| b.ids.binary_search(id).is_ok())).collect(); let (w, h) = index.size(); + // The planes the request ends with (those held plus those missing, whether they come from the + // disk cache or the file) must fit the limit, asked before any of them is allocated (#3749). + // The planes held are only kept for later requests: when they don't fit with the missing + // ones, they are let go and the request is read on its own. + if !missing.is_empty() { + let held = base.as_ref().map_or(0, |b| b.ids.len()); + let together = crate::exr_read::check_total(w, h, held.saturating_add(missing.len()), cap_of(path)); + if together.is_err() && base.is_some() { + base = None; + missing = wanted.clone(); + } + if base.is_none() { + crate::exr_read::check_total(w, h, missing.len(), cap_of(path)).map_err(|e| refused(path, e))?; + } + } + let names: Vec = missing.iter().filter_map(|i| index.channels.get(*i)).map(|c| c.name.clone()).collect(); // The disk tier first (#3271): what an earlier session or a decode RAM let go of kept, one // entry per channel (any request is assembled from them, whatever was asked before). // (a file naming two channels alike can't tell their entries apart: not kept) @@ -984,22 +1019,7 @@ fn decode(path: &str, source: &ExrSource, flight: &Arc, base: Option> = read.map_err(|e| match e { - ReadError::Cancelled => Refused::Cancelled, - // (a read that failed just now: the next request reads again) - ReadError::Io(why) => { - log::warn!("media: {path}: {why}"); - Refused::Stopped - } - ReadError::TooLarge(why) => { - log::warn!("media: {path}: {why}"); - Refused::TooLarge(why) - } - ReadError::Unreadable(why) => { - log::warn!("media: {path}: {why}"); - Refused::Unreadable - } - })?; + let read: Vec> = read.map_err(|e| refused(path, e))?; let mut read = read.into_iter(); let planes: Vec> = kept.iter_mut().map(|k| k.take().or_else(|| read.next()).unwrap_or_default()).collect(); // The union, in file order: the planes held and the ones just read. diff --git a/crates/media/src/exr_planes/tests.rs b/crates/media/src/exr_planes/tests.rs index 76b02d4cb..313302a4a 100644 --- a/crates/media/src/exr_planes/tests.rs +++ b/crates/media/src/exr_planes/tests.rs @@ -1619,18 +1619,92 @@ fn a_refusal_for_size_is_decided_anew_when_the_decode_limit_changes() { let source = ExrSource::Bytes(bytes); let index = crate::exr_index::get(path, &source).unwrap(); let want = Want { all: false, ids: (0..4).collect() }; + // (the refusal is made before anything is read: the decodes are counted as they begin) + let begun = Arc::new(AtomicU64::new(0)); + { + let begun = begun.clone(); + set_before_read( + path, + Some(Arc::new(move |_: &str| { + begun.fetch_add(1, Ordering::SeqCst); + })), + ); + } let refused = || matches!(store.get(path, &source, &index, &want, Use::Other), Err(Refused::TooLarge(_))); assert!(refused()); assert!(refused()); - assert_eq!(decodes_of(path).len(), 1, "the second refusal came from memory"); + assert_eq!(begun.load(Ordering::SeqCst), 1, "the second refusal came from memory"); // (figures under the fixed floor: only the change counts, no other test's limit moves) effectcraft_render::memory::set_decode_limit(Some(1000)); effectcraft_render::memory::set_decode_limit(Some(2000)); assert!(refused(), "still over the caller's own limit"); - assert_eq!(decodes_of(path).len(), 2, "decided anew after the limit changed"); + assert_eq!(begun.load(Ordering::SeqCst), 2, "decided anew after the limit changed"); + set_before_read(path, None); effectcraft_render::memory::set_decode_limit(None); } +/// A file of an 8×8 picture and a depth plane: five planes of 256 bytes. +fn picture_and_depth() -> Vec { + write(vec![part(None, &[("R", true), ("G", true), ("B", true), ("A", true), ("Z", false)], (8, 8), Compression::ZIP1)], (8, 8)) +} + +/// #3749 (#3301 review): the limit is for the planes a request ends with, not for the ones read +/// just now: channels added to the planes held count with them. When together they are over +/// the limit the planes held are let go and the request is read on its own (it fits alone); a +/// request that doesn't fit alone is refused, whatever is held. +#[test] +fn channels_added_to_the_planes_held_count_toward_the_limit() { + let path = "/3749-held-and-added.exr"; + // Room for four planes: the picture fits, one more with it is five. + set_cap(path, 4 * 8 * 8 * 4); + let store = PlaneStore::new(CACHE_BUDGET); + let source = ExrSource::Bytes(picture_and_depth().into()); + let index = crate::exr_index::get(path, &source).unwrap(); + let picture = Want { all: false, ids: index.picture_ids().into_iter().collect() }; + store.get(path, &source, &index, &picture, Use::Other).expect("the picture fits"); + let rest = Want { all: true, ids: Default::default() }; + let depth = store.get(path, &source, &index, &rest, Use::Other).expect("the depth plane fits alone"); + assert!(depth.aux.get("Z").is_some()); + assert!(depth.aux.get("R").is_none(), "the picture's planes were let go: four held and one more are five"); + // The picture again: it fits alone, the depth plane is let go in turn. + let again = store.get(path, &source, &index, &picture, Use::Other).expect("the picture fits alone"); + assert!(again.aux.get("R").is_some() && again.aux.get("Z").is_none()); + // Everything at once is five planes: refused, however it is asked. + let everything = Want { all: true, ids: (0..5).collect() }; + assert!(matches!(store.get(path, &source, &index, &everything, Use::Other).err(), Some(Refused::TooLarge(_)))); +} + +/// #3749 (#3301 review): planes the disk cache gives back count toward the limit of a request +/// like the ones read from the file. +#[test] +fn planes_from_the_disk_cache_count_toward_the_limit() { + use effectcraft_render::disk_cache::DiskCache; + let dir = std::env::temp_dir().join(format!("ec-3749-disk-union-{}", std::process::id())); + std::fs::create_dir_all(&dir).unwrap(); + let file = dir.join("union_0001.exr"); + std::fs::write(&file, picture_and_depth()).unwrap(); + let dc = DiskCache::open(dir.join("cache"), 1 << 30).unwrap(); + dc.set_read_us_per_mb(0); + use_disk_for(&dir.to_string_lossy()); + set_disk_cache(Some(&dc)); + let path = file.to_string_lossy().to_string(); + let source = ExrSource::File(file.clone()); + let index = crate::exr_index::get(&path, &source).unwrap(); + let all = Want { all: true, ids: (0..5).collect() }; + let first = PlaneStore::new(CACHE_BUDGET).get(&path, &source, &index, &all, Use::Other).is_ok(); + dc.flush(); + // All five planes are in the disk cache (a store without them in RAM reads them back)... + let warm = PlaneStore::new(CACHE_BUDGET).get(&path, &source, &index, &all, Use::Other).is_ok(); + let from_disk = decodes_of(&path).last().is_some_and(|d| d.from_disk); + // ...and a request may use four. + set_cap(&path, 4 * 8 * 8 * 4); + let refused = PlaneStore::new(CACHE_BUDGET).get(&path, &source, &index, &all, Use::Other).err(); + set_disk_cache(None); + let _ = std::fs::remove_dir_all(&dir); + assert!(first && warm && from_disk, "decoded without a limit, then read back from the disk cache"); + assert!(matches!(refused, Some(Refused::TooLarge(_))), "{refused:?}"); +} + /// #3749: a plane the system cannot give is not an aborted process: `craft-exr` asks for the /// planes' memory first and reports what it can't get, a read that failed just now (asked again, /// not remembered); a plane over the read's limit (the decode limit handed to it) is a refusal diff --git a/crates/media/src/exr_read.rs b/crates/media/src/exr_read.rs index 5f9151049..5624fc2d0 100644 --- a/crates/media/src/exr_read.rs +++ b/crates/media/src/exr_read.rs @@ -265,6 +265,23 @@ fn gb(bytes: usize) -> f64 { bytes as f64 / f64::from(1u32 << 30) } +fn too_large(w: usize, h: usize, need: usize, most: usize) -> ReadError { + ReadError::TooLarge(format!("its {}×{} OpenEXR channels need {:.1} GB of memory, more than the {:.1} GB one file may use", w, h, gb(need), gb(most))) +} + +/// Refuse a request whose planes together, those already in hand (held in memory or read back +/// from the disk cache) and those still to read, `planes` of a `w` × `h` display window, need +/// more memory than one file may use: the limit is for what a file's request ends with, not +/// for the part of it read just now ([`effectcraft_render::memory::decode_limit`], #3749). +pub(crate) fn check_total(w: usize, h: usize, planes: usize, max_bytes: usize) -> Result<(), ReadError> { + let need = w.saturating_mul(h).saturating_mul(planes).saturating_mul(std::mem::size_of::()); + let most = max_bytes.min(effectcraft_render::memory::decode_limit(MAX_DECODE_BYTES, need)); + if need > most { + return Err(too_large(w, h, need, most)); + } + Ok(()) +} + fn read(src: &mut dyn ReadSeek, index: &ExrIndex, req: &ReadRequest) -> Result<(Vec>, ReadStats), ReadError> { let (w, h) = index.size(); let (ow, oh) = seek::level_size((w, h), req.level.min(16)); @@ -274,13 +291,7 @@ fn read(src: &mut dyn ReadSeek, index: &ExrIndex, req: &ReadRequest) -> Result<( // it reserves, fallibly, and the largest block it decompresses follow it) let most = req.max_bytes.min(effectcraft_render::memory::decode_limit(req.floor, need)); if need > most { - return Err(ReadError::TooLarge(format!( - "its {}×{} OpenEXR channels need {:.1} GB of memory, more than the {:.1} GB one file may use", - w, - h, - gb(need), - gb(most) - ))); + return Err(too_large(w, h, need, most)); } let mut channels = Vec::with_capacity(req.channels.len()); let mut fill = Vec::with_capacity(req.channels.len()); From c0c53353fefd5229b7054d0b2afb0d9050e2208c Mon Sep 17 00:00:00 2001 From: vangel76 Date: Mon, 16 Nov 2026 23:35:44 +0100 Subject: [PATCH 219/451] 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. --- crates/media/src/exr_planes.rs | 86 ++++++++++++++++++--- crates/media/src/exr_planes/tests.rs | 111 +++++++++++++++++++++++++-- crates/media/src/exr_read.rs | 13 +++- 3 files changed, 191 insertions(+), 19 deletions(-) diff --git a/crates/media/src/exr_planes.rs b/crates/media/src/exr_planes.rs index 917dab4e3..13e46da60 100644 --- a/crates/media/src/exr_planes.rs +++ b/crates/media/src/exr_planes.rs @@ -150,6 +150,9 @@ pub(crate) enum Refused { Unreadable, /// More planes than one file may allocate (the reason; remembered). TooLarge(String), + /// The system refused the memory the planes need just now (the reason): not remembered, + /// but not asked again at once either, nor read as a whole file another way (#3749). + NoMemory(String), /// The request was called off. Cancelled, /// The file changed since it was indexed: index it again and ask again. @@ -430,8 +433,9 @@ pub(crate) fn set_before_read(path: &str, hook: Option) { } } -/// Planes of `path` may take at most this many bytes in a read (tests: a small cap in place of -/// [`crate::exr_read::MAX_DECODE_BYTES`]). +/// Planes of `path` may take at most this many bytes in a read (tests: a cap of the caller's own, +/// below the system's limit; outside tests there is none, `usize::MAX`, and only +/// [`effectcraft_render::memory::decode_limit`] applies). #[cfg(test)] static CAPS: Mutex> = Mutex::new(Vec::new()); @@ -657,7 +661,7 @@ impl PlaneStore { let clock = effectcraft_render::memory::tick(); let Some(e) = st.entries.iter_mut().find(|e| e.path == path && e.flight.as_ref().is_some_and(|f| Arc::ptr_eq(f, flight))) else { let outcome = match outcome { - Err(e @ (Refused::Cancelled | Refused::Stopped)) => Err(e), + Err(e @ (Refused::Cancelled | Refused::Stopped | Refused::NoMemory(_))) => Err(e), _ => Err(Refused::Forgotten), }; return (outcome, 0); @@ -694,7 +698,8 @@ impl PlaneStore { e.bytes = 0; e.cost_us = 0; } - Err(Refused::Cancelled | Refused::Forgotten | Refused::Stopped) => {} + // (memory refused just now: another request may get it) + Err(Refused::Cancelled | Refused::Forgotten | Refused::Stopped | Refused::NoMemory(_)) => {} } let grown = st.entries.iter().find(|e| e.path == path).map_or(0, |e| e.bytes.saturating_sub(had)); Self::drop_oldest(&mut st, self.budget(), CACHE_FILES, Some(path)); @@ -920,6 +925,10 @@ fn refused(path: &str, e: ReadError) -> Refused { log::warn!("media: {path}: {why}"); Refused::TooLarge(why) } + ReadError::OutOfMemory(why) => { + log::warn!("media: {path}: {why}"); + Refused::NoMemory(why) + } ReadError::Unreadable(why) => { log::warn!("media: {path}: {why}"); Refused::Unreadable @@ -927,6 +936,53 @@ fn refused(path: &str, e: ReadError) -> Refused { } } +/// A copy of `plane`, or `None` when the system can't give the memory for it (an allocation that +/// fails aborts the process, so it is asked for first). +fn copy_plane(plane: &[f32]) -> Option> { + let mut copy: Vec = Vec::new(); + copy.try_reserve_exact(plane.len()).ok()?; + copy.extend_from_slice(plane); + Some(copy) +} + +/// Why `planes` planes of a `w` × `h` display window couldn't be had (to show). +fn no_memory_for(w: usize, h: usize, planes: usize) -> String { + let bytes = w.saturating_mul(h).saturating_mul(planes).saturating_mul(std::mem::size_of::()); + format!("its {w}×{h} OpenEXR channels need {:.1} GB more memory than the system can give just now", bytes as f64 / f64::from(1u32 << 30)) +} + +/// Fails the reads of a path as a test says, for the channels read ([`set_read_error`]). +#[cfg(test)] +pub(crate) type ForcedError = Arc Option + Send + Sync>; +#[cfg(test)] +static READ_ERRORS: Mutex> = Mutex::new(Vec::new()); + +/// Make reads of `path` fail as `error` says for the channels read, instead of reading (`None`: +/// read again; tests: memory the system refuses). Keyed by path, so tests running at the same +/// time don't see each other's. +#[cfg(test)] +pub(crate) fn set_read_error(path: &str, error: Option) { + let mut errors = READ_ERRORS.lock().unwrap_or_else(PoisonError::into_inner); + errors.retain(|(p, _)| p != path); + if let Some(e) = error { + errors.push((path.to_string(), e)); + } +} + +/// How a test makes the read of `ids` of `path` fail ([`set_read_error`]); never outside tests. +fn forced_read_error(path: &str, ids: &[usize]) -> Option { + #[cfg(test)] + { + let error = READ_ERRORS.lock().unwrap_or_else(PoisonError::into_inner).iter().find(|(p, _)| p == path).map(|(_, e)| e.clone()); + error.and_then(|e| e(ids)) + } + #[cfg(not(test))] + { + let _ = (path, ids); + None + } +} + /// Decode what `flight` asks for and `base` doesn't hold, and make the union of both. fn decode(path: &str, source: &ExrSource, flight: &Arc, base: Option>, opened: Option) -> Result, Refused> { let _decoding = Decoding::new(); @@ -1010,6 +1066,8 @@ fn decode(path: &str, source: &ExrSource, flight: &Arc, base: Option, base: Option, base: Option b, Err(Refused::Changed) => continue, // The channels with it are too many: the picture alone (the effects ask for theirs). - Err(Refused::TooLarge(_)) if extra.is_some() => { + // (also when the system has no memory for them just now, #3749) + Err(Refused::TooLarge(_) | Refused::NoMemory(_)) if extra.is_some() => { extra = None; continue; } - Err(Refused::TooLarge(why)) => return Picture::Done(Err(why)), + // (never the whole file's decode: the memory isn't there for it either) + Err(Refused::TooLarge(why) | Refused::NoMemory(why)) => return Picture::Done(Err(why)), Err(Refused::Cancelled | Refused::Forgotten) => return Picture::Cancelled, // (the whole file's decode says why) Err(Refused::Stopped | Refused::Unreadable) => return Picture::Legacy, @@ -1290,7 +1353,10 @@ pub(crate) fn picture_rows(path: &str, source: &ExrSource, op: AlphaOp, rows: (i return picture(path, source, op, None); } let request = ReadRequest { rows: Some(rows.0..rows.1), max_bytes: cap_of(path), ..ReadRequest::full(ids.clone()) }; - let (planes, stats) = read_planes(&mut *opened.reader, &index, &request); + let (planes, stats) = match forced_read_error(path, &ids) { + Some(e) => (Err(e), Default::default()), + None => read_planes(&mut *opened.reader, &index, &request), + }; let names: Vec = ids.iter().filter_map(|i| index.channels.get(*i)).map(|c| c.name.clone()).collect(); #[cfg(test)] DECODES.lock().unwrap_or_else(PoisonError::into_inner).push((path.to_string(), DecodeRecord { channels: names.clone(), stats, from_disk: false })); @@ -1299,7 +1365,7 @@ pub(crate) fn picture_rows(path: &str, source: &ExrSource, op: AlphaOp, rows: (i let planes = match planes { Ok(p) => p, Err(ReadError::Cancelled) => return Picture::Cancelled, - Err(ReadError::TooLarge(why)) => return Picture::Done(Err(why)), + Err(ReadError::TooLarge(why) | ReadError::OutOfMemory(why)) => return Picture::Done(Err(why)), Err(_) => return Picture::Legacy, }; let (w, h) = index.size(); diff --git a/crates/media/src/exr_planes/tests.rs b/crates/media/src/exr_planes/tests.rs index 313302a4a..a08dc87fc 100644 --- a/crates/media/src/exr_planes/tests.rs +++ b/crates/media/src/exr_planes/tests.rs @@ -1075,8 +1075,12 @@ fn a_new_frame_opens_its_file_once() { /// them go they are read back from there, bit for bit (Cryptomatte IDs included), whatever was /// asked for before (the picture first, then the channels, then all of it after an eviction); /// Reload Footage drops them. +/// The tests that set the process-wide disk cache take turns (one would switch off another's). +static DISK_TESTS: Mutex<()> = Mutex::new(()); + #[test] fn decoded_planes_are_kept_on_disk_and_read_back_exactly() { + let _disk = DISK_TESTS.lock().unwrap_or_else(PoisonError::into_inner); use effectcraft_render::disk_cache::{DiskCache, Kind}; let dir = std::env::temp_dir().join(format!("ec-3271-disk-planes-{}", std::process::id())); std::fs::create_dir_all(&dir).unwrap(); @@ -1549,7 +1553,7 @@ fn a_failure_is_forgotten_once_the_file_changes() { #[test] fn an_allocation_failure_is_not_remembered() { use crate::exr_read::{ReadError, read_error}; - assert_eq!(read_error(craft_exr::seek::Error::OutOfMemory("planes".into())), ReadError::Io("planes".into())); + assert!(matches!(read_error(craft_exr::seek::Error::OutOfMemory("planes".into())), ReadError::OutOfMemory(why) if why.contains("planes"))); assert!(matches!(read_error(craft_exr::seek::Error::LimitExceeded("planes".into())), ReadError::TooLarge(_))); // A read that failed just now (here: the file can't be opened) is a stop, and the next // request for the same channels reads them. @@ -1678,6 +1682,7 @@ fn channels_added_to_the_planes_held_count_toward_the_limit() { /// like the ones read from the file. #[test] fn planes_from_the_disk_cache_count_toward_the_limit() { + let _disk = DISK_TESTS.lock().unwrap_or_else(PoisonError::into_inner); use effectcraft_render::disk_cache::DiskCache; let dir = std::env::temp_dir().join(format!("ec-3749-disk-union-{}", std::process::id())); std::fs::create_dir_all(&dir).unwrap(); @@ -1706,19 +1711,115 @@ fn planes_from_the_disk_cache_count_toward_the_limit() { } /// #3749: a plane the system cannot give is not an aborted process: `craft-exr` asks for the -/// planes' memory first and reports what it can't get, a read that failed just now (asked again, -/// not remembered); a plane over the read's limit (the decode limit handed to it) is a refusal -/// for size with `craft-exr`'s reason. +/// planes' memory first and reports what it can't get, memory refused just now (not remembered, +/// not read again at once); a plane over the read's limit (the decode limit handed to it) is a +/// refusal for size with `craft-exr`'s reason. #[test] fn a_plane_the_system_cannot_give_is_refused_not_allocated() { use crate::exr_read::{ReadError, read_error}; use craft_exr::seek::Error; let gone = read_error(Error::OutOfMemory("4096 bytes of planes".into())); - assert!(matches!(&gone, ReadError::Io(why) if why.contains("4096 bytes of planes")), "{gone:?}"); + assert!(matches!(&gone, ReadError::OutOfMemory(why) if why.contains("4096 bytes of planes")), "{gone:?}"); let over = read_error(Error::LimitExceeded("the requested rows need 4096 bytes".into())); assert!(matches!(&over, ReadError::TooLarge(why) if why.contains("4096 bytes")), "{over:?}"); } +/// Reads of `path` fail for lack of memory when `fails` says so for the channels read; the reads +/// asked for are counted. +fn no_memory_when(path: &str, fails: impl Fn(&[usize]) -> bool + Send + Sync + 'static) -> Arc { + let asked = Arc::new(AtomicU64::new(0)); + let counted = asked.clone(); + set_read_error( + path, + Some(Arc::new(move |ids: &[usize]| { + counted.fetch_add(1, Ordering::SeqCst); + fails(ids).then(|| crate::exr_read::ReadError::OutOfMemory("no memory just now".into())) + })), + ); + asked +} + +/// #3749 review: memory the system refuses during a read is neither read again at once (the +/// store's retries, a copy) nor remembered: the request is refused with the reason, and the next +/// request reads again. +#[test] +fn memory_the_system_cannot_give_is_neither_retried_nor_remembered() { + let path = "/3749-no-memory.exr"; + let source = ExrSource::Bytes(picture_and_depth().into()); + let store = PlaneStore::new(CACHE_BUDGET); + let index = crate::exr_index::get(path, &source).unwrap(); + let want = Want { all: true, ids: (0..5).collect() }; + let asked = no_memory_when(path, |_| true); + let refused = store.get(path, &source, &index, &want, Use::Other).err(); + assert!(matches!(&refused, Some(Refused::NoMemory(why)) if why.contains("no memory just now")), "{refused:?}"); + assert_eq!(asked.load(Ordering::SeqCst), 1, "read once, not again at once"); + let asked = no_memory_when(path, |_| false); + assert!(store.get(path, &source, &index, &want, Use::Other).is_ok(), "not remembered: the memory is there now"); + assert_eq!(asked.load(Ordering::SeqCst), 1); + set_read_error(path, None); +} + +/// #3749 review: a picture whose channels the system has no memory for just now is read alone +/// without the effects' channels, and refused with the reason when even that doesn't fit; never +/// handed to the whole file's decode (which would ask for more memory, infallibly). +#[test] +fn a_picture_without_memory_is_read_alone_or_refused_never_decoded_whole() { + let path = "/3749-no-memory-picture.exr"; + let source = ExrSource::Bytes(picture_and_depth().into()); + let op = AlphaOp::of(&Footage::default(), FloatCurve::Linear); + // With the depth plane it is five planes, more than the system gives: the picture alone. + no_memory_when(path, |ids| ids.len() > 4); + let Picture::Done(Ok(img)) = picture(path, &source, op, Some(&AuxNeed::All)) else { panic!("the picture alone") }; + assert_eq!((img.width, img.height), (8, 8)); + // Not even the picture: refused with the reason, also for some of its rows. + no_memory_when(path, |_| true); + match picture(path, &source, op, None) { + Picture::Done(Err(why)) => assert!(why.contains("no memory just now"), "{why}"), + _ => panic!("refused with the reason"), + } + match picture_rows(path, &source, op, (0, 4)) { + Picture::Done(Err(why)) => assert!(why.contains("no memory just now"), "{why}"), + _ => panic!("rows refused with the reason"), + } + set_read_error(path, None); +} + +/// #3749 review: only a refusal for size is decided anew when the decode limit changes; an +/// unreadable request stays refused, also when another request fails under the new limit. +#[test] +fn an_unreadable_request_stays_refused_when_the_decode_limit_changes() { + let _only = LIMIT_TESTS.lock().unwrap_or_else(PoisonError::into_inner); + let path = "/3749-unreadable-generation.exr"; + let source = ExrSource::Bytes(picture_and_depth().into()); + let store = PlaneStore::new(CACHE_BUDGET); + let index = crate::exr_index::get(path, &source).unwrap(); + let asked = Arc::new(AtomicU64::new(0)); + { + let counted = asked.clone(); + set_read_error( + path, + Some(Arc::new(move |_: &[usize]| { + counted.fetch_add(1, Ordering::SeqCst); + Some(crate::exr_read::ReadError::Unreadable("damaged".into())) + })), + ); + } + let red = Want { all: false, ids: [0].into_iter().collect() }; + let unreadable = |want: &Want| matches!(store.get(path, &source, &index, want, Use::Other), Err(Refused::Unreadable)); + assert!(unreadable(&red)); + // (figures under the fixed floor: only the change counts, no other test's limit moves) + effectcraft_render::memory::set_decode_limit(Some(1000)); + effectcraft_render::memory::set_decode_limit(Some(2000)); + assert!(unreadable(&red)); + assert_eq!(asked.load(Ordering::SeqCst), 1, "remembered across the change"); + // Another request fails under the new limit: the first refusal is still remembered. + assert!(unreadable(&Want { all: false, ids: [4].into_iter().collect() })); + assert!(unreadable(&red)); + assert_eq!(asked.load(Ordering::SeqCst), 2, "only the other request was read"); + effectcraft_render::memory::set_decode_limit(None); + set_read_error(path, None); +} + /// A two-rank Cryptomatte file of `size` with a picture: "cube" and "sphere" meet along a /// diagonal whose pixels hold both IDs (rank 00 the nearer, 55-75 %, rank 01 the other one with /// the rest), IDs and coverage stored as 32-bit floats. diff --git a/crates/media/src/exr_read.rs b/crates/media/src/exr_read.rs index 5624fc2d0..9a11dea3e 100644 --- a/crates/media/src/exr_read.rs +++ b/crates/media/src/exr_read.rs @@ -213,6 +213,9 @@ pub(crate) enum ReadError { Io(String), /// The planes need more memory than one read may allocate (the reason, to show). TooLarge(String), + /// The system refused the memory the planes need just now (the reason, to show): not a file + /// too large, but not to be asked again at once either (#3749). + OutOfMemory(String), /// The request was called off. Cancelled, } @@ -226,13 +229,15 @@ pub(crate) const MAX_DECODE_BYTES: usize = 8 << 30; #[cfg(not(target_pointer_width = "64"))] pub(crate) const MAX_DECODE_BYTES: usize = 512 << 20; -/// What a failed `craft-exr` read means here. Memory the system refused just now is a read that -/// failed ([`ReadError::Io`]: the plane store doesn't remember it, another read may succeed), -/// not a file too large (remembered until the file changes). +/// What a failed `craft-exr` read means here. Memory the system refused just now is +/// [`ReadError::OutOfMemory`]: the plane store doesn't remember it (another request may +/// succeed), but doesn't read it again at once nor fall back to decoding the whole file +/// either; a file too large is remembered until the file or the limit changes. pub(crate) fn read_error(e: seek::Error) -> ReadError { match e { seek::Error::Cancelled => ReadError::Cancelled, - seek::Error::Io(why) | seek::Error::OutOfMemory(why) => ReadError::Io(why), + seek::Error::Io(why) => ReadError::Io(why), + seek::Error::OutOfMemory(why) => ReadError::OutOfMemory(format!("its OpenEXR channels need more memory than the system can give just now ({why})")), seek::Error::LimitExceeded(why) => ReadError::TooLarge(format!("its OpenEXR channels need more memory than one file may use ({why})")), seek::Error::Malformed(why) | seek::Error::Unsupported(why) | seek::Error::UnsupportedCompression(why) => ReadError::Unreadable(why), other => ReadError::Unreadable(other.to_string()), From ba2cb5f7592c3e56e481b137a86033d3e902d5ab Mon Sep 17 00:00:00 2001 From: vangel76 Date: Mon, 16 Nov 2026 23:38:19 +0100 Subject: [PATCH 220/451] 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. --- crates/media/src/exr_planes/tests.rs | 44 ++++++++++++++++++++++++++++ crates/media/src/exr_read.rs | 11 ++++++- 2 files changed, 54 insertions(+), 1 deletion(-) diff --git a/crates/media/src/exr_planes/tests.rs b/crates/media/src/exr_planes/tests.rs index a08dc87fc..c3a831250 100644 --- a/crates/media/src/exr_planes/tests.rs +++ b/crates/media/src/exr_planes/tests.rs @@ -1724,6 +1724,50 @@ fn a_plane_the_system_cannot_give_is_refused_not_allocated() { assert!(matches!(&over, ReadError::TooLarge(why) if why.contains("4096 bytes")), "{over:?}"); } +/// A source that counts the bytes read from it. +struct Counted { + inner: R, + read: usize, +} + +impl std::io::Read for Counted { + fn read(&mut self, buf: &mut [u8]) -> std::io::Result { + let n = self.inner.read(buf)?; + self.read += n; + Ok(n) + } +} + +impl std::io::Seek for Counted { + fn seek(&mut self, to: std::io::SeekFrom) -> std::io::Result { + self.inner.seek(to) + } +} + +/// #3749 review: one decompressed block may take 8 GiB at most, whatever memory the read may +/// use: a file whose block is larger (a data window a billion pixels wide over one large chunk, +/// so that the chunk could hold it) is refused for its size before anything is read, also with a +/// decode limit far above the block. +#[test] +fn a_block_over_the_fixed_limit_is_refused_whatever_the_decode_limit() { + let _only = LIMIT_TESTS.lock().unwrap_or_else(PoisonError::into_inner); + let f32s = [("R", false), ("G", false), ("B", false), ("A", false)]; + let small = write(vec![part(None, &f32s, (1, 1), Compression::ZIP1)], (1, 1)); + // One line of 2^30 - 2 pixels of four f32 channels: a block of 16 GiB... + let mut bytes = with_data_window_x_max(small, (1 << 30) - 3); + // ...over a chunk long enough to hold it at craft-exr's ratio (2^16 bytes a byte). + bytes.extend(std::iter::repeat_n(0u8, 300 << 10)); + let index = crate::exr_index::build(&mut std::io::Cursor::new(bytes.as_slice()), FileStamp::Virtual).expect("indexed: the chunk can hold the block"); + // The read may use 64 GiB (the floor is tiny, the system's figure high). + effectcraft_render::memory::set_decode_limit(Some(64 << 30)); + let request = ReadRequest { floor: 8, ..ReadRequest::full(vec![0, 1, 2, 3]) }; + let mut src = Counted { inner: std::io::Cursor::new(bytes.as_slice()), read: 0 }; + let (read, _) = crate::exr_read::read_planes(&mut src, &index, &request); + effectcraft_render::memory::set_decode_limit(None); + assert!(matches!(&read, Err(crate::exr_read::ReadError::TooLarge(why)) if why.contains("one block of this read may use")), "{read:?}"); + assert_eq!(src.read, 0, "refused before anything was read"); +} + /// Reads of `path` fail for lack of memory when `fails` says so for the channels read; the reads /// asked for are counted. fn no_memory_when(path: &str, fails: impl Fn(&[usize]) -> bool + Send + Sync + 'static) -> Arc { diff --git a/crates/media/src/exr_read.rs b/crates/media/src/exr_read.rs index 9a11dea3e..60175806e 100644 --- a/crates/media/src/exr_read.rs +++ b/crates/media/src/exr_read.rs @@ -244,6 +244,13 @@ pub(crate) fn read_error(e: seek::Error) -> ReadError { } } +/// The most bytes one decompressed block of a read may take, whatever the read's limit +/// ([`MAX_DECODE_BYTES`]: 8 GiB, 512 MiB in the browser): the decompressor allocates a block +/// whole before it looks at the data, and a block is one strip of the file, so a larger one is a +/// damaged or hostile header, not a file with more channels (#3749). A refusal for it doesn't +/// depend on the limit: a request asking at least as much, refused for it before, would be again. +pub(crate) const MAX_BLOCK_BYTES: usize = MAX_DECODE_BYTES; + /// The most threads one read decompresses on (beside the caller's), and the size of a file /// whose chunks are decompressed on the calling thread alone. const READ_WORKERS: usize = 4; @@ -293,7 +300,8 @@ fn read(src: &mut dyn ReadSeek, index: &ExrIndex, req: &ReadRequest) -> Result<( let n = ow.checked_mul(oh).ok_or_else(|| ReadError::Unreadable("display window".into()))?; let need = n.saturating_mul(req.channels.len()).saturating_mul(std::mem::size_of::()); // (the limit is decided here and handed to `craft-exr` as the read's `max_bytes`: the planes - // it reserves, fallibly, and the largest block it decompresses follow it) + // it reserves, fallibly, follow it; one decompressed block stays at the fixed floor however + // much memory the machine has, see `MAX_BLOCK_BYTES`) let most = req.max_bytes.min(effectcraft_render::memory::decode_limit(req.floor, need)); if need > most { return Err(too_large(w, h, need, most)); @@ -309,6 +317,7 @@ fn read(src: &mut dyn ReadSeek, index: &ExrIndex, req: &ReadRequest) -> Result<( request.fill = &fill; request.rows = req.rows.clone(); request.level = req.level; + request.max_block_bytes = Some(MAX_BLOCK_BYTES); // craft-exr decompresses on threads of its own, started for this read, beside the decode // pool the caller runs on: a few at most, and none for a small file (its chunks are // decompressed on the calling thread). From 3972e5181b1a6cad3a47a09524a9760f9a37f109 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Mon, 16 Nov 2026 19:38:19 -0500 Subject: [PATCH 221/451] svg: delegate stylesheet parsing and matching to craft-svg --- Cargo.lock | 138 +++--------------------- Cargo.toml | 2 +- crates/svg/src/lib.rs | 231 ++-------------------------------------- crates/svg/src/tests.rs | 33 ------ 4 files changed, 24 insertions(+), 380 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 73d74ecb5..a11599fd7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -147,21 +147,6 @@ dependencies = [ "equator", ] -[[package]] -name = "alloc-no-stdlib" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2fb6cfd47bf496ff64095c20eaba0c201404ee38714d4142fcfa1dc334fcc7a" - -[[package]] -name = "alloc-stdlib" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b5c1865780388bfa186411ab5f247819487fc4864c6e9c3106611fa347586e1" -dependencies = [ - "alloc-no-stdlib", -] - [[package]] name = "allocator-api2" version = "0.2.21" @@ -796,16 +781,6 @@ dependencies = [ "syn 3.0.6", ] -[[package]] -name = "brotli-decompressor" -version = "6.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc031cd87c6529082b0b65c604e86af0ed7744841b17ccfe60b1e31fa606179e" -dependencies = [ - "alloc-no-stdlib", - "alloc-stdlib", -] - [[package]] name = "built" version = "0.8.1" @@ -1376,39 +1351,6 @@ dependencies = [ "writeable", ] -[[package]] -name = "craft-image-codecs" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" -dependencies = [ - "craft-jpeg 0.1.0 (git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87)", - "craft-metadata", - "crc32fast", - "exr", - "flate2", - "half", - "hayro-jpeg2000", - "image", - "image-webp", - "jpeg-encoder", - "png", - "rayon", - "serde_json", - "thiserror 2.0.21", - "tiff", - "zune-core", - "zune-jpeg", - "zune-jpegxl", -] - -[[package]] -name = "craft-jpeg" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" -dependencies = [ - "thiserror 2.0.21", -] - [[package]] name = "craft-jpeg" version = "0.1.0" @@ -1461,18 +1403,6 @@ dependencies = [ "serde_json", ] -[[package]] -name = "craft-metadata" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" -dependencies = [ - "brotli-decompressor", - "chrono", - "craft-tiff 0.1.0 (git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87)", - "quick-xml 0.41.0", - "serde", -] - [[package]] name = "craft-mime" version = "0.1.0" @@ -1543,7 +1473,7 @@ name = "craft-raw" version = "0.1.0" source = "git+https://github.com/storytold/craft-libs?rev=bea91b1861eea3889bec9d26338076f2ff31c4ac#bea91b1861eea3889bec9d26338076f2ff31c4ac" dependencies = [ - "craft-tiff 0.1.0 (git+https://github.com/storytold/craft-libs?rev=bea91b1861eea3889bec9d26338076f2ff31c4ac)", + "craft-tiff", "miniz_oxide 0.9.1", "rayon", "serde", @@ -1555,10 +1485,9 @@ dependencies = [ [[package]] name = "craft-svg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" +source = "git+https://github.com/storytold/craft-libs?rev=c3d9015ec985450386a86b04713d6f1cee597951#c3d9015ec985450386a86b04713d6f1cee597951" dependencies = [ - "craft-image-codecs", - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87)", + "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=c3d9015ec985450386a86b04713d6f1cee597951)", "flate2", "kurbo", "quick-xml 0.41.0", @@ -1576,15 +1505,6 @@ dependencies = [ "thiserror 2.0.21", ] -[[package]] -name = "craft-tiff" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" -dependencies = [ - "serde", - "thiserror 2.0.21", -] - [[package]] name = "craft-tiff" version = "0.1.0" @@ -1747,16 +1667,6 @@ dependencies = [ "thiserror 2.0.21", ] -[[package]] -name = "craft-xml" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" -dependencies = [ - "quick-xml 0.41.0", - "serde", - "thiserror 2.0.21", -] - [[package]] name = "craft-xml" version = "0.1.0" @@ -1777,6 +1687,16 @@ dependencies = [ "thiserror 2.0.21", ] +[[package]] +name = "craft-xml" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=c3d9015ec985450386a86b04713d6f1cee597951#c3d9015ec985450386a86b04713d6f1cee597951" +dependencies = [ + "quick-xml 0.41.0", + "serde", + "thiserror 2.0.21", +] + [[package]] name = "craft-y4m" version = "0.1.0" @@ -3039,7 +2959,7 @@ version = "0.20.1" source = "git+https://github.com/storytold/filmcraft?rev=3f137a7ed420cac79b32145f5243b7f98b31f71c#3f137a7ed420cac79b32145f5243b7f98b31f71c" dependencies = [ "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=82062077bba679ba5236e2d1a391f02d1533cbab)", - "craft-jpeg 0.1.0 (git+https://github.com/storytold/craft-libs?rev=937ac93c5cf3cd4b6a81e195b078fe161eb081b9)", + "craft-jpeg", "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=82062077bba679ba5236e2d1a391f02d1533cbab)", "craft-video 0.1.0 (git+https://github.com/storytold/craft-libs?rev=82062077bba679ba5236e2d1a391f02d1533cbab)", "craft-y4m", @@ -3071,7 +2991,7 @@ version = "0.20.1" source = "git+https://github.com/storytold/filmcraft?rev=3f137a7ed420cac79b32145f5243b7f98b31f71c#3f137a7ed420cac79b32145f5243b7f98b31f71c" dependencies = [ "craft-raw", - "craft-tiff 0.1.0 (git+https://github.com/storytold/craft-libs?rev=bea91b1861eea3889bec9d26338076f2ff31c4ac)", + "craft-tiff", "image", "rayon", "thiserror 2.0.21", @@ -3760,9 +3680,6 @@ name = "hayro-jpeg2000" version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c75ab947623ef4ccaa7acf0579edf7cbb5a73838e3839a7be73335e522f433a1" -dependencies = [ - "fearless_simd", -] [[package]] name = "hayro-syntax" @@ -4024,7 +3941,6 @@ dependencies = [ "moxcms", "num-traits", "png", - "qoi", "tiff", "zune-core", "zune-jpeg", @@ -4175,12 +4091,6 @@ dependencies = [ "libc", ] -[[package]] -name = "jpeg-encoder" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b454d911ac55068f53495488d8ccd0646eaa540c033a28ee15b07838afafb01f" - [[package]] name = "js-sys" version = "0.3.106" @@ -5573,15 +5483,6 @@ version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d55d956fa96f5ec02be2e13af0e20391a5aa83d6a074e3ad368959d0fab299ea" -[[package]] -name = "qoi" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f6d64c71eb498fe9eae14ce4ec935c555749aef511cca85b5568910d6e48001" -dependencies = [ - "bytemuck", -] - [[package]] name = "quick-error" version = "1.2.3" @@ -9001,15 +8902,6 @@ dependencies = [ "zune-core", ] -[[package]] -name = "zune-jpegxl" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cba11ecd07cc23351500e840ae03841b7e4997923ec8e4832ee3ae199ea0b6b4" -dependencies = [ - "zune-core", -] - [[package]] name = "zvariant" version = "5.15.0" diff --git a/Cargo.toml b/Cargo.toml index 2889bdc34..bf9f999be 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,7 @@ craft-ps = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", craft-exr = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" } craft-gif = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" } craft-psd = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "ce2ec507c2e6a6a078a5f450f641487f8931816d" } -craft-svg = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" } +craft-svg = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "c3d9015ec985450386a86b04713d6f1cee597951" } craft-webp = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" } craft-lottie = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" } craft-mesh = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87", default-features = false, features = ["stl", "obj", "gltf", "fbx"] } diff --git a/crates/svg/src/lib.rs b/crates/svg/src/lib.rs index fd4baa543..94977d153 100644 --- a/crates/svg/src/lib.rs +++ b/crates/svg/src/lib.rs @@ -425,186 +425,12 @@ enum PaintRef { Current, } -/// The most selectors (each entry of a comma list counts) the ` + + + + + + + + + + + + + "##; + let doc = effectcraft_svg::parse(svg).unwrap(); + let mut next_id = 1u64; + let mut ids = Ids(&mut next_id); + let items = svg_contents(&mut ids, &doc); + assert_eq!(items.len(), 1); + let layer = &items[0]; + assert_eq!(layer.name, "layer"); + assert!((layer.prop("transform/opacity").unwrap().value.as_f64() - 50.0).abs() < 1e-9); + + // Paint order is reversed (top of paint order first). + let children: Vec<_> = layer.sub("contents").unwrap().groups().collect(); + let names: Vec<_> = children.iter().map(|g| g.name.as_str()).collect(); + assert_eq!(names, vec!["fallback", "grad", "hole", "rect-a"]); + + // rect-a: viewBox (10, 10, 40, 20) -> (80, 40) scales by 2x; translate(10, 10) lands at (0, 0) in comp space, + // and 1em = 10 -> 20x20 rect centered at (10, 10). + let rect_a: Vec<_> = children[3].sub("contents").unwrap().groups().collect(); + assert_eq!(rect_a[0].get("size").unwrap().value.as_vec2(), [20.0, 20.0]); + assert_eq!(rect_a[0].get("position").unwrap().value.as_vec2(), [10.0, 10.0]); + assert_eq!(rect_a[1].get("color").unwrap().value, Value::Color([1.0, 0.0, 0.0, 1.0])); + + // hole: EvenOdd fill rule preserved. + let hole: Vec<_> = children[2].sub("contents").unwrap().groups().collect(); + let hole_fill = hole.iter().find(|g| g.match_id == "fill").unwrap(); + assert_eq!(hole_fill.get("rule").unwrap().value, Value::Enum(1)); + + // grad: gradient fill mapped with both stops. + let grad: Vec<_> = children[1].sub("contents").unwrap().groups().collect(); + assert!(grad.iter().any(|g| g.match_id == "gfill")); + + // fallback: missing paint server keeps fallback solid color. + let fb: Vec<_> = children[0].sub("contents").unwrap().groups().collect(); + let fb_fill = fb.iter().find(|g| g.match_id == "fill").unwrap(); + assert_eq!(fb_fill.get("color").unwrap().value, Value::Color([0.0, 0.0, 1.0, 1.0])); + } } diff --git a/crates/host/tests/it/vector_import.rs b/crates/host/tests/it/vector_import.rs index 81b0d8e59..451a30db8 100644 --- a/crates/host/tests/it/vector_import.rs +++ b/crates/host/tests/it/vector_import.rs @@ -1097,3 +1097,67 @@ fn a_vectorcraft_document_without_a_pdf_reports_the_option_to_turn_on() { assert_eq!(r["items"], json!([]), "{import_as}: {r}"); } } + +#[test] +fn svg_scene_mapping_render_parity() { + let svg = br##" + + + + + + + + + + + + + + + + + + + + + + + "##; + let path = tmp("scene-parity.svg"); + std::fs::write(&path, svg).unwrap(); + let doc = effectcraft_svg::parse(svg).unwrap(); + let (w, h) = doc.pixel_size(); + assert_eq!((w, h), (120, 80)); + + let mut s = effectcraft_host::session(); + let r = s.execute_checked("file.import", json!({"paths": [path]})).unwrap(); + assert_eq!(r["errors"], json!([]), "{r}"); + let item = r["items"][0].as_u64().unwrap(); + s.execute("comp.new", json!({"name": "Parity", "width": w, "height": h, "frameRate": 30, "duration": 1})).unwrap(); + let lid = s.execute_checked("layer.addItem", json!({"item": item})).unwrap()["layer"].as_u64().unwrap(); + let cid = s.active_comp_id().unwrap(); + let t = effectcraft_time::Tick::ZERO; + + let footage = s.render(cid, t, RenderOpts::default()); + let direct = effectcraft_svg::rasterize(&doc, w, h, 1.0); + assert!(mean_diff(&footage, &direct) < 1.0 / 255.0, "footage = rasterised SVG"); + + s.execute("layer.select", json!({"layers": [lid]})).unwrap(); + let r = s.execute_checked("layer.create", json!({"op": "shapesFromVector"})).unwrap(); + let sid = r["layers"][0].as_u64().unwrap(); + let shapes = s.render(cid, t, RenderOpts::default()); + let d1 = mean_diff(&shapes, &direct); + assert!(d1 < 0.02, "shapes vs SVG mean diff {d1}"); + + s.execute("prop.set", json!({"layer": sid, "path": "transform/scale", "value": [300, 300]})).unwrap(); + s.execute("prop.set", json!({"layer": sid, "path": "transform/position", "value": [0, 0]})).unwrap(); + s.execute("prop.set", json!({"layer": sid, "path": "transform/anchor", "value": [0, 0]})).unwrap(); + let big = s.render(cid, t, RenderOpts::default()); + let direct3 = effectcraft_svg::rasterize(&doc, w, h, 3.0); + let d3 = mean_diff(&big, &direct3); + assert!(d3 < 0.03, "shapes x3 vs SVG x3 mean diff {d3}"); +} diff --git a/crates/svg/src/tests.rs b/crates/svg/src/tests.rs index 672ef5910..ccbf58dea 100644 --- a/crates/svg/src/tests.rs +++ b/crates/svg/src/tests.rs @@ -1343,3 +1343,247 @@ fn axis_rect_recognises_only_axis_aligned_rectangles() { folded.close_path(); assert_eq!(axis_rect(&folded, Affine::IDENTITY), None); } + +#[test] +fn css_cascade_specificity_display_visibility_and_group_opacity_parity() { + let svg = br##" + + + + + + + + + + + + + + + + "##; + let doc = parse(svg).unwrap(); + let shapes = doc.flatten(); + // 5 top-row rects + 1 visible child in hidden group + 2 rects in opacity group = 8. + assert_eq!(shapes.len(), 8); + assert_eq!(shapes[0].2.fill, Some(Paint::Color([1.0, 0.0, 0.0]))); + assert_eq!(shapes[1].2.fill, Some(Paint::Color([0.0, 1.0, 0.0]))); + assert_eq!(shapes[2].2.fill, Some(Paint::Color([0.0, 1.0, 1.0]))); + assert_eq!(shapes[3].2.fill, Some(Paint::Color([0.0, 0.0, 1.0]))); + assert_eq!(shapes[4].2.fill, Some(Paint::Color([1.0, 1.0, 0.0]))); + // Group opacity multiplies in flatten() rather than mutating child fill_opacity. + assert!((shapes[6].1 - 0.5).abs() < 1e-12); + assert!((shapes[6].2.fill_opacity - 1.0).abs() < 1e-12); + + let img = rasterize(&doc, 60, 20, 1.0); + assert!(near(px(&img, 5, 5), [1.0, 0.0, 0.0, 1.0], 1e-3)); + assert!(near(px(&img, 15, 5), [0.0, 1.0, 0.0, 1.0], 1e-3)); + assert!(near(px(&img, 25, 5), [0.0, 1.0, 1.0, 1.0], 1e-3)); + assert!(near(px(&img, 35, 5), [0.0, 0.0, 1.0, 1.0], 1e-3)); + assert!(near(px(&img, 45, 5), [1.0, 1.0, 0.0, 1.0], 1e-3)); + // display:none suppresses the entire subtree. + assert_eq!(px(&img, 55, 5)[3], 0.0); + // visibility:hidden suppresses the first child, visibility:visible restores the second. + assert_eq!(px(&img, 5, 15)[3], 0.0); + assert!(near(px(&img, 15, 15), [0.0, 1.0, 0.0, 1.0], 1e-3)); + // Isolated group opacity: blue over red inside opacity=0.5 yields premultiplied [0, 0, 0.5, 0.5], + // without red bleeding through the opaque blue rect. + assert!(near(px(&img, 25, 15), [0.0, 0.0, 0.5, 0.5], 2e-3)); +} + +#[test] +fn inherited_attributes_current_color_and_use_inheritance_parity() { + let svg = br##" + + + + + + + + + + + "##; + let doc = parse(svg).unwrap(); + let shapes = doc.flatten(); + assert_eq!(shapes.len(), 4); + + let inh = shapes[0].2; + assert_eq!(inh.fill, Some(Paint::Color([1.0, 0.0, 0.0]))); + assert!((inh.fill_opacity - 0.5).abs() < 1e-12); + assert_eq!(inh.fill_rule, FillRule::EvenOdd); + let st = inh.stroke.as_ref().expect("inherited stroke"); + assert_eq!(st.paint, Paint::Color([0.0, 0.0, 1.0])); + assert_eq!(st.width, 2.0); + assert_eq!(st.cap, Cap::Round); + assert_eq!(st.join, Join::Bevel); + assert_eq!(st.miter, 6.0); + assert_eq!(st.dash, Some((vec![4.0, 2.0], 1.0))); + + let ovr = shapes[1].2; + assert_eq!(ovr.fill, Some(Paint::Color([0.0, 1.0, 0.0]))); + assert!((ovr.fill_opacity - 1.0).abs() < 1e-12); + assert!(ovr.stroke.is_none()); + + // passes its inherited fill to #tpl (which has no fill), while #own keeps its own fill. + assert_eq!(shapes[2].2.fill, Some(Paint::Color([1.0, 1.0, 0.0]))); + assert_eq!(shapes[3].2.fill, Some(Paint::Color([0.0, 1.0, 0.0]))); + + let img = rasterize(&doc, 50, 20, 1.0); + assert!(near(px(&img, 15, 5), [0.0, 1.0, 0.0, 1.0], 1e-3)); + // Both elements inherit fill-opacity="0.5" from the enclosing . + assert!(near(px(&img, 25, 5), [0.5, 0.5, 0.0, 0.5], 1e-3)); + assert!(near(px(&img, 35, 5), [0.0, 0.5, 0.0, 0.5], 1e-3)); +} + +#[test] +fn length_units_and_font_size_inheritance_parity() { + let svg = br#" + + + + + + "#; + let doc = parse(svg).unwrap(); + let shapes = doc.flatten(); + assert_eq!(shapes.len(), 3); + + let (em, abs, mm) = (shapes[0].2, shapes[1].2, shapes[2].2); + assert!(matches!(em.geom, Geom::Rect { x, y, w, h, .. } + if (x - 20.0).abs() < 1e-9 && (y - 20.0).abs() < 1e-9 && (w - 40.0).abs() < 1e-9 && (h - 20.0).abs() < 1e-9)); + assert!((em.stroke.as_ref().unwrap().width - 5.0).abs() < 1e-9); + assert!(matches!(abs.geom, Geom::Rect { x, y, w, h, .. } + if (x - 96.0).abs() < 1e-9 && (y - 16.0).abs() < 1e-9 && (w - 96.0).abs() < 1e-9 && (h - 96.0).abs() < 1e-9)); + assert!(matches!(mm.geom, Geom::Rect { x, w, h, .. } + if (x - 96.0).abs() < 1e-9 && (w - 20.0).abs() < 1e-9 && (h - 20.0).abs() < 1e-9)); +} + +#[test] +fn viewbox_preserve_aspect_ratio_and_implicit_dimensions_parity() { + // Non-zero min-x/min-y and preserveAspectRatio modes into an 80x40 viewport. + for (par, pt_expect) in [ + ("none", (40.0, 20.0)), + ("xMidYMid meet", (40.0, 20.0)), + ("xMinYMin meet", (20.0, 20.0)), + ("xMaxYMax meet", (60.0, 20.0)), + ("xMidYMid slice", (40.0, 20.0)), + ("xMinYMin slice", (40.0, 40.0)), + ] { + let svg = format!( + r#" + + "# + ); + let doc = parse(svg.as_bytes()).unwrap(); + let shapes = doc.flatten(); + assert_eq!(shapes.len(), 1); + // Center of viewBox (20, 30) in root pixel space. + let center = shapes[0].0 * kurbo::Point::new(20.0, 30.0); + assert!((center.x - pt_expect.0).abs() < 1e-9 && (center.y - pt_expect.1).abs() < 1e-9, "{par}: {center:?}"); + } + + // Pixel check for xMinYMin meet vs xMaxYMax meet: 20x20 viewBox in 80x40 -> 40x40 square. + let min_doc = parse(br#""#).unwrap(); + let min_img = rasterize(&min_doc, 80, 40, 1.0); + assert!(near(px(&min_img, 10, 20), [1.0, 0.0, 0.0, 1.0], 1e-3)); + assert_eq!(px(&min_img, 60, 20)[3], 0.0); + + let max_doc = parse(br#""#).unwrap(); + let max_img = rasterize(&max_doc, 80, 40, 1.0); + assert_eq!(px(&max_img, 10, 20)[3], 0.0); + assert!(near(px(&max_img, 60, 20), [1.0, 0.0, 0.0, 1.0], 1e-3)); + + // Omitted width/height derive from viewBox aspect ratio. + let implicit = parse(br#""#).unwrap(); + assert_eq!((implicit.width, implicit.height), (100.0, 50.0)); + let only_w = parse(br#""#).unwrap(); + assert_eq!((only_w.width, only_w.height), (200.0, 100.0)); + let only_h = parse(br#""#).unwrap(); + assert_eq!((only_h.width, only_h.height), (50.0, 25.0)); +} + +#[test] +fn transform_functions_chaining_and_raster_parity() { + let svg = br#" + + + + + + + "#; + let doc = parse(svg).unwrap(); + let shapes = doc.flatten(); + assert_eq!(shapes.len(), 4); + + // rotate(180 5 5) maps (0, 0) -> (10, 10) and keeps the [0,10]^2 square covered. + let p = shapes[1].0 * kurbo::Point::new(0.0, 0.0); + assert!((p.x - 10.0).abs() < 1e-9 && (p.y - 10.0).abs() < 1e-9); + // skewX(45) at y=2 shifts x by +2 -> (0, 2) lands at (2+2, 26) = (4, 26). + let s = shapes[2].0 * kurbo::Point::new(0.0, 2.0); + assert!((s.x - 4.0).abs() < 1e-9 && (s.y - 26.0).abs() < 1e-9); + + let img = rasterize(&doc, 40, 40, 1.0); + assert!(near(px(&img, 20, 20), [1.0, 0.0, 0.0, 1.0], 1e-3)); + assert!(near(px(&img, 5, 5), [0.0, 0.0, 1.0, 1.0], 1e-3)); + assert!(near(px(&img, 6, 26), [0.0, 128.0 / 255.0, 0.0, 1.0], 1e-3)); + assert!(near(px(&img, 28, 28), [1.0, 1.0, 0.0, 1.0], 1e-3)); +} + +#[test] +fn paint_references_gradients_fallbacks_and_stroke_styles_parity() { + let svg = br##" + + + + + + + + + + + + + + + + + "##; + let doc = parse(svg).unwrap(); + let shapes = doc.flatten(); + assert_eq!(shapes.len(), 5); + + let Some(Paint::Gradient(lg)) = &shapes[0].2.fill else { panic!("linearGradient expected") }; + assert!(!lg.bbox_units); + assert_eq!(lg.spread, Spread::Reflect); + assert_eq!(lg.stops.len(), 2); + + assert_eq!(shapes[2].2.fill, Some(Paint::Color([1.0, 0.0, 1.0]))); + assert_eq!(shapes[2].2.stroke.as_ref().map(|s| &s.paint), Some(&Paint::Color([0.0, 1.0, 1.0]))); + + let img = rasterize(&doc, 80, 40, 1.0); + // Reflected gradient: red at x=0, blue at x=10, back toward red at x=19. + assert!(px(&img, 0, 5)[0] > 0.8 && px(&img, 10, 5)[2] > 0.8 && px(&img, 19, 5)[0] > 0.8); + // Radial gradient white center at (50, 10). + assert!(near(px(&img, 50, 10), [1.0, 1.0, 1.0, 1.0], 0.05)); + // Fallback solid fill. + assert!(near(px(&img, 5, 25), [1.0, 0.0, 1.0, 1.0], 1e-3)); + // Even-odd hole at (28, 28) is transparent, outer ring at (22, 28) is green. + assert_eq!(px(&img, 28, 28)[3], 0.0); + assert!(near(px(&img, 22, 28), [0.0, 1.0, 0.0, 1.0], 1e-3)); + // Dashed stroke (6 on, 8 off, square cap extends each end by 2): on at x=43, gap at x=50. + assert!(near(px(&img, 43, 30), [1.0, 1.0, 1.0, 1.0], 1e-3)); + assert_eq!(px(&img, 50, 30)[3], 0.0); +} From c561e7352f6047d335db75a32cda45553ed34cf0 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Fri, 20 Nov 2026 11:54:22 -0500 Subject: [PATCH 321/451] mcp: add protocol transcript tests for initialize, cancel, and batch (#3990) --- crates/automation/src/tests.rs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/crates/automation/src/tests.rs b/crates/automation/src/tests.rs index a97a5f91e..afee15936 100644 --- a/crates/automation/src/tests.rs +++ b/crates/automation/src/tests.rs @@ -2112,3 +2112,28 @@ fn bridged_contact_sheet_keeps_the_times_asked_for() { let info = call_json(&mut s, "render_frame", json!({"times": [1.5, 0.25, 3], "inline": false})); assert_eq!(info["times"], json!([1.5, 0.25, 3.0])); } + +#[test] +fn stdio_batch_transcript() { + let input = concat!( + "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"initialize\",\"params\":{\"protocolVersion\":\"2025-06-18\"}}\n", + "{\"jsonrpc\":\"2.0\",\"method\":\"notifications/initialized\"}\n", + "{\"jsonrpc\":\"2.0\",\"method\":\"notifications/cancelled\",\"params\":{\"requestId\":1,\"reason\":\"client\"}}\n", + "[]\n", + "[{\"jsonrpc\":\"2.0\",\"method\":\"notifications/cancelled\",\"params\":{\"requestId\":9}}]\n", + "[{\"jsonrpc\":\"2.0\",\"id\":2,\"method\":\"ping\"},{\"jsonrpc\":\"2.0\",\"method\":\"notifications/progress\"}]\n", + "{\"jsonrpc\":\"2.0\",\"id\":3,\"method\":\"ping\",\"params\":{}}\n" + ); + let mut s = server(); + let mut out = Vec::new(); + s.serve(std::io::Cursor::new(input), &mut out).unwrap(); + + let replies: Vec = String::from_utf8(out).unwrap().lines().map(|l| serde_json::from_str(l).unwrap()).collect(); + assert_eq!(replies.len(), 4, "{replies:?}"); + assert_eq!(replies[0]["id"], 1); + assert_eq!(replies[0]["result"]["serverInfo"]["name"], "effectcraft"); + assert_eq!(replies[1]["id"], Value::Null); + assert_eq!(replies[1]["error"]["code"], -32600); + assert_eq!(replies[2], json!([{"jsonrpc": "2.0", "id": 2, "result": {}}])); + assert_eq!(replies[3], json!({"jsonrpc": "2.0", "id": 3, "result": {}})); +} From e495469969d0cf4f93fb5aa6f1a50c4eacd0c07e Mon Sep 17 00:00:00 2001 From: nazar-gavrylyk Date: Fri, 20 Nov 2026 19:38:13 +0100 Subject: [PATCH 322/451] #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. --- docs/external-helpers.md | 3 + docs/video-helper-protocol.md | 126 ++++++++++++++++++++++++++++++++++ 2 files changed, 129 insertions(+) create mode 100644 docs/video-helper-protocol.md diff --git a/docs/external-helpers.md b/docs/external-helpers.md index 3c513df95..1ec2e29e9 100644 --- a/docs/external-helpers.md +++ b/docs/external-helpers.md @@ -96,3 +96,6 @@ use `effectcraft_helper_host::serve::serve` with a `Provider` that lists `Effect `crates/helper-host/tests/it/main.rs` is a complete example and the protocol test that runs in `cargo xtask ci`. An unofficial OpenFX helper built this way lives in its own repository, [ec-extension-ofx](https://github.com/glumbis/ec-extension-ofx). + +Hardware video encoding through a helper is specified, as a proposal, in +[video-helper-protocol.md](video-helper-protocol.md) ([RFC-0031](https://github.com/storytold/craft-contrib/blob/main/rfcs/0031-hardware-video-helper.md)). diff --git a/docs/video-helper-protocol.md b/docs/video-helper-protocol.md new file mode 100644 index 000000000..e7ae54028 --- /dev/null +++ b/docs/video-helper-protocol.md @@ -0,0 +1,126 @@ +# Video helper protocol (proposed) + +**Status: proposed, not implemented.** This page specifies how EffectCraft will talk to a +hardware video helper, as decided in [RFC-0031][rfc-0031] (hardware video in a helper process). +Nothing here exists in the app yet. Phase 1 covers **encoding**; decoding is reserved for phase 2 +([decoding](#decoding-phase-2)). + +A **video helper** is an [external helper](external-helpers.md) that offers hardware video +encoding instead of effects. It reuses that page's process model: the helper is a child process, +requests and replies are JSON lines, pixels and packets go through the frame exchange file, a +helper that crashes, hangs or breaks the protocol is stopped, and one that does so 3 times is +turned off. This page covers only what is different for video. + +## Starting and finding it + +- **The user decides.** Starting a video helper needs the same consent as an effect helper (see + [Using helpers](external-helpers.md#using-helpers)). Opening a project whose output module says + Hardware Encoding: Auto does not start it. Confined agents and scripts without write and network + permission cannot start it either. +- **Only the app's own install folder.** The program is `effectcraft-helper-video`, found in + `helpers/` next to the EffectCraft executable (`Contents/Helpers` in a macOS bundle). It is not + looked for in the settings folder, in `EFFECTCRAFT_HELPER_PATH`, in `PATH` or in the current + folder. Effect-helper scans skip it. +- **Checked before any work.** EffectCraft reads the `hello` reply (below) first and sends nothing + else until the versions fit. + +## `hello` + +EffectCraft adds `"video": 1` to its `hello`: the highest video protocol version it speaks. The +helper answers with the usual fields plus a `video` object: + +```json +{"op":"hello","version":1,"name":"Hardware video","helper_version":"0.1.0","loads":[], + "video":{"version":1,"app_min":"0.25.0","devices":[ + {"id":"nvenc:0","name":"NVIDIA GeForce RTX 3090","api":"nvenc","driver":"NVIDIA 570.86", + "encode":[{"codec":"h264","profiles":["high"],"bit_depths":[8],"min_size":[64,64], + "max_size":[4096,4096],"rate_control":["bitrate"]}], + "decode":[]}]}} +``` + +- `video.version` is the video protocol version the helper will use. If EffectCraft does not speak + it, or is older than `app_min`, it does not use the helper, and the message names the installed + helper version and the version to install. +- `devices` lists every GPU the helper can use, each with a stable `id`, the `api` it reaches it + through (`vaapi`, `nvenc`, `videotoolbox`, or later `mediafoundation`), the `driver`, and what + it can `encode` and `decode`. Two GPUs that both offer H.264 are both listed; EffectCraft picks + one and its render log says which. The rule for choosing is still open in RFC-0031. +- The helper answers `describe` with no effects. +- **Start-up order.** The helper starts its hardware APIs (CUDA, VA-API and others) on one thread, + in a fixed order, before it answers `hello`. Starting NVENC and VA-API on two threads at once + can deadlock with NVIDIA's VA-API driver. + +## Pictures + +Video does not use the effect protocol's float RGBA image refs (16 bytes a pixel, about 133 MB at +4K). A picture is **8-bit 4:2:0, three planes**, Y then U then V. The luma plane is `width × +height`; each chroma plane is `width/2 × height/2`. Width and height are even and within the +device's `min_size` and `max_size`; other sizes are declined before the encoder opens. Planes are +tightly packed (`stride` = plane width) and sit one after the other in the slot. Colour is given as +[H.273](https://www.itu.int/rec/T-REC-H.273) code points. Only limited range is used at first. + +## Encoding + +``` +encode.open → encode.opened → (encode.frame → encode.packets)… → encode.flush → encode.flushed + → encode.close +``` + +| Request | Reply | | +|---|---|---| +| `{"op":"encode.open","job":1,"device":"nvenc:0","codec":"h264","width":1920,"height":1080,"rate":[30,1],"bitrate_kbps":15000,"profile":"high","keyint":60,"colour":{"primaries":1,"transfer":1,"matrix":1,"range":"limited"},"slots":[{"in":{"offset":0,"len":3110400},"out":{"offset":3110400,"len":1048576}},…],"flush_out":{"offset":…,"len":…}}` | `{"op":"encode.opened","job":1,"codec_config":"","delay":2}` | `job` is chosen by EffectCraft and is never reused. `slots` is the memory the helper may use, decided by EffectCraft. `codec_config` is the `avcC` (H.264) or `hvcC` (HEVC) record for the MP4 sample entry. `delay` is the number of frames the encoder holds back (B-frames). | +| `{"op":"encode.frame","job":1,"frame":0,"slot":0}` | `{"op":"encode.packets","job":1,"frame":0,"packets":[{"offset":0,"len":41230,"pts":0,"dts":-2,"key":true}]}` | The picture is in `slots[0].in`. The reply means the slot may be reused and says where the packets are, inside `slots[0].out`. It may hold no packets (the encoder is still holding frames) or several. | +| `{"op":"encode.flush","job":1}` | `{"op":"encode.packets","job":1,"frame":null,"packets":[…]}` then `{"op":"encode.flushed","job":1}` | The rest of the stream, inside `flush_out`. | +| `{"op":"encode.close","job":1}` | none | Free everything for the job. | +| `{"op":"cancel","job":1}` | `{"op":"cancelled","job":1}` | Stop now. EffectCraft ignores any other reply for the job after it sends `cancel`. | + +- **Timestamps** are in units of 1 / `rate[0]` seconds, so frame `i` has `pts = i × rate[1]`. + `dts` may be earlier than `pts`. +- **Who owns what.** EffectCraft decides every offset. The helper reads only the slot it is told + to and writes only that slot's `out` region (or `flush_out`). EffectCraft checks every offset and + length it gets back with checked arithmetic against the regions it gave out. +- **Backpressure.** At most 8 frames, and at most 256 MiB, are queued plus in flight together. When + the budget is used up EffectCraft waits for a reply before sending the next frame, so a slow GPU + slows the export and does not use more memory. +- **Replies are in frame order.** A reply with an unknown `job` or `frame`, outside the regions, or + larger than its `out` region (`packet_too_large`) is a protocol break. +- **Control lines** are at most 1 MiB. Pictures and packets never go through the pipe. + +## Timeouts and errors + +- **Per frame, not per export.** A frame is outstanding from `encode.frame` until its reply. If the + oldest outstanding frame waits longer than the timeout (30 s by default, set with + `EFFECTCRAFT_HELPER_VIDEO_TIMEOUT`, as `EFFECTCRAFT_HELPER_TIMEOUT` is for effects), EffectCraft + stops the helper. A GPU that hangs without exiting ends the helper instead + of making the export look busy. `encode.open` and `encode.flush` use the load timeout (600 s). +- **`{"op":"error","job":1,"code":"…","message":"…"}`** is for one request; the helper carries on. + Codes: `unsupported` (the settings are declined), `device_lost`, `out_of_memory`, + `packet_too_large`, `encoder`. +- **EffectCraft stops the helper** when it exits, closes stdout, sends a line that does not parse + or does not fit, breaks the rules above, or misses a timeout. After 3 stops it is turned off and + listed in `helper_blocklist.txt` until the user retries in Settings, as for effect helpers. + +What EffectCraft does with a failure: + +| When | What happens | +|---|---| +| Before the first frame (`unsupported`, no helper, version mismatch, blocked) | With Hardware Encoding: Auto, the built-in encoder runs and the render log says why. | +| After frames have been sent (a crash, a hang, `device_lost`) | The export ends with an error that says what failed. The format is never changed silently, and hardware and software output are never mixed in one file. | + +A hardware export writes to a temporary file and replaces the destination only when it finishes, +so a failed or cancelled export leaves any existing file as it was. + +## Decoding (phase 2) + +`decode.open`, `decode.sample` and the picture replies are reserved for phase 2 and will be +specified with it. They must cover rebuilding the decoder's state after a failure (reference +frames, presentation order, timestamps, seeks, flushes and colour information), as RFC-0031 D6 +requires. + +## Not decided here + +- How Auto chooses between two GPUs that both offer a codec. +- Who builds, signs and releases the helper, and where its code lives. +- 10-bit pictures, zero-copy transfer from GPU textures and codecs other than H.264 and HEVC. + +[rfc-0031]: https://github.com/storytold/craft-contrib/blob/main/rfcs/0031-hardware-video-helper.md From a2e62b438a63cc025c8da07f6e95e8fc3d7baff8 Mon Sep 17 00:00:00 2001 From: nazar-gavrylyk Date: Fri, 20 Nov 2026 20:10:37 +0100 Subject: [PATCH 323/451] #805: Docs: specify packet framing, offsets, flush and error replies --- docs/video-helper-protocol.md | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/docs/video-helper-protocol.md b/docs/video-helper-protocol.md index e7ae54028..bd180603f 100644 --- a/docs/video-helper-protocol.md +++ b/docs/video-helper-protocol.md @@ -68,22 +68,32 @@ encode.open → encode.opened → (encode.frame → encode.packets)… → encod | Request | Reply | | |---|---|---| -| `{"op":"encode.open","job":1,"device":"nvenc:0","codec":"h264","width":1920,"height":1080,"rate":[30,1],"bitrate_kbps":15000,"profile":"high","keyint":60,"colour":{"primaries":1,"transfer":1,"matrix":1,"range":"limited"},"slots":[{"in":{"offset":0,"len":3110400},"out":{"offset":3110400,"len":1048576}},…],"flush_out":{"offset":…,"len":…}}` | `{"op":"encode.opened","job":1,"codec_config":"","delay":2}` | `job` is chosen by EffectCraft and is never reused. `slots` is the memory the helper may use, decided by EffectCraft. `codec_config` is the `avcC` (H.264) or `hvcC` (HEVC) record for the MP4 sample entry. `delay` is the number of frames the encoder holds back (B-frames). | +| `{"op":"encode.open","job":1,"device":"nvenc:0","codec":"h264","width":1920,"height":1080,"rate":[30,1],"bitrate_kbps":15000,"profile":"high","keyint":60,"colour":{"primaries":1,"transfer":1,"matrix":1,"range":"limited"},"slots":[{"in":{"offset":0,"len":3110400},"out":{"offset":3110400,"len":1048576}},…]}` | `{"op":"encode.opened","job":1,"codec_config":"","delay":2}` | `job` is chosen by EffectCraft and is never reused. `slots` is the memory the helper may use, decided by EffectCraft. `codec_config` is the `avcC` (H.264) or `hvcC` (HEVC) record for the MP4 sample entry. `delay` is the number of frames the encoder holds back (B-frames). | | `{"op":"encode.frame","job":1,"frame":0,"slot":0}` | `{"op":"encode.packets","job":1,"frame":0,"packets":[{"offset":0,"len":41230,"pts":0,"dts":-2,"key":true}]}` | The picture is in `slots[0].in`. The reply means the slot may be reused and says where the packets are, inside `slots[0].out`. It may hold no packets (the encoder is still holding frames) or several. | -| `{"op":"encode.flush","job":1}` | `{"op":"encode.packets","job":1,"frame":null,"packets":[…]}` then `{"op":"encode.flushed","job":1}` | The rest of the stream, inside `flush_out`. | +| `{"op":"encode.flush","job":1,"out":{"offset":…,"len":…}}` | `{"op":"encode.packets","job":1,"frame":null,"packets":[…]}` then `{"op":"encode.flushed","job":1}` | The rest of the stream, inside `out`. EffectCraft sizes `out` for the frames the encoder still holds: at least `(delay + 1)` times the length of a slot's `out` region. A packet that still does not fit is `packet_too_large`. | | `{"op":"encode.close","job":1}` | none | Free everything for the job. | | `{"op":"cancel","job":1}` | `{"op":"cancelled","job":1}` | Stop now. EffectCraft ignores any other reply for the job after it sends `cancel`. | +- **Packets are MP4 samples.** Each is a sequence of length-prefixed NAL units, every length a + 4-byte big-endian number, which is what `codec_config` declares (`lengthSizeMinusOne` 3). A + helper whose API produces Annex B converts it. EffectCraft writes the bytes into the MP4 as + they are. +- **Packet offsets** are counted from the start of the region the reply uses (`slots[slot].out`, + or the `out` region of `encode.flush`). In the example the packet starts at file offset + 3110400 + 0. EffectCraft adds the region's offset and checks that `offset + len` is within the + region's length. - **Timestamps** are in units of 1 / `rate[0]` seconds, so frame `i` has `pts = i × rate[1]`. `dts` may be earlier than `pts`. - **Who owns what.** EffectCraft decides every offset. The helper reads only the slot it is told - to and writes only that slot's `out` region (or `flush_out`). EffectCraft checks every offset and - length it gets back with checked arithmetic against the regions it gave out. + to and writes only that slot's `out` region (or the `out` region of `encode.flush`). EffectCraft + checks every offset and length it gets back with checked arithmetic against the regions it gave + out. - **Backpressure.** At most 8 frames, and at most 256 MiB, are queued plus in flight together. When the budget is used up EffectCraft waits for a reply before sending the next frame, so a slow GPU slows the export and does not use more memory. -- **Replies are in frame order.** A reply with an unknown `job` or `frame`, outside the regions, or - larger than its `out` region (`packet_too_large`) is a protocol break. +- **Replies are in frame order,** `error` replies included. A reply with an unknown `job` or + `frame`, outside the regions, or larger than its `out` region (`packet_too_large`) is a protocol + break. - **Control lines** are at most 1 MiB. Pictures and packets never go through the pipe. ## Timeouts and errors @@ -93,9 +103,11 @@ encode.open → encode.opened → (encode.frame → encode.packets)… → encod `EFFECTCRAFT_HELPER_VIDEO_TIMEOUT`, as `EFFECTCRAFT_HELPER_TIMEOUT` is for effects), EffectCraft stops the helper. A GPU that hangs without exiting ends the helper instead of making the export look busy. `encode.open` and `encode.flush` use the load timeout (600 s). -- **`{"op":"error","job":1,"code":"…","message":"…"}`** is for one request; the helper carries on. - Codes: `unsupported` (the settings are declined), `device_lost`, `out_of_memory`, - `packet_too_large`, `encoder`. +- **`{"op":"error","job":1,"frame":3,"code":"…","message":"…"}`** answers one request. `frame` is + there when it answers an `encode.frame` (it ends that frame's timeout) and absent for + `encode.open` and `encode.flush`. The helper process carries on, but the job is over: + EffectCraft sends `encode.close`. Codes: `unsupported` (the settings are declined), + `device_lost`, `out_of_memory`, `packet_too_large`, `encoder`. - **EffectCraft stops the helper** when it exits, closes stdout, sends a line that does not parse or does not fit, breaks the rules above, or misses a timeout. After 3 stops it is turned off and listed in `helper_blocklist.txt` until the user retries in Settings, as for effect helpers. From 41a4eae706a10bed535194cc66749e3a2b633c7b Mon Sep 17 00:00:00 2001 From: nazar-gavrylyk Date: Fri, 20 Nov 2026 20:18:50 +0100 Subject: [PATCH 324/451] #805: Docs: define how an error and encode.close retire a job --- docs/video-helper-protocol.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/video-helper-protocol.md b/docs/video-helper-protocol.md index bd180603f..45ad3a07d 100644 --- a/docs/video-helper-protocol.md +++ b/docs/video-helper-protocol.md @@ -71,8 +71,8 @@ encode.open → encode.opened → (encode.frame → encode.packets)… → encod | `{"op":"encode.open","job":1,"device":"nvenc:0","codec":"h264","width":1920,"height":1080,"rate":[30,1],"bitrate_kbps":15000,"profile":"high","keyint":60,"colour":{"primaries":1,"transfer":1,"matrix":1,"range":"limited"},"slots":[{"in":{"offset":0,"len":3110400},"out":{"offset":3110400,"len":1048576}},…]}` | `{"op":"encode.opened","job":1,"codec_config":"","delay":2}` | `job` is chosen by EffectCraft and is never reused. `slots` is the memory the helper may use, decided by EffectCraft. `codec_config` is the `avcC` (H.264) or `hvcC` (HEVC) record for the MP4 sample entry. `delay` is the number of frames the encoder holds back (B-frames). | | `{"op":"encode.frame","job":1,"frame":0,"slot":0}` | `{"op":"encode.packets","job":1,"frame":0,"packets":[{"offset":0,"len":41230,"pts":0,"dts":-2,"key":true}]}` | The picture is in `slots[0].in`. The reply means the slot may be reused and says where the packets are, inside `slots[0].out`. It may hold no packets (the encoder is still holding frames) or several. | | `{"op":"encode.flush","job":1,"out":{"offset":…,"len":…}}` | `{"op":"encode.packets","job":1,"frame":null,"packets":[…]}` then `{"op":"encode.flushed","job":1}` | The rest of the stream, inside `out`. EffectCraft sizes `out` for the frames the encoder still holds: at least `(delay + 1)` times the length of a slot's `out` region. A packet that still does not fit is `packet_too_large`. | -| `{"op":"encode.close","job":1}` | none | Free everything for the job. | -| `{"op":"cancel","job":1}` | `{"op":"cancelled","job":1}` | Stop now. EffectCraft ignores any other reply for the job after it sends `cancel`. | +| `{"op":"encode.close","job":1}` | none | Free everything for the job. EffectCraft sends it only when no frame is outstanding, after `encode.flushed` or after `cancelled`, and frees or reuses the job's regions only then. | +| `{"op":"cancel","job":1}` | `{"op":"cancelled","job":1}` | Stop now. After it sends `cancel`, EffectCraft ignores every reply for the job except `cancelled`, so replies for frames still in flight are not protocol breaks. The helper stops using the job's regions before it replies `cancelled`. | - **Packets are MP4 samples.** Each is a sequence of length-prefixed NAL units, every length a 4-byte big-endian number, which is what `codec_config` declares (`lengthSizeMinusOne` 3). A @@ -103,10 +103,13 @@ encode.open → encode.opened → (encode.frame → encode.packets)… → encod `EFFECTCRAFT_HELPER_VIDEO_TIMEOUT`, as `EFFECTCRAFT_HELPER_TIMEOUT` is for effects), EffectCraft stops the helper. A GPU that hangs without exiting ends the helper instead of making the export look busy. `encode.open` and `encode.flush` use the load timeout (600 s). + After `cancel` the frames of that job have no timeout; `cancelled` is due within the same 30 s, + or EffectCraft stops the helper. - **`{"op":"error","job":1,"frame":3,"code":"…","message":"…"}`** answers one request. `frame` is there when it answers an `encode.frame` (it ends that frame's timeout) and absent for `encode.open` and `encode.flush`. The helper process carries on, but the job is over: - EffectCraft sends `encode.close`. Codes: `unsupported` (the settings are declined), + EffectCraft sends `cancel`, then `encode.close` once `cancelled` arrives. Frames sent before the + error are not answered. Codes: `unsupported` (the settings are declined), `device_lost`, `out_of_memory`, `packet_too_large`, `encoder`. - **EffectCraft stops the helper** when it exits, closes stdout, sends a line that does not parse or does not fit, breaks the rules above, or misses a timeout. After 3 stops it is turned off and From 7233dda4b01b81088cdf832510fafae4314048d1 Mon Sep 17 00:00:00 2001 From: nazar-gavrylyk Date: Fri, 20 Nov 2026 20:25:53 +0100 Subject: [PATCH 325/451] #805: Docs: retire a job's frames on cancel or helper exit --- docs/video-helper-protocol.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/docs/video-helper-protocol.md b/docs/video-helper-protocol.md index 45ad3a07d..c91659afc 100644 --- a/docs/video-helper-protocol.md +++ b/docs/video-helper-protocol.md @@ -71,8 +71,8 @@ encode.open → encode.opened → (encode.frame → encode.packets)… → encod | `{"op":"encode.open","job":1,"device":"nvenc:0","codec":"h264","width":1920,"height":1080,"rate":[30,1],"bitrate_kbps":15000,"profile":"high","keyint":60,"colour":{"primaries":1,"transfer":1,"matrix":1,"range":"limited"},"slots":[{"in":{"offset":0,"len":3110400},"out":{"offset":3110400,"len":1048576}},…]}` | `{"op":"encode.opened","job":1,"codec_config":"","delay":2}` | `job` is chosen by EffectCraft and is never reused. `slots` is the memory the helper may use, decided by EffectCraft. `codec_config` is the `avcC` (H.264) or `hvcC` (HEVC) record for the MP4 sample entry. `delay` is the number of frames the encoder holds back (B-frames). | | `{"op":"encode.frame","job":1,"frame":0,"slot":0}` | `{"op":"encode.packets","job":1,"frame":0,"packets":[{"offset":0,"len":41230,"pts":0,"dts":-2,"key":true}]}` | The picture is in `slots[0].in`. The reply means the slot may be reused and says where the packets are, inside `slots[0].out`. It may hold no packets (the encoder is still holding frames) or several. | | `{"op":"encode.flush","job":1,"out":{"offset":…,"len":…}}` | `{"op":"encode.packets","job":1,"frame":null,"packets":[…]}` then `{"op":"encode.flushed","job":1}` | The rest of the stream, inside `out`. EffectCraft sizes `out` for the frames the encoder still holds: at least `(delay + 1)` times the length of a slot's `out` region. A packet that still does not fit is `packet_too_large`. | -| `{"op":"encode.close","job":1}` | none | Free everything for the job. EffectCraft sends it only when no frame is outstanding, after `encode.flushed` or after `cancelled`, and frees or reuses the job's regions only then. | -| `{"op":"cancel","job":1}` | `{"op":"cancelled","job":1}` | Stop now. After it sends `cancel`, EffectCraft ignores every reply for the job except `cancelled`, so replies for frames still in flight are not protocol breaks. The helper stops using the job's regions before it replies `cancelled`. | +| `{"op":"encode.close","job":1}` | none | Free everything for the job. EffectCraft sends it after `encode.flushed` or `cancelled`, and frees or reuses the job's regions only then. If the helper was stopped first, there is no reply to wait for: the regions are freed once the helper process has exited, and a process that has exited cannot write to them. | +| `{"op":"cancel","job":1}` | `{"op":"cancelled","job":1}` | Stop now. After it sends `cancel`, EffectCraft ignores every reply for the job except `cancelled`, so replies for frames still in flight are not protocol breaks. The helper stops using the job's regions before it replies `cancelled`, and `cancelled` ends every frame of the job that is still outstanding. | - **Packets are MP4 samples.** Each is a sequence of length-prefixed NAL units, every length a 4-byte big-endian number, which is what `codec_config` declares (`lengthSizeMinusOne` 3). A @@ -98,13 +98,14 @@ encode.open → encode.opened → (encode.frame → encode.packets)… → encod ## Timeouts and errors -- **Per frame, not per export.** A frame is outstanding from `encode.frame` until its reply. If the - oldest outstanding frame waits longer than the timeout (30 s by default, set with - `EFFECTCRAFT_HELPER_VIDEO_TIMEOUT`, as `EFFECTCRAFT_HELPER_TIMEOUT` is for effects), EffectCraft - stops the helper. A GPU that hangs without exiting ends the helper instead - of making the export look busy. `encode.open` and `encode.flush` use the load timeout (600 s). - After `cancel` the frames of that job have no timeout; `cancelled` is due within the same 30 s, - or EffectCraft stops the helper. +- **Per frame, not per export.** A frame is outstanding from `encode.frame` until its reply, until + `cancelled`, or until the helper has exited. If the oldest outstanding frame waits longer than + the timeout (30 s by default, set with `EFFECTCRAFT_HELPER_VIDEO_TIMEOUT`, as + `EFFECTCRAFT_HELPER_TIMEOUT` is for effects), EffectCraft stops (kills) the helper and waits for + it to exit. A GPU that hangs without exiting ends the helper instead of making the export look + busy. `encode.open` and `encode.flush` use the load timeout (600 s). After `cancel` the frames of + that job have no timeout; `cancelled` is due within the same 30 s, or EffectCraft stops the + helper. - **`{"op":"error","job":1,"frame":3,"code":"…","message":"…"}`** answers one request. `frame` is there when it answers an `encode.frame` (it ends that frame's timeout) and absent for `encode.open` and `encode.flush`. The helper process carries on, but the job is over: From dede545a7fa5447d88fe2f4a59d5031a4e1feda7 Mon Sep 17 00:00:00 2001 From: nazar-gavrylyk Date: Fri, 20 Nov 2026 20:33:00 +0100 Subject: [PATCH 326/451] #805: Docs: keep a job's regions until every helper process has exited --- docs/video-helper-protocol.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/video-helper-protocol.md b/docs/video-helper-protocol.md index c91659afc..ab5e7d279 100644 --- a/docs/video-helper-protocol.md +++ b/docs/video-helper-protocol.md @@ -71,7 +71,7 @@ encode.open → encode.opened → (encode.frame → encode.packets)… → encod | `{"op":"encode.open","job":1,"device":"nvenc:0","codec":"h264","width":1920,"height":1080,"rate":[30,1],"bitrate_kbps":15000,"profile":"high","keyint":60,"colour":{"primaries":1,"transfer":1,"matrix":1,"range":"limited"},"slots":[{"in":{"offset":0,"len":3110400},"out":{"offset":3110400,"len":1048576}},…]}` | `{"op":"encode.opened","job":1,"codec_config":"","delay":2}` | `job` is chosen by EffectCraft and is never reused. `slots` is the memory the helper may use, decided by EffectCraft. `codec_config` is the `avcC` (H.264) or `hvcC` (HEVC) record for the MP4 sample entry. `delay` is the number of frames the encoder holds back (B-frames). | | `{"op":"encode.frame","job":1,"frame":0,"slot":0}` | `{"op":"encode.packets","job":1,"frame":0,"packets":[{"offset":0,"len":41230,"pts":0,"dts":-2,"key":true}]}` | The picture is in `slots[0].in`. The reply means the slot may be reused and says where the packets are, inside `slots[0].out`. It may hold no packets (the encoder is still holding frames) or several. | | `{"op":"encode.flush","job":1,"out":{"offset":…,"len":…}}` | `{"op":"encode.packets","job":1,"frame":null,"packets":[…]}` then `{"op":"encode.flushed","job":1}` | The rest of the stream, inside `out`. EffectCraft sizes `out` for the frames the encoder still holds: at least `(delay + 1)` times the length of a slot's `out` region. A packet that still does not fit is `packet_too_large`. | -| `{"op":"encode.close","job":1}` | none | Free everything for the job. EffectCraft sends it after `encode.flushed` or `cancelled`, and frees or reuses the job's regions only then. If the helper was stopped first, there is no reply to wait for: the regions are freed once the helper process has exited, and a process that has exited cannot write to them. | +| `{"op":"encode.close","job":1}` | none | Free everything for the job. EffectCraft sends it after `encode.flushed` or `cancelled`, and frees or reuses the job's regions only then. If the helper was stopped first, there is no reply to wait for: the regions are freed only once every process that can reach them has exited (see [stopping](#timeouts-and-errors)). | | `{"op":"cancel","job":1}` | `{"op":"cancelled","job":1}` | Stop now. After it sends `cancel`, EffectCraft ignores every reply for the job except `cancelled`, so replies for frames still in flight are not protocol breaks. The helper stops using the job's regions before it replies `cancelled`, and `cancelled` ends every frame of the job that is still outstanding. | - **Packets are MP4 samples.** Each is a sequence of length-prefixed NAL units, every length a @@ -115,6 +115,12 @@ encode.open → encode.opened → (encode.frame → encode.packets)… → encod - **EffectCraft stops the helper** when it exits, closes stdout, sends a line that does not parse or does not fit, breaks the rules above, or misses a timeout. After 3 stops it is turned off and listed in `helper_blocklist.txt` until the user retries in Settings, as for effect helpers. +- **Stopping ends every process the helper started.** A child of the helper can map the exchange + file too, so the regions stay reserved until all of them have exited. EffectCraft starts the + helper in its own process group (Unix) or job object that kills its members when it closes + (Windows), kills the whole group or job, and waits until it is empty. If it cannot confirm that + (a descendant left the group), it does not reuse the regions: it drops the exchange file and + gives the next helper a new one, so a stray process can only write into a file nobody reads. What EffectCraft does with a failure: From 3376eaa06a0b0eb28bff571ccbd94c060dc2c6dd Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Fri, 20 Nov 2026 14:33:25 -0500 Subject: [PATCH 327/451] media: route ISO-BMFF and Matroska/WebM codecs through craft-video (#3989) * media: route ISO-BMFF and Matroska/WebM codecs through craft-video * media: fix rotation, WebM alpha fallback, draft cache separation, and Matroska audio timing * media: remove nonexistent discard_padding_ns field on matroska::Sample * test: use MediaPool::audio_samples in matroska_opus_audio_timing_and_seek * media: support 8-bit planes stored in Samples::U16 (AV1) * media: fix clippy lints, wasm cfg, and expand unit test coverage * test: include kind field in isobmff::ColorInfo::Icc test literal * test: avoid clippy::assertions_on_constants in craft_source unit tests * media: avoid double-inverting container PAR fallback on rotated frames --- crates/media/Cargo.toml | 2 +- crates/media/src/craft_source.rs | 1109 ++++++++++++++++++++++++++++++ crates/media/src/lib.rs | 2 +- crates/media/src/mp4_h264.rs | 597 ---------------- crates/media/src/stream.rs | 8 +- crates/media/tests/it/footage.rs | 179 +++++ 6 files changed, 1294 insertions(+), 603 deletions(-) create mode 100644 crates/media/src/craft_source.rs delete mode 100644 crates/media/src/mp4_h264.rs diff --git a/crates/media/Cargo.toml b/crates/media/Cargo.toml index 39ad32f14..668828fca 100644 --- a/crates/media/Cargo.toml +++ b/crates/media/Cargo.toml @@ -33,7 +33,7 @@ craft-frame = { workspace = true } craft-media = { workspace = true, features = ["mpegts"] } craft-media-source = { workspace = true } craft-time = { workspace = true } -craft-video = { workspace = true, features = ["h264-decode", "threads"] } +craft-video = { workspace = true, features = ["h264-decode", "hevc-decode", "vp9-decode", "vp8-decode", "av1-decode", "prores", "dnx", "mpeg2-decode", "threads"] } filmcraft-frame = { workspace = true } filmcraft-color = { workspace = true } filmcraft-time = { workspace = true } diff --git a/crates/media/src/craft_source.rs b/crates/media/src/craft_source.rs new file mode 100644 index 000000000..24e88cc30 --- /dev/null +++ b/crates/media/src/craft_source.rs @@ -0,0 +1,1109 @@ +//! ISO-BMFF (MP4/MOV) and Matroska/WebM media-reader routes backed by `craft-media`, +//! `craft-video`, `craft-audio`, and `craft-media-source`. +//! +//! Preserves sync-sample backward seek, B-frame reordering, cooperative cancellation, VUI + +//! container colour resolution, draft mode for reduced-resolution playback, and bounded worker +//! threads, while falling back to `filmcraft-codecs` for unsupported codecs or audio streams. + +use std::sync::{Arc, Mutex}; + +use craft_audio::{AudioBuffer, TrackDecoder as AudioTrackDecoder}; +use craft_color::{ColorInfo, Matrix, Primaries, Range, Transfer}; +use craft_frame::{Chroma, PixelData, VideoFrame}; +use craft_media::isobmff::{self, Mp4File}; +use craft_media::matroska::{self, MkvFile}; +use craft_media::{ByteSource, CodecId, CodecParams}; +use craft_media_source::{ + AudioStreamInfo, FrameRequest, MAX_AUDIO_STREAMS, MediaError, MediaInfo, MediaKind, MediaSource, Result, SharedBytes, SharedSource, VideoStreamInfo, +}; +use craft_time::{FrameRate, Tick}; +use craft_video::frame::{ColorFamily, ColorTags, Plane, Samples, Subsampling, VideoFrame as DecodedVideoFrame}; +use craft_video::{TrackDecoder, TrackDecoderOptions}; + +/// Maximum worker threads per `TrackDecoder` instance. +const MAX_WORKERS: usize = 8; + +/// Maximum decoded frames retained in the per-source GOP window cache. +const MAX_CACHED_FRAMES: usize = 32; + +/// Maximum audio lookahead packets inspected when initializing `craft_audio::TrackDecoder`. +const AUDIO_LOOKAHEAD: usize = 8; + +fn worker_cap() -> usize { + std::thread::available_parallelism().map_or(4, |n| n.get()).clamp(1, MAX_WORKERS) +} + +fn supports_video_codec(codec: CodecId) -> bool { + matches!(codec, CodecId::H264 | CodecId::Hevc | CodecId::Av1 | CodecId::Vp9 | CodecId::Vp8 | CodecId::ProRes | CodecId::Dnxhd | CodecId::Mpeg2Video) +} + +/// True when `head` begins with a plausible ISO-BMFF top-level box. +fn looks_like_isobmff(head: &[u8]) -> bool { + if head.len() < 8 { + return false; + } + matches!(&head[4..8], b"ftyp" | b"moov" | b"mdat" | b"free" | b"skip" | b"wide" | b"pnot" | b"uuid") +} + +/// True when `head` begins with an EBML header (Matroska / WebM). +fn looks_like_matroska(head: &[u8]) -> bool { + head.starts_with(&[0x1A, 0x45, 0xDF, 0xA3]) +} + +/// Open an in-place ISO-BMFF or Matroska/WebM source via `craft-media` / `craft-video`. +/// Returns `None` when the container/codec/audio combination should fall back to `filmcraft-codecs`. +#[cfg(any(unix, windows))] +pub(crate) fn open_reader(name: &str, head: &[u8], reader: &SharedBytes) -> Option> { + if looks_like_isobmff(head) { + return open_isobmff(name, reader.clone()); + } + if looks_like_matroska(head) { + return open_matroska(name, reader.clone()); + } + None +} + +/// Open an in-memory ISO-BMFF or Matroska/WebM source via `craft-media` / `craft-video`. +pub(crate) fn open_bytes(name: &str, bytes: Arc<[u8]>) -> Option> { + if looks_like_isobmff(&bytes) { + return open_isobmff(name, Arc::new(bytes)); + } + if looks_like_matroska(&bytes) { + return open_matroska(name, Arc::new(bytes)); + } + None +} + +enum ContainerFile { + Isobmff(Mp4File), + Matroska(Box), +} + +impl ContainerFile { + fn sample_count(&self, track_idx: usize) -> usize { + match self { + ContainerFile::Isobmff(f) => f.tracks.get(track_idx).map_or(0, |t| t.samples.len()), + ContainerFile::Matroska(f) => f.tracks.get(track_idx).map_or(0, |t| t.samples.len()), + } + } + + fn read_sample(&self, src: &dyn ByteSource, track_idx: usize, sample_idx: usize) -> Result> { + match self { + ContainerFile::Isobmff(f) => f.read_sample(src, track_idx, sample_idx).map_err(|e| MediaError::Io(e.to_string())), + ContainerFile::Matroska(f) => f.read_sample(src, track_idx, sample_idx).map_err(|e| MediaError::Io(e.to_string())), + } + } + + fn target_sample(&self, track_idx: usize, time: Tick) -> Option<(usize, i64)> { + match self { + ContainerFile::Isobmff(f) => { + let track = f.tracks.get(track_idx)?; + let t_track = tick_to_units(time, track.timescale); + let idx = track.sample_at_presentation_time(t_track)?; + Some((idx, track.samples[idx].pts)) + } + ContainerFile::Matroska(f) => { + let track = f.tracks.get(track_idx)?; + let t_track = tick_to_matroska_units(time, track.timebase); + let idx = track.sample_at_pts(t_track)?; + Some((idx, track.samples[idx].pts)) + } + } + } + + fn sync_sample_before(&self, track_idx: usize, target_idx: usize) -> usize { + match self { + ContainerFile::Isobmff(f) => f.tracks[track_idx].sync_sample_before(target_idx), + ContainerFile::Matroska(f) => f.tracks[track_idx].sync_sample_before(target_idx), + } + } + + fn sample_pts(&self, track_idx: usize, sample_idx: usize) -> i64 { + match self { + ContainerFile::Isobmff(f) => f.tracks[track_idx].samples[sample_idx].pts, + ContainerFile::Matroska(f) => f.tracks[track_idx].samples[sample_idx].pts, + } + } + + fn pts_to_tick(&self, track_idx: usize, raw_pts: i64) -> Tick { + match self { + ContainerFile::Isobmff(f) => { + let track = &f.tracks[track_idx]; + let pts_units = raw_pts.saturating_add(track.edit_offset); + Tick::from_units(pts_units, i64::from(track.timescale.max(1))) + } + ContainerFile::Matroska(f) => { + let track = &f.tracks[track_idx]; + let ns = track.ticks_to_ns(raw_pts); + Tick::from_units(ns, 1_000_000_000) + } + } + } + + fn audio_seek_info(&self, track_idx: usize, start: i64, native_rate: u32) -> (usize, i64) { + match self { + ContainerFile::Isobmff(f) => { + let track = &f.tracks[track_idx]; + let t_track = (i128::from(start.max(0)) * i128::from(track.timescale)) / i128::from(native_rate); + let sample_idx = track.sample_at_presentation_time(i64::try_from(t_track).unwrap_or(0)).unwrap_or(0); + // Back up a few packets for AAC/Opus overlap/preroll. + let seek_idx = sample_idx.saturating_sub(2); + let sample_pts = track.presentation_pts(seek_idx).unwrap_or(0); + let decoded_pos = i64::try_from((i128::from(sample_pts) * i128::from(native_rate)) / i128::from(track.timescale.max(1))).unwrap_or(0); + (seek_idx, decoded_pos) + } + ContainerFile::Matroska(f) => { + let track = &f.tracks[track_idx]; + let delay_ns = i128::from(track.codec_delay_ns); + let preroll_ns = i128::from(track.seek_pre_roll_ns.max(80_000_000)); + let target_ns = (i128::from(start.max(0)) * 1_000_000_000) / i128::from(native_rate) + delay_ns; + let seek_ns = (target_ns - preroll_ns).max(0); + let t_track = track.ns_to_ticks(i64::try_from(seek_ns).unwrap_or(0)); + let sample_idx = track.sample_at_pts(t_track).unwrap_or(0); + let seek_idx = sample_idx.saturating_sub(2); + let sample_pts = track.samples.get(seek_idx).map_or(0, |s| s.pts); + let sample_ns = i128::from(track.ticks_to_ns(sample_pts)) - delay_ns; + let decoded_pos = i64::try_from((sample_ns * i128::from(native_rate)) / 1_000_000_000).unwrap_or(0); + (seek_idx, decoded_pos) + } + } + } +} + +fn open_audio_tracks(container: &ContainerFile, source: &dyn ByteSource, candidates: I) -> Option<(Vec, Vec)> +where + I: IntoIterator, +{ + let mut audio_tracks = Vec::new(); + let mut audio_infos = Vec::new(); + for (idx, sample_count, params, codec_delay_ns) in candidates { + if audio_tracks.len() >= MAX_AUDIO_STREAMS { + break; + } + let n = AUDIO_LOOKAHEAD.min(sample_count); + let mut lookahead = Vec::with_capacity(n); + for s_idx in 0..n { + let pkt = container.read_sample(source, idx, s_idx).ok()?; + lookahead.push(pkt); + } + let refs: Vec<&[u8]> = lookahead.iter().map(Vec::as_slice).collect(); + let dec = AudioTrackDecoder::new(¶ms, &refs).ok()?; + let native_rate = dec.sample_rate().max(1); + let channels = u32::from(dec.layout().channels()).max(1); + let delay_samples = i64::try_from((i128::from(codec_delay_ns) * i128::from(native_rate)) / 1_000_000_000).unwrap_or(0); + audio_infos.push(AudioStreamInfo { + sample_rate: native_rate, + channels, + codec: params.codec.name().to_string(), + bits_per_sample: params.pcm.map(|p| u32::from(p.bits)), + }); + audio_tracks.push(AudioTrackEntry { + track_idx: idx, + native_rate, + state: Mutex::new(AudioTrackState { decoder: dec, next_sample: 0, decoded_pos: -delay_samples, buf: Vec::new() }), + }); + } + Some((audio_tracks, audio_infos)) +} + +fn open_isobmff(name: &str, source: SharedBytes) -> Option> { + let file = isobmff::open(source.clone()).ok()?; + let video_idx = + file.tracks.iter().position(|t| t.kind == isobmff::TrackKind::Video && !t.samples.is_empty() && !t.entries.is_empty() && t.timescale > 0)?; + let video_track = &file.tracks[video_idx]; + let video_params = video_track.codec_params(); + if !supports_video_codec(video_params.codec) { + return None; + } + + let container_color = video_track.video().and_then(|v| v.color.as_ref()).map(color_from_isobmff); + let color = container_color.unwrap_or(ColorInfo::REC709); + let (mut width, mut height) = video_track + .video() + .map(|v| (u32::from(v.width), u32::from(v.height))) + .filter(|&(w, h)| w > 0 && h > 0) + .unwrap_or((video_track.width, video_track.height)); + let mut par = video_track.video().and_then(|v| v.pixel_aspect).filter(|&(n, d)| n > 0 && d > 0).unwrap_or((1, 1)); + let rotation = video_track.display_rotation().unwrap_or(0) % 4; + if rotation % 2 == 1 { + std::mem::swap(&mut width, &mut height); + par = (par.1, par.0); + } + let has_alpha = video_track.video().is_some_and(|v| v.depth == 32); + let frame_rate = estimate_isobmff_frame_rate(video_track); + let duration = Tick::from_units(i64::try_from(video_track.duration).unwrap_or(i64::MAX), i64::from(video_track.timescale)); + let bitrate = video_track.entries.first().and_then(|e| e.bitrate).map(|b| u64::from(b.avg_bitrate)).filter(|&b| b > 0); + let codec_name = video_params.codec.name().to_string(); + + let audio_candidates: Vec<(usize, usize, CodecParams, u64)> = file + .tracks + .iter() + .enumerate() + .filter(|(_, t)| t.kind == isobmff::TrackKind::Audio && !t.samples.is_empty() && !t.entries.is_empty() && t.timescale > 0) + .map(|(idx, t)| (idx, t.samples.len(), t.codec_params(), 0)) + .collect(); + + let container = ContainerFile::Isobmff(file); + let (audio_tracks, audio_infos) = open_audio_tracks(&container, &*source, audio_candidates)?; + + let video_decoder = match TrackDecoder::with_options(&video_params, TrackDecoderOptions { threads: Some(worker_cap()), draft: false }) { + Ok(d) => d, + Err(e) => return Some(Err(MediaError::Decode(e.to_string()))), + }; + + let info = MediaInfo { + name: name.to_string(), + kind: MediaKind::Movie, + duration, + video: Some(VideoStreamInfo { width, height, frame_rate, par, codec: codec_name, pixel_format: String::new(), color, has_alpha, bitrate, hdr: None }), + audio_streams: audio_infos, + container: "mp4".to_string(), + start_timecode: None, + file_size: Some(source.len()), + }; + + Some(Ok(Arc::new(CraftMediaSource { + info, + source, + file: container, + video_track_idx: video_idx, + container_color, + par, + rotation, + video: Mutex::new(VideoState { decoder: video_decoder, next_decode_idx: 0, gop_start_idx: 0, flushed: false, decoded: Vec::new() }), + audio_tracks, + }))) +} + +fn open_matroska(name: &str, source: SharedBytes) -> Option> { + let file = matroska::open(source.clone()).ok()?; + let video_idx = file.tracks.iter().position(|t| t.kind == matroska::TrackKind::Video && !t.samples.is_empty() && t.timebase.0 > 0 && t.timebase.1 > 0)?; + let video_track = &file.tracks[video_idx]; + if !video_track.frames_readable() { + return None; + } + let video_params = video_track.codec_params(); + if !supports_video_codec(video_params.codec) { + return None; + } + + let video_info = video_track.video.as_ref(); + // WebM/Matroska alpha_mode == 1 stores alpha in BlockAdditional; fall back to FilmCraft. + if video_info.is_some_and(|v| v.alpha_mode == 1) { + return None; + } + let container_color = video_info.and_then(|v| v.color.as_ref()).map(color_from_matroska); + let color = container_color.unwrap_or(ColorInfo::REC709); + let (mut width, mut height) = video_info.map_or((0, 0), |v| (v.pixel_width, v.pixel_height)); + let mut par = matroska_par(video_info, width, height); + let rotation = video_info.and_then(|v| v.display_rotation()).unwrap_or(0) % 4; + if rotation % 2 == 1 { + std::mem::swap(&mut width, &mut height); + par = (par.1, par.0); + } + let frame_rate = estimate_matroska_frame_rate(video_track); + let duration = matroska_duration(&file, video_track); + let codec_name = video_params.codec.name().to_string(); + let container_name = if file.doc_type == "webm" { "webm" } else { "mkv" }.to_string(); + + let audio_candidates: Vec<(usize, usize, CodecParams, u64)> = file + .tracks + .iter() + .enumerate() + .filter(|(_, t)| t.kind == matroska::TrackKind::Audio && !t.samples.is_empty() && t.timebase.0 > 0 && t.timebase.1 > 0 && t.frames_readable()) + .map(|(idx, t)| (idx, t.samples.len(), t.codec_params(), t.codec_delay_ns)) + .collect(); + + let container = ContainerFile::Matroska(Box::new(file)); + let (audio_tracks, audio_infos) = open_audio_tracks(&container, &*source, audio_candidates)?; + + let video_decoder = match TrackDecoder::with_options(&video_params, TrackDecoderOptions { threads: Some(worker_cap()), draft: false }) { + Ok(d) => d, + Err(e) => return Some(Err(MediaError::Decode(e.to_string()))), + }; + + let info = MediaInfo { + name: name.to_string(), + kind: MediaKind::Movie, + duration, + video: Some(VideoStreamInfo { + width, + height, + frame_rate, + par, + codec: codec_name, + pixel_format: String::new(), + color, + has_alpha: false, + bitrate: None, + hdr: None, + }), + audio_streams: audio_infos, + container: container_name, + start_timecode: None, + file_size: Some(source.len()), + }; + + Some(Ok(Arc::new(CraftMediaSource { + info, + source, + file: container, + video_track_idx: video_idx, + container_color, + par, + rotation, + video: Mutex::new(VideoState { decoder: video_decoder, next_decode_idx: 0, gop_start_idx: 0, flushed: false, decoded: Vec::new() }), + audio_tracks, + }))) +} + +struct CachedFrame { + pts: i64, + draft: bool, + frame: Arc, +} + +struct VideoState { + decoder: TrackDecoder, + next_decode_idx: usize, + gop_start_idx: usize, + flushed: bool, + decoded: Vec, +} + +struct AudioTrackState { + decoder: AudioTrackDecoder, + next_sample: usize, + /// Sample index (in native-rate frames) of `buf[0]` relative to track start (0). + decoded_pos: i64, + /// Planar: one `Vec` per channel. + buf: Vec>, +} + +struct AudioTrackEntry { + track_idx: usize, + native_rate: u32, + state: Mutex, +} + +struct CraftMediaSource { + info: MediaInfo, + source: SharedBytes, + file: ContainerFile, + video_track_idx: usize, + container_color: Option, + par: (u32, u32), + rotation: u8, + video: Mutex, + audio_tracks: Vec, +} + +impl MediaSource for CraftMediaSource { + fn info(&self) -> &MediaInfo { + &self.info + } + + fn video_frame(&self, req: FrameRequest) -> Result> { + let (target_idx, target_pts) = self.file.target_sample(self.video_track_idx, req.time).ok_or_else(|| MediaError::Decode("no video samples".into()))?; + let want_draft = req.scale < 0.99; + + let mut state = self.video.lock().unwrap_or_else(std::sync::PoisonError::into_inner); + if let Some(hit) = state.decoded.iter().find(|c| c.pts == target_pts && c.draft == want_draft) { + return Ok(hit.frame.clone()); + } + + let sync_idx = self.file.sync_sample_before(self.video_track_idx, target_idx); + let draft_changed = state.decoder.draft() != want_draft; + if draft_changed { + state.decoder.set_draft(want_draft); + } + // Backward seek, jump to a later GOP, or draft/full-quality mode switch: reset decoder to + // the target sync sample so full-quality frames never reuse draft-decoded references. + if draft_changed || target_idx < state.next_decode_idx || sync_idx > state.gop_start_idx { + state.decoder.reset().map_err(|e| MediaError::Decode(e.to_string()))?; + state.decoded.clear(); + state.next_decode_idx = sync_idx; + state.gop_start_idx = sync_idx; + state.flushed = false; + } + + let sample_count = self.file.sample_count(self.video_track_idx); + while !state.decoded.iter().any(|c| c.pts >= target_pts && c.draft == want_draft) { + if filmcraft_media::cancel::cancelled() { + return Err(MediaError::Cancelled); + } + if state.next_decode_idx < sample_count { + let idx = state.next_decode_idx; + let pts = self.file.sample_pts(self.video_track_idx, idx); + let pkt = self.file.read_sample(&*self.source, self.video_track_idx, idx)?; + let frames = state.decoder.decode(&pkt, pts).map_err(|e| MediaError::Decode(e.to_string()))?; + state.next_decode_idx = idx + 1; + push_decoded(&mut state.decoded, frames, want_draft, self.container_color, self.par, self.rotation, &self.file, self.video_track_idx)?; + } else if !state.flushed { + let frames = state.decoder.flush().map_err(|e| MediaError::Decode(e.to_string()))?; + state.flushed = true; + push_decoded(&mut state.decoded, frames, want_draft, self.container_color, self.par, self.rotation, &self.file, self.video_track_idx)?; + break; + } else { + break; + } + } + + if let Some(exact) = state.decoded.iter().find(|c| c.pts == target_pts && c.draft == want_draft) { + return Ok(exact.frame.clone()); + } + // Fallback: latest decoded frame at or before target_pts, or earliest available. + let best = state + .decoded + .iter() + .filter(|c| c.draft == want_draft && c.pts <= target_pts) + .max_by_key(|c| c.pts) + .or_else(|| state.decoded.iter().find(|c| c.draft == want_draft)) + .ok_or_else(|| MediaError::Decode("video decoder produced no frame".into()))?; + Ok(best.frame.clone()) + } + + fn audio(&self, start: i64, frames: usize, sample_rate: u32) -> Result { + self.audio_stream(0, start, frames, sample_rate) + } + + fn audio_stream(&self, stream: usize, start: i64, frames: usize, sample_rate: u32) -> Result { + let entry = self.audio_tracks.get(stream).ok_or(MediaError::NoStream("audio"))?; + if sample_rate == 0 { + return Err(MediaError::Decode("invalid audio sample rate 0".into())); + } + let channels_count = self.info.audio_streams.get(stream).map_or(2, |s| s.channels as usize); + if frames == 0 { + return Ok(AudioBuffer::new(sample_rate, channels_count as u16, 0)); + } + + let native_rate = entry.native_rate; + let (native_start, native_frames) = if sample_rate == native_rate { + (start, frames) + } else { + let s0 = (i128::from(start) * i128::from(native_rate)) / i128::from(sample_rate); + let len = ((frames as u128 * u128::from(native_rate)).div_ceil(u128::from(sample_rate)) + 2) as usize; + (i64::try_from(s0).unwrap_or(0), len) + }; + + let mut state = entry.state.lock().unwrap_or_else(std::sync::PoisonError::into_inner); + let decoded = decode_audio_range(&self.file, &*self.source, entry.track_idx, native_rate, channels_count, &mut state, native_start, native_frames)?; + + if sample_rate == native_rate { + return Ok(AudioBuffer { sample_rate, channels: decoded }); + } + + let mut resampled = vec![vec![0.0f32; frames]; channels_count]; + let ratio = f64::from(native_rate) / f64::from(sample_rate); + for (c, out_ch) in resampled.iter_mut().enumerate() { + let in_ch = &decoded[c]; + if in_ch.is_empty() { + continue; + } + for (i, dst) in out_ch.iter_mut().enumerate() { + let pos = i as f64 * ratio; + let idx = pos.floor() as usize; + let frac = (pos - idx as f64) as f32; + let s0 = in_ch.get(idx).copied().unwrap_or(0.0); + let s1 = in_ch.get(idx + 1).copied().unwrap_or(s0); + *dst = s0 + (s1 - s0) * frac; + } + } + Ok(AudioBuffer { sample_rate, channels: resampled }) + } +} + +#[allow(clippy::too_many_arguments)] +fn decode_audio_range( + file: &ContainerFile, + source: &dyn ByteSource, + track_idx: usize, + native_rate: u32, + channels_count: usize, + state: &mut AudioTrackState, + start: i64, + frames: usize, +) -> Result>> { + let mut out = vec![vec![0.0f32; frames]; channels_count]; + let end = start.saturating_add(frames as i64); + if end <= 0 { + return Ok(out); + } + + let buf_len = state.buf.first().map_or(0, Vec::len) as i64; + let buf_end = state.decoded_pos.saturating_add(buf_len); + if start < state.decoded_pos || start > buf_end + i64::from(native_rate) * 2 { + let (seek_idx, decoded_pos) = file.audio_seek_info(track_idx, start, native_rate); + state.decoder.reset(); + state.next_sample = seek_idx; + state.decoded_pos = decoded_pos; + for ch in &mut state.buf { + ch.clear(); + } + } + + if state.buf.len() != channels_count { + state.buf = vec![Vec::new(); channels_count]; + } + + let sample_count = file.sample_count(track_idx); + while state.decoded_pos + state.buf.first().map_or(0, Vec::len) as i64 <= end && state.next_sample < sample_count { + if filmcraft_media::cancel::cancelled() { + return Err(MediaError::Cancelled); + } + let idx = state.next_sample; + let pkt = file.read_sample(source, track_idx, idx)?; + state.next_sample = idx + 1; + let block = state.decoder.decode(&pkt).map_err(|e| MediaError::Decode(e.to_string()))?; + for (c, ch) in state.buf.iter_mut().enumerate() { + if let Some(src_ch) = block.channels.get(c) { + ch.extend_from_slice(src_ch); + } + } + } + + let avail = state.buf.first().map_or(0, Vec::len); + for i in 0..frames { + let pos = start.saturating_add(i as i64); + if pos >= state.decoded_pos { + let off = (pos - state.decoded_pos) as usize; + if off < avail { + for (c, out_ch) in out.iter_mut().enumerate() { + out_ch[i] = state.buf[c][off]; + } + } + } + } + + let drop_to = (end - state.decoded_pos).max(0) as usize; + let trim = drop_to.min(avail); + if trim > 0 { + for ch in &mut state.buf { + ch.drain(..trim); + } + state.decoded_pos = state.decoded_pos.saturating_add(trim as i64); + } + + Ok(out) +} + +#[allow(clippy::too_many_arguments)] +fn push_decoded( + cache: &mut Vec, + frames: Vec, + draft: bool, + container_color: Option, + par: (u32, u32), + rotation: u8, + file: &ContainerFile, + track_idx: usize, +) -> Result<()> { + for vf in frames { + let pts = vf.pts.unwrap_or(0); + let pts_tick = file.pts_to_tick(track_idx, pts); + let frame = Arc::new(to_craft_frame(vf, container_color, par, rotation, pts_tick)?); + cache.push(CachedFrame { pts, draft, frame }); + } + if cache.len() > MAX_CACHED_FRAMES { + let excess = cache.len() - MAX_CACHED_FRAMES; + cache.drain(..excess); + } + Ok(()) +} + +fn to_craft_frame(vf: DecodedVideoFrame, container_color: Option, default_par: (u32, u32), rotation: u8, pts: Tick) -> Result { + let width = vf.width(); + let height = vf.height(); + let subsampling = vf.subsampling(); + let family = vf.family(); + let tags = vf.color; + let par = match vf.sar.filter(|&(n, d)| n > 0 && d > 0) { + Some((n, d)) if rotation % 2 == 1 => (d, n), + Some(sar) => sar, + None => default_par, + }; + let color = resolve_color(tags, container_color); + let bit_depth = vf.bit_depth(); + let (planes, alpha) = vf.into_planes(); + + let data = match family { + ColorFamily::YCbCr => { + let chroma = match subsampling { + Subsampling::S420 => Chroma::C420, + Subsampling::S422 => Chroma::C422, + Subsampling::S444 => Chroma::C444, + _ => return Err(MediaError::Unsupported("unsupported YCbCr subsampling".into())), + }; + let mut iter = planes.into_iter(); + let (Some(y), Some(cb), Some(cr)) = (iter.next(), iter.next(), iter.next()) else { + return Err(MediaError::Decode("missing YUV planes".into())); + }; + if bit_depth <= 8 { + let y = Arc::new(plane_u8(y)?); + let cb = Arc::new(plane_u8(cb)?); + let cr = Arc::new(plane_u8(cr)?); + let a = alpha.map(plane_u8).transpose()?.map(Arc::new); + PixelData::Yuv8 { planes: [y, cb, cr], chroma, alpha: a } + } else { + let y = Arc::new(plane_u16(y)?); + let cb = Arc::new(plane_u16(cb)?); + let cr = Arc::new(plane_u16(cr)?); + let a = alpha.map(plane_u16).transpose()?.map(Arc::new); + PixelData::Yuv16 { planes: [y, cb, cr], chroma, bits: u32::from(bit_depth), alpha: a } + } + } + ColorFamily::Rgb | ColorFamily::Gray => return Err(MediaError::Unsupported("non-YCbCr pixel format".into())), + }; + + let frame = VideoFrame { width, height, data, color, par, pts }; + Ok(rotate_frame(frame, rotation)) +} + +fn rotate_plane(src: &[T], w: usize, h: usize, turns: u8) -> Vec { + if w == 0 || h == 0 || src.len() < w * h { + return src.to_vec(); + } + let mut dst = vec![T::default(); w * h]; + match turns % 4 { + 1 => { + for y in 0..h { + for x in 0..w { + dst[x * h + (h - 1 - y)] = src[y * w + x]; + } + } + } + 2 => { + for y in 0..h { + for x in 0..w { + dst[(h - 1 - y) * w + (w - 1 - x)] = src[y * w + x]; + } + } + } + 3 => { + for y in 0..h { + for x in 0..w { + dst[(w - 1 - x) * h + y] = src[y * w + x]; + } + } + } + _ => return src.to_vec(), + } + dst +} + +fn upsample_horiz(src: &[T], cw: usize, ch: usize, full_w: usize) -> Vec { + let mut out = Vec::with_capacity(full_w * ch); + for y in 0..ch { + let row = &src[y * cw..(y + 1) * cw]; + for x in 0..full_w { + out.push(row[(x / 2).min(cw.saturating_sub(1))]); + } + } + out +} + +fn rotate_frame(mut frame: VideoFrame, turns: u8) -> VideoFrame { + let turns = turns % 4; + if turns == 0 { + return frame; + } + let (w, h) = (frame.width as usize, frame.height as usize); + let (nw, nh) = if turns % 2 == 1 { (frame.height, frame.width) } else { (frame.width, frame.height) }; + let data = match frame.data { + PixelData::Yuv8 { planes: [y, cb, cr], chroma, alpha } => { + let (cw, ch, out_chroma) = match chroma { + Chroma::C420 => (w.div_ceil(2), h.div_ceil(2), Chroma::C420), + Chroma::C422 if turns % 2 == 1 => (w, h, Chroma::C444), + Chroma::C422 => (w.div_ceil(2), h, Chroma::C422), + Chroma::C444 => (w, h, Chroma::C444), + }; + let (cb_r, cr_r) = if chroma == Chroma::C422 && turns % 2 == 1 { + let src_cw = w.div_ceil(2); + (rotate_plane(&upsample_horiz(&cb, src_cw, h, w), w, h, turns), rotate_plane(&upsample_horiz(&cr, src_cw, h, w), w, h, turns)) + } else { + (rotate_plane(&cb, cw, ch, turns), rotate_plane(&cr, cw, ch, turns)) + }; + PixelData::Yuv8 { + planes: [Arc::new(rotate_plane(&y, w, h, turns)), Arc::new(cb_r), Arc::new(cr_r)], + chroma: out_chroma, + alpha: alpha.map(|a| Arc::new(rotate_plane(&a, w, h, turns))), + } + } + PixelData::Yuv16 { planes: [y, cb, cr], chroma, bits, alpha } => { + let (cw, ch, out_chroma) = match chroma { + Chroma::C420 => (w.div_ceil(2), h.div_ceil(2), Chroma::C420), + Chroma::C422 if turns % 2 == 1 => (w, h, Chroma::C444), + Chroma::C422 => (w.div_ceil(2), h, Chroma::C422), + Chroma::C444 => (w, h, Chroma::C444), + }; + let (cb_r, cr_r) = if chroma == Chroma::C422 && turns % 2 == 1 { + let src_cw = w.div_ceil(2); + (rotate_plane(&upsample_horiz(&cb, src_cw, h, w), w, h, turns), rotate_plane(&upsample_horiz(&cr, src_cw, h, w), w, h, turns)) + } else { + (rotate_plane(&cb, cw, ch, turns), rotate_plane(&cr, cw, ch, turns)) + }; + PixelData::Yuv16 { + planes: [Arc::new(rotate_plane(&y, w, h, turns)), Arc::new(cb_r), Arc::new(cr_r)], + chroma: out_chroma, + bits, + alpha: alpha.map(|a| Arc::new(rotate_plane(&a, w, h, turns))), + } + } + other => other, + }; + frame.width = nw; + frame.height = nh; + frame.data = data; + frame +} + +fn plane_u8(p: Plane) -> Result> { + let (w, h, stride) = (p.width() as usize, p.height() as usize, p.stride()); + match p.into_samples() { + Samples::U8(mut v) => { + if stride == w { + v.truncate(w * h); + return Ok(v); + } + let mut out = Vec::with_capacity(w * h); + for y in 0..h { + let row = y * stride; + out.extend_from_slice(&v[row..row + w]); + } + Ok(out) + } + Samples::U16(v) => { + let mut out = Vec::with_capacity(w * h); + for y in 0..h { + let row = y * stride; + out.extend(v[row..row + w].iter().map(|&s| s.min(255) as u8)); + } + Ok(out) + } + } +} + +fn plane_u16(p: Plane) -> Result> { + let (w, h, stride) = (p.width() as usize, p.height() as usize, p.stride()); + match p.into_samples() { + Samples::U16(mut v) => { + if stride == w { + v.truncate(w * h); + return Ok(v); + } + let mut out = Vec::with_capacity(w * h); + for y in 0..h { + let row = y * stride; + out.extend_from_slice(&v[row..row + w]); + } + Ok(out) + } + Samples::U8(v) => { + let mut out = Vec::with_capacity(w * h); + for y in 0..h { + let row = y * stride; + out.extend(v[row..row + w].iter().map(|&s| u16::from(s))); + } + Ok(out) + } + } +} + +fn resolve_color(vui: ColorTags, container: Option) -> ColorInfo { + let base = container.unwrap_or(ColorInfo::REC709); + let matrix = Matrix::from_code(vui.matrix).unwrap_or(base.matrix); + let transfer = Transfer::from_code(vui.transfer).unwrap_or(base.transfer); + let primaries = primaries_from_code(vui.primaries).unwrap_or(base.primaries); + let range = if vui.full_range { Range::Full } else { base.range }; + ColorInfo { matrix, transfer, primaries, range } +} + +fn color_from_isobmff(c: &isobmff::ColorInfo) -> ColorInfo { + match c { + isobmff::ColorInfo::Nclx { primaries, transfer, matrix, full_range } => ColorInfo { + matrix: u8::try_from(*matrix).ok().and_then(Matrix::from_code).unwrap_or(Matrix::Bt709), + transfer: u8::try_from(*transfer).ok().and_then(Transfer::from_code).unwrap_or(Transfer::Bt709), + primaries: u8::try_from(*primaries).ok().and_then(primaries_from_code).unwrap_or(Primaries::Bt709), + range: if *full_range { Range::Full } else { Range::Limited }, + }, + isobmff::ColorInfo::Nclc { primaries, transfer, matrix } => ColorInfo { + matrix: u8::try_from(*matrix).ok().and_then(Matrix::from_code).unwrap_or(Matrix::Bt709), + transfer: u8::try_from(*transfer).ok().and_then(Transfer::from_code).unwrap_or(Transfer::Bt709), + primaries: u8::try_from(*primaries).ok().and_then(primaries_from_code).unwrap_or(Primaries::Bt709), + range: Range::Limited, + }, + isobmff::ColorInfo::Icc { .. } => ColorInfo::REC709, + } +} + +fn color_from_matroska(c: &matroska::Color) -> ColorInfo { + ColorInfo { + matrix: c.matrix_coefficients.and_then(|m| u8::try_from(m).ok()).and_then(Matrix::from_code).unwrap_or(Matrix::Bt709), + transfer: c.transfer_characteristics.and_then(|t| u8::try_from(t).ok()).and_then(Transfer::from_code).unwrap_or(Transfer::Bt709), + primaries: c.primaries.and_then(|p| u8::try_from(p).ok()).and_then(primaries_from_code).unwrap_or(Primaries::Bt709), + range: if c.full_range() { Range::Full } else { Range::Limited }, + } +} + +fn primaries_from_code(c: u8) -> Option { + match c { + 1 => Some(Primaries::Bt709), + 5 => Some(Primaries::Bt601_625), + 6 => Some(Primaries::Bt601_525), + 9 => Some(Primaries::Bt2020), + 11 | 12 => Some(Primaries::P3D65), + _ => None, + } +} + +fn matroska_par(video: Option<&matroska::VideoInfo>, width: u32, height: u32) -> (u32, u32) { + let Some(v) = video else { return (1, 1) }; + if v.display_unit == 0 + && let (Some(dw), Some(dh)) = (v.display_width, v.display_height) + && dw > 0 + && dh > 0 + && width > 0 + && height > 0 + && (dw != width || dh != height) + { + return (dw * height, dh * width); + } + (1, 1) +} + +fn matroska_duration(file: &MkvFile, track: &matroska::Track) -> Tick { + if let Some(d) = file.info.duration + && d.is_finite() + && d > 0.0 + { + let ns = (d * file.info.timestamp_scale as f64).round() as i64; + return Tick::from_units(ns, 1_000_000_000); + } + let last_end = track.samples.last().map_or(0, |s| s.pts.saturating_add(i64::try_from(s.duration).unwrap_or(0))); + Tick::from_units(track.ticks_to_ns(last_end), 1_000_000_000) +} + +fn tick_to_units(t: Tick, timescale: u32) -> i64 { + let v = (i128::from(t.0) * i128::from(timescale)) / i128::from(craft_time::TICKS_PER_SECOND); + i64::try_from(v).unwrap_or(if v < 0 { i64::MIN } else { i64::MAX }) +} + +fn tick_to_matroska_units(t: Tick, timebase: (u64, u64)) -> i64 { + let denom = i128::from(craft_time::TICKS_PER_SECOND) * i128::from(timebase.0.max(1)); + let v = (i128::from(t.0) * i128::from(timebase.1)) / denom; + i64::try_from(v).unwrap_or(if v < 0 { i64::MIN } else { i64::MAX }) +} + +fn snap_common_fps(fps: f64) -> Option { + if !fps.is_finite() || fps <= 0.0 { + return None; + } + FrameRate::COMMON + .into_iter() + .map(|r| (r, (fps / r.as_f64() - 1.0).abs())) + .filter(|&(_, off)| off <= 0.005) + .min_by(|a, b| a.1.total_cmp(&b.1)) + .map(|(r, _)| r) +} + +fn estimate_isobmff_frame_rate(track: &isobmff::Track) -> FrameRate { + let ts = i128::from(track.timescale); + if ts <= 0 || track.samples.is_empty() { + return FrameRate::FPS_30; + } + let mut durs: Vec = track.samples.iter().map(|s| s.duration).filter(|&d| d > 0).collect(); + if durs.is_empty() { + return FrameRate::FPS_30; + } + durs.sort_unstable(); + let median = durs[durs.len() / 2]; + for r in FrameRate::COMMON { + if ts * i128::from(r.den) == i128::from(median) * i128::from(r.num) { + return r; + } + } + let fps = track.timescale as f64 / f64::from(median); + snap_common_fps(fps).unwrap_or_else(|| FrameRate::new(i64::from(track.timescale), i64::from(median))) +} + +fn estimate_matroska_frame_rate(track: &matroska::Track) -> FrameRate { + if let Some(ns) = track.default_duration_ns + && ns > 0 + { + let fps = 1_000_000_000.0 / ns as f64; + return snap_common_fps(fps).unwrap_or_else(|| FrameRate::new(1_000_000_000, i64::try_from(ns).unwrap_or(i64::MAX))); + } + if track.samples.len() >= 2 { + let mut pts: Vec = track.samples.iter().map(|s| s.pts).collect(); + pts.sort_unstable(); + let mut deltas: Vec = pts.windows(2).map(|w| w[1] - w[0]).filter(|&d| d > 0).collect(); + if !deltas.is_empty() { + deltas.sort_unstable(); + let median_ticks = deltas[deltas.len() / 2]; + let median_ns = track.ticks_to_ns(median_ticks); + if median_ns > 0 { + let fps = 1_000_000_000.0 / median_ns as f64; + return snap_common_fps(fps).unwrap_or_else(|| FrameRate::new(1_000_000_000, median_ns)); + } + } + } + FrameRate::FPS_30 +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn worker_cap_is_bounded() { + let cap = worker_cap(); + assert!((1..=MAX_WORKERS).contains(&cap), "cap={cap}"); + } + + #[test] + fn vui_overrides_container_color_and_falls_back_when_unspecified() { + let container = color_from_isobmff(&isobmff::ColorInfo::Nclx { primaries: 9, transfer: 16, matrix: 9, full_range: false }); + assert_eq!(container.primaries, Primaries::Bt2020); + assert_eq!(container.transfer, Transfer::Pq); + assert_eq!(container.matrix, Matrix::Bt2020Ncl); + assert_eq!(container.range, Range::Limited); + + // Unspecified VUI (2) falls back to container color. + let resolved = resolve_color(ColorTags::UNSPECIFIED, Some(container)); + assert_eq!(resolved, container); + + // Explicit VUI overrides container color. + let vui = ColorTags { primaries: 1, transfer: 1, matrix: 1, full_range: true }; + let resolved = resolve_color(vui, Some(container)); + assert_eq!(resolved.primaries, Primaries::Bt709); + assert_eq!(resolved.transfer, Transfer::Bt709); + assert_eq!(resolved.matrix, Matrix::Bt709); + assert_eq!(resolved.range, Range::Full); + } + + #[test] + fn matroska_color_and_sniffer_preserve_policies() { + assert!(looks_like_matroska(&[0x1A, 0x45, 0xDF, 0xA3, 0x01, 0x00])); + assert!(!looks_like_matroska(&[0x00, 0x00, 0x00, 0x18, b'f', b't', b'y', b'p'])); + assert!(looks_like_isobmff(&[0x00, 0x00, 0x00, 0x18, b'f', b't', b'y', b'p'])); + + let mkv_hdr = + matroska::Color { matrix_coefficients: Some(9), transfer_characteristics: Some(16), primaries: Some(9), range: Some(1), ..Default::default() }; + let c = color_from_matroska(&mkv_hdr); + assert_eq!(c.primaries, Primaries::Bt2020); + assert_eq!(c.transfer, Transfer::Pq); + assert_eq!(c.matrix, Matrix::Bt2020Ncl); + assert_eq!(c.range, Range::Limited); + } + + #[test] + fn rotate_frame_swaps_dimensions_and_orients_planes() { + let frame = VideoFrame { + width: 4, + height: 2, + data: PixelData::Yuv8 { + planes: [Arc::new(vec![1, 2, 3, 4, 5, 6, 7, 8]), Arc::new(vec![10, 20]), Arc::new(vec![30, 40])], + chroma: Chroma::C420, + alpha: Some(Arc::new(vec![11, 12, 13, 14, 15, 16, 17, 18])), + }, + color: ColorInfo::REC709, + par: (1, 1), + pts: Tick::ZERO, + }; + let rot90 = rotate_frame(frame.clone(), 1); + assert_eq!((rot90.width, rot90.height), (2, 4)); + assert!(matches!(rot90.data, PixelData::Yuv8 { alpha: Some(_), .. })); + if let PixelData::Yuv8 { planes: [y, ..], alpha: Some(a), .. } = &rot90.data { + assert_eq!(&**y, &[5, 1, 6, 2, 7, 3, 8, 4]); + assert_eq!(&**a, &[15, 11, 16, 12, 17, 13, 18, 14]); + } + let rot360 = rotate_frame(rot90, 3); + assert_eq!((rot360.width, rot360.height), (4, 2)); + if let PixelData::Yuv8 { planes: [y, ..], .. } = &rot360.data { + assert_eq!(&**y, &[1, 2, 3, 4, 5, 6, 7, 8]); + } + } + + #[test] + fn plane_u8_handles_8bit_u16_storage_as_av1_produces() { + let out = Plane::packed(2, 2, 8, Samples::U16(vec![10, 20, 30, 255])).ok().and_then(|p| plane_u8(p).ok()); + assert_eq!(out.as_deref(), Some(&[10, 20, 30, 255][..])); + } + + #[test] + fn rotate_frame_covers_180_270_c422_and_yuv16() { + let f16 = VideoFrame { + width: 4, + height: 2, + data: PixelData::Yuv16 { + planes: [Arc::new(vec![1, 2, 3, 4, 5, 6, 7, 8]), Arc::new(vec![10, 20, 30, 40]), Arc::new(vec![50, 60, 70, 80])], + chroma: Chroma::C422, + bits: 10, + alpha: Some(Arc::new(vec![100; 8])), + }, + color: ColorInfo::REC709, + par: (1, 1), + pts: Tick::ZERO, + }; + let r180 = rotate_frame(f16.clone(), 2); + assert_eq!((r180.width, r180.height), (4, 2)); + if let PixelData::Yuv16 { planes: [y, ..], chroma, .. } = &r180.data { + assert_eq!(*chroma, Chroma::C422); + assert_eq!(&**y, &[8, 7, 6, 5, 4, 3, 2, 1]); + } + let r270 = rotate_frame(f16, 1); + assert_eq!((r270.width, r270.height), (2, 4)); + if let PixelData::Yuv16 { chroma, .. } = &r270.data { + assert_eq!(*chroma, Chroma::C444); + } + } + + #[test] + fn plane_stride_and_container_helpers_cover_variants() { + if let Ok(p8) = Plane::new(2, 2, 4, 8, Samples::U8(vec![1, 2, 9, 9, 3, 4])) { + assert_eq!(plane_u8(p8).ok().as_deref(), Some(&[1, 2, 3, 4][..])); + } + if let Ok(p16) = Plane::new(2, 2, 4, 10, Samples::U16(vec![10, 20, 99, 99, 30, 40])) { + assert_eq!(plane_u16(p16).ok().as_deref(), Some(&[10, 20, 30, 40][..])); + } + if let Ok(p8_as_16) = Plane::packed(2, 1, 8, Samples::U8(vec![7, 8])) { + assert_eq!(plane_u16(p8_as_16).ok().as_deref(), Some(&[7, 8][..])); + } + + let nclc = color_from_isobmff(&isobmff::ColorInfo::Nclc { primaries: 1, transfer: 1, matrix: 1 }); + assert_eq!(nclc, ColorInfo::REC709); + let icc = color_from_isobmff(&isobmff::ColorInfo::Icc { kind: isobmff::FourCc(*b"prof"), profile: Vec::new() }); + assert_eq!(icc, ColorInfo::REC709); + + let v = matroska::VideoInfo { display_width: Some(1280), display_height: Some(720), display_unit: 0, ..Default::default() }; + assert_eq!(matroska_par(Some(&v), 640, 720), (1280 * 720, 720 * 640)); + assert_eq!(matroska_par(None, 640, 360), (1, 1)); + assert_eq!(snap_common_fps(23.976), Some(FrameRate::FPS_23_976)); + assert_eq!(snap_common_fps(f64::NAN), None); + assert_eq!(tick_to_matroska_units(Tick(craft_time::TICKS_PER_SECOND), (1, 1000)), 1000); + assert_eq!(tick_to_units(Tick(craft_time::TICKS_PER_SECOND), 90000), 90000); + } + + #[test] + fn rotated_frame_preserves_container_par_without_double_inversion() { + let make_vf = |sar: Option<(u32, u32)>| { + let y = Plane::packed(2, 2, 8, Samples::U8(vec![1, 2, 3, 4])).ok()?; + let cb = Plane::packed(1, 1, 8, Samples::U8(vec![128])).ok()?; + let cr = Plane::packed(1, 1, 8, Samples::U8(vec![128])).ok()?; + let mut vf = DecodedVideoFrame::new(2, 2, ColorFamily::YCbCr, Subsampling::S420, vec![y, cb, cr], None).ok()?; + vf.sar = sar; + Some(vf) + }; + // `default_par` is already rotated by the container opener (e.g. (4, 3) -> (3, 4) for 90°). + let container_rotated_par = (3, 4); + if let Some(vf_no_sar) = make_vf(None) { + let out = to_craft_frame(vf_no_sar, None, container_rotated_par, 1, Tick::ZERO).ok(); + assert_eq!(out.map(|f| f.par), Some((3, 4))); + } + // Decoder-supplied SAR is in coded coordinates and must be inverted once under 90° rotation. + if let Some(vf_with_sar) = make_vf(Some((4, 3))) { + let out = to_craft_frame(vf_with_sar, None, container_rotated_par, 1, Tick::ZERO).ok(); + assert_eq!(out.map(|f| f.par), Some((3, 4))); + } + } +} diff --git a/crates/media/src/lib.rs b/crates/media/src/lib.rs index 4f337c0bf..d1a907821 100644 --- a/crates/media/src/lib.rs +++ b/crates/media/src/lib.rs @@ -17,6 +17,7 @@ mod aac; mod convert; +mod craft_source; pub mod downmix; mod dpx; pub mod exr_channels; @@ -26,7 +27,6 @@ mod exr_read; mod gif_anim; mod layered; mod localize; -mod mp4_h264; pub use layered::vector_doc; mod pool; mod probe; diff --git a/crates/media/src/mp4_h264.rs b/crates/media/src/mp4_h264.rs deleted file mode 100644 index 456fcd92b..000000000 --- a/crates/media/src/mp4_h264.rs +++ /dev/null @@ -1,597 +0,0 @@ -//! Software MP4/MOV H.264 route backed by `craft-media`, `craft-video`, `craft-audio`, and -//! `craft-media-source`. -//! -//! Preserves sync-sample backward seek, B-frame reordering, cooperative cancellation, VUI + -//! container colour resolution, draft mode for reduced-resolution playback, and bounded worker -//! threads. - -use std::sync::{Arc, Mutex}; - -use craft_audio::{AudioBuffer, TrackDecoder as AudioTrackDecoder}; -use craft_color::{ColorInfo, Matrix, Primaries, Range, Transfer}; -use craft_frame::{Chroma, PixelData, VideoFrame}; -use craft_media::isobmff::{self, Mp4File, Track, TrackKind}; -use craft_media::{ByteSource, CodecId}; -use craft_media_source::{ - AudioStreamInfo, FrameRequest, MAX_AUDIO_STREAMS, MediaError, MediaInfo, MediaKind, MediaSource, Result, SharedBytes, SharedSource, VideoStreamInfo, -}; -use craft_time::{FrameRate, Tick}; -use craft_video::frame::{ColorFamily, ColorTags, Plane, Samples, Subsampling, VideoFrame as DecodedVideoFrame}; -use craft_video::{TrackDecoder, TrackDecoderOptions}; - -/// Maximum worker threads per `TrackDecoder` instance. -const MAX_WORKERS: usize = 8; - -/// Maximum decoded frames retained in the per-source GOP window cache. -const MAX_CACHED_FRAMES: usize = 32; - -/// Maximum audio lookahead packets inspected when initializing `craft_audio::TrackDecoder`. -const AUDIO_LOOKAHEAD: usize = 8; - -fn worker_cap() -> usize { - std::thread::available_parallelism().map_or(4, |n| n.get()).clamp(1, MAX_WORKERS) -} - -/// True when `head` begins with a plausible ISO-BMFF top-level box. -fn looks_like_isobmff(head: &[u8]) -> bool { - if head.len() < 8 { - return false; - } - matches!(&head[4..8], b"ftyp" | b"moov" | b"mdat" | b"free" | b"skip" | b"wide" | b"pnot" | b"uuid") -} - -/// Open an in-place MP4/MOV H.264 source via `craft-media` / `craft-video`. -/// Returns `None` when the file is not ISO-BMFF, has no H.264 video track, or has an audio track -/// whose codec is not yet handled by `craft-audio`. -pub(crate) fn open_reader(name: &str, head: &[u8], reader: &SharedBytes) -> Option> { - if !looks_like_isobmff(head) { - return None; - } - open_byte_source(name, reader.clone()) -} - -/// Open an in-memory MP4/MOV H.264 source via `craft-media` / `craft-video`. -pub(crate) fn open_bytes(name: &str, bytes: Arc<[u8]>) -> Option> { - if !looks_like_isobmff(&bytes) { - return None; - } - open_byte_source(name, Arc::new(bytes)) -} - -fn open_byte_source(name: &str, source: SharedBytes) -> Option> { - let file = isobmff::open(source.clone()).ok()?; - let video_idx = file.tracks.iter().position(|t| t.kind == TrackKind::Video && !t.samples.is_empty() && !t.entries.is_empty() && t.timescale > 0)?; - let video_track = &file.tracks[video_idx]; - let video_params = video_track.codec_params(); - if video_params.codec != CodecId::H264 { - return None; - } - - // Collect playable audio tracks and ensure `craft-audio` can decode every one of them. - let mut audio_tracks = Vec::new(); - let mut audio_infos = Vec::new(); - for (idx, track) in file.tracks.iter().enumerate() { - if audio_tracks.len() >= MAX_AUDIO_STREAMS { - break; - } - if track.kind != TrackKind::Audio || track.samples.is_empty() || track.entries.is_empty() || track.timescale == 0 { - continue; - } - let params = track.codec_params(); - let mut lookahead = Vec::with_capacity(AUDIO_LOOKAHEAD.min(track.samples.len())); - for s_idx in 0..AUDIO_LOOKAHEAD.min(track.samples.len()) { - let Ok(pkt) = file.read_sample(&*source, idx, s_idx) else { - return None; - }; - lookahead.push(pkt); - } - let refs: Vec<&[u8]> = lookahead.iter().map(Vec::as_slice).collect(); - let Ok(dec) = AudioTrackDecoder::new(¶ms, &refs) else { - return None; - }; - let native_rate = dec.sample_rate().max(1); - let channels = u32::from(dec.layout().channels()).max(1); - audio_infos.push(AudioStreamInfo { - sample_rate: native_rate, - channels, - codec: params.codec.name().to_string(), - bits_per_sample: params.pcm.map(|p| u32::from(p.bits)), - }); - audio_tracks.push(AudioTrackEntry { - track_idx: idx, - native_rate, - state: Mutex::new(AudioTrackState { decoder: dec, next_sample: 0, decoded_pos: 0, buf: Vec::new() }), - }); - } - - let video_decoder = match TrackDecoder::with_options(&video_params, TrackDecoderOptions { threads: Some(worker_cap()), draft: false }) { - Ok(d) => d, - Err(e) => return Some(Err(MediaError::Decode(e.to_string()))), - }; - - let container_color = video_track.video().and_then(|v| v.color.as_ref()).map(color_from_isobmff); - let color = container_color.unwrap_or(ColorInfo::REC709); - let (width, height) = video_track - .video() - .map(|v| (u32::from(v.width), u32::from(v.height))) - .filter(|&(w, h)| w > 0 && h > 0) - .unwrap_or((video_track.width, video_track.height)); - let par = video_track.video().and_then(|v| v.pixel_aspect).filter(|&(n, d)| n > 0 && d > 0).unwrap_or((1, 1)); - let frame_rate = estimate_frame_rate(video_track); - let duration = Tick::from_units(i64::try_from(video_track.duration).unwrap_or(i64::MAX), i64::from(video_track.timescale)); - let bitrate = video_track.entries.first().and_then(|e| e.bitrate).map(|b| u64::from(b.avg_bitrate)).filter(|&b| b > 0); - - let info = MediaInfo { - name: name.to_string(), - kind: MediaKind::Movie, - duration, - video: Some(VideoStreamInfo { - width, - height, - frame_rate, - par, - codec: "H.264".to_string(), - pixel_format: "yuv420p".to_string(), - color, - has_alpha: false, - bitrate, - hdr: None, - }), - audio_streams: audio_infos, - container: "mp4".to_string(), - start_timecode: None, - file_size: Some(source.len()), - }; - - Some(Ok(Arc::new(Mp4H264Source { - info, - source, - file, - video_track_idx: video_idx, - container_color, - par, - video: Mutex::new(VideoState { decoder: video_decoder, next_decode_idx: 0, gop_start_idx: 0, flushed: false, decoded: Vec::new() }), - audio_tracks, - }))) -} - -struct CachedFrame { - pts: i64, - frame: Arc, -} - -struct VideoState { - decoder: TrackDecoder, - next_decode_idx: usize, - gop_start_idx: usize, - flushed: bool, - decoded: Vec, -} - -struct AudioTrackState { - decoder: AudioTrackDecoder, - next_sample: usize, - /// Sample index (in native-rate frames) of `buf[0]` relative to track start (0). - decoded_pos: i64, - /// Interleaved or planar? Planar: one `Vec` per channel. - buf: Vec>, -} - -struct AudioTrackEntry { - track_idx: usize, - native_rate: u32, - state: Mutex, -} - -struct Mp4H264Source { - info: MediaInfo, - source: SharedBytes, - file: Mp4File, - video_track_idx: usize, - container_color: Option, - par: (u32, u32), - video: Mutex, - audio_tracks: Vec, -} - -impl MediaSource for Mp4H264Source { - fn info(&self) -> &MediaInfo { - &self.info - } - - fn video_frame(&self, req: FrameRequest) -> Result> { - let track = &self.file.tracks[self.video_track_idx]; - let t_track = tick_to_units(req.time, track.timescale); - let target_idx = track.sample_at_presentation_time(t_track).ok_or_else(|| MediaError::Decode("no video samples".into()))?; - let target_pts = track.samples[target_idx].pts; - - let mut state = self.video.lock().unwrap_or_else(std::sync::PoisonError::into_inner); - if let Some(hit) = state.decoded.iter().find(|c| c.pts == target_pts) { - return Ok(hit.frame.clone()); - } - - let sync_idx = track.sync_sample_before(target_idx); - // Backward seek or jump to a later GOP: reset the decoder to the target sync sample. - if target_idx < state.next_decode_idx || sync_idx > state.gop_start_idx { - state.decoder.reset().map_err(|e| MediaError::Decode(e.to_string()))?; - state.decoded.clear(); - state.next_decode_idx = sync_idx; - state.gop_start_idx = sync_idx; - state.flushed = false; - } - - let want_draft = req.scale < 0.99; - if state.decoder.draft() != want_draft { - state.decoder.set_draft(want_draft); - } - - while !state.decoded.iter().any(|c| c.pts >= target_pts) { - if filmcraft_media::cancel::cancelled() { - return Err(MediaError::Cancelled); - } - if state.next_decode_idx < track.samples.len() { - let idx = state.next_decode_idx; - let sample = track.samples[idx]; - let pkt = self.file.read_sample(&*self.source, self.video_track_idx, idx).map_err(|e| MediaError::Io(e.to_string()))?; - let frames = state.decoder.decode(&pkt, sample.pts).map_err(|e| MediaError::Decode(e.to_string()))?; - state.next_decode_idx = idx + 1; - push_decoded(&mut state.decoded, frames, self.container_color, self.par, track.timescale, track.edit_offset)?; - } else if !state.flushed { - let frames = state.decoder.flush().map_err(|e| MediaError::Decode(e.to_string()))?; - state.flushed = true; - push_decoded(&mut state.decoded, frames, self.container_color, self.par, track.timescale, track.edit_offset)?; - break; - } else { - break; - } - } - - if let Some(exact) = state.decoded.iter().find(|c| c.pts == target_pts) { - return Ok(exact.frame.clone()); - } - // Fallback: latest decoded frame at or before target_pts, or earliest available. - let best = state - .decoded - .iter() - .filter(|c| c.pts <= target_pts) - .max_by_key(|c| c.pts) - .or_else(|| state.decoded.first()) - .ok_or_else(|| MediaError::Decode("H.264 decoder produced no frame".into()))?; - Ok(best.frame.clone()) - } - - fn audio(&self, start: i64, frames: usize, sample_rate: u32) -> Result { - self.audio_stream(0, start, frames, sample_rate) - } - - fn audio_stream(&self, stream: usize, start: i64, frames: usize, sample_rate: u32) -> Result { - let entry = self.audio_tracks.get(stream).ok_or(MediaError::NoStream("audio"))?; - if sample_rate == 0 { - return Err(MediaError::Decode("invalid audio sample rate 0".into())); - } - let channels_count = self.info.audio_streams.get(stream).map_or(2, |s| s.channels as usize); - if frames == 0 { - return Ok(AudioBuffer::new(sample_rate, channels_count as u16, 0)); - } - - let native_rate = entry.native_rate; - let (native_start, native_frames) = if sample_rate == native_rate { - (start, frames) - } else { - let s0 = (i128::from(start) * i128::from(native_rate)) / i128::from(sample_rate); - let len = ((frames as u128 * u128::from(native_rate)).div_ceil(u128::from(sample_rate)) + 2) as usize; - (i64::try_from(s0).unwrap_or(0), len) - }; - - let track = &self.file.tracks[entry.track_idx]; - let mut state = entry.state.lock().unwrap_or_else(std::sync::PoisonError::into_inner); - let decoded = - decode_audio_range(&self.file, &*self.source, entry.track_idx, track, native_rate, channels_count, &mut state, native_start, native_frames)?; - - if sample_rate == native_rate { - return Ok(AudioBuffer { sample_rate, channels: decoded }); - } - - let mut resampled = vec![vec![0.0f32; frames]; channels_count]; - let ratio = f64::from(native_rate) / f64::from(sample_rate); - for (c, out_ch) in resampled.iter_mut().enumerate() { - let in_ch = &decoded[c]; - if in_ch.is_empty() { - continue; - } - for (i, dst) in out_ch.iter_mut().enumerate() { - let pos = i as f64 * ratio; - let idx = pos.floor() as usize; - let frac = (pos - idx as f64) as f32; - let s0 = in_ch.get(idx).copied().unwrap_or(0.0); - let s1 = in_ch.get(idx + 1).copied().unwrap_or(s0); - *dst = s0 + (s1 - s0) * frac; - } - } - Ok(AudioBuffer { sample_rate, channels: resampled }) - } -} - -#[allow(clippy::too_many_arguments)] -fn decode_audio_range( - file: &Mp4File, - source: &dyn ByteSource, - track_idx: usize, - track: &Track, - native_rate: u32, - channels_count: usize, - state: &mut AudioTrackState, - start: i64, - frames: usize, -) -> Result>> { - let mut out = vec![vec![0.0f32; frames]; channels_count]; - let end = start.saturating_add(frames as i64); - if end <= 0 { - return Ok(out); - } - - let buf_len = state.buf.first().map_or(0, Vec::len) as i64; - let buf_end = state.decoded_pos.saturating_add(buf_len); - if start < state.decoded_pos || start > buf_end + i64::from(native_rate) * 2 { - // Seek to the sample at or before `start` in track timescale. - let t_track = (i128::from(start.max(0)) * i128::from(track.timescale)) / i128::from(native_rate); - let sample_idx = track.sample_at_presentation_time(i64::try_from(t_track).unwrap_or(0)).unwrap_or(0); - // Back up a few packets for AAC/Opus overlap/preroll. - let seek_idx = sample_idx.saturating_sub(2); - state.decoder.reset(); - state.next_sample = seek_idx; - let sample_pts = track.presentation_pts(seek_idx).unwrap_or(0); - state.decoded_pos = i64::try_from((i128::from(sample_pts) * i128::from(native_rate)) / i128::from(track.timescale.max(1))).unwrap_or(0); - for ch in &mut state.buf { - ch.clear(); - } - } - - if state.buf.len() != channels_count { - state.buf = vec![Vec::new(); channels_count]; - } - - while state.decoded_pos + state.buf.first().map_or(0, Vec::len) as i64 <= end && state.next_sample < track.samples.len() { - if filmcraft_media::cancel::cancelled() { - return Err(MediaError::Cancelled); - } - let idx = state.next_sample; - let pkt = file.read_sample(source, track_idx, idx).map_err(|e| MediaError::Io(e.to_string()))?; - state.next_sample = idx + 1; - let block = state.decoder.decode(&pkt).map_err(|e| MediaError::Decode(e.to_string()))?; - for (c, ch) in state.buf.iter_mut().enumerate() { - if let Some(src_ch) = block.channels.get(c) { - ch.extend_from_slice(src_ch); - } - } - } - - let avail = state.buf.first().map_or(0, Vec::len); - for i in 0..frames { - let pos = start.saturating_add(i as i64); - if pos >= state.decoded_pos { - let off = (pos - state.decoded_pos) as usize; - if off < avail { - for (c, out_ch) in out.iter_mut().enumerate() { - out_ch[i] = state.buf[c][off]; - } - } - } - } - - // Trim already-consumed audio older than `end` minus a small safety margin. - let drop_to = (end - state.decoded_pos).max(0) as usize; - let trim = drop_to.min(avail); - if trim > 0 { - for ch in &mut state.buf { - ch.drain(..trim); - } - state.decoded_pos = state.decoded_pos.saturating_add(trim as i64); - } - - Ok(out) -} - -fn push_decoded( - cache: &mut Vec, - frames: Vec, - container_color: Option, - par: (u32, u32), - timescale: u32, - edit_offset: i64, -) -> Result<()> { - for vf in frames { - let pts = vf.pts.unwrap_or(0); - let frame = Arc::new(to_craft_frame(vf, container_color, par, timescale, edit_offset)?); - cache.push(CachedFrame { pts, frame }); - } - if cache.len() > MAX_CACHED_FRAMES { - let excess = cache.len() - MAX_CACHED_FRAMES; - cache.drain(..excess); - } - Ok(()) -} - -fn to_craft_frame(vf: DecodedVideoFrame, container_color: Option, default_par: (u32, u32), timescale: u32, edit_offset: i64) -> Result { - let width = vf.width(); - let height = vf.height(); - let subsampling = vf.subsampling(); - let family = vf.family(); - let tags = vf.color; - let pts_units = vf.pts.unwrap_or(0).saturating_add(edit_offset); - let pts = Tick::from_units(pts_units, i64::from(timescale.max(1))); - let par = vf.sar.filter(|&(n, d)| n > 0 && d > 0).unwrap_or(default_par); - let color = resolve_color(tags, container_color); - let bit_depth = vf.bit_depth(); - let (planes, alpha) = vf.into_planes(); - - let data = match family { - ColorFamily::YCbCr => { - let chroma = match subsampling { - Subsampling::S420 => Chroma::C420, - Subsampling::S422 => Chroma::C422, - Subsampling::S444 => Chroma::C444, - _ => return Err(MediaError::Unsupported("unsupported YCbCr subsampling".into())), - }; - let mut iter = planes.into_iter(); - let (Some(y), Some(cb), Some(cr)) = (iter.next(), iter.next(), iter.next()) else { - return Err(MediaError::Decode("missing YUV planes".into())); - }; - if bit_depth <= 8 { - let y = Arc::new(plane_u8(y)?); - let cb = Arc::new(plane_u8(cb)?); - let cr = Arc::new(plane_u8(cr)?); - let a = alpha.map(plane_u8).transpose()?.map(Arc::new); - PixelData::Yuv8 { planes: [y, cb, cr], chroma, alpha: a } - } else { - let y = Arc::new(plane_u16(y)?); - let cb = Arc::new(plane_u16(cb)?); - let cr = Arc::new(plane_u16(cr)?); - let a = alpha.map(plane_u16).transpose()?.map(Arc::new); - PixelData::Yuv16 { planes: [y, cb, cr], chroma, bits: u32::from(bit_depth), alpha: a } - } - } - ColorFamily::Rgb | ColorFamily::Gray => return Err(MediaError::Unsupported("non-YCbCr H.264 pixel format".into())), - }; - - Ok(VideoFrame { width, height, data, color, par, pts }) -} - -fn plane_u8(p: Plane) -> Result> { - let (w, h, stride) = (p.width() as usize, p.height() as usize, p.stride()); - match p.into_samples() { - Samples::U8(mut v) => { - if stride == w { - v.truncate(w * h); - return Ok(v); - } - let mut out = Vec::with_capacity(w * h); - for y in 0..h { - let row = y * stride; - out.extend_from_slice(&v[row..row + w]); - } - Ok(out) - } - Samples::U16(_) => Err(MediaError::Decode("expected 8-bit plane".into())), - } -} - -fn plane_u16(p: Plane) -> Result> { - let (w, h, stride) = (p.width() as usize, p.height() as usize, p.stride()); - match p.into_samples() { - Samples::U16(mut v) => { - if stride == w { - v.truncate(w * h); - return Ok(v); - } - let mut out = Vec::with_capacity(w * h); - for y in 0..h { - let row = y * stride; - out.extend_from_slice(&v[row..row + w]); - } - Ok(out) - } - Samples::U8(_) => Err(MediaError::Decode("expected 16-bit plane".into())), - } -} - -fn resolve_color(vui: ColorTags, container: Option) -> ColorInfo { - let base = container.unwrap_or(ColorInfo::REC709); - let matrix = Matrix::from_code(vui.matrix).unwrap_or(base.matrix); - let transfer = Transfer::from_code(vui.transfer).unwrap_or(base.transfer); - let primaries = primaries_from_code(vui.primaries).unwrap_or(base.primaries); - let range = if vui.full_range { Range::Full } else { base.range }; - ColorInfo { matrix, transfer, primaries, range } -} - -fn color_from_isobmff(c: &isobmff::ColorInfo) -> ColorInfo { - match c { - isobmff::ColorInfo::Nclx { primaries, transfer, matrix, full_range } => ColorInfo { - matrix: u8::try_from(*matrix).ok().and_then(Matrix::from_code).unwrap_or(Matrix::Bt709), - transfer: u8::try_from(*transfer).ok().and_then(Transfer::from_code).unwrap_or(Transfer::Bt709), - primaries: u8::try_from(*primaries).ok().and_then(primaries_from_code).unwrap_or(Primaries::Bt709), - range: if *full_range { Range::Full } else { Range::Limited }, - }, - isobmff::ColorInfo::Nclc { primaries, transfer, matrix } => ColorInfo { - matrix: u8::try_from(*matrix).ok().and_then(Matrix::from_code).unwrap_or(Matrix::Bt709), - transfer: u8::try_from(*transfer).ok().and_then(Transfer::from_code).unwrap_or(Transfer::Bt709), - primaries: u8::try_from(*primaries).ok().and_then(primaries_from_code).unwrap_or(Primaries::Bt709), - range: Range::Limited, - }, - isobmff::ColorInfo::Icc { .. } => ColorInfo::REC709, - } -} - -fn primaries_from_code(c: u8) -> Option { - match c { - 1 => Some(Primaries::Bt709), - 5 => Some(Primaries::Bt601_625), - 6 => Some(Primaries::Bt601_525), - 9 => Some(Primaries::Bt2020), - 11 | 12 => Some(Primaries::P3D65), - _ => None, - } -} - -fn tick_to_units(t: Tick, timescale: u32) -> i64 { - let v = (i128::from(t.0) * i128::from(timescale)) / i128::from(craft_time::TICKS_PER_SECOND); - i64::try_from(v).unwrap_or(if v < 0 { i64::MIN } else { i64::MAX }) -} - -fn estimate_frame_rate(track: &Track) -> FrameRate { - let ts = i128::from(track.timescale); - if ts <= 0 || track.samples.is_empty() { - return FrameRate::FPS_30; - } - let mut durs: Vec = track.samples.iter().map(|s| s.duration).filter(|&d| d > 0).collect(); - if durs.is_empty() { - return FrameRate::FPS_30; - } - durs.sort_unstable(); - let median = durs[durs.len() / 2]; - for r in FrameRate::COMMON { - if ts * i128::from(r.den) == i128::from(median) * i128::from(r.num) { - return r; - } - } - let fps = track.timescale as f64 / f64::from(median); - FrameRate::COMMON - .into_iter() - .map(|r| (r, (fps / r.as_f64() - 1.0).abs())) - .filter(|&(_, off)| off <= 0.005) - .min_by(|a, b| a.1.total_cmp(&b.1)) - .map(|(r, _)| r) - .unwrap_or_else(|| FrameRate::new(i64::from(track.timescale), i64::from(median))) -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn worker_cap_is_bounded() { - let cap = worker_cap(); - assert!((1..=MAX_WORKERS).contains(&cap), "cap={cap}"); - } - - #[test] - fn vui_overrides_container_color_and_falls_back_when_unspecified() { - let container = color_from_isobmff(&isobmff::ColorInfo::Nclx { primaries: 9, transfer: 16, matrix: 9, full_range: false }); - assert_eq!(container.primaries, Primaries::Bt2020); - assert_eq!(container.transfer, Transfer::Pq); - assert_eq!(container.matrix, Matrix::Bt2020Ncl); - assert_eq!(container.range, Range::Limited); - - // Unspecified VUI (2) falls back to container color. - let resolved = resolve_color(ColorTags::UNSPECIFIED, Some(container)); - assert_eq!(resolved, container); - - // Explicit VUI overrides container color. - let vui = ColorTags { primaries: 1, transfer: 1, matrix: 1, full_range: true }; - let resolved = resolve_color(vui, Some(container)); - assert_eq!(resolved.primaries, Primaries::Bt709); - assert_eq!(resolved.transfer, Transfer::Bt709); - assert_eq!(resolved.matrix, Matrix::Bt709); - assert_eq!(resolved.range, Range::Full); - } -} diff --git a/crates/media/src/stream.rs b/crates/media/src/stream.rs index 5f81239f3..3bcb9b970 100644 --- a/crates/media/src/stream.rs +++ b/crates/media/src/stream.rs @@ -38,7 +38,7 @@ impl DecodedFrame { } /// An opened movie/audio source, routed through `craft-media-source` for migrated formats -/// (currently software MP4/H.264) and `filmcraft-media` for remaining formats. +/// (ISO-BMFF and Matroska/WebM with supported codecs) and `filmcraft-media` for remaining formats. #[derive(Clone)] pub(crate) enum MediaSource { Craft(craft_media_source::SharedSource), @@ -74,7 +74,7 @@ impl MediaSource { /// Open an in-memory movie/audio source, trying migrated `craft-media-source` routes first. pub(crate) fn open_bytes(name: &str, bytes: Arc<[u8]>) -> Result { - if let Some(res) = crate::mp4_h264::open_bytes(name, bytes.clone()) { + if let Some(res) = crate::craft_source::open_bytes(name, bytes.clone()) { return res.map(MediaSource::Craft).map_err(MediaError::from); } filmcraft_codecs::open_bytes(name, bytes).map(MediaSource::Film).map_err(MediaError::from) @@ -174,7 +174,7 @@ pub(crate) fn open_source(path: &Path) -> Option<(Result, FileStamp let name = name_of(path); let craft_reader: craft_media_source::SharedBytes = reader.clone(); if let Ok(head) = craft_media_source::read_range(&*craft_reader, 0, craft_media_source::HEAD_LEN) - && let Some(res) = crate::mp4_h264::open_reader(&name, &head, &craft_reader) + && let Some(res) = crate::craft_source::open_reader(&name, &head, &craft_reader) { return Some((res.map(MediaSource::Craft).map_err(MediaError::from), stamp)); } @@ -268,7 +268,7 @@ pub(crate) fn probe_source(path: &Path) -> Option> { } let name = name_of(path); let craft_reader: craft_media_source::SharedBytes = reader.clone(); - if let Some(res) = crate::mp4_h264::open_reader(&name, &head, &craft_reader) { + if let Some(res) = crate::craft_source::open_reader(&name, &head, &craft_reader) { return Some(res.map(MediaSource::Craft).map_err(MediaError::from)); } let fc_reader: filmcraft_media::SharedReader = reader; diff --git a/crates/media/tests/it/footage.rs b/crates/media/tests/it/footage.rs index 944a88721..9a350223f 100644 --- a/crates/media/tests/it/footage.rs +++ b/crates/media/tests/it/footage.rs @@ -1361,3 +1361,182 @@ fn h264_bframe_route_backward_seek_cancel_color_and_draft() { pool.cancellable(&on, &mut || resumed = pool.frame(ItemId(1), &f, t_of(f.frame_rate, 20))); assert_eq!(resumed.map(|i| (i.width, i.height)), Some((320, 180))); } + +fn assert_seek_draft_cancel_parity(p: &Path, expected_size: (u32, u32), expected_color: Option) { + use std::sync::atomic::AtomicBool; + let f = probe(p).expect("probe"); + assert_eq!((f.width, f.height), expected_size); + if let Some(c) = expected_color { + assert_eq!(f.color_profile, Some(c)); + } + + let pool = MediaPool::new(); + let f18 = pool.frame(ItemId(1), &f, t_of(f.frame_rate, 18)).expect("frame 18"); + let f13 = pool.frame(ItemId(1), &f, t_of(f.frame_rate, 13)).expect("frame 13"); + let f7 = pool.frame(ItemId(1), &f, t_of(f.frame_rate, 7)).expect("frame 7"); + let f0 = pool.frame(ItemId(1), &f, t_of(f.frame_rate, 0)).expect("frame 0"); + for img in [&f18, &f13, &f7, &f0] { + assert_eq!((img.width, img.height), expected_size); + } + let fresh_f7 = MediaPool::new().frame(ItemId(1), &f, t_of(f.frame_rate, 7)).expect("fresh frame 7"); + assert!(psnr(&f7, &fresh_f7) > 55.0, "backward seek frame 7 must match fresh decode"); + + let (dw, dh) = (expected_size.0 / 2, expected_size.1 / 2); + let draft = pool.frame_at_size(ItemId(1), &f, t_of(f.frame_rate, 5), dw, dh).expect("draft frame"); + let full = pool.frame(ItemId(1), &f, t_of(f.frame_rate, 5)).expect("full frame"); + assert_eq!((draft.width, draft.height), (dw, dh)); + assert!(psnr(&draft, &effectcraft_raster::resample(&full, dw, dh)) > 40.0, "draft frame matches resampled full frame"); + + let off = Arc::new(AtomicBool::new(true)); + let mut cancelled = Some(Arc::clone(&f0)); + pool.cancellable(&off, &mut || cancelled = pool.frame(ItemId(1), &f, t_of(f.frame_rate, 20))); + assert!(cancelled.is_none(), "cancelled read must not decode"); + let on = Arc::new(AtomicBool::new(false)); + let mut resumed = None; + pool.cancellable(&on, &mut || resumed = pool.frame(ItemId(1), &f, t_of(f.frame_rate, 20))); + assert_eq!(resumed.map(|i| (i.width, i.height)), Some(expected_size)); +} + +#[test] +fn hevc_bframe_route_backward_seek_cancel_color_and_draft() { + let Some(p) = try_ffmpeg_fixture( + "hevc_bframes_bt709.mp4", + &[ + "-f", + "lavfi", + "-i", + "testsrc2=size=320x180:rate=24:duration=1", + "-c:v", + "libx265", + "-preset", + "fast", + "-x265-params", + "keyint=12:bframes=2:log-level=error", + "-pix_fmt", + "yuv420p", + "-colorspace", + "bt709", + "-color_primaries", + "bt709", + "-color_trc", + "bt709", + "-color_range", + "tv", + ], + ) else { + return; + }; + assert_seek_draft_cancel_parity(&p, (320, 180), Some(effectcraft_project::ColorSpace::Rec709)); +} + +#[test] +fn vp9_webm_route_backward_seek_cancel_and_draft() { + let Some(p) = vp9_webm() else { return }; + assert_seek_draft_cancel_parity(&p, (640, 360), None); +} + +#[test] +fn draft_and_full_quality_cache_do_not_bleed() { + if h264_encoder() != Some("libx264") { + return; + } + let Some(p) = try_ffmpeg_fixture( + "h264_draft_full_cache.mp4", + &["-f", "lavfi", "-i", "testsrc2=size=320x180:rate=24:duration=1", "-c:v", "libx264", "-preset", "fast", "-bf", "2", "-g", "12", "-pix_fmt", "yuv420p"], + ) else { + return; + }; + let f = probe(&p).expect("probe"); + let pool = MediaPool::new(); + let t = t_of(f.frame_rate, 7); + // Request draft at `t` first, then full quality at the exact same `t` and a neighbour in the same GOP. + let draft = pool.frame_at_size(ItemId(1), &f, t, 160, 90).expect("draft frame"); + assert_eq!((draft.width, draft.height), (160, 90)); + let full = pool.frame_at(&f, t).expect("full frame after draft"); + let full_next = pool.frame_at(&f, t_of(f.frame_rate, 8)).expect("full neighbour after draft"); + let fresh = MediaPool::new().frame_at(&f, t).expect("fresh full frame"); + let fresh_next = MediaPool::new().frame_at(&f, t_of(f.frame_rate, 8)).expect("fresh full neighbour"); + assert!(psnr(&full, &fresh) > 55.0, "full frame after draft must match fresh full decode"); + assert!(psnr(&full_next, &fresh_next) > 55.0, "full GOP neighbour after draft must not reuse draft references"); +} + +#[test] +fn rotated_mp4_matches_reference_orientation() { + if h264_encoder() != Some("libx264") { + return; + } + let Some(p) = try_ffmpeg_fixture( + "h264_rotate_90.mp4", + &["-f", "lavfi", "-i", "testsrc2=size=320x180:rate=24:duration=0.5", "-c:v", "libx264", "-pix_fmt", "yuv420p", "-metadata:s:v:0", "rotate=90"], + ) else { + return; + }; + let f = probe(&p).expect("probe rotated mp4"); + assert_eq!((f.width, f.height), (180, 320), "90-degree rotated mp4 swaps width and height"); + let pool = MediaPool::new(); + let img = pool.frame_at(&f, Tick::ZERO).expect("rotated frame"); + assert_eq!((img.width, img.height), (180, 320)); + assert!(psnr(&img, &reference_frame(&p, 0)) > 35.0, "rotated frame pixels match ffmpeg auto-rotated reference"); +} + +#[test] +fn webm_alpha_falls_back_to_filmcraft_preserving_alpha() { + let Some(p) = try_ffmpeg_fixture( + "vp9_alpha_fallback.webm", + &["-f", "lavfi", "-i", "format=rgba,geq=r='255':g='0':b='0':a='255*X/W':s=128x64:r=24", "-t", "0.25", "-c:v", "libvpx-vp9", "-pix_fmt", "yuva420p"], + ) else { + return; + }; + let f = probe(&p).expect("probe webm alpha"); + assert_eq!(f.alpha, AlphaMode::Straight, "WebM alpha_mode=1 must preserve Straight alpha"); + let pool = MediaPool::new(); + let img = pool.frame_at(&f, Tick::ZERO).expect("webm alpha frame"); + assert!(img.data[0][3] < 0.05 && img.data[127][3] > 0.95, "alpha ramp preserved via fallback"); +} + +#[test] +fn filmcraft_fallback_handles_mjpeg_mov() { + let Some(p) = try_ffmpeg_fixture("mjpeg_fallback.mov", &["-f", "lavfi", "-i", "testsrc2=size=160x120:rate=24:duration=0.25", "-c:v", "mjpeg", "-q:v", "3"]) + else { + return; + }; + let f = probe(&p).expect("probe mjpeg fallback"); + assert_eq!((f.width, f.height), (160, 120)); + let pool = MediaPool::new(); + let img = pool.frame_at(&f, Tick::ZERO).expect("mjpeg fallback frame"); + assert_eq!((img.width, img.height), (160, 120)); +} + +#[test] +fn matroska_opus_audio_timing_and_seek() { + let Some(p) = try_ffmpeg_fixture( + "vp9_opus_timing.webm", + &[ + "-f", + "lavfi", + "-i", + "testsrc2=size=160x120:rate=24:duration=1", + "-f", + "lavfi", + "-i", + "sine=frequency=440:sample_rate=48000:duration=1", + "-c:v", + "libvpx-vp9", + "-c:a", + "libopus", + ], + ) else { + return; + }; + let f = probe(&p).expect("probe webm with opus"); + assert!(f.has_audio, "opus audio stream detected"); + let pool = MediaPool::new(); + let start_audio = pool.audio_samples(&f, Tick::ZERO, 4800, 48_000); + assert_eq!(start_audio.len(), 9600); + let rms_start = (start_audio.iter().map(|v| v * v).sum::() / start_audio.len() as f32).sqrt(); + assert!((rms_start - 0.0625).abs() < 0.02, "opus audio at t=0 rms {rms_start}"); + let seek_audio = pool.audio_samples(&f, Tick(TICKS_PER_SECOND / 2), 4800, 48_000); + assert_eq!(seek_audio.len(), 9600); + let rms_seek = (seek_audio.iter().map(|v| v * v).sum::() / seek_audio.len() as f32).sqrt(); + assert!((rms_seek - 0.0625).abs() < 0.02, "opus audio after seek rms {rms_seek}"); +} From 5b2ee09762766345ab36b765e700a73ed9c1c4a3 Mon Sep 17 00:00:00 2001 From: nazar-gavrylyk Date: Fri, 20 Nov 2026 20:40:09 +0100 Subject: [PATCH 328/451] #805: Docs: drop a stopped helper's exchange file and bound the stop wait --- docs/video-helper-protocol.md | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/docs/video-helper-protocol.md b/docs/video-helper-protocol.md index ab5e7d279..df92305b5 100644 --- a/docs/video-helper-protocol.md +++ b/docs/video-helper-protocol.md @@ -71,7 +71,7 @@ encode.open → encode.opened → (encode.frame → encode.packets)… → encod | `{"op":"encode.open","job":1,"device":"nvenc:0","codec":"h264","width":1920,"height":1080,"rate":[30,1],"bitrate_kbps":15000,"profile":"high","keyint":60,"colour":{"primaries":1,"transfer":1,"matrix":1,"range":"limited"},"slots":[{"in":{"offset":0,"len":3110400},"out":{"offset":3110400,"len":1048576}},…]}` | `{"op":"encode.opened","job":1,"codec_config":"","delay":2}` | `job` is chosen by EffectCraft and is never reused. `slots` is the memory the helper may use, decided by EffectCraft. `codec_config` is the `avcC` (H.264) or `hvcC` (HEVC) record for the MP4 sample entry. `delay` is the number of frames the encoder holds back (B-frames). | | `{"op":"encode.frame","job":1,"frame":0,"slot":0}` | `{"op":"encode.packets","job":1,"frame":0,"packets":[{"offset":0,"len":41230,"pts":0,"dts":-2,"key":true}]}` | The picture is in `slots[0].in`. The reply means the slot may be reused and says where the packets are, inside `slots[0].out`. It may hold no packets (the encoder is still holding frames) or several. | | `{"op":"encode.flush","job":1,"out":{"offset":…,"len":…}}` | `{"op":"encode.packets","job":1,"frame":null,"packets":[…]}` then `{"op":"encode.flushed","job":1}` | The rest of the stream, inside `out`. EffectCraft sizes `out` for the frames the encoder still holds: at least `(delay + 1)` times the length of a slot's `out` region. A packet that still does not fit is `packet_too_large`. | -| `{"op":"encode.close","job":1}` | none | Free everything for the job. EffectCraft sends it after `encode.flushed` or `cancelled`, and frees or reuses the job's regions only then. If the helper was stopped first, there is no reply to wait for: the regions are freed only once every process that can reach them has exited (see [stopping](#timeouts-and-errors)). | +| `{"op":"encode.close","job":1}` | none | Free everything for the job. EffectCraft sends it after `encode.flushed` or `cancelled`, and frees or reuses the job's regions only then. If the helper was stopped first, there is no reply to wait for: the exchange file is dropped and its regions are never reused (see [stopping](#timeouts-and-errors)). | | `{"op":"cancel","job":1}` | `{"op":"cancelled","job":1}` | Stop now. After it sends `cancel`, EffectCraft ignores every reply for the job except `cancelled`, so replies for frames still in flight are not protocol breaks. The helper stops using the job's regions before it replies `cancelled`, and `cancelled` ends every frame of the job that is still outstanding. | - **Packets are MP4 samples.** Each is a sequence of length-prefixed NAL units, every length a @@ -115,12 +115,17 @@ encode.open → encode.opened → (encode.frame → encode.packets)… → encod - **EffectCraft stops the helper** when it exits, closes stdout, sends a line that does not parse or does not fit, breaks the rules above, or misses a timeout. After 3 stops it is turned off and listed in `helper_blocklist.txt` until the user retries in Settings, as for effect helpers. -- **Stopping ends every process the helper started.** A child of the helper can map the exchange - file too, so the regions stay reserved until all of them have exited. EffectCraft starts the - helper in its own process group (Unix) or job object that kills its members when it closes - (Windows), kills the whole group or job, and waits until it is empty. If it cannot confirm that - (a descendant left the group), it does not reuse the regions: it drops the exchange file and - gives the next helper a new one, so a stray process can only write into a file nobody reads. +- **A stopped helper's exchange file is never reused.** A child of the helper can map the exchange + file too, and on Unix it can leave the process group (`setsid`), so EffectCraft does not try to + prove that every such process has exited. After a stop it drops the exchange file and gives the + next helper a new one, so a stray process can only write into a file nobody reads. Regions are + reused only inside one helper process that is still running, after `encode.flushed` or + `cancelled`. +- **Stopping the helper is bounded.** EffectCraft starts the helper in its own process group (Unix) + or a job object that kills its members when it closes (Windows) and kills the whole group or + job. It waits for the helper process to exit for at most 5 s. If something is stuck (for example + in an uninterruptible driver call), it gives up waiting, logs it, and the export fails with an + error instead of hanging. What EffectCraft does with a failure: From 799c687031010a52b870272f167f24bf0373b6dd Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Fri, 20 Nov 2026 21:27:51 +0100 Subject: [PATCH 329/451] fix(media): probe coded ProRes alpha for import defaults --- crates/media/src/craft_source.rs | 15 ++++++++++++++- crates/media/tests/it/footage.rs | 31 +++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/crates/media/src/craft_source.rs b/crates/media/src/craft_source.rs index 24e88cc30..085329242 100644 --- a/crates/media/src/craft_source.rs +++ b/crates/media/src/craft_source.rs @@ -29,6 +29,9 @@ const MAX_CACHED_FRAMES: usize = 32; /// Maximum audio lookahead packets inspected when initializing `craft_audio::TrackDecoder`. const AUDIO_LOOKAHEAD: usize = 8; +/// Complete first-sample read cap for the ProRes alpha probe; larger samples use the legacy route. +const MAX_PRORES_ALPHA_SAMPLE_BYTES: u32 = 32 * 1024 * 1024; + fn worker_cap() -> usize { std::thread::available_parallelism().map_or(4, |n| n.get()).clamp(1, MAX_WORKERS) } @@ -229,7 +232,17 @@ fn open_isobmff(name: &str, source: SharedBytes) -> Option> std::mem::swap(&mut width, &mut height); par = (par.1, par.0); } - let has_alpha = video_track.video().is_some_and(|v| v.depth == 32); + let has_alpha = if video_params.codec == CodecId::ProRes { + // The coded alpha plane is authoritative for ProRes, not the MOV sample-entry depth. + let sample = video_track.samples.first()?; + if sample.size > MAX_PRORES_ALPHA_SAMPLE_BYTES { + return None; + } + let packet = file.read_sample(&*source, video_idx, 0).ok()?; + craft_video::prores::probe(&packet).ok()?.alpha != craft_video::prores::AlphaType::None + } else { + video_track.video().is_some_and(|v| v.depth == 32) + }; let frame_rate = estimate_isobmff_frame_rate(video_track); let duration = Tick::from_units(i64::try_from(video_track.duration).unwrap_or(i64::MAX), i64::from(video_track.timescale)); let bitrate = video_track.entries.first().and_then(|e| e.bitrate).map(|b| u64::from(b.avg_bitrate)).filter(|&b| b > 0); diff --git a/crates/media/tests/it/footage.rs b/crates/media/tests/it/footage.rs index 9a350223f..937bab8dc 100644 --- a/crates/media/tests/it/footage.rs +++ b/crates/media/tests/it/footage.rs @@ -437,6 +437,8 @@ fn rotated_mp4_imports_upright() { #[test] fn prores_4444_with_alpha() { + use craft_media::isobmff::{self, Brand, Mp4Writer, TrackConfig, TrackKind, WriteSample, WriterOptions}; + let Some(p) = prores_mov() else { return }; let f = probe(&p).expect("probe"); assert_eq!(f.kind, FootageKind::Video); @@ -459,6 +461,35 @@ fn prores_4444_with_alpha() { let mut g = f.clone(); g.alpha = AlphaMode::Ignore; assert!(pool.frame_at(&g, Tick::ZERO).expect("frame").data.iter().all(|p| p[3] == 1.0)); + + // Older ProRes writers can signal depth 24 yet carry a coded alpha plane. + let input = std::fs::read(&p).unwrap(); + let source = isobmff::open(input.as_slice()).unwrap(); + let (track_id, track) = source.tracks.iter().enumerate().find(|(_, t)| t.kind == TrackKind::Video).unwrap(); + assert_eq!(track.entries.len(), 1); + let packet = source.read_sample(input.as_slice(), track_id, 0).unwrap(); + let mut entry = track.entries[0].clone(); + entry.video.as_mut().unwrap().depth = 24; + + let mut writer = Mp4Writer::new(std::io::Cursor::new(Vec::new()), WriterOptions::new(Brand::Mov)).unwrap(); + let output_track = writer.add_track(TrackConfig::new(entry, track.timescale)).unwrap(); + let sample = WriteSample { data: &packet, duration: track.samples[0].duration, composition_offset: 0, is_sync: true }; + writer.write_sample(output_track, sample).unwrap(); + let bytes = writer.finish().unwrap().into_inner(); + + let remux = isobmff::open(bytes.as_slice()).unwrap(); + assert_eq!(remux.tracks[0].video().unwrap().depth, 24); + let remux_packet = remux.read_sample(bytes.as_slice(), 0, 0).unwrap(); + assert_ne!(craft_video::prores::probe(&remux_packet).unwrap().alpha, craft_video::prores::AlphaType::None); + + let dir = tempfile::tempdir().unwrap(); + let path = dir.path().join("prores4444_depth24.mov"); + std::fs::write(&path, bytes).unwrap(); + let remuxed = probe(&path).expect("probe depth-24 ProRes"); + assert_eq!(remuxed.codec, "ProRes", "depth-24 fixture must exercise the shared reader, not legacy fallback"); + assert_eq!(remuxed.alpha, AlphaMode::Straight, "coded ProRes alpha overrides the sample-entry depth"); + let img = pool.frame_at(&remuxed, Tick::ZERO).expect("decode depth-24 ProRes frame"); + assert!(img.data[0][3] < 0.02 && img.data[img.width as usize - 1][3] > 0.97); } #[test] From 9a74bb992c2761f3d1a9b8a46a9602e00a99783a Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Fri, 20 Nov 2026 21:40:23 +0100 Subject: [PATCH 330/451] test(media): make ProRes alpha parity coverage unconditional --- crates/media/tests/it/footage.rs | 68 ++++++++++++++++++-------------- 1 file changed, 39 insertions(+), 29 deletions(-) diff --git a/crates/media/tests/it/footage.rs b/crates/media/tests/it/footage.rs index 937bab8dc..e8af44e46 100644 --- a/crates/media/tests/it/footage.rs +++ b/crates/media/tests/it/footage.rs @@ -1,7 +1,7 @@ //! Footage import against ffmpeg as an external oracle. //! -//! Fixtures are generated with ffmpeg into `target/fixtures/media` (never committed); every test -//! skips (passes with a note) when ffmpeg is not installed. Decoded frames are compared with +//! Oracle fixtures are generated with ffmpeg into `target/fixtures/media` (never committed); +//! tests using them skip when ffmpeg is not installed. Decoded frames are compared with //! frames ffmpeg extracts to PNG (PSNR, premultiplied RGBA). use std::path::{Path, PathBuf}; @@ -437,8 +437,6 @@ fn rotated_mp4_imports_upright() { #[test] fn prores_4444_with_alpha() { - use craft_media::isobmff::{self, Brand, Mp4Writer, TrackConfig, TrackKind, WriteSample, WriterOptions}; - let Some(p) = prores_mov() else { return }; let f = probe(&p).expect("probe"); assert_eq!(f.kind, FootageKind::Video); @@ -461,35 +459,47 @@ fn prores_4444_with_alpha() { let mut g = f.clone(); g.alpha = AlphaMode::Ignore; assert!(pool.frame_at(&g, Tick::ZERO).expect("frame").data.iter().all(|p| p[3] == 1.0)); +} - // Older ProRes writers can signal depth 24 yet carry a coded alpha plane. - let input = std::fs::read(&p).unwrap(); - let source = isobmff::open(input.as_slice()).unwrap(); - let (track_id, track) = source.tracks.iter().enumerate().find(|(_, t)| t.kind == TrackKind::Video).unwrap(); - assert_eq!(track.entries.len(), 1); - let packet = source.read_sample(input.as_slice(), track_id, 0).unwrap(); - let mut entry = track.entries[0].clone(); - entry.video.as_mut().unwrap().depth = 24; +/// The alpha mode follows the coded frame, even when a MOV writer signals an inconsistent depth. +#[test] +fn prores_alpha_uses_coded_frame_not_mov_depth() { + use craft_media::isobmff::{self, Brand, FourCc, Mp4Writer, SampleEntry, TrackConfig, WriteSample, WriterOptions}; + use craft_video::prores::{ChromaFormat, Encoder, Frame, Profile}; - let mut writer = Mp4Writer::new(std::io::Cursor::new(Vec::new()), WriterOptions::new(Brand::Mov)).unwrap(); - let output_track = writer.add_track(TrackConfig::new(entry, track.timescale)).unwrap(); - let sample = WriteSample { data: &packet, duration: track.samples[0].duration, composition_offset: 0, is_sync: true }; - writer.write_sample(output_track, sample).unwrap(); - let bytes = writer.finish().unwrap().into_inner(); + let profile = Profile::P4444; + let mut encoder = Encoder::new(profile, 16, 16); + let mut frame = Frame::new(16, 16, ChromaFormat::Yuv444, 16, true).unwrap(); + for row in frame.alpha.as_mut().unwrap().chunks_exact_mut(16) { + row[..8].fill(0); + } + for (depth, mode) in [(24, AlphaMode::Straight), (32, AlphaMode::Ignore)] { + if mode == AlphaMode::Ignore { + frame.alpha = None; + } + let packet = encoder.encode(&frame).unwrap(); + let mut entry = SampleEntry::prores(FourCc(profile.fourcc()), 16, 16); + entry.video.as_mut().unwrap().depth = depth; + let mut writer = Mp4Writer::new(std::io::Cursor::new(Vec::new()), WriterOptions::new(Brand::Mov)).unwrap(); + let output_track = writer.add_track(TrackConfig::new(entry, 24)).unwrap(); + writer.write_sample(output_track, WriteSample { data: &packet, duration: 1, composition_offset: 0, is_sync: true }).unwrap(); + let bytes: Arc<[u8]> = writer.finish().unwrap().into_inner().into(); - let remux = isobmff::open(bytes.as_slice()).unwrap(); - assert_eq!(remux.tracks[0].video().unwrap().depth, 24); - let remux_packet = remux.read_sample(bytes.as_slice(), 0, 0).unwrap(); - assert_ne!(craft_video::prores::probe(&remux_packet).unwrap().alpha, craft_video::prores::AlphaType::None); + let mov = isobmff::open(bytes.as_ref()).unwrap(); + assert_eq!(mov.tracks[0].video().unwrap().depth, depth); + let name = format!("prores4444_depth{depth}.mov"); + let footage = probe_bytes(&name, bytes.clone()).expect("probe ProRes 4444"); + assert_eq!(footage.codec, "ProRes", "must exercise the shared reader, not legacy fallback"); + assert_eq!(footage.alpha, mode, "MOV depth {depth}"); - let dir = tempfile::tempdir().unwrap(); - let path = dir.path().join("prores4444_depth24.mov"); - std::fs::write(&path, bytes).unwrap(); - let remuxed = probe(&path).expect("probe depth-24 ProRes"); - assert_eq!(remuxed.codec, "ProRes", "depth-24 fixture must exercise the shared reader, not legacy fallback"); - assert_eq!(remuxed.alpha, AlphaMode::Straight, "coded ProRes alpha overrides the sample-entry depth"); - let img = pool.frame_at(&remuxed, Tick::ZERO).expect("decode depth-24 ProRes frame"); - assert!(img.data[0][3] < 0.02 && img.data[img.width as usize - 1][3] > 0.97); + let pool = MediaPool::new(); + pool.add_bytes(&name, bytes); + let image = pool.frame_at(&footage, Tick::ZERO).expect("decode ProRes 4444"); + assert_eq!((image.width, image.height), (16, 16)); + let left_alpha = if mode == AlphaMode::Straight { 0.0 } else { 1.0 }; + assert!((image.data[0][3] - left_alpha).abs() < 0.02); + assert!(image.data[15][3] > 0.97); + } } #[test] From f2b569469f0688afe6f150f1f318c2955b82622f Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Fri, 20 Nov 2026 22:20:31 +0100 Subject: [PATCH 331/451] test(media): use array chunks in ProRes alpha fixture --- crates/media/tests/it/footage.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/media/tests/it/footage.rs b/crates/media/tests/it/footage.rs index e8af44e46..f1aff6406 100644 --- a/crates/media/tests/it/footage.rs +++ b/crates/media/tests/it/footage.rs @@ -470,7 +470,7 @@ fn prores_alpha_uses_coded_frame_not_mov_depth() { let profile = Profile::P4444; let mut encoder = Encoder::new(profile, 16, 16); let mut frame = Frame::new(16, 16, ChromaFormat::Yuv444, 16, true).unwrap(); - for row in frame.alpha.as_mut().unwrap().chunks_exact_mut(16) { + for row in frame.alpha.as_mut().unwrap().as_chunks_mut::<16>().0 { row[..8].fill(0); } for (depth, mode) in [(24, AlphaMode::Straight), (32, AlphaMode::Ignore)] { From 09bfaf10280dc1d542b5505d085a3662f0b41ec8 Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Fri, 20 Nov 2026 23:18:34 +0100 Subject: [PATCH 332/451] fix(media): honor clean aperture on movie import --- crates/media/src/craft_source.rs | 225 +++++++++++++++++++++++-------- crates/media/tests/it/footage.rs | 46 ++++++- 2 files changed, 216 insertions(+), 55 deletions(-) diff --git a/crates/media/src/craft_source.rs b/crates/media/src/craft_source.rs index 085329242..f7e31e692 100644 --- a/crates/media/src/craft_source.rs +++ b/crates/media/src/craft_source.rs @@ -9,7 +9,8 @@ use std::sync::{Arc, Mutex}; use craft_audio::{AudioBuffer, TrackDecoder as AudioTrackDecoder}; use craft_color::{ColorInfo, Matrix, Primaries, Range, Transfer}; -use craft_frame::{Chroma, PixelData, VideoFrame}; +use craft_frame::{Chroma, PixelData, Region, VideoFrame}; +use craft_media::bitstream::unescape_rbsp; use craft_media::isobmff::{self, Mp4File}; use craft_media::matroska::{self, MkvFile}; use craft_media::{ByteSource, CodecId, CodecParams}; @@ -209,6 +210,58 @@ where Some((audio_tracks, audio_infos)) } +/// When a codec signals its own visible picture, the aperture is relative to that picture, +/// not the coded dimensions some writers store in the sample entry. +fn nal_visible_size(config: &isobmff::CodecConfig) -> Option<(u32, u32)> { + let (_, _, width, height) = match config { + isobmff::CodecConfig::Avc(avc) => { + if avc.pps.is_empty() { + return None; + } + let sps = avc.sps.iter().find(|n| n.first().is_some_and(|h| h & 0x1f == 7))?; + craft_video::h264::decode::params::Sps::parse(&unescape_rbsp(sps.get(1..)?)).ok()?.crop_rect() + } + isobmff::CodecConfig::Hevc(hevc) => { + let (mut vps, mut sps, mut pps) = (false, None, false); + for nal in hevc.arrays.iter().filter(|a| (32..=34).contains(&a.nal_type)).flat_map(|a| &a.nalus) { + match nal.first().map(|h| (h >> 1) & 0x3f) { + Some(32) => vps = true, + Some(33) if sps.is_none() => sps = Some(nal), + Some(34) => pps = true, + _ => {} + } + } + if !vps || !pps { + return None; + } + craft_video::hevc::decode::params::Sps::parse(&unescape_rbsp(sps?.get(2..)?)).ok()?.crop_rect() + } + _ => return None, + }; + (width != 0 && height != 0).then_some((width, height)) +} + +/// Apply a valid container clean aperture in decoded-picture coordinates, before rotation. +fn clean_aperture_region(aperture: isobmff::CleanAperture, (width, height): (u32, u32)) -> Option { + let ratio = |(n, d): (u32, u32)| (d != 0).then(|| f64::from(n) / f64::from(d)); + let offset = |(n, d): (i32, u32)| (d != 0).then(|| f64::from(n) / f64::from(d)); + let w = ratio(aperture.width)?.round(); + let h = ratio(aperture.height)?.round(); + let dx = offset(aperture.horiz_offset)?; + let dy = offset(aperture.vert_offset)?; + let (frame_width, frame_height) = (f64::from(width), f64::from(height)); + if w < 1.0 || h < 1.0 || w > frame_width || h > frame_height { + return None; + } + let x = ((frame_width - w) / 2.0 + dx).round(); + let y = ((frame_height - h) / 2.0 + dy).round(); + if x < 0.0 || y < 0.0 || x + w > frame_width || y + h > frame_height { + return None; + } + let r = Region { x: x as usize, y: y as usize, w: w as usize, h: h as usize }; + (!r.is_full(width as usize, height as usize)).then_some(r) +} + fn open_isobmff(name: &str, source: SharedBytes) -> Option> { let file = isobmff::open(source.clone()).ok()?; let video_idx = @@ -226,6 +279,13 @@ fn open_isobmff(name: &str, source: SharedBytes) -> Option> .map(|v| (u32::from(v.width), u32::from(v.height))) .filter(|&(w, h)| w > 0 && h > 0) .unwrap_or((video_track.width, video_track.height)); + let aperture = video_track.video().and_then(|v| v.clean_aperture).and_then(|clap| { + (width, height) = nal_visible_size(&video_track.entries[0].codec).unwrap_or((width, height)); + clean_aperture_region(clap, (width, height)) + }); + if let Some(region) = aperture { + (width, height) = (region.w as u32, region.h as u32); + } let mut par = video_track.video().and_then(|v| v.pixel_aspect).filter(|&(n, d)| n > 0 && d > 0).unwrap_or((1, 1)); let rotation = video_track.display_rotation().unwrap_or(0) % 4; if rotation % 2 == 1 { @@ -280,9 +340,7 @@ fn open_isobmff(name: &str, source: SharedBytes) -> Option> source, file: container, video_track_idx: video_idx, - container_color, - par, - rotation, + presentation: FramePresentation { container_color, par, rotation, aperture }, video: Mutex::new(VideoState { decoder: video_decoder, next_decode_idx: 0, gop_start_idx: 0, flushed: false, decoded: Vec::new() }), audio_tracks, }))) @@ -362,9 +420,7 @@ fn open_matroska(name: &str, source: SharedBytes) -> Option source, file: container, video_track_idx: video_idx, - container_color, - par, - rotation, + presentation: FramePresentation { container_color, par, rotation, aperture: None }, video: Mutex::new(VideoState { decoder: video_decoder, next_decode_idx: 0, gop_start_idx: 0, flushed: false, decoded: Vec::new() }), audio_tracks, }))) @@ -399,14 +455,20 @@ struct AudioTrackEntry { state: Mutex, } +#[derive(Clone, Copy)] +struct FramePresentation { + container_color: Option, + par: (u32, u32), + rotation: u8, + aperture: Option, +} + struct CraftMediaSource { info: MediaInfo, source: SharedBytes, file: ContainerFile, video_track_idx: usize, - container_color: Option, - par: (u32, u32), - rotation: u8, + presentation: FramePresentation, video: Mutex, audio_tracks: Vec, } @@ -451,11 +513,11 @@ impl MediaSource for CraftMediaSource { let pkt = self.file.read_sample(&*self.source, self.video_track_idx, idx)?; let frames = state.decoder.decode(&pkt, pts).map_err(|e| MediaError::Decode(e.to_string()))?; state.next_decode_idx = idx + 1; - push_decoded(&mut state.decoded, frames, want_draft, self.container_color, self.par, self.rotation, &self.file, self.video_track_idx)?; + push_decoded(&mut state.decoded, frames, want_draft, self.presentation, &self.file, self.video_track_idx)?; } else if !state.flushed { let frames = state.decoder.flush().map_err(|e| MediaError::Decode(e.to_string()))?; state.flushed = true; - push_decoded(&mut state.decoded, frames, want_draft, self.container_color, self.par, self.rotation, &self.file, self.video_track_idx)?; + push_decoded(&mut state.decoded, frames, want_draft, self.presentation, &self.file, self.video_track_idx)?; break; } else { break; @@ -600,21 +662,18 @@ fn decode_audio_range( Ok(out) } -#[allow(clippy::too_many_arguments)] fn push_decoded( cache: &mut Vec, frames: Vec, draft: bool, - container_color: Option, - par: (u32, u32), - rotation: u8, + presentation: FramePresentation, file: &ContainerFile, track_idx: usize, ) -> Result<()> { for vf in frames { let pts = vf.pts.unwrap_or(0); let pts_tick = file.pts_to_tick(track_idx, pts); - let frame = Arc::new(to_craft_frame(vf, container_color, par, rotation, pts_tick)?); + let frame = Arc::new(to_craft_frame(vf, presentation, pts_tick)?); cache.push(CachedFrame { pts, draft, frame }); } if cache.len() > MAX_CACHED_FRAMES { @@ -624,9 +683,9 @@ fn push_decoded( Ok(()) } -fn to_craft_frame(vf: DecodedVideoFrame, container_color: Option, default_par: (u32, u32), rotation: u8, pts: Tick) -> Result { - let width = vf.width(); - let height = vf.height(); +fn to_craft_frame(vf: DecodedVideoFrame, presentation: FramePresentation, pts: Tick) -> Result { + let FramePresentation { container_color, par: default_par, rotation, aperture } = presentation; + let (mut width, mut height) = (vf.width(), vf.height()); let subsampling = vf.subsampling(); let family = vf.family(); let tags = vf.color; @@ -651,17 +710,21 @@ fn to_craft_frame(vf: DecodedVideoFrame, container_color: Option, def let (Some(y), Some(cb), Some(cr)) = (iter.next(), iter.next(), iter.next()) else { return Err(MediaError::Decode("missing YUV planes".into())); }; + let (luma, chroma_region) = aperture.and_then(|r| aligned_aperture(r, width as usize, height as usize, chroma)).unzip(); + if let Some(r) = luma { + (width, height) = (r.w as u32, r.h as u32); + } if bit_depth <= 8 { - let y = Arc::new(plane_u8(y)?); - let cb = Arc::new(plane_u8(cb)?); - let cr = Arc::new(plane_u8(cr)?); - let a = alpha.map(plane_u8).transpose()?.map(Arc::new); + let y = Arc::new(plane_u8(y, luma)?); + let cb = Arc::new(plane_u8(cb, chroma_region)?); + let cr = Arc::new(plane_u8(cr, chroma_region)?); + let a = alpha.map(|p| plane_u8(p, luma)).transpose()?.map(Arc::new); PixelData::Yuv8 { planes: [y, cb, cr], chroma, alpha: a } } else { - let y = Arc::new(plane_u16(y)?); - let cb = Arc::new(plane_u16(cb)?); - let cr = Arc::new(plane_u16(cr)?); - let a = alpha.map(plane_u16).transpose()?.map(Arc::new); + let y = Arc::new(plane_u16(y, luma)?); + let cb = Arc::new(plane_u16(cb, chroma_region)?); + let cr = Arc::new(plane_u16(cr, chroma_region)?); + let a = alpha.map(|p| plane_u16(p, luma)).transpose()?.map(Arc::new); PixelData::Yuv16 { planes: [y, cb, cr], chroma, bits: u32::from(bit_depth), alpha: a } } } @@ -672,6 +735,20 @@ fn to_craft_frame(vf: DecodedVideoFrame, container_color: Option, def Ok(rotate_frame(frame, rotation)) } +/// Move the origin onto the chroma grid before clipping, keeping the size when it fits. +fn aligned_aperture(region: Region, width: usize, height: usize, chroma: Chroma) -> Option<(Region, Region)> { + let (sx, sy) = chroma.shifts(); + let (xs, ys) = (1usize << sx, 1usize << sy); + let x = region.x.min(width) & !(xs - 1); + let y = region.y.min(height) & !(ys - 1); + let luma = Region { x, y, ..region }.clip(width, height); + if luma.is_empty() || luma.is_full(width, height) { + return None; + } + let chroma = Region { x: luma.x / xs, y: luma.y / ys, w: luma.w.div_ceil(xs), h: luma.h.div_ceil(ys) }; + Some((luma, chroma)) +} + fn rotate_plane(src: &[T], w: usize, h: usize, turns: u8) -> Vec { if w == 0 || h == 0 || src.len() < w * h { return src.to_vec(); @@ -770,52 +847,62 @@ fn rotate_frame(mut frame: VideoFrame, turns: u8) -> VideoFrame { frame } -fn plane_u8(p: Plane) -> Result> { +fn plane_region(aperture: Option, width: usize, height: usize) -> Result { + let r = aperture.unwrap_or(Region { x: 0, y: 0, w: width, h: height }); + if r.clip(width, height) != r { + return Err(MediaError::Decode("clean aperture exceeds a decoded plane".into())); + } + Ok(r) +} + +fn plane_u8(p: Plane, aperture: Option) -> Result> { let (w, h, stride) = (p.width() as usize, p.height() as usize, p.stride()); + let r = plane_region(aperture, w, h)?; match p.into_samples() { Samples::U8(mut v) => { - if stride == w { + if stride == w && r.is_full(w, h) { v.truncate(w * h); return Ok(v); } - let mut out = Vec::with_capacity(w * h); - for y in 0..h { - let row = y * stride; - out.extend_from_slice(&v[row..row + w]); + let mut out = Vec::with_capacity(r.w * r.h); + for y in r.y..r.y + r.h { + let row = y * stride + r.x; + out.extend_from_slice(&v[row..row + r.w]); } Ok(out) } Samples::U16(v) => { - let mut out = Vec::with_capacity(w * h); - for y in 0..h { - let row = y * stride; - out.extend(v[row..row + w].iter().map(|&s| s.min(255) as u8)); + let mut out = Vec::with_capacity(r.w * r.h); + for y in r.y..r.y + r.h { + let row = y * stride + r.x; + out.extend(v[row..row + r.w].iter().map(|&s| s.min(255) as u8)); } Ok(out) } } } -fn plane_u16(p: Plane) -> Result> { +fn plane_u16(p: Plane, aperture: Option) -> Result> { let (w, h, stride) = (p.width() as usize, p.height() as usize, p.stride()); + let r = plane_region(aperture, w, h)?; match p.into_samples() { Samples::U16(mut v) => { - if stride == w { + if stride == w && r.is_full(w, h) { v.truncate(w * h); return Ok(v); } - let mut out = Vec::with_capacity(w * h); - for y in 0..h { - let row = y * stride; - out.extend_from_slice(&v[row..row + w]); + let mut out = Vec::with_capacity(r.w * r.h); + for y in r.y..r.y + r.h { + let row = y * stride + r.x; + out.extend_from_slice(&v[row..row + r.w]); } Ok(out) } Samples::U8(v) => { - let mut out = Vec::with_capacity(w * h); - for y in 0..h { - let row = y * stride; - out.extend(v[row..row + w].iter().map(|&s| u16::from(s))); + let mut out = Vec::with_capacity(r.w * r.h); + for y in r.y..r.y + r.h { + let row = y * stride + r.x; + out.extend(v[row..row + r.w].iter().map(|&s| u16::from(s))); } Ok(out) } @@ -1039,7 +1126,7 @@ mod tests { #[test] fn plane_u8_handles_8bit_u16_storage_as_av1_produces() { - let out = Plane::packed(2, 2, 8, Samples::U16(vec![10, 20, 30, 255])).ok().and_then(|p| plane_u8(p).ok()); + let out = Plane::packed(2, 2, 8, Samples::U16(vec![10, 20, 30, 255])).ok().and_then(|p| plane_u8(p, None).ok()); assert_eq!(out.as_deref(), Some(&[10, 20, 30, 255][..])); } @@ -1074,13 +1161,13 @@ mod tests { #[test] fn plane_stride_and_container_helpers_cover_variants() { if let Ok(p8) = Plane::new(2, 2, 4, 8, Samples::U8(vec![1, 2, 9, 9, 3, 4])) { - assert_eq!(plane_u8(p8).ok().as_deref(), Some(&[1, 2, 3, 4][..])); + assert_eq!(plane_u8(p8, None).ok().as_deref(), Some(&[1, 2, 3, 4][..])); } if let Ok(p16) = Plane::new(2, 2, 4, 10, Samples::U16(vec![10, 20, 99, 99, 30, 40])) { - assert_eq!(plane_u16(p16).ok().as_deref(), Some(&[10, 20, 30, 40][..])); + assert_eq!(plane_u16(p16, None).ok().as_deref(), Some(&[10, 20, 30, 40][..])); } if let Ok(p8_as_16) = Plane::packed(2, 1, 8, Samples::U8(vec![7, 8])) { - assert_eq!(plane_u16(p8_as_16).ok().as_deref(), Some(&[7, 8][..])); + assert_eq!(plane_u16(p8_as_16, None).ok().as_deref(), Some(&[7, 8][..])); } let nclc = color_from_isobmff(&isobmff::ColorInfo::Nclc { primaries: 1, transfer: 1, matrix: 1 }); @@ -1097,6 +1184,35 @@ mod tests { assert_eq!(tick_to_units(Tick(craft_time::TICKS_PER_SECOND), 90000), 90000); } + #[test] + fn clean_aperture_rounds_signed_offsets_and_ignores_invalid_regions() { + let aperture = isobmff::CleanAperture { width: (17, 2), height: (15, 2), horiz_offset: (1, 2), vert_offset: (-1, 2) }; + assert_eq!(clean_aperture_region(aperture, (16, 16)), Some(Region { x: 4, y: 4, w: 9, h: 8 })); + assert_eq!(clean_aperture_region(isobmff::CleanAperture { width: (17, 0), ..aperture }, (16, 16)), None); + assert_eq!(clean_aperture_region(isobmff::CleanAperture { horiz_offset: (10, 1), ..aperture }, (16, 16)), None); + let full = isobmff::CleanAperture { width: (16, 1), height: (16, 1), horiz_offset: (0, 1), vert_offset: (0, 1) }; + assert_eq!(clean_aperture_region(full, (16, 16)), None); + } + + #[test] + fn odd_clean_aperture_crops_luma_chroma_and_alpha_together() { + let luma = Plane::packed(6, 6, 8, Samples::U8((0..36).collect())).unwrap(); + let chroma = Plane::packed(3, 3, 8, Samples::U8((0..9).collect())).unwrap(); + let alpha = Plane::packed(6, 6, 8, Samples::U8((64..100).collect())).unwrap(); + let frame = DecodedVideoFrame::new(6, 6, ColorFamily::YCbCr, Subsampling::S420, vec![luma, chroma.clone(), chroma], Some(alpha)).unwrap(); + let aperture = Some(Region { x: 3, y: 3, w: 3, h: 3 }); + let presentation = FramePresentation { container_color: None, par: (3, 2), rotation: 0, aperture }; + let cropped = to_craft_frame(frame, presentation, Tick::ZERO).unwrap(); + assert_eq!((cropped.width, cropped.height, cropped.par), (3, 3, (3, 2))); + let PixelData::Yuv8 { planes: [y, cb, cr], chroma: Chroma::C420, alpha: Some(a) } = cropped.data else { + panic!("expected cropped 4:2:0 with alpha"); + }; + assert_eq!(y.as_slice(), &[14, 15, 16, 20, 21, 22, 26, 27, 28]); + assert_eq!(cb.as_slice(), &[4, 5, 7, 8]); + assert_eq!(cr.as_slice(), cb.as_slice()); + assert_eq!(a.as_slice(), &[78, 79, 80, 84, 85, 86, 90, 91, 92]); + } + #[test] fn rotated_frame_preserves_container_par_without_double_inversion() { let make_vf = |sar: Option<(u32, u32)>| { @@ -1109,13 +1225,14 @@ mod tests { }; // `default_par` is already rotated by the container opener (e.g. (4, 3) -> (3, 4) for 90°). let container_rotated_par = (3, 4); + let presentation = FramePresentation { container_color: None, par: container_rotated_par, rotation: 1, aperture: None }; if let Some(vf_no_sar) = make_vf(None) { - let out = to_craft_frame(vf_no_sar, None, container_rotated_par, 1, Tick::ZERO).ok(); + let out = to_craft_frame(vf_no_sar, presentation, Tick::ZERO).ok(); assert_eq!(out.map(|f| f.par), Some((3, 4))); } // Decoder-supplied SAR is in coded coordinates and must be inverted once under 90° rotation. if let Some(vf_with_sar) = make_vf(Some((4, 3))) { - let out = to_craft_frame(vf_with_sar, None, container_rotated_par, 1, Tick::ZERO).ok(); + let out = to_craft_frame(vf_with_sar, presentation, Tick::ZERO).ok(); assert_eq!(out.map(|f| f.par), Some((3, 4))); } } diff --git a/crates/media/tests/it/footage.rs b/crates/media/tests/it/footage.rs index f1aff6406..3aded20bc 100644 --- a/crates/media/tests/it/footage.rs +++ b/crates/media/tests/it/footage.rs @@ -385,7 +385,10 @@ fn resampled_audio_read_in_frame_pieces_matches_ffmpeg() { /// The H.264 fixture with the rotation part of its video track header's matrix (`[a b; c d]`, /// 16.16 fixed point) replaced: what a phone writes for a movie shot with the camera turned. fn turned_mp4(p: &Path, abcd: [i32; 4]) -> Arc<[u8]> { - let mut bytes = std::fs::read(p).expect("read"); + turn_mp4_bytes(std::fs::read(p).expect("read"), abcd) +} + +fn turn_mp4_bytes(mut bytes: Vec, abcd: [i32; 4]) -> Arc<[u8]> { // (The video track comes first; a version 0 `tkhd` has its matrix 44 bytes after the type.) let at = bytes.windows(4).position(|w| w == b"tkhd").expect("tkhd"); assert_eq!(bytes[at + 4], 0, "a version 0 tkhd"); @@ -502,6 +505,47 @@ fn prores_alpha_uses_coded_frame_not_mov_depth() { } } +/// A synthetic asymmetrical aperture and rotation must determine what the shared importer shows. +#[test] +fn mov_renders_clean_aperture_before_display_rotation() { + use craft_media::isobmff::{self, Brand, CleanAperture, FourCc, Mp4Writer, SampleEntry, TrackConfig, WriteSample, WriterOptions}; + use craft_video::prores::{ChromaFormat, Encoder, Frame, Profile}; + + let profile = Profile::P4444; + let mut frame = Frame::new(16, 16, ChromaFormat::Yuv444, 16, true).unwrap(); + // Our generated alpha value uniquely labels each source coordinate. + for (i, p) in frame.alpha.as_mut().unwrap().iter_mut().enumerate() { + *p = i as u16 * 257; + } + let packet = Encoder::new(profile, 16, 16).encode(&frame).unwrap(); + let mut entry = SampleEntry::prores(FourCc(profile.fourcc()), 16, 16); + let clean_aperture = CleanAperture { width: (8, 1), height: (12, 1), horiz_offset: (2, 1), vert_offset: (-1, 1) }; + entry.video.as_mut().unwrap().clean_aperture = Some(clean_aperture); + let mut writer = Mp4Writer::new(std::io::Cursor::new(Vec::new()), WriterOptions::new(Brand::Mov)).unwrap(); + let track = writer.add_track(TrackConfig::new(entry, 24)).unwrap(); + writer.write_sample(track, WriteSample { data: &packet, duration: 1, composition_offset: 0, is_sync: true }).unwrap(); + let bytes = turn_mp4_bytes(writer.finish().unwrap().into_inner(), [0, 0x1_0000, -0x1_0000, 0]); + + let mov = isobmff::open(bytes.as_ref()).unwrap(); + assert_eq!(mov.tracks[0].video().unwrap().clean_aperture, Some(clean_aperture)); + assert_eq!(mov.tracks[0].display_rotation(), Some(1)); + let name = "turned_clean_aperture.mov"; + let footage = probe_bytes(name, bytes.clone()).expect("probe the cropped MOV"); + assert_eq!(footage.codec, "ProRes", "must exercise the shared reader, not legacy fallback"); + assert_eq!((footage.width, footage.height), (12, 8)); + + let pool = MediaPool::new(); + pool.add_bytes(name, bytes); + let image = pool.frame_at(&footage, Tick::ZERO).expect("render the cropped MOV"); + assert_eq!((image.width, image.height), (12, 8)); + for (x, y) in [(0, 0), (11, 0), (0, 7), (11, 7), (4, 3)] { + // Rotate 90° after cropping the source box (6, 1, 8, 12). + let source = (6 + y, 12 - x); + let expected = (source.0 + 16 * source.1) as f32 / 255.0; + assert!((image.data[y * 12 + x][3] - expected).abs() < 0.01, "pixel {x},{y} must come from {source:?}"); + } +} + #[test] fn vp9_webm_frames() { let Some(p) = vp9_webm() else { return }; From 46391758e05984189b8b1516bfc9b7c85c261596 Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Sat, 21 Nov 2026 00:16:54 +0100 Subject: [PATCH 333/451] fix(media): resolve clean aperture on the decoded picture --- crates/media/src/craft_source.rs | 57 ++++++++++++++++++++++++-------- crates/media/tests/it/footage.rs | 2 +- 2 files changed, 44 insertions(+), 15 deletions(-) diff --git a/crates/media/src/craft_source.rs b/crates/media/src/craft_source.rs index f7e31e692..c3a23c01f 100644 --- a/crates/media/src/craft_source.rs +++ b/crates/media/src/craft_source.rs @@ -210,15 +210,19 @@ where Some((audio_tracks, audio_infos)) } -/// When a codec signals its own visible picture, the aperture is relative to that picture, -/// not the coded dimensions some writers store in the sample entry. -fn nal_visible_size(config: &isobmff::CodecConfig) -> Option<(u32, u32)> { +/// A probe hint only: a single configured SPS can signal a visible size different from the +/// sample entry. Multiple or in-band parameter sets leave the initial hint to the container. +fn nal_visible_size_hint(config: &isobmff::CodecConfig) -> Option<(u32, u32)> { let (_, _, width, height) = match config { isobmff::CodecConfig::Avc(avc) => { if avc.pps.is_empty() { return None; } - let sps = avc.sps.iter().find(|n| n.first().is_some_and(|h| h & 0x1f == 7))?; + let mut sets = avc.sps.iter().filter(|n| n.first().is_some_and(|h| h & 0x1f == 7)); + let sps = sets.next()?; + if sets.next().is_some() { + return None; + } craft_video::h264::decode::params::Sps::parse(&unescape_rbsp(sps.get(1..)?)).ok()?.crop_rect() } isobmff::CodecConfig::Hevc(hevc) => { @@ -226,7 +230,8 @@ fn nal_visible_size(config: &isobmff::CodecConfig) -> Option<(u32, u32)> { for nal in hevc.arrays.iter().filter(|a| (32..=34).contains(&a.nal_type)).flat_map(|a| &a.nalus) { match nal.first().map(|h| (h >> 1) & 0x3f) { Some(32) => vps = true, - Some(33) if sps.is_none() => sps = Some(nal), + Some(33) if sps.is_some() => return None, + Some(33) => sps = Some(nal), Some(34) => pps = true, _ => {} } @@ -279,12 +284,14 @@ fn open_isobmff(name: &str, source: SharedBytes) -> Option> .map(|v| (u32::from(v.width), u32::from(v.height))) .filter(|&(w, h)| w > 0 && h > 0) .unwrap_or((video_track.width, video_track.height)); - let aperture = video_track.video().and_then(|v| v.clean_aperture).and_then(|clap| { - (width, height) = nal_visible_size(&video_track.entries[0].codec).unwrap_or((width, height)); - clean_aperture_region(clap, (width, height)) - }); - if let Some(region) = aperture { - (width, height) = (region.w as u32, region.h as u32); + // Probe needs dimensions before decoding. Retain the original rational aperture separately + // so frame conversion can use the actual visible size, even with in-band parameter sets. + let aperture = video_track.video().and_then(|v| v.clean_aperture); + if let Some(clap) = aperture { + (width, height) = nal_visible_size_hint(&video_track.entries[0].codec).unwrap_or((width, height)); + if let Some(region) = clean_aperture_region(clap, (width, height)) { + (width, height) = (region.w as u32, region.h as u32); + } } let mut par = video_track.video().and_then(|v| v.pixel_aspect).filter(|&(n, d)| n > 0 && d > 0).unwrap_or((1, 1)); let rotation = video_track.display_rotation().unwrap_or(0) % 4; @@ -460,7 +467,7 @@ struct FramePresentation { container_color: Option, par: (u32, u32), rotation: u8, - aperture: Option, + aperture: Option, } struct CraftMediaSource { @@ -710,7 +717,10 @@ fn to_craft_frame(vf: DecodedVideoFrame, presentation: FramePresentation, pts: T let (Some(y), Some(cb), Some(cr)) = (iter.next(), iter.next(), iter.next()) else { return Err(MediaError::Decode("missing YUV planes".into())); }; - let (luma, chroma_region) = aperture.and_then(|r| aligned_aperture(r, width as usize, height as usize, chroma)).unzip(); + let (luma, chroma_region) = aperture + .and_then(|clap| clean_aperture_region(clap, (width, height))) + .and_then(|r| aligned_aperture(r, width as usize, height as usize, chroma)) + .unzip(); if let Some(r) = luma { (width, height) = (r.w as u32, r.h as u32); } @@ -1200,7 +1210,7 @@ mod tests { let chroma = Plane::packed(3, 3, 8, Samples::U8((0..9).collect())).unwrap(); let alpha = Plane::packed(6, 6, 8, Samples::U8((64..100).collect())).unwrap(); let frame = DecodedVideoFrame::new(6, 6, ColorFamily::YCbCr, Subsampling::S420, vec![luma, chroma.clone(), chroma], Some(alpha)).unwrap(); - let aperture = Some(Region { x: 3, y: 3, w: 3, h: 3 }); + let aperture = Some(isobmff::CleanAperture { width: (3, 1), height: (3, 1), horiz_offset: (3, 2), vert_offset: (3, 2) }); let presentation = FramePresentation { container_color: None, par: (3, 2), rotation: 0, aperture }; let cropped = to_craft_frame(frame, presentation, Tick::ZERO).unwrap(); assert_eq!((cropped.width, cropped.height, cropped.par), (3, 3, (3, 2))); @@ -1213,6 +1223,25 @@ mod tests { assert_eq!(a.as_slice(), &[78, 79, 80, 84, 85, 86, 90, 91, 92]); } + #[test] + fn clean_aperture_uses_the_decoded_picture_not_a_coded_size_hint() { + let luma = Plane::packed(8, 6, 8, Samples::U8((0..48).collect())).unwrap(); + let chroma = Plane::packed(8, 6, 8, Samples::U8(vec![128; 48])).unwrap(); + let frame = DecodedVideoFrame::new(8, 6, ColorFamily::YCbCr, Subsampling::S444, vec![luma, chroma.clone(), chroma], None).unwrap(); + let aperture = isobmff::CleanAperture { width: (4, 1), height: (4, 1), horiz_offset: (0, 1), vert_offset: (0, 1) }; + // A coded/sample-entry size of 8×8 would put the crop one row too low on the decoded + // 8×6 picture. The aperture remains in rational form until this picture is available. + assert_eq!(clean_aperture_region(aperture, (8, 8)).unwrap().y, 2); + let presentation = FramePresentation { container_color: None, par: (1, 1), rotation: 0, aperture: Some(aperture) }; + let cropped = to_craft_frame(frame, presentation, Tick::ZERO).unwrap(); + assert_eq!((cropped.width, cropped.height), (4, 4)); + let y = match &cropped.data { + PixelData::Yuv8 { planes, .. } => &planes[0], + _ => panic!("expected cropped luma"), + }; + assert_eq!(y.as_slice(), &[10, 11, 12, 13, 18, 19, 20, 21, 26, 27, 28, 29, 34, 35, 36, 37]); + } + #[test] fn rotated_frame_preserves_container_par_without_double_inversion() { let make_vf = |sar: Option<(u32, u32)>| { diff --git a/crates/media/tests/it/footage.rs b/crates/media/tests/it/footage.rs index 3aded20bc..593ab49f7 100644 --- a/crates/media/tests/it/footage.rs +++ b/crates/media/tests/it/footage.rs @@ -542,7 +542,7 @@ fn mov_renders_clean_aperture_before_display_rotation() { // Rotate 90° after cropping the source box (6, 1, 8, 12). let source = (6 + y, 12 - x); let expected = (source.0 + 16 * source.1) as f32 / 255.0; - assert!((image.data[y * 12 + x][3] - expected).abs() < 0.01, "pixel {x},{y} must come from {source:?}"); + assert!((image.data[y * 12 + x][3] - expected).abs() < 0.002, "pixel {x},{y} must come from {source:?}"); } } From 88a59fd77d3f89c718f13f15914683cdd0deee81 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Fri, 20 Nov 2026 19:32:40 -0500 Subject: [PATCH 334/451] media: route audio-only ISO-BMFF and Matroska/WebM through craft-audio (#4004) * media: route audio-only ISO-BMFF and Matroska/WebM through craft-audio * media: use MediaKind::AudioOnly for audio-only CraftMediaSource * media: take max duration across all Matroska audio tracks --- crates/media/src/craft_source.rs | 278 ++++++++++++++++++------------- crates/media/tests/it/footage.rs | 27 +++ 2 files changed, 188 insertions(+), 117 deletions(-) diff --git a/crates/media/src/craft_source.rs b/crates/media/src/craft_source.rs index c3a23c01f..85b5b5447 100644 --- a/crates/media/src/craft_source.rs +++ b/crates/media/src/craft_source.rs @@ -1,9 +1,24 @@ -//! ISO-BMFF (MP4/MOV) and Matroska/WebM media-reader routes backed by `craft-media`, -//! `craft-video`, `craft-audio`, and `craft-media-source`. +//! ISO-BMFF (MP4/MOV/M4A) and Matroska/WebM (MKV/MKA/WebM) media-reader routes backed by +//! `craft-media`, `craft-video`, `craft-audio`, and `craft-media-source`. //! //! Preserves sync-sample backward seek, B-frame reordering, cooperative cancellation, VUI + //! container colour resolution, draft mode for reduced-resolution playback, and bounded worker //! threads, while falling back to `filmcraft-codecs` for unsupported codecs or audio streams. +//! +//! ## Route Matrix (`crates/media`) +//! - **ISO-BMFF (`MP4`/`MOV`/`M4A`, video+audio & audio-only)**: +//! - Shared (`craft-media::isobmff` + `craft-video` + `craft-audio`): `H264`, `Hevc`, `Av1`, +//! `Vp9`, `Vp8`, `ProRes` (coded alpha via `craft_video::prores::probe`, #3999), `Dnxhd`, +//! `Mpeg2Video`; audio `Aac`, `Alac`, `Opus`, `Ac3`, `Mp3`/`Mp2`/`Mp1`. +//! - Fallback (`filmcraft-codecs`): `Mjpeg`, `Mpeg4Video`, `Ffv1`, `Apv`, or unsupported audio. +//! - **Matroska / WebM (`MKV`/`MKA`/`WebM`, video+audio & audio-only)**: +//! - Shared (`craft-media::matroska` + `craft-video` + `craft-audio`): `H264`, `Hevc`, `Av1`, +//! `Vp9`, `Vp8`, `ProRes`, `Dnxhd`, `Mpeg2Video`; audio `Aac`, `Alac`, `Opus`, `Ac3`, +//! `Mp3`/`Mp2`/`Mp1` (with `CodecDelay` + `SeekPreRoll` timing). +//! - Fallback (`filmcraft-codecs`): `alpha_mode == 1` (`BlockAdditional` alpha), unreadable/zlib +//! encodings, `Mjpeg`/`Ffv1`/`Theora`/`Apv`, or unsupported audio (`Vorbis`/`Flac`/`Pcm`). +//! - **Other containers (`MXF`, `AVI`, `MPEG-TS`/`PS`, `Ogg`, standalone `WAV`/`AIFF`/`FLAC`/`MP3`)**: +//! - Currently routed via `filmcraft-codecs` in `stream.rs` (pending subsequent cutover PRs). use std::sync::{Arc, Mutex}; @@ -269,52 +284,7 @@ fn clean_aperture_region(aperture: isobmff::CleanAperture, (width, height): (u32 fn open_isobmff(name: &str, source: SharedBytes) -> Option> { let file = isobmff::open(source.clone()).ok()?; - let video_idx = - file.tracks.iter().position(|t| t.kind == isobmff::TrackKind::Video && !t.samples.is_empty() && !t.entries.is_empty() && t.timescale > 0)?; - let video_track = &file.tracks[video_idx]; - let video_params = video_track.codec_params(); - if !supports_video_codec(video_params.codec) { - return None; - } - - let container_color = video_track.video().and_then(|v| v.color.as_ref()).map(color_from_isobmff); - let color = container_color.unwrap_or(ColorInfo::REC709); - let (mut width, mut height) = video_track - .video() - .map(|v| (u32::from(v.width), u32::from(v.height))) - .filter(|&(w, h)| w > 0 && h > 0) - .unwrap_or((video_track.width, video_track.height)); - // Probe needs dimensions before decoding. Retain the original rational aperture separately - // so frame conversion can use the actual visible size, even with in-band parameter sets. - let aperture = video_track.video().and_then(|v| v.clean_aperture); - if let Some(clap) = aperture { - (width, height) = nal_visible_size_hint(&video_track.entries[0].codec).unwrap_or((width, height)); - if let Some(region) = clean_aperture_region(clap, (width, height)) { - (width, height) = (region.w as u32, region.h as u32); - } - } - let mut par = video_track.video().and_then(|v| v.pixel_aspect).filter(|&(n, d)| n > 0 && d > 0).unwrap_or((1, 1)); - let rotation = video_track.display_rotation().unwrap_or(0) % 4; - if rotation % 2 == 1 { - std::mem::swap(&mut width, &mut height); - par = (par.1, par.0); - } - let has_alpha = if video_params.codec == CodecId::ProRes { - // The coded alpha plane is authoritative for ProRes, not the MOV sample-entry depth. - let sample = video_track.samples.first()?; - if sample.size > MAX_PRORES_ALPHA_SAMPLE_BYTES { - return None; - } - let packet = file.read_sample(&*source, video_idx, 0).ok()?; - craft_video::prores::probe(&packet).ok()?.alpha != craft_video::prores::AlphaType::None - } else { - video_track.video().is_some_and(|v| v.depth == 32) - }; - let frame_rate = estimate_isobmff_frame_rate(video_track); - let duration = Tick::from_units(i64::try_from(video_track.duration).unwrap_or(i64::MAX), i64::from(video_track.timescale)); - let bitrate = video_track.entries.first().and_then(|e| e.bitrate).map(|b| u64::from(b.avg_bitrate)).filter(|&b| b > 0); - let codec_name = video_params.codec.name().to_string(); - + let video_idx = file.tracks.iter().position(|t| t.kind == isobmff::TrackKind::Video && !t.samples.is_empty() && !t.entries.is_empty() && t.timescale > 0); let audio_candidates: Vec<(usize, usize, CodecParams, u64)> = file .tracks .iter() @@ -323,67 +293,96 @@ fn open_isobmff(name: &str, source: SharedBytes) -> Option> .map(|(idx, t)| (idx, t.samples.len(), t.codec_params(), 0)) .collect(); - let container = ContainerFile::Isobmff(file); - let (audio_tracks, audio_infos) = open_audio_tracks(&container, &*source, audio_candidates)?; + if video_idx.is_none() && audio_candidates.is_empty() { + return None; + } - let video_decoder = match TrackDecoder::with_options(&video_params, TrackDecoderOptions { threads: Some(worker_cap()), draft: false }) { - Ok(d) => d, - Err(e) => return Some(Err(MediaError::Decode(e.to_string()))), + let (video_info, video_state, presentation, duration) = if let Some(v_idx) = video_idx { + let video_track = &file.tracks[v_idx]; + let video_params = video_track.codec_params(); + if !supports_video_codec(video_params.codec) { + return None; + } + let container_color = video_track.video().and_then(|v| v.color.as_ref()).map(color_from_isobmff); + let color = container_color.unwrap_or(ColorInfo::REC709); + let (mut width, mut height) = video_track + .video() + .map(|v| (u32::from(v.width), u32::from(v.height))) + .filter(|&(w, h)| w > 0 && h > 0) + .unwrap_or((video_track.width, video_track.height)); + // Probe needs dimensions before decoding. Retain the original rational aperture separately + // so frame conversion can use the actual visible size, even with in-band parameter sets. + let aperture = video_track.video().and_then(|v| v.clean_aperture); + if let Some(clap) = aperture { + (width, height) = nal_visible_size_hint(&video_track.entries[0].codec).unwrap_or((width, height)); + if let Some(region) = clean_aperture_region(clap, (width, height)) { + (width, height) = (region.w as u32, region.h as u32); + } + } + let mut par = video_track.video().and_then(|v| v.pixel_aspect).filter(|&(n, d)| n > 0 && d > 0).unwrap_or((1, 1)); + let rotation = video_track.display_rotation().unwrap_or(0) % 4; + if rotation % 2 == 1 { + std::mem::swap(&mut width, &mut height); + par = (par.1, par.0); + } + let has_alpha = if video_params.codec == CodecId::ProRes { + // The coded alpha plane is authoritative for ProRes, not the MOV sample-entry depth. + let sample = video_track.samples.first()?; + if sample.size > MAX_PRORES_ALPHA_SAMPLE_BYTES { + return None; + } + let packet = file.read_sample(&*source, v_idx, 0).ok()?; + craft_video::prores::probe(&packet).ok()?.alpha != craft_video::prores::AlphaType::None + } else { + video_track.video().is_some_and(|v| v.depth == 32) + }; + let frame_rate = estimate_isobmff_frame_rate(video_track); + let duration = Tick::from_units(i64::try_from(video_track.duration).unwrap_or(i64::MAX), i64::from(video_track.timescale)); + let bitrate = video_track.entries.first().and_then(|e| e.bitrate).map(|b| u64::from(b.avg_bitrate)).filter(|&b| b > 0); + let codec_name = video_params.codec.name().to_string(); + let video_decoder = match TrackDecoder::with_options(&video_params, TrackDecoderOptions { threads: Some(worker_cap()), draft: false }) { + Ok(d) => d, + Err(e) => return Some(Err(MediaError::Decode(e.to_string()))), + }; + let v_info = VideoStreamInfo { width, height, frame_rate, par, codec: codec_name, pixel_format: String::new(), color, has_alpha, bitrate, hdr: None }; + let v_state = Mutex::new(VideoState { decoder: video_decoder, next_decode_idx: 0, gop_start_idx: 0, flushed: false, decoded: Vec::new() }); + (Some(v_info), Some(v_state), FramePresentation { container_color, par, rotation, aperture }, duration) + } else { + let duration = audio_candidates + .iter() + .map(|&(idx, _, _, _)| { + let t = &file.tracks[idx]; + Tick::from_units(i64::try_from(t.duration).unwrap_or(i64::MAX), i64::from(t.timescale)) + }) + .max() + .unwrap_or(Tick::ZERO); + (None, None, FramePresentation { container_color: None, par: (1, 1), rotation: 0, aperture: None }, duration) }; + let container = ContainerFile::Isobmff(file); + let (audio_tracks, audio_infos) = open_audio_tracks(&container, &*source, audio_candidates)?; + if video_info.is_none() && audio_tracks.is_empty() { + return None; + } + + let kind = if video_info.is_some() { MediaKind::Movie } else { MediaKind::AudioOnly }; let info = MediaInfo { name: name.to_string(), - kind: MediaKind::Movie, + kind, duration, - video: Some(VideoStreamInfo { width, height, frame_rate, par, codec: codec_name, pixel_format: String::new(), color, has_alpha, bitrate, hdr: None }), + video: video_info, audio_streams: audio_infos, container: "mp4".to_string(), start_timecode: None, file_size: Some(source.len()), }; - Some(Ok(Arc::new(CraftMediaSource { - info, - source, - file: container, - video_track_idx: video_idx, - presentation: FramePresentation { container_color, par, rotation, aperture }, - video: Mutex::new(VideoState { decoder: video_decoder, next_decode_idx: 0, gop_start_idx: 0, flushed: false, decoded: Vec::new() }), - audio_tracks, - }))) + Some(Ok(Arc::new(CraftMediaSource { info, source, file: container, video_track_idx: video_idx, presentation, video: video_state, audio_tracks }))) } fn open_matroska(name: &str, source: SharedBytes) -> Option> { let file = matroska::open(source.clone()).ok()?; - let video_idx = file.tracks.iter().position(|t| t.kind == matroska::TrackKind::Video && !t.samples.is_empty() && t.timebase.0 > 0 && t.timebase.1 > 0)?; - let video_track = &file.tracks[video_idx]; - if !video_track.frames_readable() { - return None; - } - let video_params = video_track.codec_params(); - if !supports_video_codec(video_params.codec) { - return None; - } - - let video_info = video_track.video.as_ref(); - // WebM/Matroska alpha_mode == 1 stores alpha in BlockAdditional; fall back to FilmCraft. - if video_info.is_some_and(|v| v.alpha_mode == 1) { - return None; - } - let container_color = video_info.and_then(|v| v.color.as_ref()).map(color_from_matroska); - let color = container_color.unwrap_or(ColorInfo::REC709); - let (mut width, mut height) = video_info.map_or((0, 0), |v| (v.pixel_width, v.pixel_height)); - let mut par = matroska_par(video_info, width, height); - let rotation = video_info.and_then(|v| v.display_rotation()).unwrap_or(0) % 4; - if rotation % 2 == 1 { - std::mem::swap(&mut width, &mut height); - par = (par.1, par.0); - } - let frame_rate = estimate_matroska_frame_rate(video_track); - let duration = matroska_duration(&file, video_track); - let codec_name = video_params.codec.name().to_string(); - let container_name = if file.doc_type == "webm" { "webm" } else { "mkv" }.to_string(); - + let video_idx = file.tracks.iter().position(|t| t.kind == matroska::TrackKind::Video && !t.samples.is_empty() && t.timebase.0 > 0 && t.timebase.1 > 0); let audio_candidates: Vec<(usize, usize, CodecParams, u64)> = file .tracks .iter() @@ -392,19 +391,42 @@ fn open_matroska(name: &str, source: SharedBytes) -> Option .map(|(idx, t)| (idx, t.samples.len(), t.codec_params(), t.codec_delay_ns)) .collect(); - let container = ContainerFile::Matroska(Box::new(file)); - let (audio_tracks, audio_infos) = open_audio_tracks(&container, &*source, audio_candidates)?; + if video_idx.is_none() && audio_candidates.is_empty() { + return None; + } - let video_decoder = match TrackDecoder::with_options(&video_params, TrackDecoderOptions { threads: Some(worker_cap()), draft: false }) { - Ok(d) => d, - Err(e) => return Some(Err(MediaError::Decode(e.to_string()))), - }; - - let info = MediaInfo { - name: name.to_string(), - kind: MediaKind::Movie, - duration, - video: Some(VideoStreamInfo { + let container_name = if file.doc_type == "webm" { "webm" } else { "mkv" }.to_string(); + let (video_info, video_state, container_color, par, rotation, duration) = if let Some(v_idx) = video_idx { + let video_track = &file.tracks[v_idx]; + if !video_track.frames_readable() { + return None; + } + let video_params = video_track.codec_params(); + if !supports_video_codec(video_params.codec) { + return None; + } + let v_meta = video_track.video.as_ref(); + // WebM/Matroska alpha_mode == 1 stores alpha in BlockAdditional; fall back to FilmCraft. + if v_meta.is_some_and(|v| v.alpha_mode == 1) { + return None; + } + let container_color = v_meta.and_then(|v| v.color.as_ref()).map(color_from_matroska); + let color = container_color.unwrap_or(ColorInfo::REC709); + let (mut width, mut height) = v_meta.map_or((0, 0), |v| (v.pixel_width, v.pixel_height)); + let mut par = matroska_par(v_meta, width, height); + let rotation = v_meta.and_then(|v| v.display_rotation()).unwrap_or(0) % 4; + if rotation % 2 == 1 { + std::mem::swap(&mut width, &mut height); + par = (par.1, par.0); + } + let frame_rate = estimate_matroska_frame_rate(video_track); + let duration = matroska_duration(&file, video_track); + let codec_name = video_params.codec.name().to_string(); + let video_decoder = match TrackDecoder::with_options(&video_params, TrackDecoderOptions { threads: Some(worker_cap()), draft: false }) { + Ok(d) => d, + Err(e) => return Some(Err(MediaError::Decode(e.to_string()))), + }; + let v_info = VideoStreamInfo { width, height, frame_rate, @@ -415,7 +437,26 @@ fn open_matroska(name: &str, source: SharedBytes) -> Option has_alpha: false, bitrate: None, hdr: None, - }), + }; + let v_state = Mutex::new(VideoState { decoder: video_decoder, next_decode_idx: 0, gop_start_idx: 0, flushed: false, decoded: Vec::new() }); + (Some(v_info), Some(v_state), container_color, par, rotation, duration) + } else { + let duration = audio_candidates.iter().map(|&(idx, _, _, _)| matroska_duration(&file, &file.tracks[idx])).max().unwrap_or(Tick::ZERO); + (None, None, None, (1, 1), 0, duration) + }; + + let container = ContainerFile::Matroska(Box::new(file)); + let (audio_tracks, audio_infos) = open_audio_tracks(&container, &*source, audio_candidates)?; + if video_info.is_none() && audio_tracks.is_empty() { + return None; + } + + let kind = if video_info.is_some() { MediaKind::Movie } else { MediaKind::AudioOnly }; + let info = MediaInfo { + name: name.to_string(), + kind, + duration, + video: video_info, audio_streams: audio_infos, container: container_name, start_timecode: None, @@ -428,7 +469,7 @@ fn open_matroska(name: &str, source: SharedBytes) -> Option file: container, video_track_idx: video_idx, presentation: FramePresentation { container_color, par, rotation, aperture: None }, - video: Mutex::new(VideoState { decoder: video_decoder, next_decode_idx: 0, gop_start_idx: 0, flushed: false, decoded: Vec::new() }), + video: video_state, audio_tracks, }))) } @@ -474,9 +515,9 @@ struct CraftMediaSource { info: MediaInfo, source: SharedBytes, file: ContainerFile, - video_track_idx: usize, + video_track_idx: Option, presentation: FramePresentation, - video: Mutex, + video: Option>, audio_tracks: Vec, } @@ -486,15 +527,18 @@ impl MediaSource for CraftMediaSource { } fn video_frame(&self, req: FrameRequest) -> Result> { - let (target_idx, target_pts) = self.file.target_sample(self.video_track_idx, req.time).ok_or_else(|| MediaError::Decode("no video samples".into()))?; + let (Some(video_idx), Some(video_mutex)) = (self.video_track_idx, &self.video) else { + return Err(MediaError::NoStream("video")); + }; + let (target_idx, target_pts) = self.file.target_sample(video_idx, req.time).ok_or_else(|| MediaError::Decode("no video samples".into()))?; let want_draft = req.scale < 0.99; - let mut state = self.video.lock().unwrap_or_else(std::sync::PoisonError::into_inner); + let mut state = video_mutex.lock().unwrap_or_else(std::sync::PoisonError::into_inner); if let Some(hit) = state.decoded.iter().find(|c| c.pts == target_pts && c.draft == want_draft) { return Ok(hit.frame.clone()); } - let sync_idx = self.file.sync_sample_before(self.video_track_idx, target_idx); + let sync_idx = self.file.sync_sample_before(video_idx, target_idx); let draft_changed = state.decoder.draft() != want_draft; if draft_changed { state.decoder.set_draft(want_draft); @@ -509,22 +553,22 @@ impl MediaSource for CraftMediaSource { state.flushed = false; } - let sample_count = self.file.sample_count(self.video_track_idx); + let sample_count = self.file.sample_count(video_idx); while !state.decoded.iter().any(|c| c.pts >= target_pts && c.draft == want_draft) { if filmcraft_media::cancel::cancelled() { return Err(MediaError::Cancelled); } if state.next_decode_idx < sample_count { let idx = state.next_decode_idx; - let pts = self.file.sample_pts(self.video_track_idx, idx); - let pkt = self.file.read_sample(&*self.source, self.video_track_idx, idx)?; + let pts = self.file.sample_pts(video_idx, idx); + let pkt = self.file.read_sample(&*self.source, video_idx, idx)?; let frames = state.decoder.decode(&pkt, pts).map_err(|e| MediaError::Decode(e.to_string()))?; state.next_decode_idx = idx + 1; - push_decoded(&mut state.decoded, frames, want_draft, self.presentation, &self.file, self.video_track_idx)?; + push_decoded(&mut state.decoded, frames, want_draft, self.presentation, &self.file, video_idx)?; } else if !state.flushed { let frames = state.decoder.flush().map_err(|e| MediaError::Decode(e.to_string()))?; state.flushed = true; - push_decoded(&mut state.decoded, frames, want_draft, self.presentation, &self.file, self.video_track_idx)?; + push_decoded(&mut state.decoded, frames, want_draft, self.presentation, &self.file, video_idx)?; break; } else { break; diff --git a/crates/media/tests/it/footage.rs b/crates/media/tests/it/footage.rs index 593ab49f7..13f3f4675 100644 --- a/crates/media/tests/it/footage.rs +++ b/crates/media/tests/it/footage.rs @@ -1625,3 +1625,30 @@ fn matroska_opus_audio_timing_and_seek() { let rms_seek = (seek_audio.iter().map(|v| v * v).sum::() / seek_audio.len() as f32).sqrt(); assert!((rms_seek - 0.0625).abs() < 0.02, "opus audio after seek rms {rms_seek}"); } + +#[test] +fn audio_only_isobmff_and_matroska_route_through_craft_audio() { + for (file, codec, args) in [ + ("audio_only_aac.m4a", "aac", &["-c:a", "aac"][..]), + ("audio_only_alac.m4a", "alac", &["-c:a", "alac"][..]), + ("audio_only_opus.webm", "libopus", &["-c:a", "libopus"][..]), + ] { + let mut ffmpeg_args = vec!["-f", "lavfi", "-i", "sine=frequency=440:sample_rate=48000:duration=1"]; + ffmpeg_args.extend_from_slice(args); + let Some(p) = try_ffmpeg_fixture(file, &ffmpeg_args) else { + continue; + }; + let f = probe(&p).expect(codec); + assert_eq!(f.kind, FootageKind::Audio, "{file} must probe as Audio"); + assert!(!f.has_video, "{file} has no video"); + assert!(f.has_audio, "{file} has audio"); + assert!(f.duration >= Tick(TICKS_PER_SECOND * 9 / 10), "{file} duration {:?}", f.duration); + let pool = MediaPool::new(); + let start = pool.audio_samples(&f, Tick::ZERO, 4800, 48_000); + let seek = pool.audio_samples(&f, Tick(TICKS_PER_SECOND / 2), 4800, 48_000); + assert_eq!(start.len(), 9600); + assert_eq!(seek.len(), 9600); + let rms_seek = (seek.iter().map(|v| v * v).sum::() / seek.len() as f32).sqrt(); + assert!((rms_seek - 0.0625).abs() < 0.02, "{file} seek rms {rms_seek}"); + } +} From b9ab1eaa2e2fec6e4f2b3d7cf66261feee0eb37e Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Sat, 21 Nov 2026 01:56:10 +0100 Subject: [PATCH 335/451] fix(media): preserve Matroska audio position on cold seek --- crates/media/src/craft_source.rs | 12 ++++-- crates/media/tests/it/footage.rs | 67 ++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+), 4 deletions(-) diff --git a/crates/media/src/craft_source.rs b/crates/media/src/craft_source.rs index 85b5b5447..3f55082ff 100644 --- a/crates/media/src/craft_source.rs +++ b/crates/media/src/craft_source.rs @@ -173,15 +173,19 @@ impl ContainerFile { } ContainerFile::Matroska(f) => { let track = &f.tracks[track_idx]; + // Indexed PTS already subtracts CodecDelay rounded to the container clock. + // Translate only that rounding difference, not the full delay a second time. + let tick_ns = i128::from(f.info.timestamp_scale.max(1)); let delay_ns = i128::from(track.codec_delay_ns); + let rounding_ns = ((delay_ns + tick_ns / 2) / tick_ns) * tick_ns - delay_ns; let preroll_ns = i128::from(track.seek_pre_roll_ns.max(80_000_000)); - let target_ns = (i128::from(start.max(0)) * 1_000_000_000) / i128::from(native_rate) + delay_ns; - let seek_ns = (target_ns - preroll_ns).max(0); - let t_track = track.ns_to_ticks(i64::try_from(seek_ns).unwrap_or(0)); + let target_ns = (i128::from(start.max(0)) * 1_000_000_000) / i128::from(native_rate); + let seek_ns = (target_ns - preroll_ns - rounding_ns).max(0); + let t_track = track.ns_to_ticks(i64::try_from(seek_ns).unwrap_or(i64::MAX)); let sample_idx = track.sample_at_pts(t_track).unwrap_or(0); let seek_idx = sample_idx.saturating_sub(2); let sample_pts = track.samples.get(seek_idx).map_or(0, |s| s.pts); - let sample_ns = i128::from(track.ticks_to_ns(sample_pts)) - delay_ns; + let sample_ns = i128::from(track.ticks_to_ns(sample_pts)) + rounding_ns; let decoded_pos = i64::try_from((sample_ns * i128::from(native_rate)) / 1_000_000_000).unwrap_or(0); (seek_idx, decoded_pos) } diff --git a/crates/media/tests/it/footage.rs b/crates/media/tests/it/footage.rs index 13f3f4675..a655efce7 100644 --- a/crates/media/tests/it/footage.rs +++ b/crates/media/tests/it/footage.rs @@ -1592,6 +1592,73 @@ fn filmcraft_fallback_handles_mjpeg_mov() { assert_eq!((img.width, img.height), (160, 120)); } +/// A cold seek and uninterrupted playback must cross the same audible boundary. The PCM is +/// contiguous, so the test isolates reset positioning from separately handled timestamp gaps. +#[test] +fn matroska_cold_seek_applies_codec_delay_once() { + use craft_media::matroska::{self, MkvWriter, MuxOptions, TrackKind, TrackSpec}; + use craft_video::prores::{ChromaFormat, Encoder, Frame, Profile}; + + const RATE: u32 = 48_000; + const PACKET_FRAMES: usize = 4_800; + const PACKET_NS: i64 = 100_000_000; + const DELAY_NS: i64 = 8_250_000; // 396 samples, but 8 rounded container ticks. + const CHANGE_PACKET: i64 = 32; + const HALF_WINDOW: usize = 192; + + let profile = Profile::P4444; + let black = Frame::new(16, 16, ChromaFormat::Yuv444, 10, false).unwrap(); + let picture = Encoder::new(profile, 16, 16).encode(&black).unwrap(); + let mut video = TrackSpec::new(TrackKind::Video, "V_PRORES"); + video.video_size = Some((16, 16)); + video.codec_private = profile.fourcc().to_vec(); + video.default_duration_ns = Some(4_000_000_000); + + let mut audio = TrackSpec::new(TrackKind::Audio, "A_PCM/INT/LIT"); + audio.audio = Some((f64::from(RATE), 1, Some(16))); + audio.codec_delay_ns = DELAY_NS as u64; + audio.default_duration_ns = Some(PACKET_NS as u64); + let mut mux = MkvWriter::new(std::io::Cursor::new(Vec::new()), vec![video, audio], MuxOptions::default()).unwrap(); + mux.write_frame(0, 0, true, &picture, None).unwrap(); + let silent = vec![0; PACKET_FRAMES * 2]; + let signal = 16_384i16.to_le_bytes().repeat(PACKET_FRAMES); + for n in 0..40 { + let pcm = if n < CHANGE_PACKET { &silent } else { &signal }; + mux.write_frame(1, n * PACKET_NS - DELAY_NS, true, pcm, None).unwrap(); + } + let bytes = mux.finish().unwrap().into_inner(); + let mkv = matroska::open(bytes.as_slice()).unwrap(); + assert_eq!(mkv.tracks[1].samples[0].pts, -8); + + // Distinct files and pools keep the two decoder states independent. + let dir = tempfile::tempdir().unwrap(); + let warm_path = dir.path().join("sequential.mkv"); + let cold_path = dir.path().join("cold.mkv"); + std::fs::write(&warm_path, &bytes).unwrap(); + std::fs::write(&cold_path, &bytes).unwrap(); + let warm = probe(&warm_path).unwrap(); + let cold = probe(&cold_path).unwrap(); + for f in [&warm, &cold] { + assert!(f.has_audio); + assert_eq!(f.codec, "ProRes", "exercise the shared Matroska route, not legacy fallback"); + } + + let warm_pool = MediaPool::new(); + for n in 0..CHANGE_PACKET - 1 { + let t = Tick::from_units(n * PACKET_FRAMES as i64, i64::from(RATE)); + let _ = warm_pool.audio_samples(&warm, t, PACKET_FRAMES, RATE); + } + let boundary = CHANGE_PACKET * PACKET_FRAMES as i64 - DELAY_NS * i64::from(RATE) / 1_000_000_000; + let t = Tick::from_units(boundary - HALF_WINDOW as i64, i64::from(RATE)); + let sequential = warm_pool.audio_samples(&warm, t, 2 * HALF_WINDOW, RATE); + assert_eq!(sequential.len(), 4 * HALF_WINDOW); + assert!(sequential[..2 * HALF_WINDOW].iter().all(|s| s.abs() < 1e-6)); + assert!(sequential[2 * HALF_WINDOW..].iter().all(|s| s.abs() > 0.1)); + + let seek = MediaPool::new().audio_samples(&cold, t, 2 * HALF_WINDOW, RATE); + assert_eq!(seek, sequential, "cold seek must not shift the signal boundary"); +} + #[test] fn matroska_opus_audio_timing_and_seek() { let Some(p) = try_ffmpeg_fixture( From e084232b7095d6d399913b069a16345d25f1e48b Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Sat, 21 Nov 2026 08:52:03 +0700 Subject: [PATCH 336/451] Match Matroska cold-seek audio frame rounding --- crates/media/src/craft_source.rs | 19 ++++++++++++------- crates/media/tests/it/footage.rs | 16 ++++++++++++---- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/crates/media/src/craft_source.rs b/crates/media/src/craft_source.rs index 3f55082ff..f4843db3a 100644 --- a/crates/media/src/craft_source.rs +++ b/crates/media/src/craft_source.rs @@ -174,25 +174,30 @@ impl ContainerFile { ContainerFile::Matroska(f) => { let track = &f.tracks[track_idx]; // Indexed PTS already subtracts CodecDelay rounded to the container clock. - // Translate only that rounding difference, not the full delay a second time. + // Translate between that clock and the warm path's whole-frame delay. let tick_ns = i128::from(f.info.timestamp_scale.max(1)); let delay_ns = i128::from(track.codec_delay_ns); - let rounding_ns = ((delay_ns + tick_ns / 2) / tick_ns) * tick_ns - delay_ns; + let indexed_delay_ns = ((delay_ns + tick_ns / 2) / tick_ns) * tick_ns; + let delay_frames = audio_frames_from_ns(delay_ns, native_rate); let preroll_ns = i128::from(track.seek_pre_roll_ns.max(80_000_000)); - let target_ns = (i128::from(start.max(0)) * 1_000_000_000) / i128::from(native_rate); - let seek_ns = (target_ns - preroll_ns - rounding_ns).max(0); + let target_ns = ((i128::from(start.max(0)) + delay_frames) * 1_000_000_000) / i128::from(native_rate); + let seek_ns = (target_ns - preroll_ns - indexed_delay_ns).max(0); let t_track = track.ns_to_ticks(i64::try_from(seek_ns).unwrap_or(i64::MAX)); let sample_idx = track.sample_at_pts(t_track).unwrap_or(0); let seek_idx = sample_idx.saturating_sub(2); let sample_pts = track.samples.get(seek_idx).map_or(0, |s| s.pts); - let sample_ns = i128::from(track.ticks_to_ns(sample_pts)) + rounding_ns; - let decoded_pos = i64::try_from((sample_ns * i128::from(native_rate)) / 1_000_000_000).unwrap_or(0); + let sample_ns = i128::from(track.ticks_to_ns(sample_pts)) + indexed_delay_ns; + let decoded_pos = i64::try_from(audio_frames_from_ns(sample_ns, native_rate) - delay_frames).unwrap_or(0); (seek_idx, decoded_pos) } } } } +fn audio_frames_from_ns(ns: i128, rate: u32) -> i128 { + (ns * i128::from(rate)) / 1_000_000_000 +} + fn open_audio_tracks(container: &ContainerFile, source: &dyn ByteSource, candidates: I) -> Option<(Vec, Vec)> where I: IntoIterator, @@ -213,7 +218,7 @@ where let dec = AudioTrackDecoder::new(¶ms, &refs).ok()?; let native_rate = dec.sample_rate().max(1); let channels = u32::from(dec.layout().channels()).max(1); - let delay_samples = i64::try_from((i128::from(codec_delay_ns) * i128::from(native_rate)) / 1_000_000_000).unwrap_or(0); + let delay_samples = i64::try_from(audio_frames_from_ns(i128::from(codec_delay_ns), native_rate)).unwrap_or(0); audio_infos.push(AudioStreamInfo { sample_rate: native_rate, channels, diff --git a/crates/media/tests/it/footage.rs b/crates/media/tests/it/footage.rs index a655efce7..df1751ff6 100644 --- a/crates/media/tests/it/footage.rs +++ b/crates/media/tests/it/footage.rs @@ -1596,13 +1596,21 @@ fn filmcraft_fallback_handles_mjpeg_mov() { /// contiguous, so the test isolates reset positioning from separately handled timestamp gaps. #[test] fn matroska_cold_seek_applies_codec_delay_once() { + assert_matroska_cold_seek_codec_delay(8_250_000); // Exactly 396 samples, but 8 indexed ticks. +} + +#[test] +fn matroska_cold_seek_matches_fractional_codec_delay_rounding() { + assert_matroska_cold_seek_codec_delay(8_260_000); // 396.48 samples, also 8 indexed ticks. +} + +fn assert_matroska_cold_seek_codec_delay(delay_ns: i64) { use craft_media::matroska::{self, MkvWriter, MuxOptions, TrackKind, TrackSpec}; use craft_video::prores::{ChromaFormat, Encoder, Frame, Profile}; const RATE: u32 = 48_000; const PACKET_FRAMES: usize = 4_800; const PACKET_NS: i64 = 100_000_000; - const DELAY_NS: i64 = 8_250_000; // 396 samples, but 8 rounded container ticks. const CHANGE_PACKET: i64 = 32; const HALF_WINDOW: usize = 192; @@ -1616,7 +1624,7 @@ fn matroska_cold_seek_applies_codec_delay_once() { let mut audio = TrackSpec::new(TrackKind::Audio, "A_PCM/INT/LIT"); audio.audio = Some((f64::from(RATE), 1, Some(16))); - audio.codec_delay_ns = DELAY_NS as u64; + audio.codec_delay_ns = delay_ns as u64; audio.default_duration_ns = Some(PACKET_NS as u64); let mut mux = MkvWriter::new(std::io::Cursor::new(Vec::new()), vec![video, audio], MuxOptions::default()).unwrap(); mux.write_frame(0, 0, true, &picture, None).unwrap(); @@ -1624,7 +1632,7 @@ fn matroska_cold_seek_applies_codec_delay_once() { let signal = 16_384i16.to_le_bytes().repeat(PACKET_FRAMES); for n in 0..40 { let pcm = if n < CHANGE_PACKET { &silent } else { &signal }; - mux.write_frame(1, n * PACKET_NS - DELAY_NS, true, pcm, None).unwrap(); + mux.write_frame(1, n * PACKET_NS - delay_ns, true, pcm, None).unwrap(); } let bytes = mux.finish().unwrap().into_inner(); let mkv = matroska::open(bytes.as_slice()).unwrap(); @@ -1648,7 +1656,7 @@ fn matroska_cold_seek_applies_codec_delay_once() { let t = Tick::from_units(n * PACKET_FRAMES as i64, i64::from(RATE)); let _ = warm_pool.audio_samples(&warm, t, PACKET_FRAMES, RATE); } - let boundary = CHANGE_PACKET * PACKET_FRAMES as i64 - DELAY_NS * i64::from(RATE) / 1_000_000_000; + let boundary = CHANGE_PACKET * PACKET_FRAMES as i64 - delay_ns * i64::from(RATE) / 1_000_000_000; let t = Tick::from_units(boundary - HALF_WINDOW as i64, i64::from(RATE)); let sequential = warm_pool.audio_samples(&warm, t, 2 * HALF_WINDOW, RATE); assert_eq!(sequential.len(), 4 * HALF_WINDOW); From aa623b7577804b07f65ba59449f8aab4d8630327 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Fri, 20 Nov 2026 22:10:32 -0500 Subject: [PATCH 337/451] media: preserve contiguous audio packet placement across rounding and gaps (#4008) * media: preserve contiguous audio packet placement across rounding and gaps Port @IppSec's contiguous_starts packet-placement logic from storytold/filmcraft#359 into CraftMediaSource so fixed-frame and Opus packets stay contiguous across 1ms Matroska timestamp rounding and laced blocks, while honoring real silence gaps, overlaps, and delayed first packets on both sequential playback and cold/backward seeks. Refs: storytold/effectcraft#1546 Refs: storytold/filmcraft#359 Co-authored-by: ippsec * media: fix opus_packet_samples helper and TrackDecoder borrow * media: use Footage and re-exported matroska mux types in audio gap tests --------- Co-authored-by: ippsec --- crates/media/src/craft_source.rs | 304 +++++++++++++++++++++++++++---- crates/media/tests/it/footage.rs | 162 ++++++++++++++++ 2 files changed, 431 insertions(+), 35 deletions(-) diff --git a/crates/media/src/craft_source.rs b/crates/media/src/craft_source.rs index f4843db3a..dad5b9cd4 100644 --- a/crates/media/src/craft_source.rs +++ b/crates/media/src/craft_source.rs @@ -159,37 +159,158 @@ impl ContainerFile { } } - fn audio_seek_info(&self, track_idx: usize, start: i64, native_rate: u32) -> (usize, i64) { - match self { - ContainerFile::Isobmff(f) => { - let track = &f.tracks[track_idx]; - let t_track = (i128::from(start.max(0)) * i128::from(track.timescale)) / i128::from(native_rate); - let sample_idx = track.sample_at_presentation_time(i64::try_from(t_track).unwrap_or(0)).unwrap_or(0); - // Back up a few packets for AAC/Opus overlap/preroll. - let seek_idx = sample_idx.saturating_sub(2); - let sample_pts = track.presentation_pts(seek_idx).unwrap_or(0); - let decoded_pos = i64::try_from((i128::from(sample_pts) * i128::from(native_rate)) / i128::from(track.timescale.max(1))).unwrap_or(0); - (seek_idx, decoded_pos) + fn audio_seek_info(audio_starts: &[i64], seek_preroll_samples: i64, start: i64) -> (usize, i64) { + let target = start.saturating_sub(seek_preroll_samples).max(0); + let sample_idx = audio_starts.partition_point(|&s| s <= target).saturating_sub(1); + let seek_idx = sample_idx.saturating_sub(2); + let decoded_pos = audio_starts.get(seek_idx).copied().unwrap_or(0); + (seek_idx, decoded_pos) + } +} + +/// Where the container puts one audio packet, for [`contiguous_starts`]. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +struct PacketTime { + /// Its timestamp, in output samples. + stamp: i64, + /// Whether `stamp` is the packet's own. A Matroska frame after the first in a laced block + /// without a duration repeats the block's timestamp. + stamped: bool, + /// Samples it decodes to, when known. + samples: Option, +} + +/// Packet start positions in output samples: each packet starts where the previous one ends, +/// unless its own timestamp is more than `tolerance` samples from there (a real gap or overlap in +/// the recording) or the previous packet's length is unknown; then it starts at its timestamp. +/// +/// Container timestamps are coarser than a sample. Matroska stores milliseconds, and a remux to MP4 +/// (OBS's) turns that rounding into uneven sample durations: a 1024-sample AAC frame at 48 kHz +/// lasts 21.33 ms, so frames are stamped at 0, 1008, 2064, 3072… Placing each decoded packet at its +/// stamp overwrote the end of one packet and left a hole of silence after another, a click every +/// few packets: crackling throughout playback and export (`storytold/effectcraft#1546`, +/// `storytold/filmcraft#359`). +fn contiguous_starts(packets: impl IntoIterator, tolerance: i64) -> Vec { + let tolerance = tolerance.max(0).unsigned_abs(); + let mut next: Option = None; + packets + .into_iter() + .map(|p| { + let start = match next { + Some(n) if !p.stamped || n.abs_diff(p.stamp) <= tolerance => n, + _ => p.stamp, + }; + next = p.samples.and_then(|k| start.checked_add(k)); + start + }) + .collect() +} + +fn fixed_packet_samples(dec: &mut AudioTrackDecoder, codec: CodecId, lookahead: &[Vec]) -> Option { + if !matches!(codec, CodecId::Aac | CodecId::HeAac | CodecId::Mp1 | CodecId::Mp2 | CodecId::Mp3 | CodecId::Ac3 | CodecId::Eac3) { + return None; + } + let mut frame_len: Option = None; + for pkt in lookahead { + let Ok(block) = dec.decode(pkt) else { + dec.reset(); + return None; + }; + let n = block.channels.first().map_or(0, Vec::len); + if n == 0 { + dec.reset(); + return None; + } + match frame_len { + None => frame_len = Some(n), + Some(prev) if prev != n => { + dec.reset(); + return None; } - ContainerFile::Matroska(f) => { - let track = &f.tracks[track_idx]; - // Indexed PTS already subtracts CodecDelay rounded to the container clock. - // Translate between that clock and the warm path's whole-frame delay. - let tick_ns = i128::from(f.info.timestamp_scale.max(1)); - let delay_ns = i128::from(track.codec_delay_ns); - let indexed_delay_ns = ((delay_ns + tick_ns / 2) / tick_ns) * tick_ns; - let delay_frames = audio_frames_from_ns(delay_ns, native_rate); - let preroll_ns = i128::from(track.seek_pre_roll_ns.max(80_000_000)); - let target_ns = ((i128::from(start.max(0)) + delay_frames) * 1_000_000_000) / i128::from(native_rate); - let seek_ns = (target_ns - preroll_ns - indexed_delay_ns).max(0); - let t_track = track.ns_to_ticks(i64::try_from(seek_ns).unwrap_or(i64::MAX)); - let sample_idx = track.sample_at_pts(t_track).unwrap_or(0); - let seek_idx = sample_idx.saturating_sub(2); - let sample_pts = track.samples.get(seek_idx).map_or(0, |s| s.pts); - let sample_ns = i128::from(track.ticks_to_ns(sample_pts)) + indexed_delay_ns; - let decoded_pos = i64::try_from(audio_frames_from_ns(sample_ns, native_rate) - delay_frames).unwrap_or(0); - (seek_idx, decoded_pos) + Some(_) => {} + } + } + dec.reset(); + frame_len.and_then(|n| i64::try_from(n).ok()) +} + +/// Duration of an Opus packet in 48 kHz samples from its TOC (RFC 6716 §3.1); `None` if invalid. +fn opus_packet_samples(pkt: &[u8]) -> Option { + let &toc = pkt.first()?; + let config = toc >> 3; + let frame = match config { + 0..=11 => [480, 960, 1920, 2880][(config & 3) as usize], + 12..=15 => [480, 960][(config & 1) as usize], + _ => [120, 240, 480, 960][(config & 3) as usize], + }; + let frames = match toc & 3 { + 0 => 1, + 1 | 2 => 2, + _ => (*pkt.get(1)? & 0x3F) as u32, + }; + let n = frame * frames; + (n > 0 && n <= 5760).then_some(n) +} + +fn compute_audio_starts( + container: &ContainerFile, + source: &dyn ByteSource, + track_idx: usize, + codec: CodecId, + native_rate: u32, + fixed_samples: Option, +) -> Vec { + let rate = i128::from(native_rate); + match container { + ContainerFile::Isobmff(f) => { + let Some(track) = f.tracks.get(track_idx) else { return Vec::new() }; + let ts = i128::from(track.timescale.max(1)); + let stamps: Vec = (0..track.samples.len()) + .map(|i| { + let pts = track.presentation_pts(i).unwrap_or(0); + i64::try_from(i128::from(pts) * rate / ts).unwrap_or(0) + }) + .collect(); + let unit = i64::try_from((rate + ts - 1) / ts).unwrap_or(i64::MAX); + if codec == CodecId::Opus { + let packets = stamps.into_iter().enumerate().map(|(i, stamp)| { + let samples = f.read_sample(source, track_idx, i).ok().and_then(|p| opus_packet_samples(&p)).map(i64::from); + PacketTime { stamp, stamped: true, samples } + }); + return contiguous_starts(packets, unit.saturating_mul(2).saturating_add(1)); } + let Some(frame) = fixed_samples else { + return stamps; + }; + let tolerance = (frame / 2).max(unit.saturating_mul(2).saturating_add(1)); + let packets = stamps.into_iter().map(|stamp| PacketTime { stamp, stamped: true, samples: Some(frame) }); + contiguous_starts(packets, tolerance) + } + ContainerFile::Matroska(f) => { + let Some(track) = f.tracks.get(track_idx) else { return Vec::new() }; + // Indexed PTS already subtracts CodecDelay rounded to the container clock. + // Translate between that clock and the warm path's whole-frame delay. + let tick_ns = i128::from(f.info.timestamp_scale.max(1)); + let delay_ns = i128::from(track.codec_delay_ns); + let indexed_delay_ns = ((delay_ns + tick_ns / 2) / tick_ns) * tick_ns; + let delay_frames = audio_frames_from_ns(delay_ns, native_rate); + let stamp_for = |pts: i64| -> i64 { + let ns = i128::from(track.ticks_to_ns(pts)) + indexed_delay_ns; + i64::try_from(audio_frames_from_ns(ns, native_rate) - delay_frames).unwrap_or(0) + }; + let tick_samples = i64::try_from(i128::from(track.ticks_to_ns(2)) * rate / 1_000_000_000).unwrap_or(i64::MAX).saturating_add(1); + if codec == CodecId::Opus { + let packets = track.samples.iter().enumerate().map(|(i, s)| { + let samples = f.read_sample(source, track_idx, i).ok().and_then(|p| opus_packet_samples(&p)).map(i64::from); + PacketTime { stamp: stamp_for(s.pts), stamped: s.lace == 0 || s.duration > 0, samples } + }); + return contiguous_starts(packets, tick_samples); + } + let Some(frame) = fixed_samples else { + return track.samples.iter().map(|s| stamp_for(s.pts)).collect(); + }; + let packets = track.samples.iter().map(|s| PacketTime { stamp: stamp_for(s.pts), stamped: s.lace == 0 || s.duration > 0, samples: Some(frame) }); + contiguous_starts(packets, (frame / 2).max(tick_samples)) } } } @@ -204,7 +325,7 @@ where { let mut audio_tracks = Vec::new(); let mut audio_infos = Vec::new(); - for (idx, sample_count, params, codec_delay_ns) in candidates { + for (idx, sample_count, params, _codec_delay_ns) in candidates { if audio_tracks.len() >= MAX_AUDIO_STREAMS { break; } @@ -215,10 +336,20 @@ where lookahead.push(pkt); } let refs: Vec<&[u8]> = lookahead.iter().map(Vec::as_slice).collect(); - let dec = AudioTrackDecoder::new(¶ms, &refs).ok()?; + let mut dec = AudioTrackDecoder::new(¶ms, &refs).ok()?; let native_rate = dec.sample_rate().max(1); let channels = u32::from(dec.layout().channels()).max(1); - let delay_samples = i64::try_from(audio_frames_from_ns(i128::from(codec_delay_ns), native_rate)).unwrap_or(0); + let codec = dec.codec(); + let fixed_samples = fixed_packet_samples(&mut dec, codec, &lookahead); + let audio_starts = compute_audio_starts(container, source, idx, codec, native_rate, fixed_samples); + let seek_preroll_samples = match container { + ContainerFile::Matroska(f) if codec == CodecId::Opus => { + let preroll_ns = i128::from(f.tracks[idx].seek_pre_roll_ns.max(80_000_000)); + i64::try_from(preroll_ns * i128::from(native_rate) / 1_000_000_000).unwrap_or(0) + } + _ => 0, + }; + let initial_pos = audio_starts.first().copied().unwrap_or(0); audio_infos.push(AudioStreamInfo { sample_rate: native_rate, channels, @@ -228,7 +359,9 @@ where audio_tracks.push(AudioTrackEntry { track_idx: idx, native_rate, - state: Mutex::new(AudioTrackState { decoder: dec, next_sample: 0, decoded_pos: -delay_samples, buf: Vec::new() }), + audio_starts, + seek_preroll_samples, + state: Mutex::new(AudioTrackState { decoder: dec, next_sample: 0, decoded_pos: initial_pos, buf: Vec::new() }), }); } Some((audio_tracks, audio_infos)) @@ -509,6 +642,8 @@ struct AudioTrackState { struct AudioTrackEntry { track_idx: usize, native_rate: u32, + audio_starts: Vec, + seek_preroll_samples: i64, state: Mutex, } @@ -622,7 +757,18 @@ impl MediaSource for CraftMediaSource { }; let mut state = entry.state.lock().unwrap_or_else(std::sync::PoisonError::into_inner); - let decoded = decode_audio_range(&self.file, &*self.source, entry.track_idx, native_rate, channels_count, &mut state, native_start, native_frames)?; + let decoded = decode_audio_range( + &self.file, + &*self.source, + entry.track_idx, + native_rate, + channels_count, + &entry.audio_starts, + entry.seek_preroll_samples, + &mut state, + native_start, + native_frames, + )?; if sample_rate == native_rate { return Ok(AudioBuffer { sample_rate, channels: decoded }); @@ -655,6 +801,8 @@ fn decode_audio_range( track_idx: usize, native_rate: u32, channels_count: usize, + audio_starts: &[i64], + seek_preroll_samples: i64, state: &mut AudioTrackState, start: i64, frames: usize, @@ -668,7 +816,7 @@ fn decode_audio_range( let buf_len = state.buf.first().map_or(0, Vec::len) as i64; let buf_end = state.decoded_pos.saturating_add(buf_len); if start < state.decoded_pos || start > buf_end + i64::from(native_rate) * 2 { - let (seek_idx, decoded_pos) = file.audio_seek_info(track_idx, start, native_rate); + let (seek_idx, decoded_pos) = ContainerFile::audio_seek_info(audio_starts, seek_preroll_samples, start); state.decoder.reset(); state.next_sample = seek_idx; state.decoded_pos = decoded_pos; @@ -687,9 +835,38 @@ fn decode_audio_range( return Err(MediaError::Cancelled); } let idx = state.next_sample; + let pk_start = audio_starts.get(idx).copied().unwrap_or_else(|| state.decoded_pos + state.buf.first().map_or(0, Vec::len) as i64); + if pk_start >= end { + break; + } let pkt = file.read_sample(source, track_idx, idx)?; state.next_sample = idx + 1; let block = state.decoder.decode(&pkt).map_err(|e| MediaError::Decode(e.to_string()))?; + let buf_len = state.buf.first().map_or(0, Vec::len) as i64; + if buf_len == 0 { + state.decoded_pos = pk_start; + } else { + let buf_end = state.decoded_pos.saturating_add(buf_len); + if pk_start > buf_end { + let gap = usize::try_from(pk_start - buf_end).unwrap_or(0); + for ch in &mut state.buf { + ch.resize(ch.len() + gap, 0.0); + } + } else if pk_start < buf_end { + if pk_start <= state.decoded_pos { + for ch in &mut state.buf { + ch.clear(); + } + state.decoded_pos = pk_start; + } else { + let overlap = usize::try_from(buf_end - pk_start).unwrap_or(0); + for ch in &mut state.buf { + let keep = ch.len().saturating_sub(overlap); + ch.truncate(keep); + } + } + } + } for (c, ch) in state.buf.iter_mut().enumerate() { if let Some(src_ch) = block.channels.get(c) { ch.extend_from_slice(src_ch); @@ -1318,4 +1495,61 @@ mod tests { assert_eq!(out.map(|f| f.par), Some((3, 4))); } } + + /// 1024-sample frames at 48 kHz stamped to the nearest millisecond, then back in samples. + fn ms_stamps(count: i64) -> Vec { + (0..count).map(|k| (k * 1024 * 1000 + 24_000) / 48_000 * 48).collect() + } + + fn timed(stamps: &[i64], samples: Option) -> Vec { + stamps.iter().map(|&stamp| PacketTime { stamp, stamped: true, samples }).collect() + } + + #[test] + fn rounded_stamps_give_back_to_back_packets() { + let stamps = ms_stamps(200); + assert_eq!(&stamps[..4], [0, 1008, 2064, 3072]); + let starts = contiguous_starts(timed(&stamps, Some(1024)), 512); + assert_eq!(starts, (0..200).map(|k| k * 1024).collect::>()); + } + + #[test] + fn real_gaps_and_overlaps_resynchronise() { + // A 100 ms gap after packet 3, then a packet stamped 600 samples early. + let mut stamps: Vec = (0..8).map(|k| k * 1024).collect(); + for s in &mut stamps[4..] { + *s += 4800; + } + stamps[7] -= 600; + let starts = contiguous_starts(timed(&stamps, Some(1024)), 512); + assert_eq!(starts, [0, 1024, 2048, 3072, 8896, 9920, 10944, 11368]); + // Within the tolerance: runs on. + stamps[7] += 200; + assert_eq!(contiguous_starts(timed(&stamps, Some(1024)), 512)[7], 11968); + } + + #[test] + fn unstamped_packets_follow_on_and_unknown_lengths_resynchronise() { + let packets = [0, 1024, 1024, 1024, 4096].map(|stamp| PacketTime { stamp, stamped: true, samples: Some(1024) }); + let mut laced = packets; + laced[2].stamped = false; + laced[3].stamped = false; + assert_eq!(contiguous_starts(laced, 512), [0, 1024, 2048, 3072, 4096]); + let mut unknown = timed(&[0, 1024, 2100, 3124], Some(1024)); + unknown[1].samples = None; + assert_eq!(contiguous_starts(unknown, 512), [0, 1024, 2100, 3124]); + } + + #[test] + fn hostile_values_stay_finite() { + let packets = [ + PacketTime { stamp: i64::MAX, stamped: true, samples: Some(i64::MAX) }, + PacketTime { stamp: i64::MIN, stamped: false, samples: Some(-5) }, + PacketTime { stamp: 0, stamped: true, samples: Some(i64::MIN) }, + PacketTime { stamp: 7, stamped: true, samples: None }, + ]; + assert_eq!(contiguous_starts(packets, i64::MIN).len(), 4); + assert_eq!(contiguous_starts(packets, i64::MAX).len(), 4); + assert!(contiguous_starts([], 512).is_empty()); + } } diff --git a/crates/media/tests/it/footage.rs b/crates/media/tests/it/footage.rs index df1751ff6..adbab9291 100644 --- a/crates/media/tests/it/footage.rs +++ b/crates/media/tests/it/footage.rs @@ -1727,3 +1727,165 @@ fn audio_only_isobmff_and_matroska_route_through_craft_audio() { assert!((rms_seek - 0.0625).abs() < 0.02, "{file} seek rms {rms_seek}"); } } + +fn read_audio_sequential(pool: &MediaPool, f: &Footage, total_frames: usize, chunk_frames: usize, rate: u32) -> Vec { + let mut out = Vec::with_capacity(total_frames * 2); + let mut pos = 0usize; + while pos < total_frames { + let len = chunk_frames.min(total_frames - pos); + let t = Tick::from_units(pos as i64, i64::from(rate)); + out.extend_from_slice(&pool.audio_samples(f, t, len, rate)); + pos += len; + } + out +} + +fn slice_rms(samples: &[f32]) -> f32 { + if samples.is_empty() { + return 0.0; + } + (samples.iter().map(|v| v * v).sum::() / samples.len() as f32).sqrt() +} + +fn assert_samples_close(a: &[f32], b: &[f32], tol: f32, ctx: &str) { + assert_eq!(a.len(), b.len(), "{ctx}: length mismatch"); + let max_diff = a.iter().zip(b).map(|(x, y)| (x - y).abs()).fold(0.0f32, f32::max); + assert!(max_diff <= tol, "{ctx}: max_diff {max_diff} > {tol}"); +} + +#[test] +fn mkv_and_mp4_aac_play_continuously_without_crackle_and_seek_matches_sequential() { + let Some(mp4_path) = + try_ffmpeg_fixture("aac_1546_pair.mp4", &["-f", "lavfi", "-i", "sine=frequency=440:sample_rate=48000:duration=2", "-c:a", "aac", "-b:a", "128k"]) + else { + return; + }; + let mp4_str = mp4_path.to_string_lossy().into_owned(); + let Some(mkv_path) = try_ffmpeg_fixture("aac_1546_pair.mkv", &["-i", &mp4_str, "-c:a", "copy"]) else { + return; + }; + + let mp4 = probe(&mp4_path).expect("probe mp4"); + let mkv = probe(&mkv_path).expect("probe mkv"); + let rate = 48_000u32; + let total_frames = 80_000usize; + + let mp4_seq = read_audio_sequential(&MediaPool::new(), &mp4, total_frames, 4096, rate); + let mkv_seq = read_audio_sequential(&MediaPool::new(), &mkv, total_frames, 4096, rate); + + // After the initial priming window (0.1s), MKV and MP4 must match without crackle. + let skip = 4800 * 2; + assert_samples_close(&mp4_seq[skip..], &mkv_seq[skip..], 0.01, "mkv vs mp4 sequential"); + + // Cold seeks on fresh MediaPools at t=0.5s and t=1.0s must match sequential playback. + for seek_frame in [24_000usize, 48_000usize] { + let t = Tick::from_units(seek_frame as i64, i64::from(rate)); + let cold = MediaPool::new().audio_samples(&mkv, t, 4800, rate); + let start = seek_frame * 2; + assert_samples_close(&cold, &mkv_seq[start..start + 4800 * 2], 1e-4, "mkv cold seek vs sequential"); + } + + // Backward seek after reading near the end must also match sequential playback. + let back_pool = MediaPool::new(); + let _ = back_pool.audio_samples(&mkv, Tick::from_units(60_000, i64::from(rate)), 4800, rate); + let backward = back_pool.audio_samples(&mkv, Tick::from_units(24_000, i64::from(rate)), 4800, rate); + assert_samples_close(&backward, &mkv_seq[24_000 * 2..24_000 * 2 + 4800 * 2], 1e-4, "mkv backward seek vs sequential"); +} + +fn build_gapped_aac_mkv(out_path: &Path, gap_at_pkt: usize, gap_ns: i64, start_offset_ns: i64) -> Option<()> { + let mp4_path = + try_ffmpeg_fixture("aac_1546_pair.mp4", &["-f", "lavfi", "-i", "sine=frequency=440:sample_rate=48000:duration=2", "-c:a", "aac", "-b:a", "128k"])?; + let bytes: std::sync::Arc<[u8]> = std::sync::Arc::from(std::fs::read(&mp4_path).ok()?); + let mp4 = craft_media::isobmff::open(bytes.clone()).ok()?; + let track_idx = mp4.tracks.iter().position(|t| t.kind == craft_media::isobmff::TrackKind::Audio)?; + let track = &mp4.tracks[track_idx]; + let asc = match &track.entries.first()?.codec { + craft_media::isobmff::CodecConfig::Aac(a) => a.asc.clone(), + _ => return None, + }; + + let mut spec = craft_media::matroska::TrackSpec::new(craft_media::matroska::TrackKind::Audio, "A_AAC"); + spec.codec_private = asc; + spec.audio = Some((48_000.0, u64::from(track.audio().map_or(2, |a| a.channels)), None)); + let mut writer = craft_media::matroska::MkvWriter::new(std::io::Cursor::new(Vec::new()), vec![spec], craft_media::matroska::MuxOptions::default()).ok()?; + + let pkt_count = track.samples.len().min(60); + for i in 0..pkt_count { + let pkt = mp4.read_sample(&*bytes, track_idx, i).ok()?; + let base_ns = (i as i64 * 1024 * 1_000_000_000) / 48_000; + let extra = if i >= gap_at_pkt { gap_ns } else { 0 }; + writer.write_frame(0, start_offset_ns + base_ns + extra, true, &pkt, None).ok()?; + } + let mkv_bytes = writer.finish().ok()?.into_inner(); + std::fs::write(out_path, mkv_bytes).ok()?; + Some(()) +} + +#[test] +fn audio_real_silence_gap_honored_on_sequential_and_seek() { + let dir = tempfile::tempdir().expect("tempdir"); + let mkv_path = dir.path().join("real_gap.mkv"); + // 24 packets (~0.512s) at 0, then a 500 ms silence gap before packet 24. + if build_gapped_aac_mkv(&mkv_path, 24, 500_000_000, 0).is_none() { + return; + } + + let f = probe(&mkv_path).expect("probe gapped mkv"); + let rate = 48_000u32; + let total_frames = 72_000usize; + let seq = read_audio_sequential(&MediaPool::new(), &f, total_frames, 4096, rate); + + // Pre-gap tone (0.1s..0.4s), silence gap (0.55s..0.95s), post-gap tone (1.1s..1.4s). + assert!(slice_rms(&seq[4800 * 2..19_200 * 2]) > 0.04, "pre-gap tone expected"); + assert!(slice_rms(&seq[26_400 * 2..45_600 * 2]) < 1e-4, "silence gap expected"); + assert!(slice_rms(&seq[52_800 * 2..67_200 * 2]) > 0.04, "post-gap tone expected"); + + for seek_frame in [9_600usize, 30_000usize, 54_000usize] { + let t = Tick::from_units(seek_frame as i64, i64::from(rate)); + let cold = MediaPool::new().audio_samples(&f, t, 4800, rate); + let start = seek_frame * 2; + assert_samples_close(&cold, &seq[start..start + 4800 * 2], 1e-4, "gap cold seek vs sequential"); + } + + let back_pool = MediaPool::new(); + let _ = back_pool.audio_samples(&f, Tick::from_units(54_000, i64::from(rate)), 4800, rate); + for seek_frame in [30_000usize, 9_600usize] { + let backward = back_pool.audio_samples(&f, Tick::from_units(seek_frame as i64, i64::from(rate)), 4800, rate); + let start = seek_frame * 2; + assert_samples_close(&backward, &seq[start..start + 4800 * 2], 1e-4, "gap backward seek vs sequential"); + } +} + +#[test] +fn audio_delayed_first_packet_honored_on_sequential_and_seek() { + let dir = tempfile::tempdir().expect("tempdir"); + let mkv_path = dir.path().join("delayed_first.mkv"); + // First packet delayed by 500 ms. + if build_gapped_aac_mkv(&mkv_path, usize::MAX, 0, 500_000_000).is_none() { + return; + } + + let f = probe(&mkv_path).expect("probe delayed mkv"); + let rate = 48_000u32; + let total_frames = 57_600usize; + let seq = read_audio_sequential(&MediaPool::new(), &f, total_frames, 4096, rate); + + // Leading silence (0..0.45s) and delayed tone (0.6s..1.0s). + assert!(slice_rms(&seq[..21_600 * 2]) < 1e-4, "leading silence expected"); + assert!(slice_rms(&seq[28_800 * 2..48_000 * 2]) > 0.04, "delayed tone expected"); + + for seek_frame in [4_800usize, 30_000usize] { + let t = Tick::from_units(seek_frame as i64, i64::from(rate)); + let cold = MediaPool::new().audio_samples(&f, t, 4800, rate); + let start = seek_frame * 2; + assert_samples_close(&cold, &seq[start..start + 4800 * 2], 1e-4, "delayed cold seek vs sequential"); + } + + let back_pool = MediaPool::new(); + let _ = back_pool.audio_samples(&f, Tick::from_units(36_000, i64::from(rate)), 4800, rate); + for seek_frame in [30_000usize, 4_800usize] { + let backward = back_pool.audio_samples(&f, Tick::from_units(seek_frame as i64, i64::from(rate)), 4800, rate); + let start = seek_frame * 2; + assert_samples_close(&backward, &seq[start..start + 4800 * 2], 1e-4, "delayed backward seek vs sequential"); + } +} From 3561194af374eac5247629737a30f20845c9f8ce Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Fri, 20 Nov 2026 23:55:20 -0500 Subject: [PATCH 338/451] media: route standalone audio (WAV/AIFF/MP3/AAC/AC-3/Ogg Opus) through craft-audio (#4009) * media: route standalone WAV, AIFF, MP3, ADTS AAC, AC-3, and Ogg Opus through craft-audio * media: fix slice indexing and exhaustive SampleFormat match * media: gate standalone audio for wasm, handle rate 0, and read wav markers * media: use ext_of(path) == "wav" for wav_markers in probe * media: deduplicate native_audio_window and drain_audio_window --- Cargo.lock | 2 + crates/media/Cargo.toml | 2 +- crates/media/src/craft_source.rs | 318 +++++++++++++++++++++++++------ crates/media/src/probe.rs | 5 + crates/media/tests/it/footage.rs | 30 +++ 5 files changed, 303 insertions(+), 54 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 360c25794..619e268fd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1210,6 +1210,8 @@ version = "0.1.0" source = "git+https://github.com/storytold/craft-libs?rev=3dff4793f1a5bd1f99a4fe3280d48f515158dff3#3dff4793f1a5bd1f99a4fe3280d48f515158dff3" dependencies = [ "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=3dff4793f1a5bd1f99a4fe3280d48f515158dff3)", + "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=3dff4793f1a5bd1f99a4fe3280d48f515158dff3)", + "log", "thiserror 2.0.21", ] diff --git a/crates/media/Cargo.toml b/crates/media/Cargo.toml index 668828fca..1808f6470 100644 --- a/crates/media/Cargo.toml +++ b/crates/media/Cargo.toml @@ -27,7 +27,7 @@ craft-dpx = { workspace = true } craft-exr = { workspace = true, features = ["decode"] } craft-gif = { workspace = true, features = ["frames"] } craft-webp = { workspace = true, features = ["frames"] } -craft-audio = { workspace = true, features = ["aac-decode", "alac-decode", "opus-decode", "ac3-decode", "mp3-decode", "mpa-decode"] } +craft-audio = { workspace = true, features = ["decode-native", "aac-decode", "alac-decode", "opus-decode", "ac3-decode", "mp3-decode", "mpa-decode"] } craft-color = { workspace = true } craft-frame = { workspace = true } craft-media = { workspace = true, features = ["mpegts"] } diff --git a/crates/media/src/craft_source.rs b/crates/media/src/craft_source.rs index dad5b9cd4..70614eec2 100644 --- a/crates/media/src/craft_source.rs +++ b/crates/media/src/craft_source.rs @@ -17,8 +17,11 @@ //! `Mp3`/`Mp2`/`Mp1` (with `CodecDelay` + `SeekPreRoll` timing). //! - Fallback (`filmcraft-codecs`): `alpha_mode == 1` (`BlockAdditional` alpha), unreadable/zlib //! encodings, `Mjpeg`/`Ffv1`/`Theora`/`Apv`, or unsupported audio (`Vorbis`/`Flac`/`Pcm`). -//! - **Other containers (`MXF`, `AVI`, `MPEG-TS`/`PS`, `Ogg`, standalone `WAV`/`AIFF`/`FLAC`/`MP3`)**: -//! - Currently routed via `filmcraft-codecs` in `stream.rs` (pending subsequent cutover PRs). +//! - **Other containers & standalone audio**: +//! - Shared (`craft_audio::Decoder` with `decode-native`): standalone `WAV`, `AIFF`, `MP3`/`MP2`/`MP1`, +//! `AAC` (ADTS), `AC-3`, and `Ogg` (`Opus`). +//! - Fallback (`filmcraft-codecs`): `MXF`, `AVI`, `MPEG-TS`/`PS`, `Ogg Vorbis`, `FLAC`, `CAF`, or +//! unsupported WAV/AIFF encodings. use std::sync::{Arc, Mutex}; @@ -69,7 +72,7 @@ fn looks_like_matroska(head: &[u8]) -> bool { head.starts_with(&[0x1A, 0x45, 0xDF, 0xA3]) } -/// Open an in-place ISO-BMFF or Matroska/WebM source via `craft-media` / `craft-video`. +/// Open an in-place ISO-BMFF, Matroska/WebM, or standalone audio source via `craft-media` / `craft-audio`. /// Returns `None` when the container/codec/audio combination should fall back to `filmcraft-codecs`. #[cfg(any(unix, windows))] pub(crate) fn open_reader(name: &str, head: &[u8], reader: &SharedBytes) -> Option> { @@ -79,10 +82,10 @@ pub(crate) fn open_reader(name: &str, head: &[u8], reader: &SharedBytes) -> Opti if looks_like_matroska(head) { return open_matroska(name, reader.clone()); } - None + open_standalone_audio(name, head, reader.clone()) } -/// Open an in-memory ISO-BMFF or Matroska/WebM source via `craft-media` / `craft-video`. +/// Open an in-memory ISO-BMFF, Matroska/WebM, or standalone audio source via `craft-media` / `craft-audio`. pub(crate) fn open_bytes(name: &str, bytes: Arc<[u8]>) -> Option> { if looks_like_isobmff(&bytes) { return open_isobmff(name, Arc::new(bytes)); @@ -90,7 +93,16 @@ pub(crate) fn open_bytes(name: &str, bytes: Arc<[u8]>) -> Option::len(&bytes).min(64); + let head = bytes[..head_len].to_vec(); + open_standalone_audio(name, &head, Arc::new(bytes)) + } + #[cfg(not(any(unix, windows)))] + { + None + } } enum ContainerFile { @@ -748,13 +760,7 @@ impl MediaSource for CraftMediaSource { } let native_rate = entry.native_rate; - let (native_start, native_frames) = if sample_rate == native_rate { - (start, frames) - } else { - let s0 = (i128::from(start) * i128::from(native_rate)) / i128::from(sample_rate); - let len = ((frames as u128 * u128::from(native_rate)).div_ceil(u128::from(sample_rate)) + 2) as usize; - (i64::try_from(s0).unwrap_or(0), len) - }; + let (native_start, native_frames) = native_audio_window(start, frames, native_rate, sample_rate); let mut state = entry.state.lock().unwrap_or_else(std::sync::PoisonError::into_inner); let decoded = decode_audio_range( @@ -774,24 +780,210 @@ impl MediaSource for CraftMediaSource { return Ok(AudioBuffer { sample_rate, channels: decoded }); } - let mut resampled = vec![vec![0.0f32; frames]; channels_count]; - let ratio = f64::from(native_rate) / f64::from(sample_rate); - for (c, out_ch) in resampled.iter_mut().enumerate() { - let in_ch = &decoded[c]; - if in_ch.is_empty() { - continue; - } - for (i, dst) in out_ch.iter_mut().enumerate() { - let pos = i as f64 * ratio; - let idx = pos.floor() as usize; - let frac = (pos - idx as f64) as f32; - let s0 = in_ch.get(idx).copied().unwrap_or(0.0); - let s1 = in_ch.get(idx + 1).copied().unwrap_or(s0); - *dst = s0 + (s1 - s0) * frac; + Ok(AudioBuffer { sample_rate, channels: resample_audio(&decoded, channels_count, native_rate, sample_rate, frames) }) + } +} + +#[cfg(any(unix, windows))] +struct SharedBytesSource(SharedBytes); + +#[cfg(any(unix, windows))] +impl ByteSource for SharedBytesSource { + fn len(&self) -> u64 { + self.0.len() + } + + fn read_at(&self, offset: u64, buf: &mut [u8]) -> std::io::Result<()> { + self.0.read_at(offset, buf) + } +} + +#[cfg(any(unix, windows))] +struct StandaloneAudioState { + decoder: craft_audio::Decoder<'static>, + decoded_pos: i64, + buf: Vec>, +} + +#[cfg(any(unix, windows))] +struct StandaloneAudioSource { + info: MediaInfo, + native_rate: u32, + state: Mutex, +} + +#[cfg(any(unix, windows))] +impl MediaSource for StandaloneAudioSource { + fn info(&self) -> &MediaInfo { + &self.info + } + + fn video_frame(&self, _req: FrameRequest) -> Result> { + Err(MediaError::NoStream("video")) + } + + fn audio(&self, start: i64, frames: usize, sample_rate: u32) -> Result { + self.audio_stream(0, start, frames, sample_rate) + } + + fn audio_stream(&self, stream: usize, start: i64, frames: usize, sample_rate: u32) -> Result { + if stream != 0 { + return Err(MediaError::NoStream("audio")); + } + let channels_count = self.info.audio_streams.first().map_or(2, |s| s.channels as usize); + if frames == 0 || sample_rate == 0 { + return Ok(AudioBuffer::new(sample_rate, channels_count as u16, frames)); + } + let native_rate = self.native_rate; + let (native_start, native_frames) = native_audio_window(start, frames, native_rate, sample_rate); + + let mut state = self.state.lock().unwrap_or_else(std::sync::PoisonError::into_inner); + let decoded = decode_standalone_range(native_rate, channels_count, &mut state, native_start, native_frames)?; + if sample_rate == native_rate { + return Ok(AudioBuffer { sample_rate, channels: decoded }); + } + Ok(AudioBuffer { sample_rate, channels: resample_audio(&decoded, channels_count, native_rate, sample_rate, frames) }) + } +} + +#[cfg(any(unix, windows))] +fn decode_standalone_range(native_rate: u32, channels_count: usize, state: &mut StandaloneAudioState, start: i64, frames: usize) -> Result>> { + let end = start.saturating_add(frames as i64); + if end <= 0 { + return Ok(vec![vec![0.0f32; frames]; channels_count]); + } + + let buf_len = state.buf.first().map_or(0, Vec::len) as i64; + let buf_end = state.decoded_pos.saturating_add(buf_len); + if start < state.decoded_pos || start > buf_end + i64::from(native_rate) * 2 { + let target = u64::try_from(start.max(0)).unwrap_or(0); + let actual = state.decoder.seek(target).map_err(|e| MediaError::Decode(e.to_string()))?; + state.decoded_pos = i64::try_from(actual).unwrap_or(i64::MAX); + for ch in &mut state.buf { + ch.clear(); + } + } + + if state.buf.len() != channels_count { + state.buf = vec![Vec::new(); channels_count]; + } + + while state.decoded_pos + state.buf.first().map_or(0, Vec::len) as i64 <= end { + if filmcraft_media::cancel::cancelled() { + return Err(MediaError::Cancelled); + } + let Some(block) = state.decoder.next_block().map_err(|e| MediaError::Decode(e.to_string()))? else { + break; + }; + for (c, ch) in state.buf.iter_mut().enumerate() { + if let Some(src_ch) = block.channels.get(c) { + ch.extend_from_slice(src_ch); } } - Ok(AudioBuffer { sample_rate, channels: resampled }) } + + Ok(drain_audio_window(&mut state.buf, &mut state.decoded_pos, channels_count, start, frames)) +} + +fn native_audio_window(start: i64, frames: usize, native_rate: u32, sample_rate: u32) -> (i64, usize) { + if sample_rate == native_rate { + return (start, frames); + } + let s0 = (i128::from(start) * i128::from(native_rate)) / i128::from(sample_rate); + let len = ((frames as u128 * u128::from(native_rate)).div_ceil(u128::from(sample_rate)) + 2) as usize; + (i64::try_from(s0).unwrap_or(0), len) +} + +fn drain_audio_window(buf: &mut [Vec], decoded_pos: &mut i64, channels_count: usize, start: i64, frames: usize) -> Vec> { + let mut out = vec![vec![0.0f32; frames]; channels_count]; + let avail = buf.first().map_or(0, Vec::len); + for i in 0..frames { + let pos = start.saturating_add(i as i64); + if pos >= *decoded_pos { + let off = (pos - *decoded_pos) as usize; + if off < avail { + for (c, out_ch) in out.iter_mut().enumerate() { + out_ch[i] = buf[c][off]; + } + } + } + } + let end = start.saturating_add(frames as i64); + let drop_to = (end - *decoded_pos).max(0) as usize; + let trim = drop_to.min(avail); + if trim > 0 { + for ch in buf { + ch.drain(..trim); + } + *decoded_pos = decoded_pos.saturating_add(trim as i64); + } + out +} + +fn resample_audio(decoded: &[Vec], channels_count: usize, native_rate: u32, sample_rate: u32, frames: usize) -> Vec> { + let mut resampled = vec![vec![0.0f32; frames]; channels_count]; + let ratio = f64::from(native_rate) / f64::from(sample_rate); + for (c, out_ch) in resampled.iter_mut().enumerate() { + let in_ch = &decoded[c]; + if in_ch.is_empty() { + continue; + } + for (i, dst) in out_ch.iter_mut().enumerate() { + let pos = i as f64 * ratio; + let idx = pos.floor() as usize; + let frac = (pos - idx as f64) as f32; + let s0 = in_ch.get(idx).copied().unwrap_or(0.0); + let s1 = in_ch.get(idx + 1).copied().unwrap_or(s0); + *dst = s0 + (s1 - s0) * frac; + } + } + resampled +} + +#[cfg(any(unix, windows))] +fn open_standalone_audio(name: &str, head: &[u8], source: SharedBytes) -> Option> { + let ext = std::path::Path::new(name).extension().and_then(|e| e.to_str()); + let container = craft_audio::detect_container(head, ext)?; + let container_name = match container { + craft_audio::Container::Wav => "wav", + craft_audio::Container::Aiff => "aiff", + craft_audio::Container::MpegAudio => "mp3", + craft_audio::Container::Adts => "aac", + craft_audio::Container::Ac3 => "ac3", + craft_audio::Container::Ogg => "ogg", + _ => return None, + }; + + let dec = craft_audio::Decoder::open(SharedBytesSource(source.clone()), ext, &craft_audio::DecodeOptions::default()).ok()?; + let audio_info = if dec.length_known() { + dec.info().clone() + } else { + craft_audio::Decoder::open(SharedBytesSource(source.clone()), ext, &craft_audio::DecodeOptions::default()).ok()?.probe().ok()? + }; + + let native_rate = audio_info.sample_rate.max(1); + let channels = u32::from(audio_info.channels).max(1); + let duration = Tick::from_units(i64::try_from(audio_info.frames).unwrap_or(i64::MAX), i64::from(native_rate)); + let bits_per_sample = match audio_info.sample_format { + craft_audio::SampleFormat::Int8 => Some(8), + craft_audio::SampleFormat::Int16 => Some(16), + craft_audio::SampleFormat::Int24 => Some(24), + craft_audio::SampleFormat::Int32 | craft_audio::SampleFormat::Float32 => Some(32), + craft_audio::SampleFormat::Float64 => Some(64), + craft_audio::SampleFormat::Compressed | _ => None, + }; + let info = MediaInfo { + name: name.to_string(), + kind: MediaKind::AudioOnly, + duration, + video: None, + audio_streams: vec![AudioStreamInfo { sample_rate: native_rate, channels, codec: audio_info.codec.name().to_string(), bits_per_sample }], + container: container_name.to_string(), + start_timecode: None, + file_size: Some(source.len()), + }; + + Some(Ok(Arc::new(StandaloneAudioSource { info, native_rate, state: Mutex::new(StandaloneAudioState { decoder: dec, decoded_pos: 0, buf: Vec::new() }) }))) } #[allow(clippy::too_many_arguments)] @@ -807,10 +999,9 @@ fn decode_audio_range( start: i64, frames: usize, ) -> Result>> { - let mut out = vec![vec![0.0f32; frames]; channels_count]; let end = start.saturating_add(frames as i64); if end <= 0 { - return Ok(out); + return Ok(vec![vec![0.0f32; frames]; channels_count]); } let buf_len = state.buf.first().map_or(0, Vec::len) as i64; @@ -874,29 +1065,7 @@ fn decode_audio_range( } } - let avail = state.buf.first().map_or(0, Vec::len); - for i in 0..frames { - let pos = start.saturating_add(i as i64); - if pos >= state.decoded_pos { - let off = (pos - state.decoded_pos) as usize; - if off < avail { - for (c, out_ch) in out.iter_mut().enumerate() { - out_ch[i] = state.buf[c][off]; - } - } - } - } - - let drop_to = (end - state.decoded_pos).max(0) as usize; - let trim = drop_to.min(avail); - if trim > 0 { - for ch in &mut state.buf { - ch.drain(..trim); - } - state.decoded_pos = state.decoded_pos.saturating_add(trim as i64); - } - - Ok(out) + Ok(drain_audio_window(&mut state.buf, &mut state.decoded_pos, channels_count, start, frames)) } fn push_decoded( @@ -1496,6 +1665,49 @@ mod tests { } } + #[test] + fn standalone_wav_opens_seeks_and_resamples_via_craft_audio() { + // Minimal 48 kHz stereo 16-bit PCM WAV with 4800 frames (0.1s). + let frames = 4800u32; + let data_bytes = frames * 4; + let mut wav = Vec::with_capacity(44 + data_bytes as usize); + wav.extend_from_slice(b"RIFF"); + wav.extend_from_slice(&(36 + data_bytes).to_le_bytes()); + wav.extend_from_slice(b"WAVEfmt "); + wav.extend_from_slice(&16u32.to_le_bytes()); + wav.extend_from_slice(&1u16.to_le_bytes()); + wav.extend_from_slice(&2u16.to_le_bytes()); + wav.extend_from_slice(&48_000u32.to_le_bytes()); + wav.extend_from_slice(&(48_000u32 * 4).to_le_bytes()); + wav.extend_from_slice(&4u16.to_le_bytes()); + wav.extend_from_slice(&16u16.to_le_bytes()); + wav.extend_from_slice(b"data"); + wav.extend_from_slice(&data_bytes.to_le_bytes()); + for i in 0..frames * 2 { + let s = (((i as i32 * 257) % 16000) - 8000) as i16; + wav.extend_from_slice(&s.to_le_bytes()); + } + + let src = open_bytes("tone.wav", Arc::from(wav)).expect("recognized").expect("opened"); + let info = src.info(); + assert_eq!(info.container, "wav"); + assert_eq!(info.kind, MediaKind::AudioOnly); + assert_eq!(info.audio_streams[0].sample_rate, 48_000); + assert_eq!(info.audio_streams[0].bits_per_sample, Some(16)); + + let head = src.audio(0, 512, 48_000).expect("head"); + assert_eq!(head.channels[0].len(), 512); + let tail = src.audio(4000, 512, 48_000).expect("forward seek"); + assert!(tail.channels[0].iter().any(|&v| v.abs() > 0.01)); + let back = src.audio(0, 512, 48_000).expect("backward seek"); + assert_eq!(head.channels[0], back.channels[0]); + let neg = src.audio(-50, 100, 48_000).expect("negative start"); + assert!(neg.channels[0][..50].iter().all(|&v| v == 0.0)); + let resampled = src.audio(0, 256, 44_100).expect("resampled"); + assert_eq!(resampled.sample_rate, 44_100); + assert_eq!(resampled.channels[0].len(), 256); + } + /// 1024-sample frames at 48 kHz stamped to the nearest millisecond, then back in samples. fn ms_stamps(count: i64) -> Vec { (0..count).map(|k| (k * 1024 * 1000 + 24_000) / 48_000 * 48).collect() diff --git a/crates/media/src/probe.rs b/crates/media/src/probe.rs index 52a29a363..74d8fb9a5 100644 --- a/crates/media/src/probe.rs +++ b/crates/media/src/probe.rs @@ -28,6 +28,11 @@ pub fn probe(path: impl AsRef) -> Result { // A movie is read in place (its index), not loaded whole. if let Some(src) = crate::stream::probe_source(path) { let mut f = footage_from_source(&path.to_string_lossy(), &src?); + if ext_of(path) == "wav" + && let Ok(bytes) = crate::read_regular_file(path) + { + f.markers = crate::wav_markers::read(&bytes); + } let header = crate::stream::movie_header(path); let turn = header.as_deref().map_or(Orientation::NoTransforms, video_turn); turn_footage(&mut f, turn); diff --git a/crates/media/tests/it/footage.rs b/crates/media/tests/it/footage.rs index adbab9291..08b7158b1 100644 --- a/crates/media/tests/it/footage.rs +++ b/crates/media/tests/it/footage.rs @@ -1728,6 +1728,36 @@ fn audio_only_isobmff_and_matroska_route_through_craft_audio() { } } +#[test] +fn standalone_audio_formats_route_through_craft_audio() { + for (file, args) in [ + ("standalone_tone.wav", &["-c:a", "pcm_s16le"][..]), + ("standalone_tone.aiff", &["-c:a", "pcm_s16be"][..]), + ("standalone_tone.mp3", &["-c:a", "libmp3lame", "-b:a", "128k"][..]), + ("standalone_tone.aac", &["-c:a", "aac", "-b:a", "128k"][..]), + ("standalone_tone.ac3", &["-c:a", "ac3", "-b:a", "192k"][..]), + ("standalone_tone.ogg", &["-c:a", "libopus"][..]), + ] { + let mut ffmpeg_args = vec!["-f", "lavfi", "-i", "sine=frequency=440:sample_rate=48000:duration=1"]; + ffmpeg_args.extend_from_slice(args); + let Some(p) = try_ffmpeg_fixture(file, &ffmpeg_args) else { + continue; + }; + let f = probe(&p).expect(file); + assert_eq!(f.kind, FootageKind::Audio, "{file} must probe as Audio"); + assert!(!f.has_video, "{file} has no video"); + assert!(f.has_audio, "{file} has audio"); + assert!(f.duration >= Tick(TICKS_PER_SECOND * 8 / 10), "{file} duration {:?}", f.duration); + let pool = MediaPool::new(); + let start = pool.audio_samples(&f, Tick::ZERO, 4800, 48_000); + let seek = pool.audio_samples(&f, Tick(TICKS_PER_SECOND / 2), 4800, 48_000); + assert_eq!(start.len(), 9600, "{file} start len"); + assert_eq!(seek.len(), 9600, "{file} seek len"); + let rms_seek = (seek.iter().map(|v| v * v).sum::() / seek.len() as f32).sqrt(); + assert!((rms_seek - 0.0625).abs() < 0.03, "{file} seek rms {rms_seek}"); + } +} + fn read_audio_sequential(pool: &MediaPool, f: &Footage, total_frames: usize, chunk_frames: usize, rate: u32) -> Vec { let mut out = Vec::with_capacity(total_frames * 2); let mut pos = 0usize; From 1c9892264cd8c9ea38882d1875344fbcb264f2fd Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sat, 21 Nov 2026 00:25:07 -0500 Subject: [PATCH 339/451] media: preserve durationless laced audio and narrow overlap reads (#4013) --- crates/media/src/craft_source.rs | 122 +++++++++++++++++++++++++++++-- 1 file changed, 117 insertions(+), 5 deletions(-) diff --git a/crates/media/src/craft_source.rs b/crates/media/src/craft_source.rs index 70614eec2..ec45a35b5 100644 --- a/crates/media/src/craft_source.rs +++ b/crates/media/src/craft_source.rs @@ -171,10 +171,20 @@ impl ContainerFile { } } - fn audio_seek_info(audio_starts: &[i64], seek_preroll_samples: i64, start: i64) -> (usize, i64) { + fn audio_packet_is_stamped(&self, track_idx: usize, sample_idx: usize) -> bool { + match self { + Self::Isobmff(_) => true, + Self::Matroska(f) => f.tracks[track_idx].samples.get(sample_idx).is_some_and(|s| s.lace == 0 || s.duration > 0), + } + } + + fn audio_seek_info(&self, track_idx: usize, audio_starts: &[i64], seek_preroll_samples: i64, start: i64) -> (usize, i64) { let target = start.saturating_sub(seek_preroll_samples).max(0); let sample_idx = audio_starts.partition_point(|&s| s <= target).saturating_sub(1); - let seek_idx = sample_idx.saturating_sub(2); + let mut seek_idx = sample_idx.saturating_sub(2); + while seek_idx > 0 && !self.audio_packet_is_stamped(track_idx, seek_idx) { + seek_idx -= 1; + } let decoded_pos = audio_starts.get(seek_idx).copied().unwrap_or(0); (seek_idx, decoded_pos) } @@ -1007,7 +1017,7 @@ fn decode_audio_range( let buf_len = state.buf.first().map_or(0, Vec::len) as i64; let buf_end = state.decoded_pos.saturating_add(buf_len); if start < state.decoded_pos || start > buf_end + i64::from(native_rate) * 2 { - let (seek_idx, decoded_pos) = ContainerFile::audio_seek_info(audio_starts, seek_preroll_samples, start); + let (seek_idx, decoded_pos) = file.audio_seek_info(track_idx, audio_starts, seek_preroll_samples, start); state.decoder.reset(); state.next_sample = seek_idx; state.decoded_pos = decoded_pos; @@ -1021,12 +1031,14 @@ fn decode_audio_range( } let sample_count = file.sample_count(track_idx); - while state.decoded_pos + state.buf.first().map_or(0, Vec::len) as i64 <= end && state.next_sample < sample_count { + while state.next_sample < sample_count { if filmcraft_media::cancel::cancelled() { return Err(MediaError::Cancelled); } let idx = state.next_sample; - let pk_start = audio_starts.get(idx).copied().unwrap_or_else(|| state.decoded_pos + state.buf.first().map_or(0, Vec::len) as i64); + let buf_len = state.buf.first().map_or(0, Vec::len) as i64; + let buf_end = state.decoded_pos.saturating_add(buf_len); + let pk_start = if buf_len > 0 && !file.audio_packet_is_stamped(track_idx, idx) { buf_end } else { audio_starts.get(idx).copied().unwrap_or(buf_end) }; if pk_start >= end { break; } @@ -1764,4 +1776,104 @@ mod tests { assert_eq!(contiguous_starts(packets, i64::MAX).len(), 4); assert!(contiguous_starts([], 512).is_empty()); } + + fn pcm_s16le_bytes(sample: i16, count: usize) -> Vec { + std::iter::repeat_n(sample.to_le_bytes(), count).flatten().collect() + } + + #[test] + fn matroska_durationless_lace_variable_pcm_preserves_all_blocks() { + use std::io::Cursor; + + let mut track = matroska::TrackSpec::new(matroska::TrackKind::Audio, "A_PCM/INT/LIT"); + track.audio = Some((48_000.0, 1, Some(16))); + let mut mux = matroska::MkvWriter::new(Cursor::new(Vec::new()), vec![track], matroska::MuxOptions::default()).unwrap(); + let blocks = [(8_000i16, 120usize), (-16_000i16, 200usize), (24_000i16, 80usize), (4_000i16, 100usize)]; + let pts_ns = [0i64, 2_000_000, 4_000_000, 8_333_333]; + for ((val, len), pts) in blocks.iter().zip(pts_ns) { + mux.write_frame(0, pts, true, &pcm_s16le_bytes(*val, *len), None).unwrap(); + } + let bytes = mux.finish().unwrap().into_inner(); + let mut mkv = matroska::open(bytes.as_slice()).unwrap(); + // Simulate a durationless lace for blocks 0..3 sharing block 0's timestamp. + let base_pts = mkv.tracks[0].samples[0].pts; + for (lace, s) in mkv.tracks[0].samples[..3].iter_mut().enumerate() { + s.pts = base_pts; + s.duration = 0; + s.lace = lace as u16; + } + let params = mkv.tracks[0].codec_params(); + let file = ContainerFile::Matroska(Box::new(mkv)); + let (mut tracks, _) = open_audio_tracks(&file, &bytes, [(0, 4, params.clone(), 0)]).unwrap(); + + let decode = |track: &mut AudioTrackEntry, start: i64, frames: usize| { + decode_audio_range(&file, &bytes, 0, 48_000, 1, &track.audio_starts, track.seek_preroll_samples, track.state.get_mut().unwrap(), start, frames) + .unwrap() + }; + + let full = decode(&mut tracks[0], 0, 500); + assert_eq!(full[0].len(), 500); + // Each block's samples remain intact at their cumulative offsets (0..120, 120..320, 320..400, 400..500). + assert!((full[0][0] - (8_000.0 / 32_768.0)).abs() < 1e-4); + assert!((full[0][120] - (-16_000.0 / 32_768.0)).abs() < 1e-4); + assert!((full[0][320] - (24_000.0 / 32_768.0)).abs() < 1e-4); + assert!((full[0][400] - (4_000.0 / 32_768.0)).abs() < 1e-4); + + // Chunked sequential reads and a backward seek into the lace must match the full read. + let (mut chunked_tracks, _) = open_audio_tracks(&file, &bytes, [(0, 4, params, 0)]).unwrap(); + let mut chunked = Vec::new(); + for (start, frames) in [(0, 150), (150, 200), (350, 150)] { + chunked.extend_from_slice(&decode(&mut chunked_tracks[0], start, frames)[0]); + } + assert_eq!(chunked, full[0]); + + let rewound = decode(&mut tracks[0], 200, 250); + assert_eq!(rewound[0], full[0][200..450]); + } + + #[test] + fn narrow_read_includes_overlapping_packet_like_wider_read() { + use std::io::Cursor; + + let mut track = matroska::TrackSpec::new(matroska::TrackKind::Audio, "A_PCM/INT/LIT"); + track.audio = Some((48_000.0, 1, Some(16))); + let mut mux = matroska::MkvWriter::new(Cursor::new(Vec::new()), vec![track], matroska::MuxOptions::default()).unwrap(); + mux.write_frame(0, 0, true, &pcm_s16le_bytes(8_000, 1024), None).unwrap(); + mux.write_frame(0, 10_666_667, true, &pcm_s16le_bytes(-16_000, 1024), None).unwrap(); + let bytes = mux.finish().unwrap().into_inner(); + let mkv = matroska::open(bytes.as_slice()).unwrap(); + let params = mkv.tracks[0].codec_params(); + let file = ContainerFile::Matroska(Box::new(mkv)); + + let open_with_overlap = || { + let (mut tracks, _) = open_audio_tracks(&file, &bytes, [(0, 2, params.clone(), 0)]).unwrap(); + tracks[0].audio_starts = vec![0, 512]; + tracks + }; + let decode = |track: &mut AudioTrackEntry, start: i64, frames: usize| { + decode_audio_range(&file, &bytes, 0, 48_000, 1, &track.audio_starts, track.seek_preroll_samples, track.state.get_mut().unwrap(), start, frames) + .unwrap() + }; + + let mut wide_tracks = open_with_overlap(); + let wide = decode(&mut wide_tracks[0], 0, 1536); + + // Narrow read [0, 600) ends before packet 0's 1024-sample tail, yet must include packet 1 at 512. + let mut narrow_tracks = open_with_overlap(); + let narrow = decode(&mut narrow_tracks[0], 0, 600); + assert_eq!(narrow[0], wide[0][..600]); + assert!((narrow[0][0] - (8_000.0 / 32_768.0)).abs() < 1e-4); + assert!((narrow[0][512] - (-16_000.0 / 32_768.0)).abs() < 1e-4); + + // Chunked reads and a backward seek over the same interval must also match. + let mut chunked_tracks = open_with_overlap(); + let mut chunked = Vec::new(); + for (start, frames) in [(0, 300), (300, 300)] { + chunked.extend_from_slice(&decode(&mut chunked_tracks[0], start, frames)[0]); + } + assert_eq!(chunked, wide[0][..600]); + + let rewound = decode(&mut wide_tracks[0], 0, 600); + assert_eq!(rewound[0], wide[0][..600]); + } } From 70c195ec28a5f8b76c4ad7d71f05aac181972710 Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Sat, 21 Nov 2026 12:46:35 +0700 Subject: [PATCH 340/451] Preserve recorded MOV timecode in the shared reader (#4012) Use the timecode track's presentation clock to rebase EDL source timecodes for compatible continuous edits. Leave ambiguous origins unset. --- crates/media/src/craft_source.rs | 72 ++++++++++++- crates/media/tests/it/file_timecode.rs | 136 +++++++++++++++++++++++-- 2 files changed, 200 insertions(+), 8 deletions(-) diff --git a/crates/media/src/craft_source.rs b/crates/media/src/craft_source.rs index ec45a35b5..20816535c 100644 --- a/crates/media/src/craft_source.rs +++ b/crates/media/src/craft_source.rs @@ -446,6 +446,75 @@ fn clean_aperture_region(aperture: isobmff::CleanAperture, (width, height): (u32 (!r.is_full(width as usize, height as usize)).then_some(r) } +/// A single unit-rate media span, optionally preceded by one empty span. A +/// scalar EDL origin cannot describe dwell, disjoint edits or respeeding. +fn continuous_edit_mapping(track: &isobmff::Track, movie_timescale: u32) -> Option<(i64, i64)> { + const UNIT_RATE: i32 = 0x0001_0000; + let (leading_duration, media) = match track.edits.as_slice() { + [] => return (track.edit_offset == 0).then_some((0, 0)), + [media] => (0, media), + [empty, media] if empty.media_time == -1 && empty.segment_duration > 0 && empty.media_rate == UNIT_RATE => (empty.segment_duration, media), + _ => return None, + }; + if media.media_time < 0 || media.segment_duration == 0 || media.media_rate != UNIT_RATE || movie_timescale == 0 || track.timescale == 0 { + return None; + } + // Check the raw movie-to-media conversion before the demuxer's rounded + // offset can make a fractional delay look like an integral frame. + let lead = i128::from(leading_duration) * i128::from(track.timescale); + let movie_clock = i128::from(movie_timescale); + if lead % movie_clock != 0 { + return None; + } + let offset = i64::try_from(lead / movie_clock - i128::from(media.media_time)).ok()?; + (offset == track.edit_offset).then_some((media.media_time, offset)) +} + +/// The EDL origin is the timecode at presentation time zero, not the raw +/// counter at the start of the timecode sample. Its own track's edit and media +/// clock determine that sample's position; the video may have a different edit. +fn isobmff_timecode_origin(file: &Mp4File, video_idx: usize, video_rate: FrameRate) -> Option { + let video = file.tracks.get(video_idx)?; + continuous_edit_mapping(video, file.timescale)?; + let mut links = video.references.iter().filter(|(kind, _)| kind.0 == *b"tmcd").flat_map(|(_, ids)| ids); + let linked = links.next(); + if links.next().is_some() { + return None; + } + + let mut tracks = file.tracks.iter().filter(|track| track.kind == isobmff::TrackKind::Timecode && linked.is_none_or(|id| track.id == *id)); + let track = tracks.next()?; + if tracks.next().is_some() { + return None; + } + let [entry] = track.entries.as_slice() else { return None }; + let isobmff::CodecConfig::Timecode(tc) = &entry.codec else { return None }; + let [sample] = track.samples.as_slice() else { return None }; + let (media_start, timecode_offset) = continuous_edit_mapping(track, file.timescale)?; + if track.timescale == 0 || tc.timescale == 0 || tc.frame_duration == 0 || video_rate.num <= 0 || video_rate.den <= 0 { + return None; + } + if !track.edits.is_empty() && !(sample.pts..sample.pts.checked_add(i64::from(sample.duration))?).contains(&media_start) { + return None; + } + + // EDL subtracts the origin in native video frames; do not invent a + // rounding or clock-conversion policy for nonmatching or fractional origins. + let num = i128::from(tc.timescale); + let den = i128::from(tc.frame_duration); + if num * i128::from(video_rate.den) != den * i128::from(video_rate.num) + || video.samples.iter().any(|sample| i128::from(sample.duration) * num != i128::from(video.timescale) * den) + { + return None; + } + let delta = (i128::from(sample.pts) + i128::from(timecode_offset)) * num; + let divisor = i128::from(track.timescale) * den; + if delta % divisor != 0 { + return None; + } + i64::try_from(i128::from(tc.start_frame?) - delta / divisor).ok().filter(|&origin| origin >= 0) +} + fn open_isobmff(name: &str, source: SharedBytes) -> Option> { let file = isobmff::open(source.clone()).ok()?; let video_idx = file.tracks.iter().position(|t| t.kind == isobmff::TrackKind::Video && !t.samples.is_empty() && !t.entries.is_empty() && t.timescale > 0); @@ -523,6 +592,7 @@ fn open_isobmff(name: &str, source: SharedBytes) -> Option> (None, None, FramePresentation { container_color: None, par: (1, 1), rotation: 0, aperture: None }, duration) }; + let start_timecode = video_idx.zip(video_info.as_ref()).and_then(|(idx, info)| isobmff_timecode_origin(&file, idx, info.frame_rate)); let container = ContainerFile::Isobmff(file); let (audio_tracks, audio_infos) = open_audio_tracks(&container, &*source, audio_candidates)?; if video_info.is_none() && audio_tracks.is_empty() { @@ -537,7 +607,7 @@ fn open_isobmff(name: &str, source: SharedBytes) -> Option> video: video_info, audio_streams: audio_infos, container: "mp4".to_string(), - start_timecode: None, + start_timecode, file_size: Some(source.len()), }; diff --git a/crates/media/tests/it/file_timecode.rs b/crates/media/tests/it/file_timecode.rs index dae3335ba..7a91640fc 100644 --- a/crates/media/tests/it/file_timecode.rs +++ b/crates/media/tests/it/file_timecode.rs @@ -5,18 +5,16 @@ use std::io::Cursor; use craft_media::isobmff::{Brand, Mp4Writer, SampleEntry, TimecodeConfig, TrackConfig, WriteSample, WriterOptions}; use effectcraft_project::FootageKind; -/// A two-frame 24 fps Motion JPEG MOV, with a timecode track from `start_frame` when given. -fn mov(start_frame: Option) -> Vec { - let mut jpeg = Vec::new(); - image::RgbImage::from_pixel(16, 16, image::Rgb([200, 40, 90])).write_to(&mut Cursor::new(&mut jpeg), image::ImageFormat::Jpeg).expect("jpeg"); +/// A two-frame 24 fps MOV, with a timecode track from `start_frame` when given. +fn mov(entry: SampleEntry, packet: &[u8], start_frame: Option) -> Vec { let mut w = Mp4Writer::new(Cursor::new(Vec::new()), WriterOptions::new(Brand::Mov)).expect("writer"); - let v = w.add_track(TrackConfig::new(SampleEntry::jpeg(16, 16), 24)).expect("video track"); + let v = w.add_track(TrackConfig::new(entry, 24)).expect("video track"); if let Some(start) = start_frame { let tc = TimecodeConfig { timescale: 24, frame_duration: 1, frames_per_second: 24, ..Default::default() }; w.add_timecode_track(v, tc, start).expect("timecode track"); } for _ in 0..2 { - w.write_sample(v, WriteSample { data: &jpeg, duration: 1, composition_offset: 0, is_sync: true }).expect("frame"); + w.write_sample(v, WriteSample { data: packet, duration: 1, composition_offset: 0, is_sync: true }).expect("frame"); } w.finish().expect("finish").into_inner() } @@ -25,10 +23,12 @@ fn mov(start_frame: Option) -> Vec { fn a_movies_start_timecode_is_read() { let dir = std::env::temp_dir().join(format!("effectcraft-file-timecode-{}", std::process::id())); std::fs::create_dir_all(&dir).expect("mkdir"); + let mut jpeg = Vec::new(); + image::RgbImage::from_pixel(16, 16, image::Rgb([200, 40, 90])).write_to(&mut Cursor::new(&mut jpeg), image::ImageFormat::Jpeg).expect("jpeg"); // 10:00:00:00 at 24 fps, and a movie with no timecode for (name, start) in [("tc.mov", Some(10 * 3600 * 24)), ("none.mov", None)] { let p = dir.join(name); - std::fs::write(&p, mov(start)).expect("write"); + std::fs::write(&p, mov(SampleEntry::jpeg(16, 16), &jpeg, start)).expect("write"); let f = effectcraft_media::probe(&p).expect("probe"); assert_eq!(f.kind, FootageKind::Video, "{name}"); assert_eq!(f.file_timecode, start.map(i64::from), "{name}"); @@ -36,3 +36,125 @@ fn a_movies_start_timecode_is_read() { } let _ = std::fs::remove_dir_all(&dir); } + +#[test] +fn shared_mov_preserves_recorded_start_timecode() { + use craft_media::isobmff::FourCc; + use craft_video::prores::{ChromaFormat, Encoder, Frame, Profile}; + + let dir = tempfile::tempdir().expect("temp dir"); + let profile = Profile::P4444; + let frame = Frame::new(16, 16, ChromaFormat::Yuv444, 16, false).expect("ProRes frame"); + let packet = Encoder::new(profile, 16, 16).encode(&frame).expect("encode ProRes"); + for (name, start) in [("tc.mov", Some(10 * 3600 * 24)), ("none.mov", None)] { + let entry = SampleEntry::prores(FourCc(profile.fourcc()), 16, 16); + let bytes = mov(entry, &packet, start); + let path = dir.path().join(name); + std::fs::write(&path, &bytes).expect("write MOV"); + + let from_file = effectcraft_media::probe(&path).expect("probe file"); + let from_bytes = effectcraft_media::probe_bytes(name, bytes.into()).expect("probe bytes"); + for footage in [from_file, from_bytes] { + assert_eq!(footage.kind, FootageKind::Video, "{name}"); + // FilmCraft labels the same sample entry "Apple ProRes 4444". + assert_eq!(footage.codec, "ProRes", "{name}: must use the shared reader"); + assert_eq!(footage.file_timecode, start.map(i64::from), "{name}"); + assert_eq!(footage.start_timecode, None, "{name}: no Interpret Footage override"); + } + } +} + +#[test] +fn shared_mov_timecode_rebases_edl_labels_on_its_own_presentation_clock() { + use craft_media::isobmff::{self, CodecConfig, Edit, FourCc, TrackKind}; + use craft_video::prores::{ChromaFormat, Encoder, Frame, Profile}; + use effectcraft_media::{MediaPool, probe_bytes}; + use effectcraft_time::{FrameRate, Tick}; + + const START: u32 = 10 * 3600 * 24; + const MOVIE_CLOCK: u32 = 24; + const VIDEO_CLOCK: u32 = 48; + const TC_CLOCK: u32 = 96; + const UNIT_RATE: i32 = 0x0001_0000; + let edit = |segment_duration, media_time| Edit { segment_duration, media_time, media_rate: UNIT_RATE }; + + let profile = Profile::P4444; + let mut encoder = Encoder::new(profile, 16, 16); + let mut frame = Frame::new(16, 16, ChromaFormat::Yuv444, 16, false).expect("ProRes frame"); + let packets = [40, 120, 200].map(|luma| { + frame.y.fill(luma << 8); + encoder.encode(&frame).expect("encode ProRes") + }); + + // The timecode track is written independently to vary its real media edit, + // rather than accidentally using the video's edit as a timecode adjustment. + let make_mov = |video_edits: Vec, tc_edits: Vec, counter: u32, movie_clock: u32| { + let mut opts = WriterOptions::new(Brand::Mov); + opts.movie_timescale = movie_clock; + let mut w = Mp4Writer::new(Cursor::new(Vec::new()), opts).expect("writer"); + let mut video_cfg = TrackConfig::new(SampleEntry::prores(FourCc(profile.fourcc()), 16, 16), VIDEO_CLOCK); + video_cfg.edits = video_edits; + let video = w.add_track(video_cfg).expect("video track"); + + let tc = TimecodeConfig { timescale: TC_CLOCK, frame_duration: 4, frames_per_second: 24, ..Default::default() }; + let entry = + SampleEntry { format: FourCc(*b"tmcd"), data_reference_index: 1, codec: CodecConfig::Timecode(tc), video: None, audio: None, bitrate: None }; + let mut tc_cfg = TrackConfig::new(entry, TC_CLOCK); + tc_cfg.edits = tc_edits; + let tc = w.add_track(tc_cfg).expect("timecode track"); + for packet in &packets { + w.write_sample(video, WriteSample { data: packet, duration: 2, composition_offset: 0, is_sync: true }).expect("write ProRes"); + } + w.write_sample(tc, WriteSample { data: &counter.to_be_bytes(), duration: 12, composition_offset: 0, is_sync: true }).expect("write timecode"); + w.finish().expect("finish").into_inner() + }; + + let pool = MediaPool::new(); + let plain: std::sync::Arc<[u8]> = make_mov(vec![], vec![], START, MOVIE_CLOCK).into(); + let unedited = probe_bytes("plain.mov", plain.clone()).expect("probe unedited MOV"); + assert_eq!(unedited.file_timecode, Some(i64::from(START))); + pool.add_bytes("plain.mov", plain); + let at = |presentation_frame| Tick::from_units(presentation_frame, i64::from(MOVIE_CLOCK)); + let pixels = [0, 1, 2].map(|n| pool.frame_at(&unedited, at(n)).expect("decode unedited reference").data[0]); + assert!(pixels[0][0] < pixels[1][0] && pixels[1][0] < pixels[2][0], "reference pictures must be distinct"); + + let cases = [ + ("matched-trim.mov", vec![edit(2, 2)], vec![edit(2, 4)], START, -4, START + 1, [(START + 1, 0, 1), (START + 2, 1, 2)]), + ("video-only-trim.mov", vec![edit(2, 2)], vec![], START + 1, 0, START + 1, [(START + 1, 0, 1), (START + 2, 1, 2)]), + ("matched-delay.mov", vec![edit(1, -1), edit(3, 0)], vec![edit(1, -1), edit(3, 0)], START, 4, START - 1, [(START, 1, 0), (START + 1, 2, 1)]), + ]; + for (name, video_edits, tc_edits, counter, tc_pts, expected_origin, points) in cases { + let bytes: std::sync::Arc<[u8]> = make_mov(video_edits, tc_edits, counter, MOVIE_CLOCK).into(); + let parsed = isobmff::open(bytes.as_ref()).expect("parse generated MOV"); + let tc = parsed.tracks.iter().find(|track| track.kind == TrackKind::Timecode).expect("timecode track"); + assert_eq!(tc.presentation_pts(0), Some(tc_pts), "{name}: fixture timecode edit"); + let footage = probe_bytes(name, bytes.clone()).expect("probe edited MOV"); + assert_eq!(footage.codec, "ProRes", "{name}: must use the shared reader"); + assert_eq!(footage.native_rate.unwrap_or(footage.frame_rate), FrameRate::FPS_24); + let origin = footage.file_timecode.expect("usable presentation timecode"); + assert_eq!(origin, i64::from(expected_origin), "{name}"); + pool.add_bytes(name, bytes); + + for (edl_label, presentation_frame, picture) in points { + // The EDL importer subtracts this origin at the native video rate. + let rebased = i64::from(edl_label) - origin; + assert_eq!(rebased, presentation_frame, "{name}: EDL in-point"); + let image = pool.frame_at(&footage, at(rebased)).expect("decode rebased in-point"); + assert_eq!(image.data[0], pixels[picture], "{name}: decoded source picture"); + } + } + + let disjoint = make_mov(vec![edit(1, 0), edit(1, 4)], vec![], START, MOVIE_CLOCK); + let footage = probe_bytes("disjoint.mov", disjoint.into()).expect("probe disjoint MOV"); + assert_eq!(footage.codec, "ProRes", "ambiguous timecode alone must not force a decoder fallback"); + assert_eq!(footage.file_timecode, None, "a single EDL origin cannot describe disjoint edits"); + + // One millisecond cannot be represented in the 96 Hz timecode track. + // The demuxer reports zero after conversion, but the EDL origin is ambiguous. + let fractional = make_mov(vec![], vec![edit(1, -1), edit(125, 0)], START, 1000); + let parsed = isobmff::open(fractional.as_slice()).expect("parse fractional delay MOV"); + let tc = parsed.tracks.iter().find(|track| track.kind == TrackKind::Timecode).expect("timecode track"); + assert_eq!(tc.presentation_pts(0), Some(0), "demux rounded the empty edit"); + let footage = probe_bytes("fractional.mov", fractional.into()).expect("probe fractional delay MOV"); + assert_eq!(footage.file_timecode, None, "do not turn a fractional delay into a fabricated origin"); +} From a29e69d25799dfd949a73dcbd3015e7a4df7a0c0 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sat, 21 Nov 2026 01:22:53 -0500 Subject: [PATCH 341/451] media: generate pure-Rust AAC fixtures for gap and seek tests (#4015) --- crates/media/Cargo.toml | 2 + crates/media/tests/it/footage.rs | 88 +++++++++++++++++++------------- 2 files changed, 55 insertions(+), 35 deletions(-) diff --git a/crates/media/Cargo.toml b/crates/media/Cargo.toml index 1808f6470..ffd8ea9fe 100644 --- a/crates/media/Cargo.toml +++ b/crates/media/Cargo.toml @@ -52,3 +52,5 @@ gif = { workspace = true } tempfile = { workspace = true } # (tests render comps that read layers through effects; already a dependency of effectcraft-render) effectcraft-effects = { workspace = true } +# Pure-Rust AAC test fixture encoding (no external ffmpeg dependency). +craft-audio = { workspace = true, features = ["aac-encode"] } diff --git a/crates/media/tests/it/footage.rs b/crates/media/tests/it/footage.rs index 08b7158b1..a542d4439 100644 --- a/crates/media/tests/it/footage.rs +++ b/crates/media/tests/it/footage.rs @@ -1783,17 +1783,51 @@ fn assert_samples_close(a: &[f32], b: &[f32], tol: f32, ctx: &str) { assert!(max_diff <= tol, "{ctx}: max_diff {max_diff} > {tol}"); } +fn pure_rust_aac_packets(duration_secs: usize) -> (Vec, Vec>) { + let mut enc = craft_audio::aac::Encoder::new(craft_audio::aac::EncoderConfig::cbr(48_000, 2, 128_000)).expect("aac encoder"); + let asc = enc.audio_specific_config(); + let samples: Vec = (0..48_000 * duration_secs).map(|i| (2.0 * std::f32::consts::PI * 440.0 * i as f32 / 48_000.0).sin() * 0.25).collect(); + let mut pkts = enc.encode(&[&samples, &samples]); + pkts.extend(enc.flush()); + (asc, pkts) +} + #[test] fn mkv_and_mp4_aac_play_continuously_without_crackle_and_seek_matches_sequential() { - let Some(mp4_path) = - try_ffmpeg_fixture("aac_1546_pair.mp4", &["-f", "lavfi", "-i", "sine=frequency=440:sample_rate=48000:duration=2", "-c:a", "aac", "-b:a", "128k"]) - else { - return; - }; - let mp4_str = mp4_path.to_string_lossy().into_owned(); - let Some(mkv_path) = try_ffmpeg_fixture("aac_1546_pair.mkv", &["-i", &mp4_str, "-c:a", "copy"]) else { - return; + let dir = tempfile::tempdir().expect("tempdir"); + let mp4_path = dir.path().join("aac_1546_pair.mp4"); + let mkv_path = dir.path().join("aac_1546_pair.mkv"); + let (asc, pkts) = pure_rust_aac_packets(2); + + let entry = craft_media::isobmff::SampleEntry { + format: craft_media::isobmff::FourCc(*b"mp4a"), + data_reference_index: 1, + codec: craft_media::isobmff::CodecConfig::Aac(craft_media::isobmff::AacConfig::from_asc(asc.clone())), + video: None, + audio: Some(craft_media::isobmff::AudioParams { channels: 2, sample_size: 16, sample_rate: 48_000.0, ..Default::default() }), + bitrate: None, }; + let mut mp4_writer = + craft_media::isobmff::Mp4Writer::new(std::io::Cursor::new(Vec::new()), craft_media::isobmff::WriterOptions::new(craft_media::isobmff::Brand::Mp4)) + .expect("mp4 writer"); + mp4_writer.add_track(craft_media::isobmff::TrackConfig::new(entry, 48_000)).expect("add track"); + for pkt in &pkts { + mp4_writer + .write_sample(0, craft_media::isobmff::WriteSample { data: pkt, duration: 1024, composition_offset: 0, is_sync: true }) + .expect("write mp4 sample"); + } + std::fs::write(&mp4_path, mp4_writer.finish().expect("finish mp4").into_inner()).expect("write mp4"); + + let mut spec = craft_media::matroska::TrackSpec::new(craft_media::matroska::TrackKind::Audio, "A_AAC"); + spec.codec_private = asc; + spec.audio = Some((48_000.0, 2, None)); + let mut mkv_writer = + craft_media::matroska::MkvWriter::new(std::io::Cursor::new(Vec::new()), vec![spec], craft_media::matroska::MuxOptions::default()).expect("mkv writer"); + for (i, pkt) in pkts.iter().enumerate() { + let pts_ns = (i as i64 * 1024 * 1_000_000_000) / 48_000; + mkv_writer.write_frame(0, pts_ns, true, pkt, None).expect("write mkv frame"); + } + std::fs::write(&mkv_path, mkv_writer.finish().expect("finish mkv").into_inner()).expect("write mkv"); let mp4 = probe(&mp4_path).expect("probe mp4"); let mkv = probe(&mkv_path).expect("probe mkv"); @@ -1822,33 +1856,21 @@ fn mkv_and_mp4_aac_play_continuously_without_crackle_and_seek_matches_sequential assert_samples_close(&backward, &mkv_seq[24_000 * 2..24_000 * 2 + 4800 * 2], 1e-4, "mkv backward seek vs sequential"); } -fn build_gapped_aac_mkv(out_path: &Path, gap_at_pkt: usize, gap_ns: i64, start_offset_ns: i64) -> Option<()> { - let mp4_path = - try_ffmpeg_fixture("aac_1546_pair.mp4", &["-f", "lavfi", "-i", "sine=frequency=440:sample_rate=48000:duration=2", "-c:a", "aac", "-b:a", "128k"])?; - let bytes: std::sync::Arc<[u8]> = std::sync::Arc::from(std::fs::read(&mp4_path).ok()?); - let mp4 = craft_media::isobmff::open(bytes.clone()).ok()?; - let track_idx = mp4.tracks.iter().position(|t| t.kind == craft_media::isobmff::TrackKind::Audio)?; - let track = &mp4.tracks[track_idx]; - let asc = match &track.entries.first()?.codec { - craft_media::isobmff::CodecConfig::Aac(a) => a.asc.clone(), - _ => return None, - }; - +fn build_gapped_aac_mkv(out_path: &Path, gap_at_pkt: usize, gap_ns: i64, start_offset_ns: i64) { + let (asc, pkts) = pure_rust_aac_packets(2); let mut spec = craft_media::matroska::TrackSpec::new(craft_media::matroska::TrackKind::Audio, "A_AAC"); spec.codec_private = asc; - spec.audio = Some((48_000.0, u64::from(track.audio().map_or(2, |a| a.channels)), None)); - let mut writer = craft_media::matroska::MkvWriter::new(std::io::Cursor::new(Vec::new()), vec![spec], craft_media::matroska::MuxOptions::default()).ok()?; + spec.audio = Some((48_000.0, 2, None)); + let mut writer = + craft_media::matroska::MkvWriter::new(std::io::Cursor::new(Vec::new()), vec![spec], craft_media::matroska::MuxOptions::default()).expect("mkv writer"); - let pkt_count = track.samples.len().min(60); - for i in 0..pkt_count { - let pkt = mp4.read_sample(&*bytes, track_idx, i).ok()?; + for (i, pkt) in pkts.iter().take(60).enumerate() { let base_ns = (i as i64 * 1024 * 1_000_000_000) / 48_000; let extra = if i >= gap_at_pkt { gap_ns } else { 0 }; - writer.write_frame(0, start_offset_ns + base_ns + extra, true, &pkt, None).ok()?; + writer.write_frame(0, start_offset_ns + base_ns + extra, true, pkt, None).expect("write mkv frame"); } - let mkv_bytes = writer.finish().ok()?.into_inner(); - std::fs::write(out_path, mkv_bytes).ok()?; - Some(()) + let mkv_bytes = writer.finish().expect("finish mkv").into_inner(); + std::fs::write(out_path, mkv_bytes).expect("write mkv"); } #[test] @@ -1856,9 +1878,7 @@ fn audio_real_silence_gap_honored_on_sequential_and_seek() { let dir = tempfile::tempdir().expect("tempdir"); let mkv_path = dir.path().join("real_gap.mkv"); // 24 packets (~0.512s) at 0, then a 500 ms silence gap before packet 24. - if build_gapped_aac_mkv(&mkv_path, 24, 500_000_000, 0).is_none() { - return; - } + build_gapped_aac_mkv(&mkv_path, 24, 500_000_000, 0); let f = probe(&mkv_path).expect("probe gapped mkv"); let rate = 48_000u32; @@ -1891,9 +1911,7 @@ fn audio_delayed_first_packet_honored_on_sequential_and_seek() { let dir = tempfile::tempdir().expect("tempdir"); let mkv_path = dir.path().join("delayed_first.mkv"); // First packet delayed by 500 ms. - if build_gapped_aac_mkv(&mkv_path, usize::MAX, 0, 500_000_000).is_none() { - return; - } + build_gapped_aac_mkv(&mkv_path, usize::MAX, 0, 500_000_000); let f = probe(&mkv_path).expect("probe delayed mkv"); let rate = 48_000u32; From c821d6e0e712930887ca8cea128f6a25e57f4656 Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Sat, 21 Nov 2026 14:46:35 +0700 Subject: [PATCH 342/451] media: avoid scanning Opus payloads at open (#4011) * Avoid scanning Opus payloads during track open * Apply rustfmt to the Opus timing regression * Split Opus regression scenarios for Clippy --- crates/media/src/craft_source.rs | 428 +++++++++++++++++++++++++++---- 1 file changed, 377 insertions(+), 51 deletions(-) diff --git a/crates/media/src/craft_source.rs b/crates/media/src/craft_source.rs index 20816535c..c0deb4673 100644 --- a/crates/media/src/craft_source.rs +++ b/crates/media/src/craft_source.rs @@ -47,6 +47,7 @@ const MAX_CACHED_FRAMES: usize = 32; /// Maximum audio lookahead packets inspected when initializing `craft_audio::TrackDecoder`. const AUDIO_LOOKAHEAD: usize = 8; +const AUDIO_SEEK_BACKUP_PACKETS: usize = 2; /// Complete first-sample read cap for the ProRes alpha probe; larger samples use the legacy route. const MAX_PRORES_ALPHA_SAMPLE_BYTES: u32 = 32 * 1024 * 1024; @@ -181,7 +182,7 @@ impl ContainerFile { fn audio_seek_info(&self, track_idx: usize, audio_starts: &[i64], seek_preroll_samples: i64, start: i64) -> (usize, i64) { let target = start.saturating_sub(seek_preroll_samples).max(0); let sample_idx = audio_starts.partition_point(|&s| s <= target).saturating_sub(1); - let mut seek_idx = sample_idx.saturating_sub(2); + let mut seek_idx = sample_idx.saturating_sub(AUDIO_SEEK_BACKUP_PACKETS); while seek_idx > 0 && !self.audio_packet_is_stamped(track_idx, seek_idx) { seek_idx -= 1; } @@ -214,18 +215,103 @@ struct PacketTime { /// `storytold/filmcraft#359`). fn contiguous_starts(packets: impl IntoIterator, tolerance: i64) -> Vec { let tolerance = tolerance.max(0).unsigned_abs(); - let mut next: Option = None; - packets - .into_iter() - .map(|p| { - let start = match next { - Some(n) if !p.stamped || n.abs_diff(p.stamp) <= tolerance => n, - _ => p.stamp, - }; - next = p.samples.and_then(|k| start.checked_add(k)); - start + let mut next = None; + packets.into_iter().map(|p| place_packet(p, &mut next, tolerance)).collect() +} + +fn packet_start(packet: PacketTime, next: Option, tolerance: u64) -> i64 { + match next { + Some(n) if !packet.stamped || n.abs_diff(packet.stamp) <= tolerance => n, + _ => packet.stamp, + } +} + +fn place_packet(packet: PacketTime, next: &mut Option, tolerance: u64) -> i64 { + let start = packet_start(packet, *next, tolerance); + *next = packet.samples.and_then(|n| start.checked_add(n)); + start +} + +struct OpusPrefix { + len: usize, + next: Option, + tolerance: u64, + min_pending_stamp: i64, +} + +struct AudioStarts { + // For Opus, unvisited entries still hold raw container stamps. Resolve in place + // as packets arrive, reusing this table for the finished timeline. + positions: Vec, + opus: Option, +} + +impl AudioStarts { + fn complete(positions: Vec) -> Self { + Self { positions, opus: None } + } + + fn opus(positions: Vec, tolerance: i64) -> Self { + // Open resolves exactly the bounded lookahead before anyone can seek. + let min_pending_stamp = positions.iter().skip(AUDIO_LOOKAHEAD).copied().min().unwrap_or(i64::MIN); + let opus = (!positions.is_empty()).then_some(OpusPrefix { len: 0, next: None, tolerance: tolerance.max(0).unsigned_abs(), min_pending_stamp }); + Self { positions, opus } + } + + fn start(&self, file: &ContainerFile, track: usize, idx: usize) -> Option { + let stamp = *self.positions.get(idx)?; + let Some(prefix) = &self.opus else { return Some(stamp) }; + if idx < prefix.len { + return Some(stamp); + } + debug_assert_eq!(idx, prefix.len); + (idx == prefix.len).then(|| { + let packet = PacketTime { stamp, stamped: file.audio_packet_is_stamped(track, idx), samples: None }; + packet_start(packet, prefix.next, prefix.tolerance) }) - .collect() + } + + fn observe(&mut self, file: &ContainerFile, track: usize, idx: usize, packet: &[u8]) { + let Some(prefix) = &mut self.opus else { return }; + if idx != prefix.len { + return; + } + let timing = + PacketTime { stamp: self.positions[idx], stamped: file.audio_packet_is_stamped(track, idx), samples: opus_packet_samples(packet).map(i64::from) }; + self.positions[idx] = place_packet(timing, &mut prefix.next, prefix.tolerance); + prefix.len += 1; + if prefix.len == self.positions.len() { + self.opus = None; + } + } + + fn seek_proves_first_packet(&self, target: i64) -> bool { + let Some(prefix) = &self.opus else { return false }; + // A normal read that starts before the very first packet looks like a + // backward seek. It need not read the suffix if the ordinary seek + // would back up to packet 0 anyway. Stamped starts can only move by the + // timing tolerance; unstamped continuation moves forward from next. + prefix.min_pending_stamp > target + && prefix.min_pending_stamp.abs_diff(target) > prefix.tolerance + && prefix.next.is_none_or(|next| next > target) + && self.positions.get(AUDIO_SEEK_BACKUP_PACKETS + 1..prefix.len).is_some_and(|p| p.iter().all(|&start| start > target)) + } + + fn finish_for_seek(&mut self, file: &ContainerFile, source: &dyn ByteSource, track: usize) -> Result<()> { + // The exact recurrence can carry a timing phase across arbitrarily many + // rounded or laced packets. A first discontinuous seek may still have to + // index the unread suffix; normal open and sequential decode never do this. + while let Some(idx) = self.opus.as_ref().map(|prefix| prefix.len) { + if filmcraft_media::cancel::cancelled() { + return Err(MediaError::Cancelled); + } + // Do not commit a guessed duration after an I/O error; the next + // request can retry this packet without re-reading the valid prefix. + let packet = file.read_sample(source, track, idx)?; + self.observe(file, track, idx, &packet); + } + Ok(()) + } } fn fixed_packet_samples(dec: &mut AudioTrackDecoder, codec: CodecId, lookahead: &[Vec]) -> Option { @@ -274,18 +360,11 @@ fn opus_packet_samples(pkt: &[u8]) -> Option { (n > 0 && n <= 5760).then_some(n) } -fn compute_audio_starts( - container: &ContainerFile, - source: &dyn ByteSource, - track_idx: usize, - codec: CodecId, - native_rate: u32, - fixed_samples: Option, -) -> Vec { +fn compute_audio_starts(container: &ContainerFile, track_idx: usize, codec: CodecId, native_rate: u32, fixed_samples: Option) -> AudioStarts { let rate = i128::from(native_rate); match container { ContainerFile::Isobmff(f) => { - let Some(track) = f.tracks.get(track_idx) else { return Vec::new() }; + let Some(track) = f.tracks.get(track_idx) else { return AudioStarts::complete(Vec::new()) }; let ts = i128::from(track.timescale.max(1)); let stamps: Vec = (0..track.samples.len()) .map(|i| { @@ -295,21 +374,17 @@ fn compute_audio_starts( .collect(); let unit = i64::try_from((rate + ts - 1) / ts).unwrap_or(i64::MAX); if codec == CodecId::Opus { - let packets = stamps.into_iter().enumerate().map(|(i, stamp)| { - let samples = f.read_sample(source, track_idx, i).ok().and_then(|p| opus_packet_samples(&p)).map(i64::from); - PacketTime { stamp, stamped: true, samples } - }); - return contiguous_starts(packets, unit.saturating_mul(2).saturating_add(1)); + return AudioStarts::opus(stamps, unit.saturating_mul(2).saturating_add(1)); } let Some(frame) = fixed_samples else { - return stamps; + return AudioStarts::complete(stamps); }; let tolerance = (frame / 2).max(unit.saturating_mul(2).saturating_add(1)); let packets = stamps.into_iter().map(|stamp| PacketTime { stamp, stamped: true, samples: Some(frame) }); - contiguous_starts(packets, tolerance) + AudioStarts::complete(contiguous_starts(packets, tolerance)) } ContainerFile::Matroska(f) => { - let Some(track) = f.tracks.get(track_idx) else { return Vec::new() }; + let Some(track) = f.tracks.get(track_idx) else { return AudioStarts::complete(Vec::new()) }; // Indexed PTS already subtracts CodecDelay rounded to the container clock. // Translate between that clock and the warm path's whole-frame delay. let tick_ns = i128::from(f.info.timestamp_scale.max(1)); @@ -322,17 +397,13 @@ fn compute_audio_starts( }; let tick_samples = i64::try_from(i128::from(track.ticks_to_ns(2)) * rate / 1_000_000_000).unwrap_or(i64::MAX).saturating_add(1); if codec == CodecId::Opus { - let packets = track.samples.iter().enumerate().map(|(i, s)| { - let samples = f.read_sample(source, track_idx, i).ok().and_then(|p| opus_packet_samples(&p)).map(i64::from); - PacketTime { stamp: stamp_for(s.pts), stamped: s.lace == 0 || s.duration > 0, samples } - }); - return contiguous_starts(packets, tick_samples); + return AudioStarts::opus(track.samples.iter().map(|s| stamp_for(s.pts)).collect(), tick_samples); } let Some(frame) = fixed_samples else { - return track.samples.iter().map(|s| stamp_for(s.pts)).collect(); + return AudioStarts::complete(track.samples.iter().map(|s| stamp_for(s.pts)).collect()); }; let packets = track.samples.iter().map(|s| PacketTime { stamp: stamp_for(s.pts), stamped: s.lace == 0 || s.duration > 0, samples: Some(frame) }); - contiguous_starts(packets, (frame / 2).max(tick_samples)) + AudioStarts::complete(contiguous_starts(packets, (frame / 2).max(tick_samples))) } } } @@ -363,7 +434,12 @@ where let channels = u32::from(dec.layout().channels()).max(1); let codec = dec.codec(); let fixed_samples = fixed_packet_samples(&mut dec, codec, &lookahead); - let audio_starts = compute_audio_starts(container, source, idx, codec, native_rate, fixed_samples); + let mut audio_starts = compute_audio_starts(container, idx, codec, native_rate, fixed_samples); + if codec == CodecId::Opus { + for (s_idx, pkt) in lookahead.iter().enumerate() { + audio_starts.observe(container, idx, s_idx, pkt); + } + } let seek_preroll_samples = match container { ContainerFile::Matroska(f) if codec == CodecId::Opus => { let preroll_ns = i128::from(f.tracks[idx].seek_pre_roll_ns.max(80_000_000)); @@ -371,7 +447,7 @@ where } _ => 0, }; - let initial_pos = audio_starts.first().copied().unwrap_or(0); + let initial_pos = audio_starts.start(container, idx, 0).unwrap_or(0); audio_infos.push(AudioStreamInfo { sample_rate: native_rate, channels, @@ -381,9 +457,8 @@ where audio_tracks.push(AudioTrackEntry { track_idx: idx, native_rate, - audio_starts, seek_preroll_samples, - state: Mutex::new(AudioTrackState { decoder: dec, next_sample: 0, decoded_pos: initial_pos, buf: Vec::new() }), + state: Mutex::new(AudioTrackState { decoder: dec, audio_starts, next_sample: 0, decoded_pos: initial_pos, buf: Vec::new() }), }); } Some((audio_tracks, audio_infos)) @@ -724,6 +799,7 @@ struct VideoState { struct AudioTrackState { decoder: AudioTrackDecoder, + audio_starts: AudioStarts, next_sample: usize, /// Sample index (in native-rate frames) of `buf[0]` relative to track start (0). decoded_pos: i64, @@ -734,7 +810,6 @@ struct AudioTrackState { struct AudioTrackEntry { track_idx: usize, native_rate: u32, - audio_starts: Vec, seek_preroll_samples: i64, state: Mutex, } @@ -849,7 +924,6 @@ impl MediaSource for CraftMediaSource { entry.track_idx, native_rate, channels_count, - &entry.audio_starts, entry.seek_preroll_samples, &mut state, native_start, @@ -1073,7 +1147,6 @@ fn decode_audio_range( track_idx: usize, native_rate: u32, channels_count: usize, - audio_starts: &[i64], seek_preroll_samples: i64, state: &mut AudioTrackState, start: i64, @@ -1086,8 +1159,15 @@ fn decode_audio_range( let buf_len = state.buf.first().map_or(0, Vec::len) as i64; let buf_end = state.decoded_pos.saturating_add(buf_len); - if start < state.decoded_pos || start > buf_end + i64::from(native_rate) * 2 { - let (seek_idx, decoded_pos) = file.audio_seek_info(track_idx, audio_starts, seek_preroll_samples, start); + let moves_backward = start < state.decoded_pos; + if moves_backward || start > buf_end + i64::from(native_rate) * 2 { + let target = start.saturating_sub(seek_preroll_samples).max(0); + let (seek_idx, decoded_pos) = if moves_backward && state.next_sample == 0 && state.audio_starts.seek_proves_first_packet(target) { + (0, state.decoded_pos) + } else { + state.audio_starts.finish_for_seek(file, source, track_idx)?; + file.audio_seek_info(track_idx, &state.audio_starts.positions, seek_preroll_samples, start) + }; state.decoder.reset(); state.next_sample = seek_idx; state.decoded_pos = decoded_pos; @@ -1108,11 +1188,16 @@ fn decode_audio_range( let idx = state.next_sample; let buf_len = state.buf.first().map_or(0, Vec::len) as i64; let buf_end = state.decoded_pos.saturating_add(buf_len); - let pk_start = if buf_len > 0 && !file.audio_packet_is_stamped(track_idx, idx) { buf_end } else { audio_starts.get(idx).copied().unwrap_or(buf_end) }; + let pk_start = if buf_len > 0 && !file.audio_packet_is_stamped(track_idx, idx) { + buf_end + } else { + state.audio_starts.start(file, track_idx, idx).unwrap_or(buf_end) + }; if pk_start >= end { break; } let pkt = file.read_sample(source, track_idx, idx)?; + state.audio_starts.observe(file, track_idx, idx, &pkt); state.next_sample = idx + 1; let block = state.decoder.decode(&pkt).map_err(|e| MediaError::Decode(e.to_string()))?; let buf_len = state.buf.first().map_or(0, Vec::len) as i64; @@ -1545,6 +1630,249 @@ fn estimate_matroska_frame_rate(track: &matroska::Track) -> FrameRate { mod tests { use super::*; + // One 20 ms mono packet from craft-audio's generated tone.opus test fixture. + // Re-mux it into ordinary small audio-only files without an external encoder. + const OPUS_TONE: &[u8] = b"\x78\x82\x01\xB7\x6C\x7E\x40\xE6\x00\x00\x0A\xBE\x9A\xA7\xBE\xFF\xB6\x85\xD7\x0A\x71\xE0\xDD\ + \x6B\xA0\xE3\xC6\xC5\xC3\x32\xC6\x64\x1E\x6E\x63\x52\x3A\x45\x0C\x8A\x53\x8F\x44\x18\xB0\x8C\ + \x64\xAB\xEC\x98\x96\x79\x6C\x54\x53\x30\x55\x4E\x82\xE4\x16\xCA\x59\x49\xD8\xC7\x09\x5D\x59"; + + struct OpusPayloadReads { + bytes: Vec, + offsets: Vec, + packets: Mutex>, + fail_once_at: Mutex>, + } + + impl ByteSource for OpusPayloadReads { + fn len(&self) -> u64 { + self.bytes.len() as u64 + } + + fn read_at(&self, offset: u64, buf: &mut [u8]) -> std::io::Result<()> { + if buf.len() == OPUS_TONE.len() + && let Ok(index) = self.offsets.binary_search(&offset) + { + self.packets.lock().unwrap().push(index); + let mut failure = self.fail_once_at.lock().unwrap(); + if *failure == Some(index) { + *failure = None; + return Err(std::io::Error::new(std::io::ErrorKind::Interrupted, "test transient packet read")); + } + } + self.bytes.as_slice().read_at(offset, buf) + } + } + + const OPUS_RATE: u32 = 48_000; + const OPUS_FRAME: usize = 960; + const OPUS_PACKETS: usize = 192; + const OPUS_GAP_AT: usize = 96; + const OPUS_GAP: usize = 9_600; + const OPUS_LEAD: usize = 4_800; + const OPUS_CODEC_DELAY_NS: i64 = 6_500_000; + const OPUS_CODEC_DELAY_FRAMES: i64 = 312; + + struct OpusFixture { + bytes: Vec, + file: ContainerFile, + offsets: Vec, + params: CodecParams, + delay: u64, + } + + fn opus_test_config() -> isobmff::OpusConfig { + isobmff::OpusConfig { output_channels: 1, pre_skip: OPUS_CODEC_DELAY_FRAMES as u16, input_sample_rate: OPUS_RATE, ..Default::default() } + } + + fn generated_opus_matroska(lead: usize, laced: bool) -> OpusFixture { + use std::io::Cursor; + + let mut track = matroska::TrackSpec::new(matroska::TrackKind::Audio, "A_OPUS"); + track.audio = Some((f64::from(OPUS_RATE), 1, None)); + track.codec_private = opus_test_config().opus_head(); + track.codec_delay_ns = OPUS_CODEC_DELAY_NS as u64; + track.seek_pre_roll_ns = 80_000_000; + track.default_duration_ns = Some(20_000_000); + let options = if laced { + matroska::MuxOptions { lacing: matroska::LacingMode::FixedOrEbml, max_lace_frames: 6, cluster_duration_ns: 10_000_000_000, ..Default::default() } + } else { + matroska::MuxOptions::default() + }; + let mut mux = matroska::MkvWriter::new(Cursor::new(Vec::new()), vec![track], options).unwrap(); + let lead_ns = lead as i64 * 1_000_000_000 / i64::from(OPUS_RATE); + for idx in 0..OPUS_PACKETS { + let gap_ns = if idx >= OPUS_GAP_AT { 200_000_000 } else { 0 }; + let jitter = if laced || idx % 2 == 0 { 0 } else { 1_000_000 }; + mux.write_frame(0, idx as i64 * 20_000_000 + lead_ns + gap_ns + jitter - OPUS_CODEC_DELAY_NS, true, OPUS_TONE, None).unwrap(); + } + let bytes = mux.finish().unwrap().into_inner(); + let mut file = matroska::open(bytes.as_slice()).unwrap(); + let track = &mut file.tracks[0]; + if laced { + // The writer needs a duration to group real laces. Exercise the + // durationless index representation by clearing it after demuxing. + assert_eq!(track.samples[AUDIO_LOOKAHEAD].lace, 2); + assert_eq!(track.samples[145].lace, 1); + let mut anchor = 0; + for packet in &mut track.samples { + if packet.lace == 0 { + anchor = packet.pts; + } else { + packet.pts = anchor; + } + packet.duration = 0; + } + } + let offsets = track.samples.iter().map(|s| s.offset).collect::>(); + let params = track.codec_params(); + OpusFixture { bytes, file: ContainerFile::Matroska(Box::new(file)), offsets, params, delay: OPUS_CODEC_DELAY_NS as u64 } + } + + fn generated_opus_mp4(lead: usize) -> OpusFixture { + use std::io::Cursor; + + let entry = isobmff::SampleEntry { + format: isobmff::FourCc(*b"Opus"), + data_reference_index: 1, + codec: isobmff::CodecConfig::Opus(opus_test_config()), + video: None, + audio: Some(isobmff::AudioParams { channels: 1, sample_size: 16, sample_rate: f64::from(OPUS_RATE), ..Default::default() }), + bitrate: None, + }; + let mut mux = isobmff::Mp4Writer::new(Cursor::new(Vec::new()), isobmff::WriterOptions::new(isobmff::Brand::Mp4)).unwrap(); + mux.add_track(isobmff::TrackConfig::new(entry, OPUS_RATE)).unwrap(); + for idx in 0..OPUS_PACKETS { + let duration = (if idx + 1 == OPUS_GAP_AT { OPUS_FRAME + OPUS_GAP } else { OPUS_FRAME }) as u32; + mux.write_sample(0, isobmff::WriteSample { data: OPUS_TONE, duration, composition_offset: lead as i32, is_sync: true }).unwrap(); + } + let bytes = mux.finish().unwrap().into_inner(); + let file = isobmff::open(bytes.as_slice()).unwrap(); + let track = &file.tracks[0]; + let offsets = track.samples.iter().map(|s| s.offset).collect::>(); + let params = track.codec_params(); + OpusFixture { bytes, file: ContainerFile::Isobmff(file), offsets, params, delay: 0 } + } + + fn assert_opus_early_and_backward( + file: &ContainerFile, + source: &OpusPayloadReads, + params: &CodecParams, + delay: u64, + expected_positions: &[i64], + lead: usize, + ) -> Vec> { + let (mut tracks, _) = open_audio_tracks(file, source, [(0, OPUS_PACKETS, params.clone(), delay)]).unwrap(); + assert_eq!(*source.packets.lock().unwrap(), (0..AUDIO_LOOKAHEAD).collect::>()); + + let first = expected_positions[0]; + assert_eq!(tracks[0].state.get_mut().unwrap().decoded_pos, first); + let (mut reference, _) = open_audio_tracks(file, &source.bytes, [(0, OPUS_PACKETS, params.clone(), delay)]).unwrap(); + reference[0].state.get_mut().unwrap().audio_starts = AudioStarts::complete(expected_positions.to_vec()); + + let decode = |track: &mut AudioTrackEntry, src: &dyn ByteSource, start, frames| { + decode_audio_range(file, src, 0, OPUS_RATE, 1, track.seek_preroll_samples, track.state.get_mut().unwrap(), start, frames).unwrap() + }; + // A first read before the initial packet can be ordinary leading silence + // or negative pre-roll. Neither should trigger the cold suffix scan. + let early_start = if lead == 0 { first - 128 } else { 0 }; + let silent_frames = (first - early_start) as usize; + let silent = decode(&mut tracks[0], source, early_start, silent_frames); + assert!(silent[0].iter().all(|&s| s == 0.0)); + assert_eq!(*source.packets.lock().unwrap(), (0..AUDIO_LOOKAHEAD).collect::>()); + assert_eq!(silent, decode(&mut reference[0], &source.bytes, early_start, silent_frames)); + let early_frames = silent_frames + 12 * OPUS_FRAME; + let early = decode(&mut tracks[0], source, early_start, early_frames); + assert_eq!(early, decode(&mut reference[0], &source.bytes, early_start, early_frames)); + assert!(early[0].iter().all(|s| s.is_finite())); + assert!(early[0].iter().any(|s| s.abs() > 1e-5), "real Opus decoding, not a silent fallback"); + { + let reads = source.packets.lock().unwrap(); + assert!(reads.iter().any(|&i| i >= AUDIO_LOOKAHEAD), "exercise the incremental frontier"); + assert!(reads.iter().all(|&i| i < 14) && reads.len() <= AUDIO_LOOKAHEAD + 14, "{reads:?}"); + } + + // A backward read after real decode must still use the exact seek index. + let backward_start = first + 2 * OPUS_FRAME as i64; + let backward = decode(&mut tracks[0], source, backward_start, OPUS_FRAME); + assert_eq!(backward, decode(&mut reference[0], &source.bytes, backward_start, OPUS_FRAME)); + let state = tracks[0].state.get_mut().unwrap(); + assert_eq!(state.audio_starts.positions.as_slice(), expected_positions); + assert!(state.audio_starts.opus.is_none()); + early + } + + fn assert_opus_first_cold_seek_and_retry( + file: &ContainerFile, + source: &OpusPayloadReads, + params: CodecParams, + delay: u64, + expected_positions: &[i64], + laced: bool, + start: i64, + ) { + let first = expected_positions[0]; + let decode = |track: &mut AudioTrackEntry, src: &dyn ByteSource, start, frames| { + decode_audio_range(file, src, 0, OPUS_RATE, 1, track.seek_preroll_samples, track.state.get_mut().unwrap(), start, frames).unwrap() + }; + // A genuinely random first request is not the leading-silence shortcut. + let (mut fresh, _) = open_audio_tracks(file, source, [(0, OPUS_PACKETS, params.clone(), delay)]).unwrap(); + let (mut eager, _) = open_audio_tracks(file, &source.bytes, [(0, OPUS_PACKETS, params, delay)]).unwrap(); + eager[0].state.get_mut().unwrap().audio_starts = AudioStarts::complete(expected_positions.to_vec()); + if laced { + assert_eq!(file.audio_seek_info(0, expected_positions, fresh[0].seek_preroll_samples, start).0, 144); + } + let transient_packet = 64; + *source.fail_once_at.lock().unwrap() = Some(transient_packet); + { + let entry = &mut fresh[0]; + let preroll = entry.seek_preroll_samples; + let state = entry.state.get_mut().unwrap(); + let error = decode_audio_range(file, source, 0, OPUS_RATE, 1, preroll, state, start, 3 * OPUS_FRAME).unwrap_err(); + assert!(matches!(error, MediaError::Io(_))); + assert_eq!(state.audio_starts.opus.as_ref().unwrap().len, transient_packet); + assert_eq!((state.next_sample, state.decoded_pos), (0, first)); + } + let cold = decode(&mut fresh[0], source, start, 3 * OPUS_FRAME); + assert_eq!(cold, decode(&mut eager[0], &source.bytes, start, 3 * OPUS_FRAME)); + assert!(cold[0].iter().any(|s| s.abs() > 1e-5)); + let state = fresh[0].state.get_mut().unwrap(); + assert_eq!(state.audio_starts.positions.as_slice(), expected_positions); + assert!(state.audio_starts.opus.is_none()); + } + + #[test] + fn opus_open_and_first_sequential_read_do_not_scan_tail_packets() { + assert_eq!(opus_packet_samples(OPUS_TONE), Some(OPUS_FRAME as u32)); + let mut unlaced_matroska_audio = None; + let cases = [(false, 0, false), (true, 0, false), (false, OPUS_LEAD, false), (true, OPUS_LEAD, false), (true, OPUS_LEAD, true)]; + for (matroska_file, lead, laced) in cases { + let fixture = if matroska_file { generated_opus_matroska(lead, laced) } else { generated_opus_mp4(lead) }; + let OpusFixture { bytes, file, offsets, params, delay } = fixture; + assert_eq!(offsets.len(), OPUS_PACKETS); + assert!(offsets.windows(2).all(|w| w[0] < w[1])); + // Start counting after container metadata indexing. This isolates payload reads by the app + // opener, independent of how the demuxer peeks at block headers or buffers the file. + let source = OpusPayloadReads { bytes, offsets, packets: Mutex::new(Vec::new()), fail_once_at: Mutex::new(None) }; + // Independent eager placement oracle: fixed 20 ms packets, an explicit 200 ms gap, + // no drift from alternating Matroska stamp jitter, and delay applied once. + let delay_frames = if matroska_file { OPUS_CODEC_DELAY_FRAMES } else { 0 }; + let expected_positions: Vec<_> = (0..OPUS_PACKETS) + .map(|i| { + let gap = if i >= OPUS_GAP_AT { OPUS_GAP } else { 0 }; + (lead + i * OPUS_FRAME + gap) as i64 - delay_frames + }) + .collect(); + let early = assert_opus_early_and_backward(&file, &source, ¶ms, delay, &expected_positions, lead); + if laced { + assert_eq!(&early, unlaced_matroska_audio.as_ref().unwrap(), "durationless laces must place the same real audio as stamped packets"); + } else if matroska_file && lead == OPUS_LEAD { + unlaced_matroska_audio = Some(early); + } + let start = (lead + 151 * OPUS_FRAME + OPUS_GAP) as i64 - delay_frames; + assert_opus_first_cold_seek_and_retry(&file, &source, params, delay, &expected_positions, laced, start); + } + } + #[test] fn worker_cap_is_bounded() { let cap = worker_cap(); @@ -1877,8 +2205,7 @@ mod tests { let (mut tracks, _) = open_audio_tracks(&file, &bytes, [(0, 4, params.clone(), 0)]).unwrap(); let decode = |track: &mut AudioTrackEntry, start: i64, frames: usize| { - decode_audio_range(&file, &bytes, 0, 48_000, 1, &track.audio_starts, track.seek_preroll_samples, track.state.get_mut().unwrap(), start, frames) - .unwrap() + decode_audio_range(&file, &bytes, 0, 48_000, 1, track.seek_preroll_samples, track.state.get_mut().unwrap(), start, frames).unwrap() }; let full = decode(&mut tracks[0], 0, 500); @@ -1917,12 +2244,11 @@ mod tests { let open_with_overlap = || { let (mut tracks, _) = open_audio_tracks(&file, &bytes, [(0, 2, params.clone(), 0)]).unwrap(); - tracks[0].audio_starts = vec![0, 512]; + tracks[0].state.get_mut().unwrap().audio_starts = AudioStarts::complete(vec![0, 512]); tracks }; let decode = |track: &mut AudioTrackEntry, start: i64, frames: usize| { - decode_audio_range(&file, &bytes, 0, 48_000, 1, &track.audio_starts, track.seek_preroll_samples, track.state.get_mut().unwrap(), start, frames) - .unwrap() + decode_audio_range(&file, &bytes, 0, 48_000, 1, track.seek_preroll_samples, track.state.get_mut().unwrap(), start, frames).unwrap() }; let mut wide_tracks = open_with_overlap(); From 05f181cc041dac379ce6552328fc26597b5de161 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sat, 21 Nov 2026 03:37:05 -0500 Subject: [PATCH 343/451] media: route MXF video and PCM/AES3 sound through craft-media::mxf (#4006) * media: route MXF video and PCM/AES3 sound through craft-media::mxf * media: use SoundFormat::Aes3Element for MXF AES3 sound * media: address MXF presentation window, timecode rate, reorder fallback, and unit coverage * media: fix StartTimecode and MediaSource::audio calls in MXF unit test * media: fix unnecessary cast and add MXF video/trim unit test * media: use PictureCoding::Avc and smoke-test open_mxf video+sound * media: pass raw_bytes Vec to open_bytes in MXF unit test * media: disambiguate Arc<[u8]> type in MXF unit test * media: remove duplicate AudioBackend enum after merge * media: match AudioBackend::Decoder struct variant * media: fix MXF sync_sample_before assertion in unit test --- Cargo.lock | 1 + crates/media/Cargo.toml | 2 +- crates/media/src/craft_source.rs | 389 ++++++++++++++++++++++++++++--- crates/media/tests/it/footage.rs | 27 +++ 4 files changed, 384 insertions(+), 35 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 619e268fd..48e59a0b4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1417,6 +1417,7 @@ name = "craft-media" version = "0.1.0" source = "git+https://github.com/storytold/craft-libs?rev=3dff4793f1a5bd1f99a4fe3280d48f515158dff3#3dff4793f1a5bd1f99a4fe3280d48f515158dff3" dependencies = [ + "chrono", "thiserror 2.0.21", ] diff --git a/crates/media/Cargo.toml b/crates/media/Cargo.toml index ffd8ea9fe..76a86a69a 100644 --- a/crates/media/Cargo.toml +++ b/crates/media/Cargo.toml @@ -30,7 +30,7 @@ craft-webp = { workspace = true, features = ["frames"] } craft-audio = { workspace = true, features = ["decode-native", "aac-decode", "alac-decode", "opus-decode", "ac3-decode", "mp3-decode", "mpa-decode"] } craft-color = { workspace = true } craft-frame = { workspace = true } -craft-media = { workspace = true, features = ["mpegts"] } +craft-media = { workspace = true, features = ["mpegts", "mxf"] } craft-media-source = { workspace = true } craft-time = { workspace = true } craft-video = { workspace = true, features = ["h264-decode", "hevc-decode", "vp9-decode", "vp8-decode", "av1-decode", "prores", "dnx", "mpeg2-decode", "threads"] } diff --git a/crates/media/src/craft_source.rs b/crates/media/src/craft_source.rs index c0deb4673..84379fb70 100644 --- a/crates/media/src/craft_source.rs +++ b/crates/media/src/craft_source.rs @@ -17,10 +17,14 @@ //! `Mp3`/`Mp2`/`Mp1` (with `CodecDelay` + `SeekPreRoll` timing). //! - Fallback (`filmcraft-codecs`): `alpha_mode == 1` (`BlockAdditional` alpha), unreadable/zlib //! encodings, `Mjpeg`/`Ffv1`/`Theora`/`Apv`, or unsupported audio (`Vorbis`/`Flac`/`Pcm`). +//! - **MXF (`MXF`, video+audio & audio-only OP1a/OP-Atom)**: +//! - Shared (`craft-media::mxf` + `craft-video` + `MxfFile::read_pcm`): `H264`, `Hevc`, `Av1`, +//! `Vp9`, `Vp8`, `ProRes`, `Dnxhd`, `Mpeg2Video`; sound `Pcm` and `Aes3` (D-10). +//! - Fallback (`filmcraft-codecs`): compressed MXF sound or unsupported video codecs. //! - **Other containers & standalone audio**: //! - Shared (`craft_audio::Decoder` with `decode-native`): standalone `WAV`, `AIFF`, `MP3`/`MP2`/`MP1`, //! `AAC` (ADTS), `AC-3`, and `Ogg` (`Opus`). -//! - Fallback (`filmcraft-codecs`): `MXF`, `AVI`, `MPEG-TS`/`PS`, `Ogg Vorbis`, `FLAC`, `CAF`, or +//! - Fallback (`filmcraft-codecs`): `AVI`, `MPEG-TS`/`PS`, `Ogg Vorbis`, `FLAC`, `CAF`, or //! unsupported WAV/AIFF encodings. use std::sync::{Arc, Mutex}; @@ -31,6 +35,7 @@ use craft_frame::{Chroma, PixelData, Region, VideoFrame}; use craft_media::bitstream::unescape_rbsp; use craft_media::isobmff::{self, Mp4File}; use craft_media::matroska::{self, MkvFile}; +use craft_media::mxf::{self, MxfFile, SoundFormat}; use craft_media::{ByteSource, CodecId, CodecParams}; use craft_media_source::{ AudioStreamInfo, FrameRequest, MAX_AUDIO_STREAMS, MediaError, MediaInfo, MediaKind, MediaSource, Result, SharedBytes, SharedSource, VideoStreamInfo, @@ -73,7 +78,12 @@ fn looks_like_matroska(head: &[u8]) -> bool { head.starts_with(&[0x1A, 0x45, 0xDF, 0xA3]) } -/// Open an in-place ISO-BMFF, Matroska/WebM, or standalone audio source via `craft-media` / `craft-audio`. +/// True when `head` contains an MXF SMPTE KLV partition pack key. +fn looks_like_mxf(head: &[u8]) -> bool { + head.windows(12).any(|w| w == [0x06, 0x0e, 0x2b, 0x34, 0x02, 0x05, 0x01, 0x01, 0x0d, 0x01, 0x02, 0x01]) +} + +/// Open an in-place ISO-BMFF, Matroska/WebM, MXF, or standalone audio source via `craft-media` / `craft-video` / `craft-audio`. /// Returns `None` when the container/codec/audio combination should fall back to `filmcraft-codecs`. #[cfg(any(unix, windows))] pub(crate) fn open_reader(name: &str, head: &[u8], reader: &SharedBytes) -> Option> { @@ -83,10 +93,13 @@ pub(crate) fn open_reader(name: &str, head: &[u8], reader: &SharedBytes) -> Opti if looks_like_matroska(head) { return open_matroska(name, reader.clone()); } + if looks_like_mxf(head) { + return open_mxf(name, reader.clone()); + } open_standalone_audio(name, head, reader.clone()) } -/// Open an in-memory ISO-BMFF, Matroska/WebM, or standalone audio source via `craft-media` / `craft-audio`. +/// Open an in-memory ISO-BMFF, Matroska/WebM, MXF, or standalone audio source via `craft-media` / `craft-video` / `craft-audio`. pub(crate) fn open_bytes(name: &str, bytes: Arc<[u8]>) -> Option> { if looks_like_isobmff(&bytes) { return open_isobmff(name, Arc::new(bytes)); @@ -94,6 +107,9 @@ pub(crate) fn open_bytes(name: &str, bytes: Arc<[u8]>) -> Option::len(&bytes).min(64); @@ -109,6 +125,7 @@ pub(crate) fn open_bytes(name: &str, bytes: Arc<[u8]>) -> Option), + Mxf(Box), } impl ContainerFile { @@ -116,6 +133,7 @@ impl ContainerFile { match self { ContainerFile::Isobmff(f) => f.tracks.get(track_idx).map_or(0, |t| t.samples.len()), ContainerFile::Matroska(f) => f.tracks.get(track_idx).map_or(0, |t| t.samples.len()), + ContainerFile::Mxf(f) => f.tracks.get(track_idx).map_or(0, |t| t.samples.len()), } } @@ -123,6 +141,7 @@ impl ContainerFile { match self { ContainerFile::Isobmff(f) => f.read_sample(src, track_idx, sample_idx).map_err(|e| MediaError::Io(e.to_string())), ContainerFile::Matroska(f) => f.read_sample(src, track_idx, sample_idx).map_err(|e| MediaError::Io(e.to_string())), + ContainerFile::Mxf(f) => f.read_sample(src, track_idx, sample_idx).map_err(|e| MediaError::Io(e.to_string())), } } @@ -140,6 +159,16 @@ impl ContainerFile { let idx = track.sample_at_pts(t_track)?; Some((idx, track.samples[idx].pts)) } + ContainerFile::Mxf(f) => { + let track = f.tracks.get(track_idx)?; + let offset = track.first_edit_unit(); + let d = tick_to_rational_units(time, i64::from(track.edit_rate.num), i64::from(track.edit_rate.den)); + let presented_len = track.duration.unwrap_or_else(|| i64::try_from(track.display_order.len()).unwrap_or(0).saturating_sub(offset).max(0)); + let max_rel = presented_len.saturating_sub(1).max(0); + let pos = offset.saturating_add(d.clamp(0, max_rel)); + let idx = track.sample_at(pos)?; + Some((idx, track.samples[idx].pts)) + } } } @@ -147,6 +176,7 @@ impl ContainerFile { match self { ContainerFile::Isobmff(f) => f.tracks[track_idx].sync_sample_before(target_idx), ContainerFile::Matroska(f) => f.tracks[track_idx].sync_sample_before(target_idx), + ContainerFile::Mxf(f) => f.tracks[track_idx].sync_before(target_idx), } } @@ -154,6 +184,7 @@ impl ContainerFile { match self { ContainerFile::Isobmff(f) => f.tracks[track_idx].samples[sample_idx].pts, ContainerFile::Matroska(f) => f.tracks[track_idx].samples[sample_idx].pts, + ContainerFile::Mxf(f) => f.tracks[track_idx].samples[sample_idx].pts, } } @@ -169,12 +200,17 @@ impl ContainerFile { let ns = track.ticks_to_ns(raw_pts); Tick::from_units(ns, 1_000_000_000) } + ContainerFile::Mxf(f) => { + let track = &f.tracks[track_idx]; + let rel_pts = raw_pts.saturating_sub(track.first_edit_unit()); + Tick::from_units(rel_pts.saturating_mul(i64::from(track.edit_rate.den)), i64::from(track.edit_rate.num.max(1))) + } } } fn audio_packet_is_stamped(&self, track_idx: usize, sample_idx: usize) -> bool { match self { - Self::Isobmff(_) => true, + Self::Isobmff(_) | Self::Mxf(_) => true, Self::Matroska(f) => f.tracks[track_idx].samples.get(sample_idx).is_some_and(|s| s.lace == 0 || s.duration > 0), } } @@ -405,6 +441,7 @@ fn compute_audio_starts(container: &ContainerFile, track_idx: usize, codec: Code let packets = track.samples.iter().map(|s| PacketTime { stamp: stamp_for(s.pts), stamped: s.lace == 0 || s.duration > 0, samples: Some(frame) }); AudioStarts::complete(contiguous_starts(packets, (frame / 2).max(tick_samples))) } + ContainerFile::Mxf(_) => AudioStarts::complete(Vec::new()), } } @@ -457,8 +494,10 @@ where audio_tracks.push(AudioTrackEntry { track_idx: idx, native_rate, - seek_preroll_samples, - state: Mutex::new(AudioTrackState { decoder: dec, audio_starts, next_sample: 0, decoded_pos: initial_pos, buf: Vec::new() }), + backend: AudioBackend::Decoder { + seek_preroll_samples, + state: Mutex::new(AudioTrackState { decoder: dec, audio_starts, next_sample: 0, decoded_pos: initial_pos, buf: Vec::new() }), + }, }); } Some((audio_tracks, audio_infos)) @@ -783,6 +822,135 @@ fn open_matroska(name: &str, source: SharedBytes) -> Option }))) } +fn mxf_sound_window(track: &mxf::EssenceTrack) -> (u64, u64) { + let (sp_num, sp_den) = track.samples_per_edit_unit(); + let sp_den = i128::from(sp_den.max(1)); + let sp_num = i128::from(sp_num); + let offset_units = track.first_edit_unit(); + let presented_start = u64::try_from((i128::from(offset_units) * sp_num) / sp_den).unwrap_or(0); + let stored = track.stored_sample_frames(); + let presented_len = match track.duration { + Some(dur_units) => u64::try_from((i128::from(dur_units.max(0)) * sp_num) / sp_den).unwrap_or(u64::MAX).min(stored.saturating_sub(presented_start)), + None => stored.saturating_sub(presented_start), + }; + (presented_start, presented_len) +} + +fn mxf_start_timecode(tc: mxf::Timecode, rate: Option) -> i64 { + let Some(rate) = rate else { + return tc.start; + }; + if tc.rounded_base == 0 || rate.num <= 0 || rate.den <= 0 { + return tc.start; + } + let rounded_media = (rate.num as f64 / rate.den as f64).round().clamp(1.0, f64::from(u16::MAX)) as u16; + if rounded_media == tc.rounded_base { + return tc.start; + } + let (tc_num, tc_den) = if tc.drop_frame { (i128::from(tc.rounded_base) * 1000, 1001i128) } else { (i128::from(tc.rounded_base), 1i128) }; + let converted = (i128::from(tc.start) * tc_den * i128::from(rate.num)) / (tc_num * i128::from(rate.den)); + i64::try_from(converted).unwrap_or(tc.start) +} + +fn open_mxf(name: &str, source: SharedBytes) -> Option> { + let file = mxf::open(&*source).ok()?; + let video_idx = file.tracks.iter().position(|t| t.kind == mxf::TrackKind::Picture && !t.samples.is_empty() && t.edit_rate.is_valid()); + let sound_indices: Vec = + file.tracks.iter().enumerate().filter(|(_, t)| t.kind == mxf::TrackKind::Sound && !t.chunks.is_empty()).map(|(idx, _)| idx).collect(); + + if video_idx.is_none() && sound_indices.is_empty() { + return None; + } + + // Fall back to FilmCraft for compressed MXF sound until MXF compressed audio is wired. + let mut audio_tracks = Vec::new(); + let mut audio_infos = Vec::new(); + for &idx in &sound_indices { + if audio_tracks.len() >= MAX_AUDIO_STREAMS { + break; + } + let t = &file.tracks[idx]; + if !matches!(t.sound_format, SoundFormat::Pcm | SoundFormat::Aes3Element) { + return None; + } + let sound = t.sound.as_ref()?; + let rate = if sound.sample_rate.is_valid() { sound.sample_rate.as_f64().round().clamp(1.0, f64::from(u32::MAX)) as u32 } else { 48_000 }; + let channels = sound.channels.max(1); + let (presented_start, presented_len) = mxf_sound_window(t); + audio_infos.push(AudioStreamInfo { sample_rate: rate, channels, codec: t.codec.codec_id().name().to_string(), bits_per_sample: Some(sound.bits) }); + audio_tracks.push(AudioTrackEntry { track_idx: idx, native_rate: rate, backend: AudioBackend::MxfPcm { presented_start, presented_len } }); + } + + let (video_info, video_state, presentation, duration) = if let Some(v_idx) = video_idx { + let video_track = &file.tracks[v_idx]; + let video_params = video_track.codec_params(); + if !supports_video_codec(video_params.codec) || video_track.needs_reorder { + return None; + } + let (width, height) = video_track.picture.as_ref().map_or((0, 0), |p| (p.frame_width(), p.frame_height())); + let er = video_track.edit_rate; + let fps = f64::from(er.num) / f64::from(er.den.max(1)); + let frame_rate = snap_common_fps(fps).unwrap_or_else(|| FrameRate::new(i64::from(er.num), i64::from(er.den))); + let dur_units = video_track.duration.unwrap_or_else(|| i64::try_from(video_track.display_order.len()).unwrap_or(0)); + let duration = Tick::from_units(dur_units.saturating_mul(i64::from(er.den)), i64::from(er.num.max(1))); + let has_alpha = video_track.picture.as_ref().is_some_and(|p| p.alpha_depth > 0); + let video_decoder = match TrackDecoder::with_options(&video_params, TrackDecoderOptions { threads: Some(worker_cap()), draft: false }) { + Ok(d) => d, + Err(e) => return Some(Err(MediaError::Decode(e.to_string()))), + }; + let v_info = VideoStreamInfo { + width, + height, + frame_rate, + par: (1, 1), + codec: video_params.codec.name().to_string(), + pixel_format: String::new(), + color: ColorInfo::REC709, + has_alpha, + bitrate: None, + hdr: None, + }; + let v_state = Mutex::new(VideoState { decoder: video_decoder, next_decode_idx: 0, gop_start_idx: 0, flushed: false, decoded: Vec::new() }); + (Some(v_info), Some(v_state), FramePresentation { container_color: None, par: (1, 1), rotation: 0, aperture: None }, duration) + } else { + let duration = audio_tracks + .iter() + .map(|entry| { + let presented_len = match entry.backend { + AudioBackend::MxfPcm { presented_len, .. } => i64::try_from(presented_len).unwrap_or(i64::MAX), + AudioBackend::Decoder { .. } => 0, + }; + Tick::from_units(presented_len, i64::from(entry.native_rate)) + }) + .max() + .unwrap_or(Tick::ZERO); + (None, None, FramePresentation { container_color: None, par: (1, 1), rotation: 0, aperture: None }, duration) + }; + + let kind = if video_info.is_some() { MediaKind::Movie } else { MediaKind::AudioOnly }; + let start_timecode = file.timecode.map(|tc| mxf_start_timecode(tc, video_info.as_ref().map(|v| v.frame_rate))); + let info = MediaInfo { + name: name.to_string(), + kind, + duration, + video: video_info, + audio_streams: audio_infos, + container: "mxf".to_string(), + start_timecode, + file_size: Some(source.len()), + }; + + Some(Ok(Arc::new(CraftMediaSource { + info, + source, + file: ContainerFile::Mxf(Box::new(file)), + video_track_idx: video_idx, + presentation, + video: video_state, + audio_tracks, + }))) +} + struct CachedFrame { pts: i64, draft: bool, @@ -807,11 +975,25 @@ struct AudioTrackState { buf: Vec>, } +enum AudioBackend { + Decoder { seek_preroll_samples: i64, state: Mutex }, + MxfPcm { presented_start: u64, presented_len: u64 }, +} + struct AudioTrackEntry { track_idx: usize, native_rate: u32, - seek_preroll_samples: i64, - state: Mutex, + backend: AudioBackend, +} + +#[cfg(test)] +impl AudioTrackEntry { + fn decoder_parts(&mut self) -> (i64, &mut AudioTrackState) { + match &mut self.backend { + AudioBackend::Decoder { seek_preroll_samples, state } => (*seek_preroll_samples, state.get_mut().unwrap()), + AudioBackend::MxfPcm { .. } => panic!("expected decoder audio backend"), + } + } } #[derive(Clone, Copy)] @@ -917,18 +1099,50 @@ impl MediaSource for CraftMediaSource { let native_rate = entry.native_rate; let (native_start, native_frames) = native_audio_window(start, frames, native_rate, sample_rate); - let mut state = entry.state.lock().unwrap_or_else(std::sync::PoisonError::into_inner); - let decoded = decode_audio_range( - &self.file, - &*self.source, - entry.track_idx, - native_rate, - channels_count, - entry.seek_preroll_samples, - &mut state, - native_start, - native_frames, - )?; + let decoded = match &entry.backend { + AudioBackend::Decoder { seek_preroll_samples, state: state_mutex } => { + let mut state = state_mutex.lock().unwrap_or_else(std::sync::PoisonError::into_inner); + decode_audio_range( + &self.file, + &*self.source, + entry.track_idx, + native_rate, + channels_count, + *seek_preroll_samples, + &mut state, + native_start, + native_frames, + )? + } + AudioBackend::MxfPcm { presented_start, presented_len } => { + if filmcraft_media::cancel::cancelled() { + return Err(MediaError::Cancelled); + } + let ContainerFile::Mxf(mxf_file) = &self.file else { + return Err(MediaError::NoStream("audio")); + }; + let req_end = native_start.saturating_add(native_frames as i64); + let win_len = i64::try_from(*presented_len).unwrap_or(i64::MAX); + if *presented_start == 0 && native_start >= 0 && req_end <= win_len { + mxf_file.read_pcm(&*self.source, entry.track_idx, native_start as u64, native_frames).map_err(|e| MediaError::Io(e.to_string()))? + } else { + let mut out = vec![vec![0.0f32; native_frames]; channels_count]; + let clamped_start = native_start.max(0).min(win_len); + let clamped_end = req_end.max(0).min(win_len); + let read_len = usize::try_from(clamped_end.saturating_sub(clamped_start)).unwrap_or(0); + if read_len > 0 { + let dst_off = usize::try_from(clamped_start - native_start).unwrap_or(0); + let stored_start = presented_start.saturating_add(clamped_start as u64); + let read = mxf_file.read_pcm(&*self.source, entry.track_idx, stored_start, read_len).map_err(|e| MediaError::Io(e.to_string()))?; + for (dst, src) in out.iter_mut().zip(&read) { + let n = src.len().min(read_len); + dst[dst_off..dst_off + n].copy_from_slice(&src[..n]); + } + } + out + } + } + }; if sample_rate == native_rate { return Ok(AudioBuffer { sample_rate, channels: decoded }); @@ -1570,6 +1784,12 @@ fn tick_to_matroska_units(t: Tick, timebase: (u64, u64)) -> i64 { i64::try_from(v).unwrap_or(if v < 0 { i64::MIN } else { i64::MAX }) } +fn tick_to_rational_units(t: Tick, num: i64, den: i64) -> i64 { + let denom = i128::from(craft_time::TICKS_PER_SECOND) * i128::from(den.max(1)); + let v = (i128::from(t.0) * i128::from(num.max(1))) / denom; + i64::try_from(v).unwrap_or(if v < 0 { i64::MIN } else { i64::MAX }) +} + fn snap_common_fps(fps: f64) -> Option { if !fps.is_finite() || fps <= 0.0 { return None; @@ -1765,12 +1985,13 @@ mod tests { assert_eq!(*source.packets.lock().unwrap(), (0..AUDIO_LOOKAHEAD).collect::>()); let first = expected_positions[0]; - assert_eq!(tracks[0].state.get_mut().unwrap().decoded_pos, first); + assert_eq!(tracks[0].decoder_parts().1.decoded_pos, first); let (mut reference, _) = open_audio_tracks(file, &source.bytes, [(0, OPUS_PACKETS, params.clone(), delay)]).unwrap(); - reference[0].state.get_mut().unwrap().audio_starts = AudioStarts::complete(expected_positions.to_vec()); + reference[0].decoder_parts().1.audio_starts = AudioStarts::complete(expected_positions.to_vec()); let decode = |track: &mut AudioTrackEntry, src: &dyn ByteSource, start, frames| { - decode_audio_range(file, src, 0, OPUS_RATE, 1, track.seek_preroll_samples, track.state.get_mut().unwrap(), start, frames).unwrap() + let (preroll, state) = track.decoder_parts(); + decode_audio_range(file, src, 0, OPUS_RATE, 1, preroll, state, start, frames).unwrap() }; // A first read before the initial packet can be ordinary leading silence // or negative pre-roll. Neither should trigger the cold suffix scan. @@ -1795,7 +2016,7 @@ mod tests { let backward_start = first + 2 * OPUS_FRAME as i64; let backward = decode(&mut tracks[0], source, backward_start, OPUS_FRAME); assert_eq!(backward, decode(&mut reference[0], &source.bytes, backward_start, OPUS_FRAME)); - let state = tracks[0].state.get_mut().unwrap(); + let (_, state) = tracks[0].decoder_parts(); assert_eq!(state.audio_starts.positions.as_slice(), expected_positions); assert!(state.audio_starts.opus.is_none()); early @@ -1812,21 +2033,20 @@ mod tests { ) { let first = expected_positions[0]; let decode = |track: &mut AudioTrackEntry, src: &dyn ByteSource, start, frames| { - decode_audio_range(file, src, 0, OPUS_RATE, 1, track.seek_preroll_samples, track.state.get_mut().unwrap(), start, frames).unwrap() + let (preroll, state) = track.decoder_parts(); + decode_audio_range(file, src, 0, OPUS_RATE, 1, preroll, state, start, frames).unwrap() }; // A genuinely random first request is not the leading-silence shortcut. let (mut fresh, _) = open_audio_tracks(file, source, [(0, OPUS_PACKETS, params.clone(), delay)]).unwrap(); let (mut eager, _) = open_audio_tracks(file, &source.bytes, [(0, OPUS_PACKETS, params, delay)]).unwrap(); - eager[0].state.get_mut().unwrap().audio_starts = AudioStarts::complete(expected_positions.to_vec()); + eager[0].decoder_parts().1.audio_starts = AudioStarts::complete(expected_positions.to_vec()); if laced { - assert_eq!(file.audio_seek_info(0, expected_positions, fresh[0].seek_preroll_samples, start).0, 144); + assert_eq!(file.audio_seek_info(0, expected_positions, fresh[0].decoder_parts().0, start).0, 144); } let transient_packet = 64; *source.fail_once_at.lock().unwrap() = Some(transient_packet); { - let entry = &mut fresh[0]; - let preroll = entry.seek_preroll_samples; - let state = entry.state.get_mut().unwrap(); + let (preroll, state) = fresh[0].decoder_parts(); let error = decode_audio_range(file, source, 0, OPUS_RATE, 1, preroll, state, start, 3 * OPUS_FRAME).unwrap_err(); assert!(matches!(error, MediaError::Io(_))); assert_eq!(state.audio_starts.opus.as_ref().unwrap().len, transient_packet); @@ -1835,7 +2055,7 @@ mod tests { let cold = decode(&mut fresh[0], source, start, 3 * OPUS_FRAME); assert_eq!(cold, decode(&mut eager[0], &source.bytes, start, 3 * OPUS_FRAME)); assert!(cold[0].iter().any(|s| s.abs() > 1e-5)); - let state = fresh[0].state.get_mut().unwrap(); + let (_, state) = fresh[0].decoder_parts(); assert_eq!(state.audio_starts.positions.as_slice(), expected_positions); assert!(state.audio_starts.opus.is_none()); } @@ -2075,6 +2295,105 @@ mod tests { } } + #[test] + fn mxf_sniffer_and_rational_units() { + assert!(looks_like_mxf(&[0x06, 0x0e, 0x2b, 0x34, 0x02, 0x05, 0x01, 0x01, 0x0d, 0x01, 0x02, 0x01, 0x01, 0x02])); + assert!(!looks_like_mxf(&[0x00, 0x00, 0x00, 0x18, b'f', b't', b'y', b'p'])); + assert_eq!(tick_to_rational_units(Tick(craft_time::TICKS_PER_SECOND), 25, 1), 25); + assert_eq!(tick_to_rational_units(Tick(craft_time::TICKS_PER_SECOND), 30000, 1001), 29); + } + + #[test] + fn mxf_start_timecode_converts_mismatched_rates_and_preserves_matching() { + let tc = mxf::Timecode { start: 100, rounded_base: 24, drop_frame: false }; + assert_eq!(mxf_start_timecode(tc, Some(FrameRate::FPS_23_976)), 100); + assert_eq!(mxf_start_timecode(tc, Some(FrameRate::FPS_24)), 100); + assert_eq!(mxf_start_timecode(tc, Some(FrameRate::new(48, 1))), 200); + let df = mxf::Timecode { start: 3000, rounded_base: 30, drop_frame: true }; + assert_eq!(mxf_start_timecode(df, Some(FrameRate::FPS_29_97)), 3000); + assert_eq!(mxf_start_timecode(df, Some(FrameRate::new(60_000, 1001))), 6000); + assert_eq!(mxf_start_timecode(df, None), 3000); + } + + #[test] + fn mxf_opatom_pcm_reads_windowed_and_resampled_audio() { + let opts = mxf::write::OpAtomPcm { + sample_rate: 48_000, + bits: 16, + channels: 2, + edit_rate: None, + ids: mxf::write::PackageIds::from_seed("eff-mxf-test", "pcm"), + timecode: Some(mxf::write::StartTimecode { frames: 240, rate: mxf::Rational::new(24, 1), drop_frame: false }), + }; + let samples: Vec = (0..4800 * 2).map(|i| ((i * 137) % 16000) - 8000).collect(); + let bytes = mxf::write::write_opatom_pcm(&opts, &samples).expect("write opatom pcm"); + let src = open_bytes("test.mxf", Arc::from(bytes)).expect("recognized").expect("opened"); + let info = src.info(); + assert_eq!(info.container, "mxf"); + assert_eq!(info.kind, MediaKind::AudioOnly); + assert_eq!(info.audio_streams.len(), 1); + assert_eq!(info.audio_streams[0].sample_rate, 48_000); + assert_eq!(info.audio_streams[0].channels, 2); + + // Direct read at t=0 + let buf = src.audio(0, 1024, 48_000).expect("direct read"); + assert_eq!(buf.channels.len(), 2); + assert_eq!(buf.channels[0].len(), 1024); + assert!(buf.channels[0].iter().any(|&v| v.abs() > 0.01)); + + // Negative start and past-end read zero-fill cleanly + let neg = src.audio(-100, 200, 48_000).expect("negative start"); + assert!(neg.channels[0][..100].iter().all(|&v| v == 0.0)); + assert!(neg.channels[0][100..].iter().any(|&v| v.abs() > 0.01)); + let past = src.audio(4700, 200, 48_000).expect("past end"); + assert!(past.channels[0][..100].iter().any(|&v| v.abs() > 0.01)); + assert!(past.channels[0][100..].iter().all(|&v| v == 0.0)); + + // Resampled read + let resampled = src.audio(0, 512, 44_100).expect("resampled"); + assert_eq!(resampled.sample_rate, 44_100); + assert_eq!(resampled.channels[0].len(), 512); + } + + #[test] + fn mxf_video_window_and_sound_trim_helpers() { + let mut cfg = + mxf::write::WriterConfig::new(mxf::write::Pattern::Op1a, mxf::Rational::new(25, 1), mxf::write::PackageIds::from_seed("eff-mxf-vid", "op1a")); + cfg.picture = Some(mxf::write::PictureDesc::new(mxf::write::PictureCoding::Avc { profile_idc: 66, intra: false }, 16, 16)); + cfg.sound = vec![mxf::write::SoundDesc { sample_rate: 48_000, channels: 1, bits: 16 }]; + let mut w = mxf::write::MxfWriter::new(std::io::Cursor::new(Vec::new()), cfg).expect("writer"); + let pcm = mxf::write::encode_pcm(&[vec![0.1f32; 1920]], 16); + w.push_picture(&[0x00, 0x00, 0x00, 0x01, 0x65], mxf::write::FrameInfo::intra()).expect("pic0"); + w.push_sound(0, &pcm).expect("snd0"); + w.push_picture(&[0x00, 0x00, 0x00, 0x01, 0x41], mxf::write::FrameInfo::intra()).expect("pic1"); + w.push_sound(0, &pcm).expect("snd1"); + let raw_bytes = w.finish().expect("finish").into_inner(); + let arc_bytes: Arc<[u8]> = Arc::from(raw_bytes.clone()); + let mxf_bytes: SharedBytes = Arc::new(arc_bytes); + let mut file = mxf::open(&*mxf_bytes).expect("open mxf"); + + // Exercise ContainerFile::Mxf video helpers and trimmed sound window. + file.tracks[0].origin = 1; + file.tracks[0].duration = Some(1); + file.tracks[1].origin = 1; + file.tracks[1].duration = Some(1); + let (win_start, win_len) = mxf_sound_window(&file.tracks[1]); + assert_eq!((win_start, win_len), (1920, 1920)); + + let container = ContainerFile::Mxf(Box::new(file)); + assert_eq!(container.sample_count(0), 2); + assert_eq!(container.target_sample(0, Tick::ZERO), Some((1, 1))); + assert_eq!(container.sync_sample_before(0, 1), 1); + assert_eq!(container.sample_pts(0, 1), 1); + assert_eq!(container.pts_to_tick(0, 1), Tick::ZERO); + + // Exercise open_mxf video+sound path on valid Op1a Avc+PCM. + let src = open_bytes("op1a.mxf", Arc::from(raw_bytes)).expect("recognized").expect("opened"); + assert_eq!(src.info().container, "mxf"); + assert_eq!(src.info().audio_streams.len(), 1); + assert!(open_bytes("op1a.mxf", Arc::from(vec![0u8; 4])).is_none()); + } + #[test] fn standalone_wav_opens_seeks_and_resamples_via_craft_audio() { // Minimal 48 kHz stereo 16-bit PCM WAV with 4800 frames (0.1s). @@ -2205,7 +2524,8 @@ mod tests { let (mut tracks, _) = open_audio_tracks(&file, &bytes, [(0, 4, params.clone(), 0)]).unwrap(); let decode = |track: &mut AudioTrackEntry, start: i64, frames: usize| { - decode_audio_range(&file, &bytes, 0, 48_000, 1, track.seek_preroll_samples, track.state.get_mut().unwrap(), start, frames).unwrap() + let (preroll, state) = track.decoder_parts(); + decode_audio_range(&file, &bytes, 0, 48_000, 1, preroll, state, start, frames).unwrap() }; let full = decode(&mut tracks[0], 0, 500); @@ -2244,11 +2564,12 @@ mod tests { let open_with_overlap = || { let (mut tracks, _) = open_audio_tracks(&file, &bytes, [(0, 2, params.clone(), 0)]).unwrap(); - tracks[0].state.get_mut().unwrap().audio_starts = AudioStarts::complete(vec![0, 512]); + tracks[0].decoder_parts().1.audio_starts = AudioStarts::complete(vec![0, 512]); tracks }; let decode = |track: &mut AudioTrackEntry, start: i64, frames: usize| { - decode_audio_range(&file, &bytes, 0, 48_000, 1, track.seek_preroll_samples, track.state.get_mut().unwrap(), start, frames).unwrap() + let (preroll, state) = track.decoder_parts(); + decode_audio_range(&file, &bytes, 0, 48_000, 1, preroll, state, start, frames).unwrap() }; let mut wide_tracks = open_with_overlap(); diff --git a/crates/media/tests/it/footage.rs b/crates/media/tests/it/footage.rs index a542d4439..ee722d7eb 100644 --- a/crates/media/tests/it/footage.rs +++ b/crates/media/tests/it/footage.rs @@ -1728,6 +1728,33 @@ fn audio_only_isobmff_and_matroska_route_through_craft_audio() { } } +#[test] +fn mxf_route_backward_seek_cancel_and_pcm_audio() { + use std::sync::atomic::AtomicBool; + let Some(p) = mpeg2_mxf() else { return }; + let f = probe(&p).expect("probe mxf"); + assert_eq!(f.codec, "MPEG-2", "MXF MPEG-2 must route through shared craft-media::mxf"); + let pool = MediaPool::new(); + let f20 = pool.frame(ItemId(1), &f, t_of(f.frame_rate, 20)).expect("frame 20"); + let f5 = pool.frame(ItemId(1), &f, t_of(f.frame_rate, 5)).expect("backward seek frame 5"); + assert_eq!((f20.width, f20.height), (1280, 720)); + assert_eq!((f5.width, f5.height), (1280, 720)); + let fresh_f5 = MediaPool::new().frame(ItemId(1), &f, t_of(f.frame_rate, 5)).expect("fresh frame 5"); + assert!(psnr(&f5, &fresh_f5) > 55.0, "MXF backward seek frame 5 matches fresh decode"); + + let off = Arc::new(AtomicBool::new(true)); + let mut cancelled = Some(Arc::clone(&f5)); + pool.cancellable(&off, &mut || cancelled = pool.frame(ItemId(1), &f, t_of(f.frame_rate, 30))); + assert!(cancelled.is_none(), "cancelled MXF read must not decode"); + + let pcm_start = pool.audio_samples(&f, Tick::ZERO, 4800, 48_000); + let pcm_seek = pool.audio_samples(&f, Tick(TICKS_PER_SECOND / 2), 4800, 48_000); + assert_eq!(pcm_start.len(), 9600); + assert_eq!(pcm_seek.len(), 9600); + let rms_seek = (pcm_seek.iter().map(|v| v * v).sum::() / pcm_seek.len() as f32).sqrt(); + assert!((rms_seek - 0.0625).abs() < 0.02, "MXF PCM seek rms {rms_seek}"); +} + #[test] fn standalone_audio_formats_route_through_craft_audio() { for (file, args) in [ From c03539fafb5b8e7c1a14f057463c0edb8db3536c Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sat, 21 Nov 2026 04:24:37 -0500 Subject: [PATCH 344/451] media: route AVI, MPEG-TS, and MPEG-PS through craft-media (#4010) * media: route AVI, MPEG-TS, and MPEG-PS through craft-media * media: add tick_to_rational_units and unwrap CodecParams dims * media: deduplicate container source builder and add AVI/MPEG unit test * media: import avi mux types from craft_media::avi root in test * media: test estimate_mpeg_frame_rate via pts helper * media: expand AVI and MPEG-TS unit test coverage * media: write >=5 TS packets in MPEG-TS unit test for sniff * media: expect MPEG-2 TS container name in unit test * media: restore ContainerFile::Avi arm in target_sample --- crates/media/Cargo.toml | 2 +- crates/media/src/craft_source.rs | 357 ++++++++++++++++++++++++++++++- crates/media/tests/it/footage.rs | 71 ++++++ 3 files changed, 424 insertions(+), 6 deletions(-) diff --git a/crates/media/Cargo.toml b/crates/media/Cargo.toml index 76a86a69a..338bdc6f7 100644 --- a/crates/media/Cargo.toml +++ b/crates/media/Cargo.toml @@ -30,7 +30,7 @@ craft-webp = { workspace = true, features = ["frames"] } craft-audio = { workspace = true, features = ["decode-native", "aac-decode", "alac-decode", "opus-decode", "ac3-decode", "mp3-decode", "mpa-decode"] } craft-color = { workspace = true } craft-frame = { workspace = true } -craft-media = { workspace = true, features = ["mpegts", "mxf"] } +craft-media = { workspace = true, features = ["mpegts", "avi", "mxf"] } craft-media-source = { workspace = true } craft-time = { workspace = true } craft-video = { workspace = true, features = ["h264-decode", "hevc-decode", "vp9-decode", "vp8-decode", "av1-decode", "prores", "dnx", "mpeg2-decode", "threads"] } diff --git a/crates/media/src/craft_source.rs b/crates/media/src/craft_source.rs index 84379fb70..f06391e5c 100644 --- a/crates/media/src/craft_source.rs +++ b/crates/media/src/craft_source.rs @@ -21,20 +21,28 @@ //! - Shared (`craft-media::mxf` + `craft-video` + `MxfFile::read_pcm`): `H264`, `Hevc`, `Av1`, //! `Vp9`, `Vp8`, `ProRes`, `Dnxhd`, `Mpeg2Video`; sound `Pcm` and `Aes3` (D-10). //! - Fallback (`filmcraft-codecs`): compressed MXF sound or unsupported video codecs. +//! - **AVI / MPEG-TS / MPEG-PS**: +//! - Shared (`craft-media::avi`, `craft-media::mpegts` + `craft-video` + `craft-audio`): +//! `H264`, `Hevc`, `Mpeg2Video`, `Av1`, `Vp9`, `Vp8`, `ProRes`, `Dnxhd`; audio `Aac`, +//! `Ac3`/`Eac3`, `Mp3`/`Mp2`/`Mp1`, `Pcm`. +//! - Fallback (`filmcraft-codecs`): unsupported codecs (`Mjpeg`, `Mpeg4Video`, `Ffv1`, `Theora`, +//! `Apv`, raw RGB AVI) or unsupported audio. //! - **Other containers & standalone audio**: //! - Shared (`craft_audio::Decoder` with `decode-native`): standalone `WAV`, `AIFF`, `MP3`/`MP2`/`MP1`, //! `AAC` (ADTS), `AC-3`, and `Ogg` (`Opus`). -//! - Fallback (`filmcraft-codecs`): `AVI`, `MPEG-TS`/`PS`, `Ogg Vorbis`, `FLAC`, `CAF`, or -//! unsupported WAV/AIFF encodings. +//! - Fallback (`filmcraft-codecs`): `Ogg Vorbis`, `FLAC`, `CAF`, or unsupported WAV/AIFF +//! encodings. use std::sync::{Arc, Mutex}; use craft_audio::{AudioBuffer, TrackDecoder as AudioTrackDecoder}; use craft_color::{ColorInfo, Matrix, Primaries, Range, Transfer}; use craft_frame::{Chroma, PixelData, Region, VideoFrame}; +use craft_media::avi::{self, AviFile}; use craft_media::bitstream::unescape_rbsp; use craft_media::isobmff::{self, Mp4File}; use craft_media::matroska::{self, MkvFile}; +use craft_media::mpegts; use craft_media::mxf::{self, MxfFile, SoundFormat}; use craft_media::{ByteSource, CodecId, CodecParams}; use craft_media_source::{ @@ -83,7 +91,7 @@ fn looks_like_mxf(head: &[u8]) -> bool { head.windows(12).any(|w| w == [0x06, 0x0e, 0x2b, 0x34, 0x02, 0x05, 0x01, 0x01, 0x0d, 0x01, 0x02, 0x01]) } -/// Open an in-place ISO-BMFF, Matroska/WebM, MXF, or standalone audio source via `craft-media` / `craft-video` / `craft-audio`. +/// Open an in-place ISO-BMFF, Matroska/WebM, MXF, AVI, MPEG-TS/PS, or standalone audio source via `craft-media` / `craft-video` / `craft-audio`. /// Returns `None` when the container/codec/audio combination should fall back to `filmcraft-codecs`. #[cfg(any(unix, windows))] pub(crate) fn open_reader(name: &str, head: &[u8], reader: &SharedBytes) -> Option> { @@ -96,10 +104,16 @@ pub(crate) fn open_reader(name: &str, head: &[u8], reader: &SharedBytes) -> Opti if looks_like_mxf(head) { return open_mxf(name, reader.clone()); } + if avi::sniff(head) { + return open_avi(name, reader.clone()); + } + if let Some(fmt) = mpegts::sniff(head) { + return open_mpeg(name, fmt, reader.clone()); + } open_standalone_audio(name, head, reader.clone()) } -/// Open an in-memory ISO-BMFF, Matroska/WebM, MXF, or standalone audio source via `craft-media` / `craft-video` / `craft-audio`. +/// Open an in-memory ISO-BMFF, Matroska/WebM, MXF, AVI, MPEG-TS/PS, or standalone audio source via `craft-media` / `craft-video` / `craft-audio`. pub(crate) fn open_bytes(name: &str, bytes: Arc<[u8]>) -> Option> { if looks_like_isobmff(&bytes) { return open_isobmff(name, Arc::new(bytes)); @@ -110,6 +124,12 @@ pub(crate) fn open_bytes(name: &str, bytes: Arc<[u8]>) -> Option::len(&bytes).min(64); @@ -125,6 +145,8 @@ pub(crate) fn open_bytes(name: &str, bytes: Arc<[u8]>) -> Option), + Avi(Box), + Mpeg { file: Box, origin_pts: i64 }, Mxf(Box), } @@ -133,6 +155,8 @@ impl ContainerFile { match self { ContainerFile::Isobmff(f) => f.tracks.get(track_idx).map_or(0, |t| t.samples.len()), ContainerFile::Matroska(f) => f.tracks.get(track_idx).map_or(0, |t| t.samples.len()), + ContainerFile::Avi(f) => f.streams.get(track_idx).map_or(0, |s| s.chunks.len()), + ContainerFile::Mpeg { file, .. } => file.streams.get(track_idx).map_or(0, |s| s.units.len()), ContainerFile::Mxf(f) => f.tracks.get(track_idx).map_or(0, |t| t.samples.len()), } } @@ -141,6 +165,8 @@ impl ContainerFile { match self { ContainerFile::Isobmff(f) => f.read_sample(src, track_idx, sample_idx).map_err(|e| MediaError::Io(e.to_string())), ContainerFile::Matroska(f) => f.read_sample(src, track_idx, sample_idx).map_err(|e| MediaError::Io(e.to_string())), + ContainerFile::Avi(f) => f.read_chunk(src, track_idx, sample_idx).map_err(|e| MediaError::Io(e.to_string())), + ContainerFile::Mpeg { file, .. } => file.read_unit(src, track_idx, sample_idx).map_err(|e| MediaError::Io(e.to_string())), ContainerFile::Mxf(f) => f.read_sample(src, track_idx, sample_idx).map_err(|e| MediaError::Io(e.to_string())), } } @@ -159,6 +185,29 @@ impl ContainerFile { let idx = track.sample_at_pts(t_track)?; Some((idx, track.samples[idx].pts)) } + ContainerFile::Avi(f) => { + let s = f.streams.get(track_idx)?; + if s.chunks.is_empty() || s.rate == 0 || s.scale == 0 { + return None; + } + let max_idx = i64::try_from(s.chunks.len() - 1).unwrap_or(0); + let d = tick_to_rational_units(time, i64::from(s.rate), i64::from(s.scale)).clamp(0, max_idx); + let idx = usize::try_from(d).ok()?; + Some((idx, d)) + } + ContainerFile::Mpeg { file, origin_pts } => { + let s = file.streams.get(track_idx)?; + let t_90k = tick_to_units(time, 90_000).saturating_add(*origin_pts); + let (idx, pts) = s + .units + .iter() + .enumerate() + .filter_map(|(i, u)| u.pts.map(|p| (i, p))) + .filter(|&(_, p)| p <= t_90k) + .max_by_key(|&(_, p)| p) + .or_else(|| s.units.iter().enumerate().find_map(|(i, u)| u.pts.map(|p| (i, p))))?; + Some((idx, pts)) + } ContainerFile::Mxf(f) => { let track = f.tracks.get(track_idx)?; let offset = track.first_edit_unit(); @@ -176,6 +225,16 @@ impl ContainerFile { match self { ContainerFile::Isobmff(f) => f.tracks[track_idx].sync_sample_before(target_idx), ContainerFile::Matroska(f) => f.tracks[track_idx].sync_sample_before(target_idx), + ContainerFile::Avi(f) => { + let s = &f.streams[track_idx]; + let i = target_idx.min(s.chunks.len().saturating_sub(1)); + if s.keyframes_known { (0..=i).rev().find(|&k| s.chunks[k].key).unwrap_or(0) } else { 0 } + } + ContainerFile::Mpeg { file, .. } => { + let s = &file.streams[track_idx]; + let i = target_idx.min(s.units.len().saturating_sub(1)); + (0..=i).rev().find(|&k| s.units[k].key).unwrap_or(0) + } ContainerFile::Mxf(f) => f.tracks[track_idx].sync_before(target_idx), } } @@ -184,6 +243,8 @@ impl ContainerFile { match self { ContainerFile::Isobmff(f) => f.tracks[track_idx].samples[sample_idx].pts, ContainerFile::Matroska(f) => f.tracks[track_idx].samples[sample_idx].pts, + ContainerFile::Avi(_) => i64::try_from(sample_idx).unwrap_or(0), + ContainerFile::Mpeg { file, .. } => file.streams[track_idx].units[sample_idx].pts.unwrap_or(0), ContainerFile::Mxf(f) => f.tracks[track_idx].samples[sample_idx].pts, } } @@ -200,6 +261,11 @@ impl ContainerFile { let ns = track.ticks_to_ns(raw_pts); Tick::from_units(ns, 1_000_000_000) } + ContainerFile::Avi(f) => { + let s = &f.streams[track_idx]; + Tick::from_units(raw_pts.saturating_mul(i64::from(s.scale.max(1))), i64::from(s.rate.max(1))) + } + ContainerFile::Mpeg { origin_pts, .. } => Tick::from_units(raw_pts.saturating_sub(*origin_pts), 90_000), ContainerFile::Mxf(f) => { let track = &f.tracks[track_idx]; let rel_pts = raw_pts.saturating_sub(track.first_edit_unit()); @@ -210,7 +276,7 @@ impl ContainerFile { fn audio_packet_is_stamped(&self, track_idx: usize, sample_idx: usize) -> bool { match self { - Self::Isobmff(_) | Self::Mxf(_) => true, + Self::Isobmff(_) | Self::Avi(_) | Self::Mpeg { .. } | Self::Mxf(_) => true, Self::Matroska(f) => f.tracks[track_idx].samples.get(sample_idx).is_some_and(|s| s.lace == 0 || s.duration > 0), } } @@ -441,6 +507,50 @@ fn compute_audio_starts(container: &ContainerFile, track_idx: usize, codec: Code let packets = track.samples.iter().map(|s| PacketTime { stamp: stamp_for(s.pts), stamped: s.lace == 0 || s.duration > 0, samples: Some(frame) }); AudioStarts::complete(contiguous_starts(packets, (frame / 2).max(tick_samples))) } + ContainerFile::Avi(f) => { + let Some(s) = f.streams.get(track_idx) else { return AudioStarts::complete(Vec::new()) }; + let den = i128::from(s.rate.max(1)); + let scale = i128::from(s.scale.max(1)); + if s.sample_size > 0 { + let mut acc = 0i64; + return AudioStarts::complete( + s.chunks + .iter() + .map(|c| { + let start = acc; + acc = acc.saturating_add(i64::from(c.size / s.sample_size.max(1))); + start + }) + .collect(), + ); + } + let stamps: Vec = (0..s.chunks.len()).map(|i| i64::try_from(i128::from(i as i64) * scale * rate / den).unwrap_or(0)).collect(); + let Some(frame) = fixed_samples else { + return AudioStarts::complete(stamps); + }; + AudioStarts::complete(contiguous_starts(stamps.into_iter().map(|stamp| PacketTime { stamp, stamped: true, samples: Some(frame) }), frame / 2)) + } + ContainerFile::Mpeg { file, origin_pts } => { + let Some(s) = file.streams.get(track_idx) else { return AudioStarts::complete(Vec::new()) }; + let mut last_stamp = 0i64; + let stamps: Vec = s + .units + .iter() + .map(|u| { + if let Some(p) = u.pts { + last_stamp = i64::try_from(i128::from(p.saturating_sub(*origin_pts)) * rate / 90_000).unwrap_or(0); + } + last_stamp + }) + .collect(); + let Some(frame) = fixed_samples else { + return AudioStarts::complete(stamps); + }; + AudioStarts::complete(contiguous_starts( + s.units.iter().zip(stamps).map(|(u, stamp)| PacketTime { stamp, stamped: u.pts.is_some(), samples: Some(frame) }), + frame / 2, + )) + } ContainerFile::Mxf(_) => AudioStarts::complete(Vec::new()), } } @@ -822,6 +932,51 @@ fn open_matroska(name: &str, source: SharedBytes) -> Option }))) } +struct ContainerVideoPart { + track_idx: usize, + info: VideoStreamInfo, + state: Mutex, +} + +fn finish_container_source( + name: &str, + container_name: &str, + source: SharedBytes, + container: ContainerFile, + video: Option, + duration: Tick, + audio_candidates: Vec<(usize, usize, CodecParams, u64)>, +) -> Option> { + let (audio_tracks, audio_infos) = open_audio_tracks(&container, &*source, audio_candidates)?; + if video.is_none() && audio_tracks.is_empty() { + return None; + } + let kind = if video.is_some() { MediaKind::Movie } else { MediaKind::AudioOnly }; + let (video_track_idx, video_info, video_state) = match video { + Some(v) => (Some(v.track_idx), Some(v.info), Some(v.state)), + None => (None, None, None), + }; + let info = MediaInfo { + name: name.to_string(), + kind, + duration, + video: video_info, + audio_streams: audio_infos, + container: container_name.to_string(), + start_timecode: None, + file_size: Some(source.len()), + }; + Some(Ok(Arc::new(CraftMediaSource { + info, + source, + file: container, + video_track_idx, + presentation: FramePresentation { container_color: None, par: (1, 1), rotation: 0, aperture: None }, + video: video_state, + audio_tracks, + }))) +} + fn mxf_sound_window(track: &mxf::EssenceTrack) -> (u64, u64) { let (sp_num, sp_den) = track.samples_per_edit_unit(); let sp_den = i128::from(sp_den.max(1)); @@ -951,6 +1106,141 @@ fn open_mxf(name: &str, source: SharedBytes) -> Option> { }))) } +fn default_video_info(width: u32, height: u32, frame_rate: FrameRate, codec: &CodecParams) -> VideoStreamInfo { + VideoStreamInfo { + width, + height, + frame_rate, + par: (1, 1), + codec: codec.codec.name().to_string(), + pixel_format: String::new(), + color: ColorInfo::REC709, + has_alpha: false, + bitrate: None, + hdr: None, + } +} + +fn open_avi(name: &str, source: SharedBytes) -> Option> { + let file = avi::open(&*source).ok()?; + let video_idx = file.streams.iter().position(|s| s.kind == avi::StreamKind::Video && !s.chunks.is_empty() && s.rate > 0 && s.scale > 0); + let audio_candidates: Vec<(usize, usize, CodecParams, u64)> = file + .streams + .iter() + .enumerate() + .filter(|(_, s)| s.kind == avi::StreamKind::Audio && !s.chunks.is_empty()) + .map(|(idx, s)| (idx, s.chunks.len(), s.codec_params(), 0)) + .collect(); + + if video_idx.is_none() && audio_candidates.is_empty() { + return None; + } + + let (video, duration) = if let Some(v_idx) = video_idx { + let video_stream = &file.streams[v_idx]; + let video_params = video_stream.codec_params(); + if !supports_video_codec(video_params.codec) { + return None; + } + let (width, height) = video_stream.video.as_ref().map_or((0, 0), |v| (v.width.unsigned_abs(), v.height.unsigned_abs())); + let fps = f64::from(video_stream.rate) / f64::from(video_stream.scale.max(1)); + let frame_rate = snap_common_fps(fps).unwrap_or_else(|| FrameRate::new(i64::from(video_stream.rate), i64::from(video_stream.scale))); + let total_units = i64::from(video_stream.length.max(video_stream.chunks.len() as u32)); + let duration = Tick::from_units(total_units.saturating_mul(i64::from(video_stream.scale)), i64::from(video_stream.rate.max(1))); + let video_decoder = match TrackDecoder::with_options(&video_params, TrackDecoderOptions { threads: Some(worker_cap()), draft: false }) { + Ok(d) => d, + Err(e) => return Some(Err(MediaError::Decode(e.to_string()))), + }; + let info = default_video_info(width, height, frame_rate, &video_params); + let state = Mutex::new(VideoState { decoder: video_decoder, next_decode_idx: 0, gop_start_idx: 0, flushed: false, decoded: Vec::new() }); + (Some(ContainerVideoPart { track_idx: v_idx, info, state }), duration) + } else { + let duration = audio_candidates + .iter() + .map(|&(idx, _, _, _)| { + let s = &file.streams[idx]; + Tick::from_units(i64::from(s.length).saturating_mul(i64::from(s.scale.max(1))), i64::from(s.rate.max(1))) + }) + .max() + .unwrap_or(Tick::ZERO); + (None, duration) + }; + + finish_container_source(name, "avi", source, ContainerFile::Avi(Box::new(file)), video, duration, audio_candidates) +} + +fn estimate_mpeg_frame_rate_pts(pts: impl IntoIterator) -> FrameRate { + let mut pts: Vec = pts.into_iter().take(64).collect(); + pts.sort_unstable(); + let mut deltas: Vec = pts.windows(2).map(|w| w[1] - w[0]).filter(|&d| d > 0).collect(); + if deltas.is_empty() { + return FrameRate::FPS_30; + } + deltas.sort_unstable(); + let median = deltas[deltas.len() / 2]; + snap_common_fps(90_000.0 / median as f64).unwrap_or(FrameRate::FPS_30) +} + +fn estimate_mpeg_frame_rate(units: &[mpegts::Unit]) -> FrameRate { + estimate_mpeg_frame_rate_pts(units.iter().filter_map(|u| u.pts)) +} + +fn open_mpeg(name: &str, fmt: mpegts::Format, source: SharedBytes) -> Option> { + let file = mpegts::open(&*source).ok()?; + let origin_pts = file.streams.iter().filter_map(|s| s.pts_range().map(|(lo, _)| lo)).min().unwrap_or(0); + let video_idx = file.streams.iter().position(|s| s.kind() == mpegts::Kind::Video && !s.units.is_empty()); + let audio_candidates: Vec<(usize, usize, CodecParams, u64)> = file + .streams + .iter() + .enumerate() + .filter(|(_, s)| s.kind() == mpegts::Kind::Audio && !s.units.is_empty()) + .map(|(idx, s)| (idx, s.units.len(), s.codec_params(), 0)) + .collect(); + + if video_idx.is_none() && audio_candidates.is_empty() { + return None; + } + + let (video, duration) = if let Some(v_idx) = video_idx { + let video_stream = &file.streams[v_idx]; + let video_params = video_stream.codec_params(); + if !supports_video_codec(video_params.codec) { + return None; + } + let mut video_decoder = match TrackDecoder::with_options(&video_params, TrackDecoderOptions { threads: Some(worker_cap()), draft: false }) { + Ok(d) => d, + Err(e) => return Some(Err(MediaError::Decode(e.to_string()))), + }; + let mut decoded_dims = (video_params.width.unwrap_or(0), video_params.height.unwrap_or(0)); + if decoded_dims.0 == 0 || decoded_dims.1 == 0 { + let start_u = video_stream.units.iter().position(|u| u.key).unwrap_or(0); + for u_idx in start_u..video_stream.units.len().min(start_u + 16) { + if let Ok(pkt) = file.read_unit(&*source, v_idx, u_idx) + && let Ok(frames) = video_decoder.decode(&pkt, video_stream.units[u_idx].pts.unwrap_or(0)) + && let Some(vf) = frames.first() + { + decoded_dims = (vf.width(), vf.height()); + break; + } + } + let _ = video_decoder.reset(); + } + let frame_rate = estimate_mpeg_frame_rate(&video_stream.units); + let duration = video_stream.pts_range().map_or(Tick::ZERO, |(_, hi)| Tick::from_units(hi.saturating_sub(origin_pts), 90_000)); + let info = default_video_info(decoded_dims.0, decoded_dims.1, frame_rate, &video_params); + let state = Mutex::new(VideoState { decoder: video_decoder, next_decode_idx: 0, gop_start_idx: 0, flushed: false, decoded: Vec::new() }); + (Some(ContainerVideoPart { track_idx: v_idx, info, state }), duration) + } else { + let duration = audio_candidates + .iter() + .filter_map(|&(idx, _, _, _)| file.streams[idx].pts_range().map(|(_, hi)| Tick::from_units(hi.saturating_sub(origin_pts), 90_000))) + .max() + .unwrap_or(Tick::ZERO); + (None, duration) + }; + + finish_container_source(name, fmt.name(), source, ContainerFile::Mpeg { file: Box::new(file), origin_pts }, video, duration, audio_candidates) +} struct CachedFrame { pts: i64, draft: bool, @@ -2494,6 +2784,63 @@ mod tests { assert!(contiguous_starts([], 512).is_empty()); } + #[test] + fn avi_and_mpeg_helpers_and_in_memory_route() { + assert_eq!(tick_to_rational_units(Tick(craft_time::TICKS_PER_SECOND), 24, 1), 24); + assert_eq!(tick_to_rational_units(Tick(-1), 24, 1), 0); + assert_eq!(estimate_mpeg_frame_rate_pts([0, 3000, 6000]), FrameRate::FPS_30); + assert_eq!(estimate_mpeg_frame_rate(&[]), FrameRate::FPS_30); + + let streams = vec![avi::StreamSpec::Video(avi::VideoSpec::new(*b"H264", 16, 16, 24, 1)), avi::StreamSpec::Audio(avi::AudioSpec::pcm(48_000, 2, 16))]; + let mut w = avi::AviWriter::new(std::io::Cursor::new(Vec::new()), streams, avi::MuxOptions::default()).expect("avi writer"); + let pcm = vec![0x10u8; 2000 * 4]; + w.write_chunk(0, &[0x00, 0x00, 0x00, 0x01, 0x65], true).expect("v0"); + w.write_chunk(1, &pcm, true).expect("a0"); + w.write_chunk(0, &[0x00, 0x00, 0x00, 0x01, 0x41], false).expect("v1"); + w.write_chunk(1, &pcm, true).expect("a1"); + let raw = w.finish().expect("finish").into_inner(); + let avi_file = avi::open(raw.as_slice()).expect("open avi"); + let avi_container = ContainerFile::Avi(Box::new(avi_file)); + assert_eq!(avi_container.sample_count(0), 2); + assert_eq!(avi_container.target_sample(0, Tick::ZERO), Some((0, 0))); + assert_eq!(avi_container.sync_sample_before(0, 1), 0); + assert_eq!(avi_container.sample_pts(0, 1), 1); + assert!(avi_container.pts_to_tick(0, 1) > Tick::ZERO); + + let src = open_bytes("test.avi", Arc::from(raw)).expect("recognized").expect("opened"); + assert_eq!(src.info().container, "avi"); + assert_eq!(src.info().audio_streams[0].sample_rate, 48_000); + let audio = src.audio(0, 512, 48_000).expect("avi audio"); + assert_eq!(audio.channels[0].len(), 512); + + // Audio-only AVI route. + let mut wa = + avi::AviWriter::new(std::io::Cursor::new(Vec::new()), vec![avi::StreamSpec::Audio(avi::AudioSpec::pcm(48_000, 1, 16))], avi::MuxOptions::default()) + .expect("audio avi writer"); + wa.write_chunk(0, &pcm_s16le_bytes(4_000, 1024), true).expect("a0"); + let audio_avi = + open_bytes("audio.avi", Arc::from(wa.finish().expect("finish audio avi").into_inner())).expect("recognized audio avi").expect("opened audio avi"); + assert_eq!(audio_avi.info().kind, MediaKind::AudioOnly); + assert_eq!(audio_avi.audio(0, 256, 48_000).expect("audio avi read").channels[0].len(), 256); + + // MPEG-TS route and ContainerFile::Mpeg helpers. + let mut ts = mpegts::mux::Muxer::new(Vec::new(), mpegts::mux::Config::default(), &[mpegts::mux::Stream::new(0x100, mpegts::mux::Codec::H264)]) + .expect("ts muxer"); + ts.write_frame(0, &mpegts::mux::Frame { data: &[0x00, 0x00, 0x00, 0x01, 0x65, 0x88], pts: 90_000, dts: None, key: true }).expect("ts f0"); + ts.write_frame(0, &mpegts::mux::Frame { data: &[0x00, 0x00, 0x00, 0x01, 0x41, 0x9A], pts: 93_000, dts: None, key: false }).expect("ts f1"); + ts.write_frame(0, &mpegts::mux::Frame { data: &[0x00, 0x00, 0x00, 0x01, 0x41, 0x9A], pts: 96_000, dts: None, key: false }).expect("ts f2"); + ts.write_frame(0, &mpegts::mux::Frame { data: &[0x00, 0x00, 0x00, 0x01, 0x41, 0x9A], pts: 99_000, dts: None, key: false }).expect("ts f3"); + let ts_bytes = ts.finish().expect("finish ts"); + let ts_file = mpegts::open(ts_bytes.as_slice()).expect("open ts"); + let ts_container = ContainerFile::Mpeg { file: Box::new(ts_file), origin_pts: 90_000 }; + assert!(ts_container.target_sample(0, Tick::ZERO).is_some()); + let _ = ts_container.sync_sample_before(0, 1); + assert_eq!(ts_container.sample_pts(0, 0), 90_000); + assert_eq!(ts_container.pts_to_tick(0, 90_000), Tick::ZERO); + let ts_src = open_bytes("test.ts", Arc::from(ts_bytes)).expect("recognized ts").expect("opened ts"); + assert_eq!(ts_src.info().container, "MPEG-2 TS"); + } + fn pcm_s16le_bytes(sample: i16, count: usize) -> Vec { std::iter::repeat_n(sample.to_le_bytes(), count).flatten().collect() } diff --git a/crates/media/tests/it/footage.rs b/crates/media/tests/it/footage.rs index ee722d7eb..2d6af707c 100644 --- a/crates/media/tests/it/footage.rs +++ b/crates/media/tests/it/footage.rs @@ -1964,3 +1964,74 @@ fn audio_delayed_first_packet_honored_on_sequential_and_seek() { assert_samples_close(&backward, &seq[start..start + 4800 * 2], 1e-4, "delayed backward seek vs sequential"); } } + +#[test] +fn avi_and_mpegts_route_through_craft_media_with_seek_and_cancel() { + use std::sync::atomic::AtomicBool; + for (file, args) in [ + ( + "route_h264.avi", + &[ + "-f", + "lavfi", + "-i", + "testsrc2=size=160x120:rate=24:duration=1", + "-f", + "lavfi", + "-i", + "sine=frequency=440:sample_rate=48000:duration=1", + "-c:v", + "libx264", + "-pix_fmt", + "yuv420p", + "-g", + "12", + "-c:a", + "mp3", + ][..], + ), + ( + "route_h264.ts", + &[ + "-f", + "lavfi", + "-i", + "testsrc2=size=160x120:rate=24:duration=1", + "-f", + "lavfi", + "-i", + "sine=frequency=440:sample_rate=48000:duration=1", + "-c:v", + "libx264", + "-pix_fmt", + "yuv420p", + "-g", + "12", + "-c:a", + "aac", + ][..], + ), + ] { + let Some(p) = try_ffmpeg_fixture(file, args) else { + continue; + }; + let f = probe(&p).expect(file); + assert!(f.has_video && f.has_audio, "{file} must have video+audio"); + let pool = MediaPool::new(); + let f15 = pool.frame(ItemId(1), &f, t_of(f.frame_rate, 15)).expect("frame 15"); + let f3 = pool.frame(ItemId(1), &f, t_of(f.frame_rate, 3)).expect("backward seek frame 3"); + assert_eq!((f15.width, f15.height), (160, 120)); + let fresh_f3 = MediaPool::new().frame(ItemId(1), &f, t_of(f.frame_rate, 3)).expect("fresh frame 3"); + assert!(psnr(&f3, &fresh_f3) > 50.0, "{file} backward seek frame 3 matches fresh"); + + let off = Arc::new(AtomicBool::new(true)); + let mut cancelled = Some(Arc::clone(&f3)); + pool.cancellable(&off, &mut || cancelled = pool.frame(ItemId(1), &f, t_of(f.frame_rate, 20))); + assert!(cancelled.is_none(), "{file} cancelled read must not decode"); + + let pcm_seek = pool.audio_samples(&f, Tick(TICKS_PER_SECOND / 2), 4800, 48_000); + assert_eq!(pcm_seek.len(), 9600); + let rms = (pcm_seek.iter().map(|v| v * v).sum::() / pcm_seek.len() as f32).sqrt(); + assert!((rms - 0.0625).abs() < 0.03, "{file} audio seek rms {rms}"); + } +} From c4bf4f592540e0627b9eafd17e8838d40a315d37 Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Sat, 21 Nov 2026 16:31:31 +0700 Subject: [PATCH 345/451] Round recorded MXF start timecodes to the nearest video frame (#4018) Co-authored-by: Codex --- crates/media/src/craft_source.rs | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/crates/media/src/craft_source.rs b/crates/media/src/craft_source.rs index f06391e5c..ae4aac50f 100644 --- a/crates/media/src/craft_source.rs +++ b/crates/media/src/craft_source.rs @@ -1003,7 +1003,14 @@ fn mxf_start_timecode(tc: mxf::Timecode, rate: Option) -> i64 { return tc.start; } let (tc_num, tc_den) = if tc.drop_frame { (i128::from(tc.rounded_base) * 1000, 1001i128) } else { (i128::from(tc.rounded_base), 1i128) }; - let converted = (i128::from(tc.start) * tc_den * i128::from(rate.num)) / (tc_num * i128::from(rate.den)); + let Some(numerator) = (i128::from(tc.start) * tc_den).checked_mul(i128::from(rate.num)) else { + return tc.start; + }; + let denominator = tc_num * i128::from(rate.den); + // Match FilmCraft's nearest-frame rounding for recorded nonnegative labels. + // Keep the shared reader's existing truncation for negative counts. + let round_up = numerator >= 0 && numerator % denominator >= denominator - denominator / 2; + let converted = numerator / denominator + i128::from(round_up); i64::try_from(converted).unwrap_or(tc.start) } @@ -2605,6 +2612,29 @@ mod tests { assert_eq!(mxf_start_timecode(df, None), 3000); } + #[test] + fn mxf_start_timecode_rounds_fractional_recorded_frames() { + // Three frames at 25 fps fall at 3.6 frames on a 30 fps track. + let tc = mxf::Timecode { start: 3, rounded_base: 25, drop_frame: false }; + assert_eq!(mxf_start_timecode(tc, Some(FrameRate::FPS_30)), 4); + // Two frames at 24 fps fall exactly halfway between frames 2 and 3. + let half = mxf::Timecode { start: 2, rounded_base: 24, ..tc }; + assert_eq!(mxf_start_timecode(half, Some(FrameRate::FPS_30)), 3); + let integral = mxf::Timecode { start: 5, ..tc }; + assert_eq!(mxf_start_timecode(integral, Some(FrameRate::FPS_30)), 6); + + let negative = mxf::Timecode { start: -100, ..tc }; + assert_eq!(mxf_start_timecode(negative, Some(FrameRate::FPS_30)), -120); + let negative_fraction = mxf::Timecode { start: -3, ..tc }; + assert_eq!(mxf_start_timecode(negative_fraction, Some(FrameRate::FPS_30)), -3); + let fallback = mxf::Timecode { start: i64::MAX - 1, ..tc }; + assert_eq!(mxf_start_timecode(fallback, Some(FrameRate::FPS_50)), i64::MAX - 1); + let too_large = mxf::Timecode { start: i64::MAX, ..tc }; + assert_eq!(mxf_start_timecode(too_large, Some(FrameRate::FPS_50)), i64::MAX); + let extreme = mxf::Timecode { drop_frame: true, ..too_large }; + assert_eq!(mxf_start_timecode(extreme, Some(FrameRate::new(i64::MAX, 1))), i64::MAX); + } + #[test] fn mxf_opatom_pcm_reads_windowed_and_resampled_audio() { let opts = mxf::write::OpAtomPcm { From 0fbf652f49de6bd3441cdbe85456ed29d96a0a5d Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Sat, 21 Nov 2026 17:07:08 +0700 Subject: [PATCH 346/451] test: report stalls in the ProRes MOV roundtrip (#4019) --- .config/nextest.toml | 7 ++++++ crates/export/tests/it/roundtrip.rs | 39 +++++++++++++++++++++-------- 2 files changed, 36 insertions(+), 10 deletions(-) diff --git a/.config/nextest.toml b/.config/nextest.toml index 38f939c31..54ea528cf 100644 --- a/.config/nextest.toml +++ b/.config/nextest.toml @@ -12,3 +12,10 @@ gpu = { max-threads = 1 } [[profile.default.overrides]] filter = 'package(effectcraft-gpu) | package(effectcraft-ui-egui) | package(effectcraft-sam2) | (package(effectcraft-cli) & test(/^cli::gpu_adapter_name_/))' test-group = 'gpu' + +# This sub-second test can stall indefinitely. Keep its assertions and surface the last +# flushed stage on timeout instead of waiting for the whole job to be cancelled. +[[profile.default.overrides]] +filter = 'binary_id(=effectcraft-export::it) & test(=roundtrip::prores_mov_roundtrip)' +slow-timeout = { period = "60s", terminate-after = 2, on-timeout = "fail" } +failure-output = "immediate" diff --git a/crates/export/tests/it/roundtrip.rs b/crates/export/tests/it/roundtrip.rs index 65644f071..fbde6ab1b 100644 --- a/crates/export/tests/it/roundtrip.rs +++ b/crates/export/tests/it/roundtrip.rs @@ -126,7 +126,19 @@ fn check_frame(img: &Image, k: u64, tol: f32) { assert!(near([c[0], c[1], c[2]], want, tol), "frame {k} centre {c:?} want {want:?}"); } -fn decode_movie(path: &Path, frames: u64, tol: f32) -> effectcraft_project::Footage { +/// Write to the test process's stderr, not libtest's buffered per-test capture: nextest can +/// then show the last stage even when it has to terminate a stuck process. +fn prores_stage(trace: bool, stage: std::fmt::Arguments<'_>) { + use std::io::Write as _; + + if trace { + let mut stderr = std::io::stderr().lock(); + let _ = writeln!(stderr, "ProRes MOV roundtrip: {stage}").and_then(|()| stderr.flush()); + } +} + +fn decode_movie(path: &Path, frames: u64, tol: f32, trace: bool) -> effectcraft_project::Footage { + prores_stage(trace, format_args!("native probe")); let f = effectcraft_media::probe(path).expect("probe our output"); assert_eq!((f.width, f.height), (W, H)); assert!(f.has_video); @@ -134,6 +146,7 @@ fn decode_movie(path: &Path, frames: u64, tol: f32) -> effectcraft_project::Foot assert_eq!(n as u64, frames, "frame count from duration {:?} @ {:?}", f.duration, f.frame_rate); let pool = MediaPool::new(); for k in 0..frames { + prores_stage(trace, format_args!("native decode frame {k}")); let img = pool.frame_at(&f, f.frame_rate.tick_of(k as i64)).expect("decode"); check_frame(&img, k, tol); } @@ -153,8 +166,9 @@ fn ffprobe(path: &Path) -> Option { } /// Frame `k` decoded by ffmpeg (external oracle) as RGBA, or `None` without ffmpeg. -fn ffmpeg_frame(path: &Path, k: u64) -> Option { +fn ffmpeg_frame(path: &Path, k: u64, trace: bool) -> Option { let png = path.with_extension(format!("ffmpeg-{k}.png")); + prores_stage(trace, format_args!("FFmpeg decode frame {k}")); let st = Command::new("ffmpeg") .args(["-hide_banner", "-loglevel", "error", "-y", "-i"]) .arg(path) @@ -163,13 +177,14 @@ fn ffmpeg_frame(path: &Path, k: u64) -> Option { .status() .ok()?; assert!(st.success(), "ffmpeg failed to decode {}", path.display()); + prores_stage(trace, format_args!("read FFmpeg oracle PNG for frame {k}")); let img = image::open(&png).expect("ffmpeg png").to_rgba8(); Some(Image::from_rgba8(img.width(), img.height(), img.as_raw())) } -fn ffmpeg_check(path: &Path, tol: f32) { +fn ffmpeg_check(path: &Path, tol: f32, trace: bool) { for k in [0, 4, 5, FRAMES - 1] { - match ffmpeg_frame(path, k) { + match ffmpeg_frame(path, k, trace) { Some(img) => check_frame(&img, k, tol), None => { eprintln!("ffmpeg not found: skipping oracle decode"); @@ -187,8 +202,8 @@ fn h264_mp4_roundtrip() { let path = d.join("comp.mp4"); let r = run(&p, cid, &NoFootage, &om, &path); assert!(r.bytes > 100 && !r.audio); - decode_movie(&path, FRAMES, 0.08); - ffmpeg_check(&path, 0.08); + decode_movie(&path, FRAMES, 0.08, false); + ffmpeg_check(&path, 0.08, false); if let Some(s) = ffprobe(&path) { assert!(s.contains("h264|64|48|yuv420p"), "{s}"); assert!(s.lines().next().unwrap_or("").ends_with("|12"), "{s}"); @@ -223,17 +238,21 @@ fn h264_odd_size_is_cropped_even() { #[test] fn prores_mov_roundtrip() { + prores_stage(true, format_args!("fixture setup")); let d = out_dir("prores"); let (p, cid) = project(None); let om = OutputModule::for_format(OutputFormat::ProRes); let path = d.join("comp.mov"); + prores_stage(true, format_args!("native export")); run(&p, cid, &NoFootage, &om, &path); - decode_movie(&path, FRAMES, 0.03); - ffmpeg_check(&path, 0.03); + decode_movie(&path, FRAMES, 0.03, true); + ffmpeg_check(&path, 0.03, true); + prores_stage(true, format_args!("ffprobe metadata")); if let Some(s) = ffprobe(&path) { assert!(s.starts_with("prores|64|48"), "{s}"); assert!(s.lines().next().unwrap_or("").ends_with("|12"), "{s}"); } + prores_stage(true, format_args!("complete")); } #[test] @@ -758,12 +777,12 @@ fn webm_vp9_opus_roundtrip() { let r = run(&p, cid, &pool, &om, &path); assert!(r.audio && r.bytes > 200, "{r:?}"); // Decoded back through FilmCraft (Matroska demuxer, VP9 and Opus decoders). - let f = decode_movie(&path, FRAMES, 0.08); + let f = decode_movie(&path, FRAMES, 0.08, false); assert!(f.has_audio); let s = MediaPool::new().audio_samples(&f, Tick::from_seconds_f64(0.3), 24_000, 48_000); let l = rms(s.iter().step_by(2).copied()); assert!((l - 0.3536).abs() < 0.06, "left RMS {l}"); - ffmpeg_check(&path, 0.08); + ffmpeg_check(&path, 0.08, false); if let Some(s) = ffprobe(&path) { assert!(s.contains("vp9|64|48|yuv420p"), "{s}"); assert!(s.contains("opus"), "{s}"); From 7003f0a056f9b001fb8f4877f9f5371d1d03dbc9 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sat, 21 Nov 2026 05:19:23 -0500 Subject: [PATCH 347/451] media: switch non-fallback AUDIO_EXTENSIONS and convert tests to craft-libs (#4020) * media: switch non-fallback AUDIO_EXTENSIONS and convert tests to craft-libs * media: accept FrameView in frame_to_image --- crates/media/src/convert.rs | 34 +++++++++++++++------------------- crates/media/src/lib.rs | 2 +- 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/crates/media/src/convert.rs b/crates/media/src/convert.rs index bf83a9650..dd3a46801 100644 --- a/crates/media/src/convert.rs +++ b/crates/media/src/convert.rs @@ -137,7 +137,7 @@ impl<'a> From<&'a crate::stream::DecodedFrame> for FrameView<'a> { /// Convert a FilmCraft frame to an [`Image`]. #[cfg(test)] -pub(crate) fn frame_to_image(f: &VideoFrame, op: AlphaOp) -> Image { +pub(crate) fn frame_to_image<'a>(f: impl Into>, op: AlphaOp) -> Image { frame_to_image_in(f, op, Vec::new()) } @@ -533,25 +533,28 @@ pub(crate) fn straight_to_image(w: u32, h: u32, px: &[[f32; 4]], op: AlphaOp) -> #[cfg(test)] mod tests { use super::*; + use craft_color::ColorInfo; + use craft_frame::{Chroma, PixelData, VideoFrame}; + use craft_time::Tick; use std::sync::Arc; - fn yuv_frame(y: u8, u: u8, v: u8, color: filmcraft_color::ColorInfo) -> VideoFrame { + fn yuv_frame(y: u8, u: u8, v: u8, color: ColorInfo) -> VideoFrame { VideoFrame { width: 4, height: 2, data: PixelData::Yuv8 { planes: [Arc::new(vec![y; 8]), Arc::new(vec![u; 2]), Arc::new(vec![v; 2])], chroma: Chroma::C420, alpha: None }, color, par: (1, 1), - pts: filmcraft_time::Tick::ZERO, + pts: Tick::ZERO, } } #[test] fn limited_range_grey_and_white() { let op = AlphaOp::new(AlphaMode::Straight, [0.0; 3]); - let img = frame_to_image(&yuv_frame(235, 128, 128, filmcraft_color::ColorInfo::REC709), op); + let img = frame_to_image(&yuv_frame(235, 128, 128, ColorInfo::REC709), op); assert!(img.data.iter().all(|p| (p[0] - 1.0).abs() < 1e-5 && (p[1] - 1.0).abs() < 1e-5 && p[3] == 1.0)); - let img = frame_to_image(&yuv_frame(126, 128, 128, filmcraft_color::ColorInfo::REC709), op); + let img = frame_to_image(&yuv_frame(126, 128, 128, ColorInfo::REC709), op); assert!((img.data[0][0] - 110.0 / 219.0).abs() < 1e-5); } @@ -568,9 +571,9 @@ mod tests { chroma: Chroma::C420, alpha: None, }, - color: filmcraft_color::ColorInfo::REC709, + color: ColorInfo::REC709, par: (1, 1), - pts: filmcraft_time::Tick::ZERO, + pts: Tick::ZERO, } } @@ -588,7 +591,7 @@ mod tests { // More than half the size, odd sizes, other chroma layouts: convert the full frame. assert!(frame_to_image_scaled(&f, 49, 32).is_none()); assert!(frame_to_image_scaled(&smooth_420(95, 64), 40, 30).is_none()); - assert!(frame_to_image_scaled(&yuv_frame(100, 128, 128, filmcraft_color::ColorInfo::REC709), 2, 1).is_some()); + assert!(frame_to_image_scaled(&yuv_frame(100, 128, 128, ColorInfo::REC709), 2, 1).is_some()); let mut f444 = smooth_420(96, 64); if let PixelData::Yuv8 { chroma, .. } = &mut f444.data { *chroma = Chroma::C444; @@ -600,7 +603,7 @@ mod tests { fn bt709_red() { // 8-bit limited BT.709 red: Y 63, Cb 102, Cr 240 let op = AlphaOp::new(AlphaMode::Straight, [0.0; 3]); - let p = frame_to_image(&yuv_frame(63, 102, 240, filmcraft_color::ColorInfo::REC709), op).data[0]; + let p = frame_to_image(&yuv_frame(63, 102, 240, ColorInfo::REC709), op).data[0]; assert!(p[0] > 0.98 && p[1] < 0.02 && p[2] < 0.02, "{p:?}"); } @@ -631,14 +634,7 @@ mod tests { fn rgba8_levels_are_the_quantised_float_frame() { let (w, h) = (37usize, 18usize); let noise = |n: usize, seed: usize| Arc::new((0..n).map(|i| ((i * 7919 + seed * 104_729) % 256) as u8).collect::>()); - let frame = |data| VideoFrame { - width: w as u32, - height: h as u32, - data, - color: filmcraft_color::ColorInfo::REC709, - par: (1, 1), - pts: filmcraft_time::Tick::ZERO, - }; + let frame = |data| VideoFrame { width: w as u32, height: h as u32, data, color: ColorInfo::REC709, par: (1, 1), pts: Tick::ZERO }; let yuv = |chroma: Chroma, alpha: bool| { let n = w.div_ceil(1 << chroma.shifts().0) * h.div_ceil(1 << chroma.shifts().1); frame(PixelData::Yuv8 { planes: [noise(w * h, 1), noise(n, 2), noise(n, 3)], chroma, alpha: alpha.then(|| noise(w * h, 4)) }) @@ -675,9 +671,9 @@ mod tests { chroma: Chroma::C420, alpha: None, }, - color: filmcraft_color::ColorInfo::REC709, + color: ColorInfo::REC709, par: (1, 1), - pts: filmcraft_time::Tick::ZERO, + pts: Tick::ZERO, }; let op = AlphaOp::new(AlphaMode::Straight, [0.0; 3]); for _ in 0..3 { diff --git a/crates/media/src/lib.rs b/crates/media/src/lib.rs index d1a907821..5d3f376d0 100644 --- a/crates/media/src/lib.rs +++ b/crates/media/src/lib.rs @@ -84,7 +84,7 @@ impl From for MediaError { pub const STILL_EXTENSIONS: &[&str] = &["png", "jpg", "jpeg", "gif", "webp", "tif", "tiff", "bmp", "exr", "tga", "hdr", "psd", "psb", "svg", "pdf", "ai", "eps", "vectorcraft"]; /// File extensions recognised as audio-only files. -pub const AUDIO_EXTENSIONS: &[&str] = filmcraft_media::AUDIO_EXTENSIONS; +pub const AUDIO_EXTENSIONS: &[&str] = craft_media_source::AUDIO_EXTENSIONS; pub use effectcraft_project::VIDEO_EXTENSIONS; /// File extensions recognised as 3D models (Advanced 3D model layers). From fd2e7d7b6fa809c4cc29349e5aac5253ce5289be Mon Sep 17 00:00:00 2001 From: Terra854 Date: Sat, 21 Nov 2026 18:30:06 +0800 Subject: [PATCH 348/451] fix(media): preserve leading MOV audio silence and saturate positions (#4005) * fix(media): honor MOV audio edit lists on first read * fix(media): preserve sign on ISO-BMFF edit-list position overflow --------- Co-authored-by: Dylan M. Taylor --- crates/media/src/craft_source.rs | 165 ++++++++++++++++++++++++++----- crates/media/tests/it/footage.rs | 70 +++++++++++++ 2 files changed, 211 insertions(+), 24 deletions(-) diff --git a/crates/media/src/craft_source.rs b/crates/media/src/craft_source.rs index ae4aac50f..fb99282c5 100644 --- a/crates/media/src/craft_source.rs +++ b/crates/media/src/craft_source.rs @@ -291,6 +291,21 @@ impl ContainerFile { let decoded_pos = audio_starts.get(seek_idx).copied().unwrap_or(0); (seek_idx, decoded_pos) } + + fn audio_silent_prefix(&self, track_idx: usize, start: i64, frames: usize, sample_rate: u32) -> usize { + let Self::Isobmff(file) = self else { return 0 }; + let Some((leading_duration, media_time)) = file.tracks.get(track_idx).and_then(|track| unit_rate_media_edit(&track.edits)) else { + return 0; + }; + if leading_duration == 0 || media_time == 0 || file.timescale == 0 { + return 0; + } + + // The net packet offset includes the trim and can put decoder preroll inside + // the empty edit. Use the empty edit's duration on the output clock instead. + let first_presented = (u128::from(leading_duration) * u128::from(sample_rate)).div_ceil(u128::from(file.timescale)) as i128; + usize::try_from((first_presented - i128::from(start)).max(0)).unwrap_or(usize::MAX).min(frames) + } } /// Where the container puts one audio packet, for [`contiguous_starts`]. @@ -468,12 +483,7 @@ fn compute_audio_starts(container: &ContainerFile, track_idx: usize, codec: Code ContainerFile::Isobmff(f) => { let Some(track) = f.tracks.get(track_idx) else { return AudioStarts::complete(Vec::new()) }; let ts = i128::from(track.timescale.max(1)); - let stamps: Vec = (0..track.samples.len()) - .map(|i| { - let pts = track.presentation_pts(i).unwrap_or(0); - i64::try_from(i128::from(pts) * rate / ts).unwrap_or(0) - }) - .collect(); + let stamps: Vec = (0..track.samples.len()).map(|i| isobmff_audio_position(track, i, native_rate)).collect(); let unit = i64::try_from((rate + ts - 1) / ts).unwrap_or(i64::MAX); if codec == CodecId::Opus { return AudioStarts::opus(stamps, unit.saturating_mul(2).saturating_add(1)); @@ -559,6 +569,14 @@ fn audio_frames_from_ns(ns: i128, rate: u32) -> i128 { (ns * i128::from(rate)) / 1_000_000_000 } +/// The decoded buffer starts on the presentation timeline, including negative trimmed samples. +/// Using the same signed position on open and seek preserves edit-list trim and leading silence. +fn isobmff_audio_position(track: &isobmff::Track, sample_idx: usize, native_rate: u32) -> i64 { + let pts = track.presentation_pts(sample_idx).unwrap_or(0); + let scaled = (i128::from(pts) * i128::from(native_rate)) / i128::from(track.timescale.max(1)); + i64::try_from(scaled).unwrap_or(if scaled < 0 { i64::MIN } else { i64::MAX }) +} + fn open_audio_tracks(container: &ContainerFile, source: &dyn ByteSource, candidates: I) -> Option<(Vec, Vec)> where I: IntoIterator, @@ -670,17 +688,24 @@ fn clean_aperture_region(aperture: isobmff::CleanAperture, (width, height): (u32 (!r.is_full(width as usize, height as usize)).then_some(r) } -/// A single unit-rate media span, optionally preceded by one empty span. A -/// scalar EDL origin cannot describe dwell, disjoint edits or respeeding. -fn continuous_edit_mapping(track: &isobmff::Track, movie_timescale: u32) -> Option<(i64, i64)> { +/// A single unit-rate media span, optionally preceded by one empty span. +fn unit_rate_media_edit(edits: &[isobmff::Edit]) -> Option<(u64, i64)> { const UNIT_RATE: i32 = 0x0001_0000; - let (leading_duration, media) = match track.edits.as_slice() { - [] => return (track.edit_offset == 0).then_some((0, 0)), + let (leading_duration, media) = match edits { [media] => (0, media), [empty, media] if empty.media_time == -1 && empty.segment_duration > 0 && empty.media_rate == UNIT_RATE => (empty.segment_duration, media), _ => return None, }; - if media.media_time < 0 || media.segment_duration == 0 || media.media_rate != UNIT_RATE || movie_timescale == 0 || track.timescale == 0 { + (media.media_time >= 0 && media.segment_duration != 0 && media.media_rate == UNIT_RATE).then_some((leading_duration, media.media_time)) +} + +/// A scalar EDL origin cannot describe dwell, disjoint edits or respeeding. +fn continuous_edit_mapping(track: &isobmff::Track, movie_timescale: u32) -> Option<(i64, i64)> { + if track.edits.is_empty() { + return (track.edit_offset == 0).then_some((0, 0)); + } + let (leading_duration, media_time) = unit_rate_media_edit(&track.edits)?; + if movie_timescale == 0 || track.timescale == 0 { return None; } // Check the raw movie-to-media conversion before the demuxer's rounded @@ -690,8 +715,8 @@ fn continuous_edit_mapping(track: &isobmff::Track, movie_timescale: u32) -> Opti if lead % movie_clock != 0 { return None; } - let offset = i64::try_from(lead / movie_clock - i128::from(media.media_time)).ok()?; - (offset == track.edit_offset).then_some((media.media_time, offset)) + let offset = i64::try_from(lead / movie_clock - i128::from(media_time)).ok()?; + (offset == track.edit_offset).then_some((media_time, offset)) } /// The EDL origin is the timecode at presentation time zero, not the raw @@ -1389,12 +1414,15 @@ impl MediaSource for CraftMediaSource { return Err(MediaError::Decode("invalid audio sample rate 0".into())); } let channels_count = self.info.audio_streams.get(stream).map_or(2, |s| s.channels as usize); - if frames == 0 { - return Ok(AudioBuffer::new(sample_rate, channels_count as u16, 0)); + let silent_frames = self.file.audio_silent_prefix(entry.track_idx, start, frames, sample_rate); + let audible_frames = frames - silent_frames; + if audible_frames == 0 { + return Ok(AudioBuffer::new(sample_rate, channels_count as u16, frames)); } + let audible_start = i64::try_from(i128::from(start) + silent_frames as i128).unwrap_or(i64::MAX); let native_rate = entry.native_rate; - let (native_start, native_frames) = native_audio_window(start, frames, native_rate, sample_rate); + let (native_start, native_frames) = native_audio_window(audible_start, audible_frames, native_rate, sample_rate); let decoded = match &entry.backend { AudioBackend::Decoder { seek_preroll_samples, state: state_mutex } => { @@ -1441,11 +1469,15 @@ impl MediaSource for CraftMediaSource { } }; - if sample_rate == native_rate { - return Ok(AudioBuffer { sample_rate, channels: decoded }); + let mut channels = + if sample_rate == native_rate { decoded } else { resample_audio(&decoded, channels_count, native_rate, sample_rate, audible_frames) }; + if silent_frames > 0 { + for channel in &mut channels { + channel.resize(frames, 0.0); + channel.rotate_right(silent_frames); + } } - - Ok(AudioBuffer { sample_rate, channels: resample_audio(&decoded, channels_count, native_rate, sample_rate, frames) }) + Ok(AudioBuffer { sample_rate, channels }) } } @@ -1565,7 +1597,7 @@ fn drain_audio_window(buf: &mut [Vec], decoded_pos: &mut i64, channels_coun for i in 0..frames { let pos = start.saturating_add(i as i64); if pos >= *decoded_pos { - let off = (pos - *decoded_pos) as usize; + let off = usize::try_from(pos.saturating_sub(*decoded_pos)).unwrap_or(usize::MAX); if off < avail { for (c, out_ch) in out.iter_mut().enumerate() { out_ch[i] = buf[c][off]; @@ -1574,7 +1606,7 @@ fn drain_audio_window(buf: &mut [Vec], decoded_pos: &mut i64, channels_coun } } let end = start.saturating_add(frames as i64); - let drop_to = (end - *decoded_pos).max(0) as usize; + let drop_to = usize::try_from(end.saturating_sub(*decoded_pos).max(0)).unwrap_or(usize::MAX); let trim = drop_to.min(avail); if trim > 0 { for ch in buf { @@ -1671,7 +1703,7 @@ fn decode_audio_range( let buf_len = state.buf.first().map_or(0, Vec::len) as i64; let buf_end = state.decoded_pos.saturating_add(buf_len); let moves_backward = start < state.decoded_pos; - if moves_backward || start > buf_end + i64::from(native_rate) * 2 { + if moves_backward || start > buf_end.saturating_add(i64::from(native_rate) * 2) { let target = start.saturating_sub(seek_preroll_samples).max(0); let (seek_idx, decoded_pos) = if moves_backward && state.next_sample == 0 && state.audio_starts.seek_proves_first_packet(target) { (0, state.decoded_pos) @@ -2396,6 +2428,91 @@ mod tests { assert!((1..=MAX_WORKERS).contains(&cap), "cap={cap}"); } + /// Generated AAC permits unequal track/sample clocks, unlike the MOV writer's PCM tracks. + #[test] + fn mov_aac_edit_positions_saturate_with_unequal_clocks() { + use craft_audio::aac::{Encoder, EncoderConfig}; + use isobmff::{Brand, Edit, Mp4Writer, SampleEntry, TrackConfig, WriteSample, WriterOptions}; + + const RATE: u32 = 48_000; + let mut encoder = Encoder::new(EncoderConfig::cbr(RATE, 1, 64_000)).unwrap(); + let tone: Vec = (0..2048).map(|i| (i as f32 * 0.13).sin() * 0.25).collect(); + let mut packets = encoder.encode(&[&tone]); + packets.extend(encoder.flush()); + assert!(!packets.is_empty()); + for (offset, expected) in [(10i64, 480i64), (-10, -480), (i64::MAX / 2, i64::MAX), (-i64::MAX / 2, i64::MIN)] { + let mut writer = Mp4Writer::new(std::io::Cursor::new(Vec::new()), WriterOptions::new(Brand::Mov)).unwrap(); + let mut config = TrackConfig::new(SampleEntry::aac(encoder.audio_specific_config(), 1, RATE), 1_000); + if offset > 0 { + config.edits.push(Edit { segment_duration: offset as u64, media_time: -1, media_rate: 0x0001_0000 }); + } + config.edits.push(Edit { segment_duration: 100, media_time: (-offset).max(0), media_rate: 0x0001_0000 }); + let track_idx = writer.add_track(config).expect("AAC accepts unequal media and sample clocks"); + for packet in &packets { + writer.write_sample(track_idx, WriteSample { data: packet, duration: 21, composition_offset: 0, is_sync: true }).unwrap(); + } + let bytes = writer.finish().unwrap().into_inner(); + let mov = isobmff::open(bytes.as_slice()).unwrap(); + let track = &mov.tracks[0]; + assert_eq!((track.timescale, track.edit_offset, track.presentation_pts(0)), (1_000, offset, Some(offset))); + let params = track.codec_params(); + assert_eq!((params.codec, params.sample_rate), (CodecId::Aac, Some(RATE))); + // Check the conversion itself: a decode error substituted with silence cannot pass. + assert_eq!(isobmff_audio_position(track, 0, RATE), expected); + let file = ContainerFile::Isobmff(mov); + let (mut tracks, infos) = open_audio_tracks(&file, &bytes, [(0, packets.len(), params, 0)]).expect("shared AAC source"); + assert_eq!(infos[0].sample_rate, RATE); + let (preroll, state) = tracks[0].decoder_parts(); + assert_eq!(state.audio_starts.start(&file, 0, 0), Some(expected)); + for start in [0, 6_000, 0] { + let decoded = decode_audio_range(&file, &bytes, 0, RATE, 1, preroll, state, start, 64).expect("the result-returning shared read must succeed"); + assert_eq!(decoded[0].len(), 64); + if expected == i64::MAX || expected == i64::MIN { + assert!(decoded[0].iter().all(|&v| v == 0.0), "out-of-range edits have no audible samples at {start}"); + } + } + } + } + + /// Original PCM generated in memory to exercise an empty edit followed by a trim. + #[test] + fn mov_pcm_trim_after_empty_edit_preserves_leading_silence() { + use isobmff::{Brand, Edit, Mp4Writer, PcmConfig, SampleEntry, TrackConfig, WriteSample, WriterOptions}; + + const RATE: u32 = 48_000; + const DELAY_MS: u64 = 100; + const DELAY: i64 = 4_800; + let samples: Vec = (0..12_000).map(|i| 1_000 + (i % 257) as i16 * 32).collect(); + for trim in [2_400i64, 4_800, 9_600] { + let mut writer = Mp4Writer::new(std::io::Cursor::new(Vec::new()), WriterOptions::new(Brand::Mov)).unwrap(); + let pcm = PcmConfig { bits: 16, float: false, big_endian: false, signed: true, channels: 1, sample_rate: f64::from(RATE) }; + let mut config = TrackConfig::new(SampleEntry::pcm(pcm), RATE); + config.edits = vec![ + Edit { segment_duration: DELAY_MS, media_time: -1, media_rate: 0x0001_0000 }, + Edit { segment_duration: 40, media_time: trim, media_rate: 0x0001_0000 }, + ]; + let track = writer.add_track(config).unwrap(); + for chunk in samples.chunks(256) { + let data: Vec = chunk.iter().flat_map(|sample| sample.to_le_bytes()).collect(); + writer.write_sample(track, WriteSample { data: &data, duration: chunk.len() as u32, composition_offset: 0, is_sync: true }).unwrap(); + } + let bytes = writer.finish().unwrap().into_inner(); + let file = isobmff::open(bytes.as_slice()).unwrap(); + assert_eq!(file.timescale, 1_000); + assert_eq!(file.tracks[0].edit_offset, DELAY - trim); + + let source = open_bytes("edited-pcm.mov", bytes.into()).expect("shared MOV route").unwrap(); + let sample = |index: i64| f32::from(samples[index as usize]) / 32_768.0; + let expected = [0.0, 0.0, sample(trim), sample(trim + 1)]; + let read = |start, frames, rate| source.audio(start, frames, rate).expect("direct shared PCM read").channels.remove(0); + assert_eq!(read(DELAY - 2, 4, RATE), expected, "first read, trim {trim}"); + assert_eq!(read(0, DELAY as usize, RATE), vec![0.0; DELAY as usize], "backward seek, trim {trim}"); + assert_eq!(read(DELAY, 2, RATE), expected[2..], "read from first presented sample, trim {trim}"); + assert_eq!(read(DELAY * 2 - 4, 5, RATE * 2), [0.0, 0.0, 0.0, 0.0, sample(trim)], "resampled read, trim {trim}"); + assert_eq!(read(4_408, 3, 44_100), [0.0, 0.0, sample(trim)], "nonintegral resampling ratio, trim {trim}"); + } + } + #[test] fn vui_overrides_container_color_and_falls_back_when_unspecified() { let container = color_from_isobmff(&isobmff::ColorInfo::Nclx { primaries: 9, transfer: 16, matrix: 9, full_range: false }); diff --git a/crates/media/tests/it/footage.rs b/crates/media/tests/it/footage.rs index 2d6af707c..1b03817ab 100644 --- a/crates/media/tests/it/footage.rs +++ b/crates/media/tests/it/footage.rs @@ -505,6 +505,76 @@ fn prores_alpha_uses_coded_frame_not_mov_depth() { } } +/// Generated PCM ramps expose edit-list timing without an external encoder or oracle. +#[test] +fn mov_pcm_edit_lists_preserve_first_read_and_seek_timing() { + use craft_media::isobmff::{self, Brand, Edit, FourCc, Mp4Writer, PcmConfig, SampleEntry, TrackConfig, WriteSample, WriterOptions}; + use craft_video::prores::{ChromaFormat, Encoder, Frame, Profile}; + + const RATE: u32 = 48_000; + const AUDIO_FRAMES: usize = 12_000; + let samples: Vec<[i16; 2]> = (0..AUDIO_FRAMES).map(|i| [1000 + (i % 257) as i16 * 32, -2000 - (i % 193) as i16 * 16]).collect(); + let profile = Profile::Hq; + let mut encoder = Encoder::new(profile, 16, 16); + let packet = encoder.encode(&Frame::new(16, 16, ChromaFormat::Yuv422, 10, false).unwrap()).unwrap(); + // The extreme edits also guard signed buffer arithmetic on the first audio request. + for offset in [0i64, 480, -480, -i64::MAX, i64::MAX - i64::MAX % 48] { + let mut writer = Mp4Writer::new(std::io::Cursor::new(Vec::new()), WriterOptions::new(Brand::Mov)).unwrap(); + let video = writer.add_track(TrackConfig::new(SampleEntry::prores(FourCc(profile.fourcc()), 16, 16), 24)).unwrap(); + let pcm = PcmConfig { bits: 16, float: false, big_endian: false, signed: true, channels: 2, sample_rate: f64::from(RATE) }; + let mut audio_config = TrackConfig::new(SampleEntry::pcm(pcm), RATE); + if offset > 0 { + audio_config.edits.push(Edit { segment_duration: (offset / 48) as u64, media_time: -1, media_rate: 0x0001_0000 }); + } + if offset != 0 { + audio_config.edits.push(Edit { segment_duration: 240, media_time: (-offset).max(0), media_rate: 0x0001_0000 }); + } + let audio = writer.add_track(audio_config).unwrap(); + writer.write_sample(video, WriteSample { data: &packet, duration: 24, composition_offset: 0, is_sync: true }).unwrap(); + for chunk in samples.chunks(256) { + let data: Vec = chunk.iter().flat_map(|frame| frame.iter().flat_map(|s| s.to_le_bytes())).collect(); + writer.write_sample(audio, WriteSample { data: &data, duration: chunk.len() as u32, composition_offset: 0, is_sync: true }).unwrap(); + } + let bytes: Arc<[u8]> = writer.finish().unwrap().into_inner().into(); + let mov = isobmff::open(bytes.as_ref()).unwrap(); + let track = mov.tracks.iter().find(|t| t.kind == isobmff::TrackKind::Audio).unwrap(); + assert_eq!(track.edit_offset, offset, "fixture must carry the requested audio edit"); + assert_eq!(track.presentation_pts(0), Some(offset)); + + let name = format!("pcm-edit-{offset}.mov"); + let footage = probe_bytes(&name, bytes.clone()).expect("probe generated MOV"); + assert_eq!(footage.codec, "ProRes", "must exercise the shared importer"); + assert!(footage.has_audio); + let pool = MediaPool::new(); + pool.add_bytes(&name, bytes); + let check = |start: usize, count: usize| { + let got = pool.audio_samples(&footage, Tick::from_units(start as i64, i64::from(RATE)), count, RATE); + assert_eq!(got.len(), count * 2); + for (i, frame) in got.as_chunks::<2>().0.iter().enumerate() { + let source = i64::try_from(start + i).unwrap().saturating_sub(offset); + let expected = usize::try_from(source).ok().and_then(|p| samples.get(p)).copied().unwrap_or([0, 0]); + for c in 0..2 { + assert_eq!(frame[c], f32::from(expected[c]) / 32768.0, "edit {offset}, request {start}, frame {i}, channel {c}"); + } + } + got + }; + let first = check(0, 2048); + let mut sequential = Vec::new(); + let mut start = 0; + while start < 2048 { + let count = 127.min(2048 - start); + sequential.extend(check(start, count)); + start += count; + } + assert_eq!(sequential, first, "edit {offset}: chunking must preserve samples"); + for start in [3000, 100, 6000, 0, 480, 700] { + check(start, 600); + } + assert_eq!(check(0, 2048), first, "edit {offset}: reopening the decode window must preserve samples"); + } +} + /// A synthetic asymmetrical aperture and rotation must determine what the shared importer shows. #[test] fn mov_renders_clean_aperture_before_display_rotation() { From 0ecc246f05e29d92885a50f7e3783c627fca7f2a Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Sat, 21 Nov 2026 17:50:20 +0700 Subject: [PATCH 349/451] media: preserve standalone audio resampling phase across seeks (#4017) Co-authored-by: Codex --- crates/media/src/craft_source.rs | 76 ++++++++++++++++++++++++++++++-- 1 file changed, 73 insertions(+), 3 deletions(-) diff --git a/crates/media/src/craft_source.rs b/crates/media/src/craft_source.rs index fb99282c5..a6a7bc37d 100644 --- a/crates/media/src/craft_source.rs +++ b/crates/media/src/craft_source.rs @@ -1532,17 +1532,61 @@ impl MediaSource for StandaloneAudioSource { return Ok(AudioBuffer::new(sample_rate, channels_count as u16, frames)); } let native_rate = self.native_rate; - let (native_start, native_frames) = native_audio_window(start, frames, native_rate, sample_rate); + let (native_start, native_frames, phase) = if sample_rate == native_rate { + (start, frames, 0) + } else { + let scaled = i128::from(start) * i128::from(native_rate); + let divisor = i128::from(sample_rate); + let Ok(origin) = i64::try_from(scaled.div_euclid(divisor)) else { + // An unrepresentable source position cannot address this stream. + return Ok(AudioBuffer::new(sample_rate, channels_count as u16, frames)); + }; + // Reuse the existing window size, but not its truncating start calculation. + (origin, native_audio_window(0, frames, native_rate, sample_rate).1, scaled.rem_euclid(divisor) as u64) + }; let mut state = self.state.lock().unwrap_or_else(std::sync::PoisonError::into_inner); let decoded = decode_standalone_range(native_rate, channels_count, &mut state, native_start, native_frames)?; if sample_rate == native_rate { return Ok(AudioBuffer { sample_rate, channels: decoded }); } - Ok(AudioBuffer { sample_rate, channels: resample_audio(&decoded, channels_count, native_rate, sample_rate, frames) }) + // Negative output positions are silence, not interpolation into frame zero. + let first_output = if start < 0 { usize::try_from(start.unsigned_abs()).unwrap_or(frames).min(frames) } else { 0 }; + Ok(AudioBuffer { sample_rate, channels: resample_standalone_audio(&decoded, native_rate, sample_rate, frames, phase, first_output) }) } } +/// Step the fractional input position as an exact integer quotient and remainder; +/// rounding happens only when interpolating a sample, independent of the window. +#[cfg(any(unix, windows))] +fn resample_standalone_audio(decoded: &[Vec], native_rate: u32, sample_rate: u32, frames: usize, phase: u64, first_output: usize) -> Vec> { + let mut out = vec![vec![0.0; frames]; decoded.len()]; + let divisor = u64::from(sample_rate); + let first = first_output as u128 * u128::from(native_rate) + u128::from(phase); + let Ok(first_index) = usize::try_from(first / u128::from(divisor)) else { return out }; + let first_remainder = (first % u128::from(divisor)) as u64; + let whole_step = (native_rate / sample_rate) as usize; + let remainder_step = u64::from(native_rate % sample_rate); + let inverse_rate = f64::from(sample_rate).recip(); + for (samples, dst) in decoded.iter().zip(&mut out) { + let (mut index, mut remainder) = (first_index, first_remainder); + for sample in dst.iter_mut().skip(first_output) { + let Some(&a) = samples.get(index) else { break }; + let b = samples.get(index + 1).copied().unwrap_or(a); + let t = (remainder as f64 * inverse_rate) as f32; + *sample = a + (b - a) * t; + remainder += remainder_step; + let carry = remainder >= divisor; + if carry { + remainder -= divisor; + } + let Some(next) = index.checked_add(whole_step + carry as usize) else { break }; + index = next; + } + } + out +} + #[cfg(any(unix, windows))] fn decode_standalone_range(native_rate: u32, channels_count: usize, state: &mut StandaloneAudioState, start: i64, frames: usize) -> Result>> { let end = start.saturating_add(frames as i64); @@ -2854,7 +2898,8 @@ mod tests { wav.extend_from_slice(&s.to_le_bytes()); } - let src = open_bytes("tone.wav", Arc::from(wav)).expect("recognized").expect("opened"); + let wav = Arc::<[u8]>::from(wav); + let src = open_bytes("tone.wav", wav.clone()).expect("recognized").expect("opened"); let info = src.info(); assert_eq!(info.container, "wav"); assert_eq!(info.kind, MediaKind::AudioOnly); @@ -2872,6 +2917,31 @@ mod tests { let resampled = src.audio(0, 256, 44_100).expect("resampled"); assert_eq!(resampled.sample_rate, 44_100); assert_eq!(resampled.channels[0].len(), 256); + + let cold = open_bytes("tone.wav", wav).expect("recognized").expect("opened"); + let alone = cold.audio(1, 1, 44_100).expect("single output frame"); + // Output frame 1 is at input frame 160/147. The left channel's + // input frames 1 and 2 contain -7486 and -6972 in signed 16-bit PCM. + let expected = (-7486.0 + (13.0 / 147.0) * 514.0) / 32768.0; + assert!((alone.channels[0][0] - expected).abs() < 1e-7, "absolute fractional phase"); + for (single, block) in alone.channels.iter().zip(&resampled.channels) { + assert_eq!(single[0], block[1], "reading a frame alone must match a longer block"); + } + let pre_roll = cold.audio(-1, 3, 44_100).expect("negative output window"); + for (shifted, block) in pre_roll.channels.iter().zip(&resampled.channels) { + assert_eq!(shifted[0], 0.0, "silence before frame zero"); + assert_eq!(&shifted[1..], &block[..2], "crossing frame zero must preserve phase"); + } + // Frame 3675 is exactly native frame 4000, where the left ramp is zero. + let crossing = cold.audio(3670, 6, 44_100).expect("cross a zero sample"); + let zero = cold.audio(3675, 1, 44_100).expect("read the zero sample alone"); + assert_eq!(crossing.channels[0][5], 0.0, "a fractional start must not leak into an integral sample"); + assert_eq!(crossing.channels[0][5], zero.channels[0][0]); + + let after_end = cold.audio(4410, 2, 44_100).expect("after EOF"); + assert!(after_end.channels.iter().flatten().all(|&sample| sample == 0.0)); + let out_of_range = cold.audio(i64::MAX / 2, 1, 1).expect("unrepresentable source origin"); + assert!(out_of_range.channels.iter().flatten().all(|&sample| sample == 0.0), "an unreachable origin must not replay frame zero"); } /// 1024-sample frames at 48 kHz stamped to the nearest millisecond, then back in samples. From bf8529941087809f57a705413618adf0e3d58522 Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Sat, 21 Nov 2026 18:34:46 +0700 Subject: [PATCH 350/451] media: clamp MXF picture duration and seeking to indexed frames (#4021) * Use the same indexed MXF picture window for duration and seek * Apply hosted rustfmt to MXF window test --------- Co-authored-by: Codex --- crates/media/src/craft_source.rs | 41 ++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 5 deletions(-) diff --git a/crates/media/src/craft_source.rs b/crates/media/src/craft_source.rs index a6a7bc37d..d53dc927b 100644 --- a/crates/media/src/craft_source.rs +++ b/crates/media/src/craft_source.rs @@ -210,11 +210,12 @@ impl ContainerFile { } ContainerFile::Mxf(f) => { let track = f.tracks.get(track_idx)?; - let offset = track.first_edit_unit(); + let (offset, presented_len) = mxf_picture_window(track); + if presented_len == 0 { + return None; + } let d = tick_to_rational_units(time, i64::from(track.edit_rate.num), i64::from(track.edit_rate.den)); - let presented_len = track.duration.unwrap_or_else(|| i64::try_from(track.display_order.len()).unwrap_or(0).saturating_sub(offset).max(0)); - let max_rel = presented_len.saturating_sub(1).max(0); - let pos = offset.saturating_add(d.clamp(0, max_rel)); + let pos = offset.saturating_add(d.clamp(0, presented_len - 1)); let idx = track.sample_at(pos)?; Some((idx, track.samples[idx].pts)) } @@ -1039,8 +1040,19 @@ fn mxf_start_timecode(tc: mxf::Timecode, rate: Option) -> i64 { i64::try_from(converted).unwrap_or(tc.start) } +/// Material-package picture span, limited to indexed display pictures after the origin. +fn mxf_picture_window(track: &mxf::EssenceTrack) -> (i64, i64) { + let start = track.first_edit_unit(); + let available = i64::try_from(track.display_order.len()).unwrap_or(i64::MAX).saturating_sub(start).max(0); + (start, track.duration.unwrap_or(available).clamp(0, available)) +} + fn open_mxf(name: &str, source: SharedBytes) -> Option> { let file = mxf::open(&*source).ok()?; + open_parsed_mxf(name, source, file) +} + +fn open_parsed_mxf(name: &str, source: SharedBytes, file: mxf::MxfFile) -> Option> { let video_idx = file.tracks.iter().position(|t| t.kind == mxf::TrackKind::Picture && !t.samples.is_empty() && t.edit_rate.is_valid()); let sound_indices: Vec = file.tracks.iter().enumerate().filter(|(_, t)| t.kind == mxf::TrackKind::Sound && !t.chunks.is_empty()).map(|(idx, _)| idx).collect(); @@ -1078,7 +1090,7 @@ fn open_mxf(name: &str, source: SharedBytes) -> Option> { let er = video_track.edit_rate; let fps = f64::from(er.num) / f64::from(er.den.max(1)); let frame_rate = snap_common_fps(fps).unwrap_or_else(|| FrameRate::new(i64::from(er.num), i64::from(er.den))); - let dur_units = video_track.duration.unwrap_or_else(|| i64::try_from(video_track.display_order.len()).unwrap_or(0)); + let (_, dur_units) = mxf_picture_window(video_track); let duration = Tick::from_units(dur_units.saturating_mul(i64::from(er.den)), i64::from(er.num.max(1))); let has_alpha = video_track.picture.as_ref().is_some_and(|p| p.alpha_depth > 0); let video_decoder = match TrackDecoder::with_options(&video_params, TrackDecoderOptions { threads: Some(worker_cap()), draft: false }) { @@ -2861,6 +2873,25 @@ mod tests { let (win_start, win_len) = mxf_sound_window(&file.tracks[1]); assert_eq!((win_start, win_len), (1920, 1920)); + // Reuse the demuxed writer fixture and vary just its material-picture metadata. + // The writer itself authors neither an overclaimed nor an absent duration here. + assert_eq!(file.tracks[0].display_order, [0, 1]); + let one_frame = Tick::from_units(40, 1_000); + let beyond = Tick::from_units(80, 1_000); + for (origin, declared, expected_duration, expected_target) in + [(1, Some(2), one_frame, Some((1, 1))), (1, None, one_frame, Some((1, 1))), (1, Some(0), Tick::ZERO, None), (2, Some(2), Tick::ZERO, None)] + { + let mut edited = file.clone(); + edited.tracks[0].origin = origin; + edited.tracks[0].duration = declared; + assert_eq!(edited.tracks[0].first_edit_unit(), origin); + let source = open_parsed_mxf("op1a.mxf", mxf_bytes.clone(), edited.clone()).expect("shared MXF").expect("open parsed"); + assert_eq!(source.info().duration, expected_duration, "origin {origin}, duration {declared:?}"); + let container = ContainerFile::Mxf(Box::new(edited)); + assert_eq!(container.target_sample(0, Tick::ZERO), expected_target); + assert_eq!(container.target_sample(0, beyond), expected_target); + } + let container = ContainerFile::Mxf(Box::new(file)); assert_eq!(container.sample_count(0), 2); assert_eq!(container.target_sample(0, Tick::ZERO), Some((1, 1))); From 917a68783aa3e7003eada07035a3d5661510852b Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Sat, 21 Nov 2026 19:31:33 +0700 Subject: [PATCH 351/451] Preserve MXF descriptor pixel aspect in the shared reader (#4022) Co-authored-by: Codex --- crates/media/src/craft_source.rs | 74 +++++++++++++++++++++++++++++++- 1 file changed, 72 insertions(+), 2 deletions(-) diff --git a/crates/media/src/craft_source.rs b/crates/media/src/craft_source.rs index d53dc927b..7acb6058f 100644 --- a/crates/media/src/craft_source.rs +++ b/crates/media/src/craft_source.rs @@ -1047,6 +1047,25 @@ fn mxf_picture_window(track: &mxf::EssenceTrack) -> (i64, i64) { (start, track.duration.unwrap_or(available).clamp(0, available)) } +/// Pixel aspect is the descriptor's display aspect divided by the frame's raster aspect. +fn mxf_picture_par(dar: mxf::Rational, width: u32, height: u32) -> (u32, u32) { + const SQUARE: (u32, u32) = (1, 1); + if !dar.is_valid() || width == 0 || height == 0 { + return SQUARE; + } + // Positive i32 by u32 fits u64; reduce before narrowing to the frame's u32 pair. + let num = u64::from(dar.num as u32) * u64::from(height); + let den = u64::from(dar.den as u32) * u64::from(width); + let (mut a, mut b) = (num, den); + while b != 0 { + (a, b) = (b, a % b); + } + match (u32::try_from(num / a), u32::try_from(den / a)) { + (Ok(num), Ok(den)) => (num, den), + _ => SQUARE, + } +} + fn open_mxf(name: &str, source: SharedBytes) -> Option> { let file = mxf::open(&*source).ok()?; open_parsed_mxf(name, source, file) @@ -1087,6 +1106,7 @@ fn open_parsed_mxf(name: &str, source: SharedBytes, file: mxf::MxfFile) -> Optio return None; } let (width, height) = video_track.picture.as_ref().map_or((0, 0), |p| (p.frame_width(), p.frame_height())); + let par = video_track.picture.as_ref().map_or((1, 1), |p| mxf_picture_par(p.aspect_ratio, width, height)); let er = video_track.edit_rate; let fps = f64::from(er.num) / f64::from(er.den.max(1)); let frame_rate = snap_common_fps(fps).unwrap_or_else(|| FrameRate::new(i64::from(er.num), i64::from(er.den))); @@ -1101,7 +1121,7 @@ fn open_parsed_mxf(name: &str, source: SharedBytes, file: mxf::MxfFile) -> Optio width, height, frame_rate, - par: (1, 1), + par, codec: video_params.codec.name().to_string(), pixel_format: String::new(), color: ColorInfo::REC709, @@ -1110,7 +1130,7 @@ fn open_parsed_mxf(name: &str, source: SharedBytes, file: mxf::MxfFile) -> Optio hdr: None, }; let v_state = Mutex::new(VideoState { decoder: video_decoder, next_decode_idx: 0, gop_start_idx: 0, flushed: false, decoded: Vec::new() }); - (Some(v_info), Some(v_state), FramePresentation { container_color: None, par: (1, 1), rotation: 0, aperture: None }, duration) + (Some(v_info), Some(v_state), FramePresentation { container_color: None, par, rotation: 0, aperture: None }, duration) } else { let duration = audio_tracks .iter() @@ -2765,6 +2785,56 @@ mod tests { } } + #[test] + fn mxf_descriptor_aspect_reaches_shared_probe_and_frame() { + use craft_video::prores::{ChromaFormat, Encoder, Frame, Profile}; + + let frame = Frame::new(16, 12, ChromaFormat::Yuv422, 10, false).expect("ProRes frame"); + let packet = Encoder::new(Profile::Hq, 16, 12).encode(&frame).expect("encode ProRes"); + for (dar, expected) in [(mxf::Rational::new(16, 9), (4, 3)), (mxf::Rational::new(0, 0), (1, 1))] { + let ids = mxf::write::PackageIds::from_seed("eff-mxf-par", "op1a"); + let mut cfg = mxf::write::WriterConfig::new(mxf::write::Pattern::Op1a, mxf::Rational::new(25, 1), ids); + let mut picture = mxf::write::PictureDesc::new(mxf::write::PictureCoding::ProRes { profile: 4 }, 16, 12); + picture.aspect = dar; + cfg.picture = Some(picture); + let mut writer = mxf::write::MxfWriter::new(std::io::Cursor::new(Vec::new()), cfg).expect("writer"); + writer.push_picture(&packet, mxf::write::FrameInfo::intra()).expect("picture"); + let bytes: Arc<[u8]> = writer.finish().expect("finish").into_inner().into(); + + let file = mxf::open(bytes.as_ref()).expect("demux fixture"); + assert_eq!(file.tracks[0].picture.as_ref().expect("picture descriptor").aspect_ratio, dar); + let footage = crate::probe::probe_bytes("aspect.mxf", bytes.clone()).expect("public probe"); + // The FilmCraft backend labels the same essence "Apple ProRes 422 HQ". + assert_eq!(footage.codec, "ProRes", "must use the shared MXF route"); + assert_eq!(footage.pixel_aspect, f64::from(expected.0) / f64::from(expected.1)); + + let source = open_bytes("aspect.mxf", bytes).expect("recognized MXF").expect("shared MXF"); + assert_eq!(source.info().video.as_ref().expect("video").par, expected); + let decoded = source.video_frame(FrameRequest { time: Tick::ZERO, scale: 1.0 }).expect("decode frame"); + assert_eq!(decoded.par, expected); + } + } + + #[test] + fn mxf_descriptor_aspect_is_bounded_and_yields_to_decoder_sar() { + let wide = mxf::Rational::new(i32::MAX, i32::MAX); + assert_eq!(mxf_picture_par(wide, u32::MAX, u32::MAX), (1, 1)); + assert_eq!(mxf_picture_par(wide, 12, 16), (4, 3)); + assert_eq!(mxf_picture_par(mxf::Rational::new(i32::MAX, 1), 1, u32::MAX), (1, 1)); + assert_eq!(mxf_picture_par(mxf::Rational::new(16, 9), 0, 12), (1, 1)); + + let par = mxf_picture_par(mxf::Rational::new(16, 9), 16, 12); + let presentation = FramePresentation { container_color: None, par, rotation: 0, aperture: None }; + for (sar, expected) in [(None, (4, 3)), (Some((0, 2)), (4, 3)), (Some((2, 1)), (2, 1))] { + let y = Plane::packed(2, 2, 8, Samples::U8(vec![1, 2, 3, 4])).expect("luma"); + let cb = Plane::packed(1, 1, 8, Samples::U8(vec![128])).expect("chroma"); + let cr = Plane::packed(1, 1, 8, Samples::U8(vec![128])).expect("chroma"); + let mut frame = DecodedVideoFrame::new(2, 2, ColorFamily::YCbCr, Subsampling::S420, vec![y, cb, cr], None).expect("decoded frame"); + frame.sar = sar; + assert_eq!(to_craft_frame(frame, presentation, Tick::ZERO).expect("converted").par, expected); + } + } + #[test] fn mxf_sniffer_and_rational_units() { assert!(looks_like_mxf(&[0x06, 0x0e, 0x2b, 0x34, 0x02, 0x05, 0x01, 0x01, 0x0d, 0x01, 0x02, 0x01, 0x01, 0x02])); From 5f435d45ef90145ad34470918a68a381b58f963b Mon Sep 17 00:00:00 2001 From: Terra854 Date: Sat, 21 Nov 2026 21:24:47 +0800 Subject: [PATCH 352/451] fix(media): silence reads past the MOV audio edit end (#4024) * Stop presenting MOV audio at the edit end * Credit Terra854 in EffectCraft About --- contributors/people.toml | 3 + crates/media/src/craft_source.rs | 123 +++++++++++++++++++++---------- 2 files changed, 89 insertions(+), 37 deletions(-) diff --git a/contributors/people.toml b/contributors/people.toml index 4f77ce8d1..eb363be5d 100644 --- a/contributors/people.toml +++ b/contributors/people.toml @@ -143,3 +143,6 @@ sync_github_name = true real_name = "Nicola Falcier" display_name = "Nicola Falcier" sync_github_name = false + +[people.Terra854] +display_name = "Terra854" diff --git a/crates/media/src/craft_source.rs b/crates/media/src/craft_source.rs index 7acb6058f..7307a8323 100644 --- a/crates/media/src/craft_source.rs +++ b/crates/media/src/craft_source.rs @@ -293,19 +293,23 @@ impl ContainerFile { (seek_idx, decoded_pos) } - fn audio_silent_prefix(&self, track_idx: usize, start: i64, frames: usize, sample_rate: u32) -> usize { - let Self::Isobmff(file) = self else { return 0 }; - let Some((leading_duration, media_time)) = file.tracks.get(track_idx).and_then(|track| unit_rate_media_edit(&track.edits)) else { - return 0; + fn audio_edit_range(&self, track_idx: usize, start: i64, frames: usize, sample_rate: u32) -> std::ops::Range { + let Self::Isobmff(file) = self else { return 0..frames }; + let Some((leading_duration, media)) = file.tracks.get(track_idx).and_then(|track| unit_rate_media_edit(&track.edits)) else { + return 0..frames; }; - if leading_duration == 0 || media_time == 0 || file.timescale == 0 { - return 0; + if file.timescale == 0 { + return 0..frames; } - // The net packet offset includes the trim and can put decoder preroll inside - // the empty edit. Use the empty edit's duration on the output clock instead. - let first_presented = (u128::from(leading_duration) * u128::from(sample_rate)).div_ceil(u128::from(file.timescale)) as i128; - usize::try_from((first_presented - i128::from(start)).max(0)).unwrap_or(usize::MAX).min(frames) + // Packet positions include preroll. The edit's movie-clock boundaries + // determine which samples are presented, with the end excluded. + let offset = |ticks: u128| { + let frame = (ticks * u128::from(sample_rate)).div_ceil(u128::from(file.timescale)) as i128; + usize::try_from((frame - i128::from(start)).max(0)).unwrap_or(usize::MAX).min(frames) + }; + let leading = u128::from(leading_duration); + offset(leading)..offset(leading + u128::from(media.segment_duration)) } } @@ -690,14 +694,14 @@ fn clean_aperture_region(aperture: isobmff::CleanAperture, (width, height): (u32 } /// A single unit-rate media span, optionally preceded by one empty span. -fn unit_rate_media_edit(edits: &[isobmff::Edit]) -> Option<(u64, i64)> { +fn unit_rate_media_edit(edits: &[isobmff::Edit]) -> Option<(u64, &isobmff::Edit)> { const UNIT_RATE: i32 = 0x0001_0000; let (leading_duration, media) = match edits { [media] => (0, media), [empty, media] if empty.media_time == -1 && empty.segment_duration > 0 && empty.media_rate == UNIT_RATE => (empty.segment_duration, media), _ => return None, }; - (media.media_time >= 0 && media.segment_duration != 0 && media.media_rate == UNIT_RATE).then_some((leading_duration, media.media_time)) + (media.media_time >= 0 && media.segment_duration != 0 && media.media_rate == UNIT_RATE).then_some((leading_duration, media)) } /// A scalar EDL origin cannot describe dwell, disjoint edits or respeeding. @@ -705,7 +709,7 @@ fn continuous_edit_mapping(track: &isobmff::Track, movie_timescale: u32) -> Opti if track.edits.is_empty() { return (track.edit_offset == 0).then_some((0, 0)); } - let (leading_duration, media_time) = unit_rate_media_edit(&track.edits)?; + let (leading_duration, media) = unit_rate_media_edit(&track.edits)?; if movie_timescale == 0 || track.timescale == 0 { return None; } @@ -716,8 +720,8 @@ fn continuous_edit_mapping(track: &isobmff::Track, movie_timescale: u32) -> Opti if lead % movie_clock != 0 { return None; } - let offset = i64::try_from(lead / movie_clock - i128::from(media_time)).ok()?; - (offset == track.edit_offset).then_some((media_time, offset)) + let offset = i64::try_from(lead / movie_clock - i128::from(media.media_time)).ok()?; + (offset == track.edit_offset).then_some((media.media_time, offset)) } /// The EDL origin is the timecode at presentation time zero, not the raw @@ -1446,15 +1450,20 @@ impl MediaSource for CraftMediaSource { return Err(MediaError::Decode("invalid audio sample rate 0".into())); } let channels_count = self.info.audio_streams.get(stream).map_or(2, |s| s.channels as usize); - let silent_frames = self.file.audio_silent_prefix(entry.track_idx, start, frames, sample_rate); - let audible_frames = frames - silent_frames; + let edit_range = self.file.audio_edit_range(entry.track_idx, start, frames, sample_rate); + let audible_frames = edit_range.len(); if audible_frames == 0 { return Ok(AudioBuffer::new(sample_rate, channels_count as u16, frames)); } - let audible_start = i64::try_from(i128::from(start) + silent_frames as i128).unwrap_or(i64::MAX); + let audible_start = i64::try_from(i128::from(start) + edit_range.start as i128).unwrap_or(i64::MAX); let native_rate = entry.native_rate; - let (native_start, native_frames) = native_audio_window(audible_start, audible_frames, native_rate, sample_rate); + let (native_start, mut native_frames) = native_audio_window(audible_start, audible_frames, native_rate, sample_rate); + if native_rate != sample_rate { + // The resampler asks for lookahead. Do not interpolate with samples + // that are stored in the track but lie beyond the edit. + native_frames = self.file.audio_edit_range(entry.track_idx, native_start, native_frames, native_rate).end; + } let decoded = match &entry.backend { AudioBackend::Decoder { seek_preroll_samples, state: state_mutex } => { @@ -1503,10 +1512,10 @@ impl MediaSource for CraftMediaSource { let mut channels = if sample_rate == native_rate { decoded } else { resample_audio(&decoded, channels_count, native_rate, sample_rate, audible_frames) }; - if silent_frames > 0 { + if audible_frames < frames { for channel in &mut channels { channel.resize(frames, 0.0); - channel.rotate_right(silent_frames); + channel.rotate_right(edit_range.start); } } Ok(AudioBuffer { sample_rate, channels }) @@ -2550,29 +2559,37 @@ mod tests { } } - /// Original PCM generated in memory to exercise an empty edit followed by a trim. + /// Original PCM generated in memory at the MOV writer's default movie timescale. + fn edited_pcm_mov(rate: u32, samples: &[i16], edits: Vec) -> Vec { + use isobmff::{Brand, Mp4Writer, PcmConfig, SampleEntry, TrackConfig, WriteSample, WriterOptions}; + + let mut writer = Mp4Writer::new(std::io::Cursor::new(Vec::new()), WriterOptions::new(Brand::Mov)).unwrap(); + let pcm = PcmConfig { bits: 16, float: false, big_endian: false, signed: true, channels: 1, sample_rate: f64::from(rate) }; + let mut config = TrackConfig::new(SampleEntry::pcm(pcm), rate); + config.edits = edits; + let track = writer.add_track(config).unwrap(); + for chunk in samples.chunks(256) { + let data: Vec = chunk.iter().flat_map(|sample| sample.to_le_bytes()).collect(); + writer.write_sample(track, WriteSample { data: &data, duration: chunk.len() as u32, composition_offset: 0, is_sync: true }).unwrap(); + } + writer.finish().unwrap().into_inner() + } + #[test] fn mov_pcm_trim_after_empty_edit_preserves_leading_silence() { - use isobmff::{Brand, Edit, Mp4Writer, PcmConfig, SampleEntry, TrackConfig, WriteSample, WriterOptions}; - const RATE: u32 = 48_000; const DELAY_MS: u64 = 100; const DELAY: i64 = 4_800; let samples: Vec = (0..12_000).map(|i| 1_000 + (i % 257) as i16 * 32).collect(); for trim in [2_400i64, 4_800, 9_600] { - let mut writer = Mp4Writer::new(std::io::Cursor::new(Vec::new()), WriterOptions::new(Brand::Mov)).unwrap(); - let pcm = PcmConfig { bits: 16, float: false, big_endian: false, signed: true, channels: 1, sample_rate: f64::from(RATE) }; - let mut config = TrackConfig::new(SampleEntry::pcm(pcm), RATE); - config.edits = vec![ - Edit { segment_duration: DELAY_MS, media_time: -1, media_rate: 0x0001_0000 }, - Edit { segment_duration: 40, media_time: trim, media_rate: 0x0001_0000 }, - ]; - let track = writer.add_track(config).unwrap(); - for chunk in samples.chunks(256) { - let data: Vec = chunk.iter().flat_map(|sample| sample.to_le_bytes()).collect(); - writer.write_sample(track, WriteSample { data: &data, duration: chunk.len() as u32, composition_offset: 0, is_sync: true }).unwrap(); - } - let bytes = writer.finish().unwrap().into_inner(); + let bytes = edited_pcm_mov( + RATE, + &samples, + vec![ + isobmff::Edit { segment_duration: DELAY_MS, media_time: -1, media_rate: 0x0001_0000 }, + isobmff::Edit { segment_duration: 40, media_time: trim, media_rate: 0x0001_0000 }, + ], + ); let file = isobmff::open(bytes.as_slice()).unwrap(); assert_eq!(file.timescale, 1_000); assert_eq!(file.tracks[0].edit_offset, DELAY - trim); @@ -2589,6 +2606,38 @@ mod tests { } } + #[test] + fn mov_pcm_audio_is_silent_after_the_edit_span() { + const RATE: u32 = 48_000; + const EDIT_MS: u64 = 41; + const TRIM: i64 = 9_600; + const EDIT_FRAMES: usize = 1_968; + let samples: Vec = (0..12_000).map(|i| 1_000 + (i % 257) as i16 * 32).collect(); + let last = f32::from(samples[TRIM as usize + EDIT_FRAMES - 1]) / 32_768.0; + let previous = f32::from(samples[TRIM as usize + EDIT_FRAMES - 2]) / 32_768.0; + for delay_ms in [0, 100] { + let mut edits = Vec::new(); + if delay_ms > 0 { + edits.push(isobmff::Edit { segment_duration: delay_ms, media_time: -1, media_rate: 0x0001_0000 }); + } + edits.push(isobmff::Edit { segment_duration: EDIT_MS, media_time: TRIM, media_rate: 0x0001_0000 }); + let bytes = edited_pcm_mov(RATE, &samples, edits); + let source = open_bytes("edited-pcm.mov", bytes.into()).expect("shared MOV route").unwrap(); + let read = |start, frames, rate| source.audio(start, frames, rate).expect("direct shared PCM read").channels.remove(0); + + let end = ((delay_ms + EDIT_MS) * 48) as i64; + assert_eq!(read(end - 2, 4, RATE), [previous, last, 0.0, 0.0], "crossing the boundary, delay {delay_ms}"); + assert_eq!(read(end, 2, RATE), [0.0, 0.0], "read after the end"); + assert_eq!(read(end - 2, 2, RATE), [previous, last], "backward seek"); + assert_eq!(read(end * 2 - 4, 6, RATE * 2), [previous, (previous + last) / 2.0, last, last, 0.0, 0.0]); + + let first_silent = ((delay_ms + EDIT_MS) * 44_100).div_ceil(1_000) as i64; + let boundary = read(first_silent - 1, 2, 44_100); + assert!(boundary[0] > 0.0, "sample before the fractional boundary"); + assert_eq!(boundary[1], 0.0, "sample after the fractional boundary"); + } + } + #[test] fn vui_overrides_container_color_and_falls_back_when_unspecified() { let container = color_from_isobmff(&isobmff::ColorInfo::Nclx { primaries: 9, transfer: 16, matrix: 9, full_range: false }); From b71670634aa78d822d9a65f498ec74607088bfa8 Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Sat, 21 Nov 2026 21:01:09 +0700 Subject: [PATCH 353/451] media: honor MXF descriptor color fallback for ProRes (#778) (#4023) * media: honor MXF descriptor color fallback for ProRes (#778) * style: format MXF descriptor color fallback --------- Co-authored-by: Codex --- crates/media/src/craft_source.rs | 206 ++++++++++++++++++++++++++++++- crates/media/src/probe.rs | 2 +- 2 files changed, 205 insertions(+), 3 deletions(-) diff --git a/crates/media/src/craft_source.rs b/crates/media/src/craft_source.rs index 7307a8323..d7c2f5d7c 100644 --- a/crates/media/src/craft_source.rs +++ b/crates/media/src/craft_source.rs @@ -64,6 +64,9 @@ const AUDIO_SEEK_BACKUP_PACKETS: usize = 2; /// Complete first-sample read cap for the ProRes alpha probe; larger samples use the legacy route. const MAX_PRORES_ALPHA_SAMPLE_BYTES: u32 = 32 * 1024 * 1024; +/// Complete first-presented sample cap for the MXF ProRes colour probe. Larger samples retain the +/// existing colour policy; the ProRes header parser requires the complete declared frame. +const MAX_MXF_PRORES_COLOR_SAMPLE_BYTES: u32 = 4 * 1024 * 1024; fn worker_cap() -> usize { std::thread::available_parallelism().map_or(4, |n| n.get()).clamp(1, MAX_WORKERS) @@ -1121,6 +1124,8 @@ fn open_parsed_mxf(name: &str, source: SharedBytes, file: mxf::MxfFile) -> Optio Ok(d) => d, Err(e) => return Some(Err(MediaError::Decode(e.to_string()))), }; + let (color, container_color) = + mxf_prores_color(&file, &*source, v_idx).map_or((ColorInfo::REC709, None), |(probe, descriptor)| (probe, Some(descriptor))); let v_info = VideoStreamInfo { width, height, @@ -1128,13 +1133,13 @@ fn open_parsed_mxf(name: &str, source: SharedBytes, file: mxf::MxfFile) -> Optio par, codec: video_params.codec.name().to_string(), pixel_format: String::new(), - color: ColorInfo::REC709, + color, has_alpha, bitrate: None, hdr: None, }; let v_state = Mutex::new(VideoState { decoder: video_decoder, next_decode_idx: 0, gop_start_idx: 0, flushed: false, decoded: Vec::new() }); - (Some(v_info), Some(v_state), FramePresentation { container_color: None, par, rotation: 0, aperture: None }, duration) + (Some(v_info), Some(v_state), FramePresentation { container_color, par, rotation: 0, aperture: None }, duration) } else { let duration = audio_tracks .iter() @@ -2122,6 +2127,48 @@ fn resolve_color(vui: ColorTags, container: Option) -> ColorInfo { ColorInfo { matrix, transfer, primaries, range } } +/// Resolve the clip's initial probe colour from the first presented ProRes frame, without +/// changing decoder state or a project's saved interpretation. Later frames still resolve their +/// own decoder fields against the descriptor; this is not a variable-profile clip probe. +fn mxf_prores_color(file: &MxfFile, source: &dyn ByteSource, track_idx: usize) -> Option<(ColorInfo, ColorInfo)> { + use effectcraft_project::ColorSpace; + + let track = file.tracks.get(track_idx)?; + if !matches!(track.codec, mxf::Codec::ProRes { .. }) { + return None; + } + let descriptor = color_from_mxf(track.picture.as_ref()?)?; + let (start, len) = mxf_picture_window(track); + if len == 0 { + return None; + } + let index = track.sample_at(start)?; + let sample = track.samples.get(index)?; + if !(28..=MAX_MXF_PRORES_COLOR_SAMPLE_BYTES).contains(&sample.size) { + return None; + } + let packet = file.read_sample(source, track_idx, index).ok()?; + let tags = craft_video::prores::probe(&packet).ok()?.color; + let tags = ColorTags { primaries: tags.primaries, transfer: tags.transfer, matrix: tags.matrix, full_range: false }; + let color = resolve_color(tags, Some(descriptor)); + // Only opt in when the managed compositor can represent the resolved primaries/transfer. + // The general profile mapper also approximates some other pairs for existing routes. + match crate::probe::profile_of_craft(&color) { + Some(ColorSpace::Rec2100Pq | ColorSpace::Rec2100Hlg) => Some((color, descriptor)), + Some(ColorSpace::Rec709) if color.primaries == Primaries::Bt709 => Some((color, descriptor)), + _ => None, + } +} + +fn color_from_mxf(picture: &mxf::PictureInfo) -> Option { + let (primaries, transfer, matrix) = picture.color_codes(); + if (primaries, transfer, matrix) == (None, None, None) { + return None; + } + // Use the existing H.273 defaults without changing MXF quantisation range policy. + Some(resolve_color(ColorTags { primaries: primaries.unwrap_or(2), transfer: transfer.unwrap_or(2), matrix: matrix.unwrap_or(2), full_range: false }, None)) +} + fn color_from_isobmff(c: &isobmff::ColorInfo) -> ColorInfo { match c { isobmff::ColorInfo::Nclx { primaries, transfer, matrix, full_range } => ColorInfo { @@ -2834,6 +2881,161 @@ mod tests { } } + fn mxf_prores_color_packet(codes: (u8, u8, u8)) -> Vec { + use craft_video::prores::{self, ChromaFormat, Encoder, EncoderConfig, Frame, Profile}; + + let mut frame = Frame::new(16, 12, ChromaFormat::Yuv422, 10, false).expect("ProRes frame"); + frame.y.fill(512); + frame.cb.fill(512); + frame.cr.fill(512); + let (primaries, transfer, matrix) = codes; + let mut encoder = EncoderConfig::new(Profile::Hq, 16, 12); + encoder.color = prores::ColorInfo { primaries, transfer, matrix }; + let packet = Encoder::with_config(encoder).encode(&frame).expect("encode ProRes"); + let bits = prores::probe(&packet).expect("ProRes header").color; + assert_eq!((bits.primaries, bits.transfer, bits.matrix), codes); + packet + } + + fn mxf_prores_color_fixture(color: mxf::write::ColorSpace, packets: &[&[u8]]) -> Arc<[u8]> { + let ids = mxf::write::PackageIds::from_seed("eff-mxf-color", "op1a"); + let mut cfg = mxf::write::WriterConfig::new(mxf::write::Pattern::Op1a, mxf::Rational::new(25, 1), ids); + let mut picture = mxf::write::PictureDesc::new(mxf::write::PictureCoding::ProRes { profile: 4 }, 16, 12); + picture.color = color; + cfg.picture = Some(picture); + let mut writer = mxf::write::MxfWriter::new(std::io::Cursor::new(Vec::new()), cfg).expect("writer"); + for packet in packets { + writer.push_picture(packet, mxf::write::FrameInfo::intra()).expect("picture"); + } + writer.finish().expect("finish").into_inner().into() + } + + #[test] + fn mxf_descriptor_color_fills_unspecified_shared_prores_fields() { + use effectcraft_project::ColorSpace; + + let pq = ColorInfo { primaries: Primaries::Bt2020, transfer: Transfer::Pq, matrix: Matrix::Bt2020Ncl, range: Range::Limited }; + let mixed = ColorInfo { matrix: Matrix::Bt709, ..pq }; + for (descriptor, descriptor_codes, packet_codes, profile, expected) in [ + (mxf::write::ColorSpace::Rec2020Pq, (9, 16, 9), (2, 2, 2), Some(ColorSpace::Rec2100Pq), pq), + (mxf::write::ColorSpace::Rec2020Pq, (9, 16, 9), (1, 1, 1), Some(ColorSpace::Rec709), ColorInfo::REC709), + (mxf::write::ColorSpace::Rec2020Pq, (9, 16, 9), (2, 2, 1), Some(ColorSpace::Rec2100Pq), mixed), + (mxf::write::ColorSpace::Rec2020Pq, (9, 16, 9), (1, 2, 1), Some(ColorSpace::Rec709), ColorInfo::REC709), + (mxf::write::ColorSpace::Rec709, (1, 1, 1), (2, 2, 2), Some(ColorSpace::Rec709), ColorInfo::REC709), + ] { + let bytes = mxf_prores_color_fixture(descriptor, &[&mxf_prores_color_packet(packet_codes)]); + let file = mxf::open(bytes.as_ref()).expect("demux fixture"); + let picture = file.tracks[0].picture.as_ref().expect("picture descriptor"); + let (p, t, m) = descriptor_codes; + assert_eq!(picture.color_codes(), (Some(p), Some(t), Some(m))); + let footage = crate::probe::probe_bytes("color.mxf", bytes.clone()).expect("public probe"); + assert_eq!(footage.codec, "ProRes", "must use the shared MXF route"); + assert_eq!(footage.color_profile, profile); + + let source = open_bytes("color.mxf", bytes).expect("recognized MXF").expect("shared MXF"); + let info = source.info().video.as_ref().expect("video"); + assert_eq!(info.color, expected); + assert!(info.hdr.is_none(), "color labels alone are not HDR static metadata"); + let decoded = source.video_frame(FrameRequest { time: Tick::ZERO, scale: 1.0 }).expect("decode frame"); + assert_eq!(decoded.color, expected); + } + } + + #[test] + fn mxf_prores_explicit_rec709_keeps_managed_pixels_and_saved_interpretation() { + use effectcraft_color::{ColorSpace, Label}; + use effectcraft_project::{BitDepth, Comp, ItemKind, LayerSource, Project, build}; + use effectcraft_render::{RenderOpts, Renderer}; + + let packet = mxf_prores_color_packet((1, 1, 1)); + let render = |descriptor, saved_override| { + let bytes = mxf_prores_color_fixture(descriptor, &[&packet]); + let path = "managed-color.mxf"; + let mut footage = crate::probe::probe_bytes(path, bytes.clone()).expect("public probe"); + assert_eq!(footage.codec, "ProRes", "must use the shared MXF route"); + assert_eq!(footage.color_profile, Some(ColorSpace::Rec709)); + if saved_override { + footage.color_profile = Some(ColorSpace::Rec2100Pq); + } + let pool = crate::MediaPool::new(); + pool.add_bytes(path, bytes); + + let mut project = Project::default(); + project.settings.bit_depth = BitDepth::Bpc32; + project.settings.working_space = Some(ColorSpace::Srgb); + let rate = effectcraft_time::FrameRate::new(25, 1); + let mut comp = Comp::new(16, 12, rate, rate.tick_of(1)); + let item = project.add_item("Footage", Label::Aqua, None, ItemKind::Footage(footage)); + let layer = build::layer(&mut project, &comp, "Footage", LayerSource::Footage { item }, (16, 12), Some(comp.duration)); + comp.layers.push(layer); + let comp_id = project.add_item("Comp", Label::Sandstone, None, ItemKind::Comp(comp.into())); + Renderer::new(&project, &pool, RenderOpts::default()).comp_frame(comp_id, effectcraft_time::Tick::ZERO).get(8, 6) + }; + + let rec709 = render(mxf::write::ColorSpace::Rec709, false); + let conflicting = render(mxf::write::ColorSpace::Rec2020Pq, false); + let overridden = render(mxf::write::ColorSpace::Rec2020Pq, true); + assert!(rec709[0] > 0.1 && rec709[0] < 0.9 && rec709[3] > 0.99, "not an opaque midtone: {rec709:?}"); + assert!(rec709.iter().zip(conflicting).all(|(a, b)| (a - b).abs() < 1e-4), "{rec709:?} vs {conflicting:?}"); + assert!((overridden[0] - conflicting[0]).abs() > 0.02, "saved interpretation did not change the pixel: {overridden:?} vs {conflicting:?}"); + } + + #[test] + fn mxf_prores_color_reads_one_bounded_presented_packet() { + struct Reads<'a> { + bytes: &'a [u8], + log: Mutex>, + fail: bool, + } + impl ByteSource for Reads<'_> { + fn len(&self) -> u64 { + if self.fail { u64::MAX } else { self.bytes.len() as u64 } + } + fn read_at(&self, offset: u64, buf: &mut [u8]) -> std::io::Result<()> { + self.log.lock().unwrap().push((offset, buf.len())); + if self.fail { + return Err(std::io::Error::other("unreadable fixture packet")); + } + self.bytes.read_at(offset, buf) + } + } + + let unspecified = mxf_prores_color_packet((2, 2, 2)); + let rec709 = mxf_prores_color_packet((1, 1, 1)); + let bytes = mxf_prores_color_fixture(mxf::write::ColorSpace::Rec2020Pq, &[&unspecified, &rec709]); + let mut file = mxf::open(bytes.as_ref()).expect("demux fixture"); + // Exercise a material edit on parsed metadata: stored packet zero is hidden. + file.tracks[0].start_position = 1; + let sample = file.tracks[0].samples[1]; + let mut reads = Reads { bytes: &bytes, log: Mutex::new(Vec::new()), fail: false }; + let (probe, descriptor) = mxf_prores_color(&file, &reads, 0).expect("first presented ProRes header"); + assert_eq!(probe, ColorInfo::REC709); + assert_eq!(descriptor.transfer, Transfer::Pq); + assert_eq!(std::mem::take(reads.log.get_mut().unwrap()), [(sample.offset, sample.size as usize)]); + + reads.fail = true; + assert_eq!(mxf_prores_color(&file, &reads, 0), None); + assert_eq!(std::mem::take(reads.log.get_mut().unwrap()), [(sample.offset, sample.size as usize)]); + // The source reports ample backing so only the cap can explain the skipped read. + file.tracks[0].samples[1].size = MAX_MXF_PRORES_COLOR_SAMPLE_BYTES + 1; + assert_eq!(mxf_prores_color(&file, &reads, 0), None); + assert!(reads.log.get_mut().unwrap().is_empty()); + + file.tracks[0].samples[1] = sample; + file.tracks[0].codec = mxf::Codec::Vc3; + assert_eq!(mxf_prores_color(&file, &reads, 0), None); + assert!(reads.log.get_mut().unwrap().is_empty()); + } + + #[test] + fn mxf_absent_color_labels_keep_defaults_and_range_policy() { + let picture = mxf::PictureInfo { component_depth: 10, black_ref_level: Some(0), white_ref_level: Some(1023), ..Default::default() }; + assert!(picture.full_range()); + assert_eq!(picture.color_codes(), (None, None, None)); + assert_eq!(color_from_mxf(&picture), None); + assert_eq!(resolve_color(ColorTags::UNSPECIFIED, color_from_mxf(&picture)), ColorInfo::REC709); + } + #[test] fn mxf_descriptor_aspect_reaches_shared_probe_and_frame() { use craft_video::prores::{ChromaFormat, Encoder, Frame, Profile}; diff --git a/crates/media/src/probe.rs b/crates/media/src/probe.rs index 74d8fb9a5..954036fc4 100644 --- a/crates/media/src/probe.rs +++ b/crates/media/src/probe.rs @@ -240,7 +240,7 @@ pub(crate) fn footage_from_craft_info(path: &str, info: &craft_media_source::Med } } -fn profile_of_craft(c: &craft_color::ColorInfo) -> Option { +pub(crate) fn profile_of_craft(c: &craft_color::ColorInfo) -> Option { use craft_color::{Primaries, Transfer}; use effectcraft_project::ColorSpace; match (c.primaries, c.transfer) { From 775b157e66a22df08d8e5a1002360f746f3a7317 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sat, 21 Nov 2026 09:03:46 -0500 Subject: [PATCH 354/451] media: probe AVI ProRes coded alpha parity (#4025) * media: probe AVI ProRes coded alpha parity * media: fix prores::Profile, ChromaFormat, and Encoder::with_config in AVI alpha test --- crates/media/src/craft_source.rs | 66 +++++++++++++++++++++++++++++--- 1 file changed, 60 insertions(+), 6 deletions(-) diff --git a/crates/media/src/craft_source.rs b/crates/media/src/craft_source.rs index d7c2f5d7c..76b7b19f9 100644 --- a/crates/media/src/craft_source.rs +++ b/crates/media/src/craft_source.rs @@ -72,6 +72,14 @@ fn worker_cap() -> usize { std::thread::available_parallelism().map_or(4, |n| n.get()).clamp(1, MAX_WORKERS) } +fn prores_has_alpha(packet_size: u32, read: impl FnOnce() -> Option>) -> Option { + if packet_size > MAX_PRORES_ALPHA_SAMPLE_BYTES { + return None; + } + let packet = read()?; + Some(craft_video::prores::probe(&packet).ok()?.alpha != craft_video::prores::AlphaType::None) +} + fn supports_video_codec(codec: CodecId) -> bool { matches!(codec, CodecId::H264 | CodecId::Hevc | CodecId::Av1 | CodecId::Vp9 | CodecId::Vp8 | CodecId::ProRes | CodecId::Dnxhd | CodecId::Mpeg2Video) } @@ -818,11 +826,7 @@ fn open_isobmff(name: &str, source: SharedBytes) -> Option> let has_alpha = if video_params.codec == CodecId::ProRes { // The coded alpha plane is authoritative for ProRes, not the MOV sample-entry depth. let sample = video_track.samples.first()?; - if sample.size > MAX_PRORES_ALPHA_SAMPLE_BYTES { - return None; - } - let packet = file.read_sample(&*source, v_idx, 0).ok()?; - craft_video::prores::probe(&packet).ok()?.alpha != craft_video::prores::AlphaType::None + prores_has_alpha(sample.size, || file.read_sample(&*source, v_idx, 0).ok())? } else { video_track.video().is_some_and(|v| v.depth == 32) }; @@ -1224,7 +1228,12 @@ fn open_avi(name: &str, source: SharedBytes) -> Option> { Ok(d) => d, Err(e) => return Some(Err(MediaError::Decode(e.to_string()))), }; - let info = default_video_info(width, height, frame_rate, &video_params); + let mut info = default_video_info(width, height, frame_rate, &video_params); + if video_params.codec == CodecId::ProRes { + // The coded alpha plane is authoritative for ProRes, regardless of AVI header depth. + let chunk = video_stream.chunks.first()?; + info.has_alpha = prores_has_alpha(chunk.size, || file.read_chunk(&*source, v_idx, 0).ok())?; + } let state = Mutex::new(VideoState { decoder: video_decoder, next_decode_idx: 0, gop_start_idx: 0, flushed: false, decoded: Vec::new() }); (Some(ContainerVideoPart { track_idx: v_idx, info, state }), duration) } else { @@ -3509,4 +3518,49 @@ mod tests { let rewound = decode(&mut wide_tracks[0], 0, 600); assert_eq!(rewound[0], wide[0][..600]); } + + #[test] + fn avi_prores_coded_alpha_parity() { + use craft_video::prores::{ChromaFormat, ColorInfo as ProResColor, Encoder, EncoderConfig, Frame as ProResFrame, Interlace, Profile}; + + let encode_prores_avi = |with_alpha: bool| -> Vec { + let mut cfg = EncoderConfig::new(Profile::P4444, 16, 16); + cfg.encode_alpha = with_alpha; + cfg.threads = false; + let mut enc = Encoder::with_config(cfg); + let frame = ProResFrame { + width: 16, + height: 16, + chroma: ChromaFormat::Yuv444, + bit_depth: 10, + y: vec![512; 256], + cb: vec![512; 256], + cr: vec![512; 256], + alpha: with_alpha.then(|| vec![512; 256]), + interlace: Interlace::Progressive, + color: ProResColor::default(), + aspect_ratio: 0, + frame_rate_code: 0, + }; + let pkt = enc.encode(&frame).expect("encode prores"); + let mut w = avi::AviWriter::new( + std::io::Cursor::new(Vec::new()), + vec![avi::StreamSpec::Video(avi::VideoSpec::new(*b"ap4h", 16, 16, 24, 1))], + avi::MuxOptions::default(), + ) + .expect("avi writer"); + w.write_chunk(0, &pkt, true).expect("write prores chunk"); + w.finish().expect("finish avi").into_inner() + }; + + let alpha_src = open_bytes("alpha.avi", Arc::from(encode_prores_avi(true))).expect("recognized").expect("opened"); + assert!(alpha_src.info().video.as_ref().unwrap().has_alpha); + let frame = alpha_src.video_frame(FrameRequest { time: Tick::ZERO, scale: 1.0 }).expect("decode alpha frame"); + assert!(matches!(frame.data, PixelData::Yuv16 { alpha: Some(_), .. })); + + let opaque_src = open_bytes("opaque.avi", Arc::from(encode_prores_avi(false))).expect("recognized").expect("opened"); + assert!(!opaque_src.info().video.as_ref().unwrap().has_alpha); + let frame = opaque_src.video_frame(FrameRequest { time: Tick::ZERO, scale: 1.0 }).expect("decode opaque frame"); + assert!(matches!(frame.data, PixelData::Yuv16 { alpha: None, .. })); + } } From 7334a14ac2d993e14d7953e77d4d3a7f3869437f Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sat, 21 Nov 2026 09:43:57 -0500 Subject: [PATCH 355/451] media: enable FFV1 and APV decode in craft-video route (#4027) * media: enable FFV1 and APV decode in craft-video route * media: supply FFV1 config_record extradata in TrackDecoder unit test --- crates/media/Cargo.toml | 2 +- crates/media/src/craft_source.rs | 40 +++++++++++++++++++++++++++++++- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/crates/media/Cargo.toml b/crates/media/Cargo.toml index 338bdc6f7..cf93c6861 100644 --- a/crates/media/Cargo.toml +++ b/crates/media/Cargo.toml @@ -33,7 +33,7 @@ craft-frame = { workspace = true } craft-media = { workspace = true, features = ["mpegts", "avi", "mxf"] } craft-media-source = { workspace = true } craft-time = { workspace = true } -craft-video = { workspace = true, features = ["h264-decode", "hevc-decode", "vp9-decode", "vp8-decode", "av1-decode", "prores", "dnx", "mpeg2-decode", "threads"] } +craft-video = { workspace = true, features = ["h264-decode", "hevc-decode", "vp9-decode", "vp8-decode", "av1-decode", "prores", "dnx", "mpeg2-decode", "ffv1", "apv-decode", "threads"] } filmcraft-frame = { workspace = true } filmcraft-color = { workspace = true } filmcraft-time = { workspace = true } diff --git a/crates/media/src/craft_source.rs b/crates/media/src/craft_source.rs index 76b7b19f9..c7398947a 100644 --- a/crates/media/src/craft_source.rs +++ b/crates/media/src/craft_source.rs @@ -81,7 +81,19 @@ fn prores_has_alpha(packet_size: u32, read: impl FnOnce() -> Option>) -> } fn supports_video_codec(codec: CodecId) -> bool { - matches!(codec, CodecId::H264 | CodecId::Hevc | CodecId::Av1 | CodecId::Vp9 | CodecId::Vp8 | CodecId::ProRes | CodecId::Dnxhd | CodecId::Mpeg2Video) + matches!( + codec, + CodecId::H264 + | CodecId::Hevc + | CodecId::Av1 + | CodecId::Vp9 + | CodecId::Vp8 + | CodecId::ProRes + | CodecId::Dnxhd + | CodecId::Mpeg2Video + | CodecId::Ffv1 + | CodecId::Apv + ) } /// True when `head` begins with a plausible ISO-BMFF top-level box. @@ -3519,6 +3531,32 @@ mod tests { assert_eq!(rewound[0], wide[0][..600]); } + #[test] + fn ffv1_and_apv_video_codecs_route_through_craft_video() { + assert!(supports_video_codec(CodecId::Ffv1)); + assert!(supports_video_codec(CodecId::Apv)); + + let template = craft_video::ffv1::Frame { + width: 16, + height: 16, + colorspace: craft_video::ffv1::Colorspace::YCbCr, + bit_depth: 8, + chroma_shift: (1, 1), + planes: vec![vec![128; 256], vec![128; 64], vec![128; 64]], + }; + let ffv1_enc = craft_video::ffv1::Encoder::new(&template, craft_video::ffv1::EncoderConfig::default()).expect("ffv1 encoder"); + let mut ffv1_params = CodecParams::new(CodecId::Ffv1); + ffv1_params.width = Some(16); + ffv1_params.height = Some(16); + ffv1_params.extradata = ffv1_enc.config_record(); + assert!(TrackDecoder::with_options(&ffv1_params, TrackDecoderOptions { threads: Some(1), draft: false }).is_ok(), "Ffv1 decoder"); + + let mut apv_params = CodecParams::new(CodecId::Apv); + apv_params.width = Some(16); + apv_params.height = Some(16); + assert!(TrackDecoder::with_options(&apv_params, TrackDecoderOptions { threads: Some(1), draft: false }).is_ok(), "Apv decoder"); + } + #[test] fn avi_prores_coded_alpha_parity() { use craft_video::prores::{ChromaFormat, ColorInfo as ProResColor, Encoder, EncoderConfig, Frame as ProResFrame, Interlace, Profile}; From 52c78fd25235851110142c11e006af72a9ff3bd5 Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Sat, 21 Nov 2026 22:18:42 +0700 Subject: [PATCH 356/451] media: preserve the final picture in regular H.264 transport streams (#778) (#4030) * Preserve the final picture duration in regular H.264 transport streams * Test TS duration through the public H.264 encoder API --------- Co-authored-by: Codex --- crates/media/src/craft_source.rs | 159 ++++++++++++++++++++++++++++++- 1 file changed, 158 insertions(+), 1 deletion(-) diff --git a/crates/media/src/craft_source.rs b/crates/media/src/craft_source.rs index c7398947a..d7c050318 100644 --- a/crates/media/src/craft_source.rs +++ b/crates/media/src/craft_source.rs @@ -1279,6 +1279,45 @@ fn estimate_mpeg_frame_rate(units: &[mpegts::Unit]) -> FrameRate { estimate_mpeg_frame_rate_pts(units.iter().filter_map(|u| u.pts)) } +/// A timestamp is the start of a picture, not the end of its display interval. +fn regular_ts_picture_end(units: &[mpegts::Unit], origin_pts: i64, rate: FrameRate) -> Option { + let [first, second, rest @ ..] = units else { return None }; + let first_pts = first.pts?; + // A complete index can still contain a unit the public reader refuses to allocate. + let readable = |unit: &mpegts::Unit| unit.size > 0 && unit.size <= mpegts::MAX_UNIT_BYTES; + if !first.key || first_pts != origin_pts || rate.num <= 0 || rate.den <= 0 || !readable(first) || !readable(second) { + return None; + } + let mut last = second.pts?; + let step = last.checked_sub(first_pts)?; + // Do not infer a tail from a snapped rate or extrapolate an irregular track. + if step <= 0 || i128::from(step) * i128::from(rate.num) != 90_000 * i128::from(rate.den) { + return None; + } + for unit in rest { + let pts = unit.pts?; + if pts.checked_sub(last)? != step || !readable(unit) { + return None; + } + last = pts; + } + let end = last.checked_add(step)?.checked_sub(origin_pts)?; + let ticks = i128::from(end) * i128::from(craft_time::TICKS_PER_SECOND) / 90_000; + Some(Tick(i64::try_from(ticks).ok()?)) +} + +fn clean_ts_packet_index(file: &mpegts::File, source: &S) -> bool { + let mpegts::Format::Ts { packet_size, sync_offset } = file.format else { return false }; + if !file.warnings.is_empty() || !matches!(packet_size, 188 | 192 | 204) || sync_offset >= packet_size || !source.len().is_multiple_of(packet_size as u64) { + return false; + } + // Unlike the scanner's recovery path, require the five sync bytes it uses to + // identify a TS to align from byte zero, with no ignored partial packet at EOF. + let mut head = [0u8; 5 * 204]; + let Some(prefix) = head.get_mut(..5 * packet_size) else { return false }; + source.read_at(0, prefix).is_ok() && (0..5).all(|i| prefix.get(i * packet_size + sync_offset) == Some(&0x47)) +} + fn open_mpeg(name: &str, fmt: mpegts::Format, source: SharedBytes) -> Option> { let file = mpegts::open(&*source).ok()?; let origin_pts = file.streams.iter().filter_map(|s| s.pts_range().map(|(lo, _)| lo)).min().unwrap_or(0); @@ -1320,7 +1359,13 @@ fn open_mpeg(name: &str, fmt: mpegts::Format, source: SharedBytes) -> Option Vec { + use craft_video::h264::{Encoder, EncoderConfig, YuvFrame}; + use mpegts::mux::{Codec, Config, Frame, Muxer, Stream}; + + let mut config = EncoderConfig::new(16, 16, 25, 1); + config.intra_only = true; + config.threads = 1; + let mut encoder = Encoder::new(config).unwrap(); + let mut packets = Vec::new(); + let uv = [128; 8 * 8]; + for (pts, level) in [(90_000, 48), (93_600, 192)] { + let y = [level; 16 * 16]; + packets.extend(encoder.encode(&YuvFrame { y: &y, u: &uv, v: &uv, y_stride: 16, uv_stride: 8 }, pts).unwrap()); + } + packets.extend(encoder.flush()); + assert_eq!(packets.len(), 2); + let mut mux = Muxer::new(Vec::new(), Config::default(), &[Stream::new(0x100, Codec::H264)]).unwrap(); + for packet in packets { + assert!(packet.keyframe); + mux.write_frame(0, &Frame { data: &packet.data, pts: packet.pts, dts: Some(packet.dts), key: true }).unwrap(); + } + mux.finish().unwrap() + } + + #[test] + fn regular_video_only_h264_ts_duration_keeps_the_last_picture_playable() { + let bytes = generated_two_frame_ts(); + let parsed = mpegts::open(bytes.as_slice()).unwrap(); + assert_eq!(parsed.streams.len(), 1); + assert!(parsed.warnings.is_empty(), "{:?}", parsed.warnings); + assert_eq!(parsed.streams[0].skipped_bytes, 0); + assert!(clean_ts_packet_index(&parsed, bytes.as_slice())); + let units = &parsed.streams[0].units; + assert_eq!(units.iter().map(|unit| unit.pts).collect::>(), [Some(90_000), Some(93_600)]); + + let bytes: Arc<[u8]> = bytes.into(); + let opened = crate::stream::open_bytes("final-picture.ts", bytes.clone()).unwrap(); + assert!(matches!(opened, crate::stream::MediaSource::Craft(_))); + let film = filmcraft_codecs::open_bytes("final-picture.ts", bytes.clone()).unwrap(); + let rate = effectcraft_time::FrameRate::FPS_25; + assert_eq!(film.info().duration.0, rate.tick_of(2).0); + + let dir = tempfile::tempdir().unwrap(); + let path = dir.path().join("final-picture.ts"); + std::fs::write(&path, bytes.as_ref()).unwrap(); + let footage = crate::probe(&path).unwrap(); + let pool = crate::MediaPool::new(); + let first = pool.frame_at(&footage, effectcraft_time::Tick::ZERO).unwrap(); + let last = pool.frame_at(&footage, rate.tick_of(1)).unwrap(); + assert!(last.get(8, 8)[0] > first.get(8, 8)[0] + 0.25, "the earlier duration clamped the last request to the first picture"); + assert_eq!(footage.frame_rate, rate); + assert!(!footage.has_audio); + assert_eq!(footage.duration, rate.tick_of(2)); + } + + #[test] + fn ts_damaged_or_partial_tail_keeps_the_earlier_indexed_duration() { + let mut transport_error = [0xff; 188]; + // A dropped error-marked packet does not alter the two indexed pictures. + transport_error[..4].copy_from_slice(&[0x47, 0x9f, 0xff, 0x10]); + for (tail, warned) in [(&transport_error[..], true), (&[0x47][..], false)] { + let mut bytes = generated_two_frame_ts(); + bytes.extend_from_slice(tail); + let parsed = mpegts::open(bytes.as_slice()).unwrap(); + assert_eq!(parsed.warnings.iter().any(|warning| warning.contains("transport error indicator")), warned); + assert_eq!(parsed.streams[0].units.len(), 2); + assert_eq!(regular_ts_picture_end(&parsed.streams[0].units, 90_000, FrameRate::FPS_25), Some(Tick(craft_time::TICKS_PER_SECOND * 2 / 25))); + assert!(!clean_ts_packet_index(&parsed, bytes.as_slice())); + // The same shared route still opens and retains its prior duration. + let source = crate::stream::open_bytes("damaged-tail.ts", bytes.into()).unwrap(); + let crate::stream::MediaSource::Craft(source) = source else { panic!("existing shared route") }; + assert_eq!(source.info().duration, Tick(craft_time::TICKS_PER_SECOND / 25)); + } + } + + #[test] + fn ts_picture_end_requires_complete_exact_regular_stamps() { + let bytes = generated_two_frame_ts(); + let parsed = mpegts::open(bytes.as_slice()).unwrap(); + let units = &parsed.streams[0].units; + let rate = FrameRate::FPS_25; + assert_eq!(regular_ts_picture_end(units, 90_000, rate), Some(Tick(craft_time::TICKS_PER_SECOND * 2 / 25))); + assert_eq!(regular_ts_picture_end(&units[..1], 90_000, rate), None); + assert_eq!(regular_ts_picture_end(units, 89_999, rate), None); + assert_eq!(regular_ts_picture_end(units, 90_000, FrameRate::FPS_30), None); + + let mut nonkey = units.clone(); + nonkey[0].key = false; + assert_eq!(regular_ts_picture_end(&nonkey, 90_000, rate), None); + let mut missing = units.clone(); + missing[1].pts = None; + assert_eq!(regular_ts_picture_end(&missing, 90_000, rate), None); + let mut irregular = units.clone(); + let mut third = units[1]; + third.pts = Some(97_201); + irregular.push(third); + assert_eq!(regular_ts_picture_end(&irregular, 90_000, rate), None); + + let mut oversized = units.clone(); + oversized[1].size = mpegts::MAX_UNIT_BYTES + 1; + assert_eq!(regular_ts_picture_end(&oversized, 90_000, rate), None); + oversized[1].size = mpegts::MAX_UNIT_BYTES; + assert!(regular_ts_picture_end(&oversized, 90_000, rate).is_some()); + oversized[1].size = 0; + assert_eq!(regular_ts_picture_end(&oversized, 90_000, rate), None); + + let mut overflow = units.clone(); + overflow[0].pts = Some(i64::MAX - 3_600); + overflow[1].pts = Some(i64::MAX); + assert_eq!(regular_ts_picture_end(&overflow, i64::MAX - 3_600, rate), None); + } + fn pcm_s16le_bytes(sample: i16, count: usize) -> Vec { std::iter::repeat_n(sample.to_le_bytes(), count).flatten().collect() } From d46142eb69e282265364987a7deb81e3aff0b9cf Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sat, 21 Nov 2026 10:42:03 -0500 Subject: [PATCH 357/451] media: preserve container audio resampling phase across seeks (#4026) --- crates/media/src/craft_source.rs | 129 +++++++++++++++++++++---------- 1 file changed, 88 insertions(+), 41 deletions(-) diff --git a/crates/media/src/craft_source.rs b/crates/media/src/craft_source.rs index d7c050318..86caca007 100644 --- a/crates/media/src/craft_source.rs +++ b/crates/media/src/craft_source.rs @@ -1529,7 +1529,9 @@ impl MediaSource for CraftMediaSource { let audible_start = i64::try_from(i128::from(start) + edit_range.start as i128).unwrap_or(i64::MAX); let native_rate = entry.native_rate; - let (native_start, mut native_frames) = native_audio_window(audible_start, audible_frames, native_rate, sample_rate); + let Some((native_start, mut native_frames, phase)) = resampling_window(audible_start, audible_frames, native_rate, sample_rate) else { + return Ok(AudioBuffer::new(sample_rate, channels_count as u16, frames)); + }; if native_rate != sample_rate { // The resampler asks for lookahead. Do not interpolate with samples // that are stored in the track but lie beyond the edit. @@ -1581,8 +1583,12 @@ impl MediaSource for CraftMediaSource { } }; - let mut channels = - if sample_rate == native_rate { decoded } else { resample_audio(&decoded, channels_count, native_rate, sample_rate, audible_frames) }; + let mut channels = if sample_rate == native_rate { + decoded + } else { + let first_output = if audible_start < 0 { usize::try_from(audible_start.unsigned_abs()).unwrap_or(audible_frames).min(audible_frames) } else { 0 }; + resample_audio_with_phase(&decoded, native_rate, sample_rate, audible_frames, phase, first_output) + }; if audible_frames < frames { for channel in &mut channels { channel.resize(frames, 0.0); @@ -1644,17 +1650,9 @@ impl MediaSource for StandaloneAudioSource { return Ok(AudioBuffer::new(sample_rate, channels_count as u16, frames)); } let native_rate = self.native_rate; - let (native_start, native_frames, phase) = if sample_rate == native_rate { - (start, frames, 0) - } else { - let scaled = i128::from(start) * i128::from(native_rate); - let divisor = i128::from(sample_rate); - let Ok(origin) = i64::try_from(scaled.div_euclid(divisor)) else { - // An unrepresentable source position cannot address this stream. - return Ok(AudioBuffer::new(sample_rate, channels_count as u16, frames)); - }; - // Reuse the existing window size, but not its truncating start calculation. - (origin, native_audio_window(0, frames, native_rate, sample_rate).1, scaled.rem_euclid(divisor) as u64) + let Some((native_start, native_frames, phase)) = resampling_window(start, frames, native_rate, sample_rate) else { + // An unrepresentable source position cannot address this stream. + return Ok(AudioBuffer::new(sample_rate, channels_count as u16, frames)); }; let mut state = self.state.lock().unwrap_or_else(std::sync::PoisonError::into_inner); @@ -1664,14 +1662,13 @@ impl MediaSource for StandaloneAudioSource { } // Negative output positions are silence, not interpolation into frame zero. let first_output = if start < 0 { usize::try_from(start.unsigned_abs()).unwrap_or(frames).min(frames) } else { 0 }; - Ok(AudioBuffer { sample_rate, channels: resample_standalone_audio(&decoded, native_rate, sample_rate, frames, phase, first_output) }) + Ok(AudioBuffer { sample_rate, channels: resample_audio_with_phase(&decoded, native_rate, sample_rate, frames, phase, first_output) }) } } /// Step the fractional input position as an exact integer quotient and remainder; /// rounding happens only when interpolating a sample, independent of the window. -#[cfg(any(unix, windows))] -fn resample_standalone_audio(decoded: &[Vec], native_rate: u32, sample_rate: u32, frames: usize, phase: u64, first_output: usize) -> Vec> { +fn resample_audio_with_phase(decoded: &[Vec], native_rate: u32, sample_rate: u32, frames: usize, phase: u64, first_output: usize) -> Vec> { let mut out = vec![vec![0.0; frames]; decoded.len()]; let divisor = u64::from(sample_rate); let first = first_output as u128 * u128::from(native_rate) + u128::from(phase); @@ -1738,13 +1735,15 @@ fn decode_standalone_range(native_rate: u32, channels_count: usize, state: &mut Ok(drain_audio_window(&mut state.buf, &mut state.decoded_pos, channels_count, start, frames)) } -fn native_audio_window(start: i64, frames: usize, native_rate: u32, sample_rate: u32) -> (i64, usize) { +fn resampling_window(start: i64, frames: usize, native_rate: u32, sample_rate: u32) -> Option<(i64, usize, u64)> { if sample_rate == native_rate { - return (start, frames); + return Some((start, frames, 0)); } - let s0 = (i128::from(start) * i128::from(native_rate)) / i128::from(sample_rate); + let scaled = i128::from(start) * i128::from(native_rate); + let divisor = i128::from(sample_rate); + let origin = i64::try_from(scaled.div_euclid(divisor)).ok()?; let len = ((frames as u128 * u128::from(native_rate)).div_ceil(u128::from(sample_rate)) + 2) as usize; - (i64::try_from(s0).unwrap_or(0), len) + Some((origin, len, scaled.rem_euclid(divisor) as u64)) } fn drain_audio_window(buf: &mut [Vec], decoded_pos: &mut i64, channels_count: usize, start: i64, frames: usize) -> Vec> { @@ -1773,26 +1772,6 @@ fn drain_audio_window(buf: &mut [Vec], decoded_pos: &mut i64, channels_coun out } -fn resample_audio(decoded: &[Vec], channels_count: usize, native_rate: u32, sample_rate: u32, frames: usize) -> Vec> { - let mut resampled = vec![vec![0.0f32; frames]; channels_count]; - let ratio = f64::from(native_rate) / f64::from(sample_rate); - for (c, out_ch) in resampled.iter_mut().enumerate() { - let in_ch = &decoded[c]; - if in_ch.is_empty() { - continue; - } - for (i, dst) in out_ch.iter_mut().enumerate() { - let pos = i as f64 * ratio; - let idx = pos.floor() as usize; - let frac = (pos - idx as f64) as f32; - let s0 = in_ch.get(idx).copied().unwrap_or(0.0); - let s1 = in_ch.get(idx + 1).copied().unwrap_or(s0); - *dst = s0 + (s1 - s0) * frac; - } - } - resampled -} - #[cfg(any(unix, windows))] fn open_standalone_audio(name: &str, head: &[u8], source: SharedBytes) -> Option> { let ext = std::path::Path::new(name).extension().and_then(|e| e.to_str()); @@ -3688,6 +3667,74 @@ mod tests { assert_eq!(rewound[0], wide[0][..600]); } + #[test] + fn container_audio_preserves_fractional_resampling_phase_across_seeks() { + let mut mux = + avi::AviWriter::new(std::io::Cursor::new(Vec::new()), vec![avi::StreamSpec::Audio(avi::AudioSpec::pcm(48_000, 1, 16))], avi::MuxOptions::default()) + .unwrap(); + let mut pcm = Vec::with_capacity(4800 * 2); + for i in 0..4800i32 { + // Frame 4000 is exactly 0 so output frame 3675 (at 44.1 kHz) lands on 0.0. + let sample = ((i - 4000) * 5).clamp(-32767, 32767) as i16; + pcm.extend_from_slice(&sample.to_le_bytes()); + } + mux.write_chunk(0, &pcm, true).unwrap(); + let bytes: Arc<[u8]> = Arc::from(mux.finish().unwrap().into_inner()); + + let src = open_bytes("ramp.avi", bytes.clone()).expect("recognized").expect("opened"); + let resampled = src.audio(0, 256, 44_100).expect("resampled"); + + let cold = open_bytes("ramp.avi", bytes).expect("recognized").expect("opened"); + let alone = cold.audio(1, 1, 44_100).expect("single output frame"); + // Output frame 1 at 44.1 kHz is native frame 160/147 (between native 1 and 2: -19995 and -19990). + let expected = (-19995.0 + (13.0 / 147.0) * 5.0) / 32768.0; + assert!((alone.channels[0][0] - expected).abs() < 1e-7, "absolute fractional phase"); + assert_eq!(alone.channels[0][0], resampled.channels[0][1], "single-frame seek matches block"); + + let pre_roll = cold.audio(-1, 3, 44_100).expect("negative output window"); + assert_eq!(pre_roll.channels[0][0], 0.0, "silence before frame zero"); + assert_eq!(&pre_roll.channels[0][1..], &resampled.channels[0][..2], "crossing frame zero preserves phase"); + + let crossing = cold.audio(3670, 6, 44_100).expect("cross zero sample"); + let zero = cold.audio(3675, 1, 44_100).expect("zero sample alone"); + assert_eq!(crossing.channels[0][5], 0.0); + assert_eq!(crossing.channels[0][5], zero.channels[0][0]); + + let after_end = cold.audio(4410, 2, 44_100).expect("after EOF"); + assert!(after_end.channels.iter().flatten().all(|&s| s == 0.0)); + let out_of_range = cold.audio(i64::MAX / 2, 1, 1).expect("unreachable origin"); + assert!(out_of_range.channels.iter().flatten().all(|&s| s == 0.0)); + + // 48->44.1 kHz MOV edit boundary: full read, split read, and fresh seek must all agree, + // sample 6,218 must not blend in the stored tail past the edit, and sample 6,219 must be silent. + const MOV_TRIM: usize = 9_600; + const MOV_EDIT_FRAMES: usize = 1_968; + let mov_samples: Vec = (0..12_000).map(|i| 1_000 + (i % 257) as i16 * 32).collect(); + let last_in_edit = f32::from(mov_samples[MOV_TRIM + MOV_EDIT_FRAMES - 1]) / 32_768.0; + let mov_bytes: Arc<[u8]> = edited_pcm_mov( + 48_000, + &mov_samples, + vec![ + isobmff::Edit { segment_duration: 100, media_time: -1, media_rate: 0x0001_0000 }, + isobmff::Edit { segment_duration: 41, media_time: MOV_TRIM as i64, media_rate: 0x0001_0000 }, + ], + ) + .into(); + let full_mov = open_bytes("edited-pcm.mov", mov_bytes.clone()).expect("recognized").expect("opened"); + let full_window = full_mov.audio(6_200, 25, 44_100).expect("full mov read").channels.remove(0); + assert_eq!(full_window[18], last_in_edit, "sample 6,218 must not blend in the tail past the edit"); + assert_eq!(full_window[19], 0.0, "sample 6,219 must be silent"); + + let split_mov = open_bytes("edited-pcm.mov", mov_bytes.clone()).expect("recognized").expect("opened"); + let mut split_window = split_mov.audio(6_200, 18, 44_100).expect("split part 1").channels.remove(0); + split_window.extend_from_slice(&split_mov.audio(6_218, 7, 44_100).expect("split part 2").channels[0]); + assert_eq!(split_window, full_window, "split read must match full read"); + + let seek_mov = open_bytes("edited-pcm.mov", mov_bytes).expect("recognized").expect("opened"); + let seek_window = seek_mov.audio(6_218, 2, 44_100).expect("fresh seek").channels.remove(0); + assert_eq!(seek_window, full_window[18..20], "fresh seek must match full read"); + } + #[test] fn ffv1_and_apv_video_codecs_route_through_craft_video() { assert!(supports_video_codec(CodecId::Ffv1)); From b76b883e903e446be33f7fe00345da0189d959bb Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Sat, 21 Nov 2026 23:06:55 +0700 Subject: [PATCH 358/451] media: keep shared AVI playback when ProRes alpha cannot be inferred (#4035) Co-authored-by: Codex --- crates/media/src/craft_source.rs | 113 +++++++++++++++++++++---------- 1 file changed, 78 insertions(+), 35 deletions(-) diff --git a/crates/media/src/craft_source.rs b/crates/media/src/craft_source.rs index 86caca007..2ea8a1440 100644 --- a/crates/media/src/craft_source.rs +++ b/crates/media/src/craft_source.rs @@ -1242,9 +1242,10 @@ fn open_avi(name: &str, source: SharedBytes) -> Option> { }; let mut info = default_video_info(width, height, frame_rate, &video_params); if video_params.codec == CodecId::ProRes { - // The coded alpha plane is authoritative for ProRes, regardless of AVI header depth. - let chunk = video_stream.chunks.first()?; - info.has_alpha = prores_has_alpha(chunk.size, || file.read_chunk(&*source, v_idx, 0).ok())?; + // The coded alpha plane is authoritative when it can be probed. Otherwise, + // keep the old AVI default without dropping an otherwise readable stream. + let alpha = video_stream.chunks.first().and_then(|chunk| prores_has_alpha(chunk.size, || file.read_chunk(&*source, v_idx, 0).ok())); + info.has_alpha = alpha.unwrap_or(false); } let state = Mutex::new(VideoState { decoder: video_decoder, next_decode_idx: 0, gop_start_idx: 0, flushed: false, decoded: Vec::new() }); (Some(ContainerVideoPart { track_idx: v_idx, info, state }), duration) @@ -3761,48 +3762,90 @@ mod tests { assert!(TrackDecoder::with_options(&apv_params, TrackDecoderOptions { threads: Some(1), draft: false }).is_ok(), "Apv decoder"); } - #[test] - fn avi_prores_coded_alpha_parity() { + fn generated_avi_prores(with_alpha: bool, invalid_first: bool) -> Vec { use craft_video::prores::{ChromaFormat, ColorInfo as ProResColor, Encoder, EncoderConfig, Frame as ProResFrame, Interlace, Profile}; - let encode_prores_avi = |with_alpha: bool| -> Vec { - let mut cfg = EncoderConfig::new(Profile::P4444, 16, 16); - cfg.encode_alpha = with_alpha; - cfg.threads = false; - let mut enc = Encoder::with_config(cfg); - let frame = ProResFrame { - width: 16, - height: 16, - chroma: ChromaFormat::Yuv444, - bit_depth: 10, - y: vec![512; 256], - cb: vec![512; 256], - cr: vec![512; 256], - alpha: with_alpha.then(|| vec![512; 256]), - interlace: Interlace::Progressive, - color: ProResColor::default(), - aspect_ratio: 0, - frame_rate_code: 0, - }; - let pkt = enc.encode(&frame).expect("encode prores"); - let mut w = avi::AviWriter::new( - std::io::Cursor::new(Vec::new()), - vec![avi::StreamSpec::Video(avi::VideoSpec::new(*b"ap4h", 16, 16, 24, 1))], - avi::MuxOptions::default(), - ) - .expect("avi writer"); - w.write_chunk(0, &pkt, true).expect("write prores chunk"); - w.finish().expect("finish avi").into_inner() + let mut cfg = EncoderConfig::new(Profile::P4444, 16, 16); + cfg.encode_alpha = with_alpha; + cfg.threads = false; + let mut enc = Encoder::with_config(cfg); + let frame = ProResFrame { + width: 16, + height: 16, + chroma: ChromaFormat::Yuv444, + bit_depth: 10, + y: vec![512; 256], + cb: vec![512; 256], + cr: vec![512; 256], + alpha: with_alpha.then(|| vec![512; 256]), + interlace: Interlace::Progressive, + color: ProResColor::default(), + aspect_ratio: 0, + frame_rate_code: 0, }; + let pkt = enc.encode(&frame).expect("encode prores"); + let mut w = avi::AviWriter::new( + std::io::Cursor::new(Vec::new()), + vec![avi::StreamSpec::Video(avi::VideoSpec::new(*b"ap4h", 16, 16, 24, 1))], + avi::MuxOptions::default(), + ) + .expect("avi writer"); + if invalid_first { + w.write_chunk(0, &[0], true).expect("write nonempty invalid first chunk"); + } + w.write_chunk(0, &pkt, true).expect("write prores chunk"); + w.finish().expect("finish avi").into_inner() + } - let alpha_src = open_bytes("alpha.avi", Arc::from(encode_prores_avi(true))).expect("recognized").expect("opened"); + #[test] + fn avi_prores_coded_alpha_parity() { + let alpha_src = open_bytes("alpha.avi", Arc::from(generated_avi_prores(true, false))).expect("recognized").expect("opened"); assert!(alpha_src.info().video.as_ref().unwrap().has_alpha); let frame = alpha_src.video_frame(FrameRequest { time: Tick::ZERO, scale: 1.0 }).expect("decode alpha frame"); assert!(matches!(frame.data, PixelData::Yuv16 { alpha: Some(_), .. })); - let opaque_src = open_bytes("opaque.avi", Arc::from(encode_prores_avi(false))).expect("recognized").expect("opened"); + let opaque_src = open_bytes("opaque.avi", Arc::from(generated_avi_prores(false, false))).expect("recognized").expect("opened"); assert!(!opaque_src.info().video.as_ref().unwrap().has_alpha); let frame = opaque_src.video_frame(FrameRequest { time: Tick::ZERO, scale: 1.0 }).expect("decode opaque frame"); assert!(matches!(frame.data, PixelData::Yuv16 { alpha: None, .. })); } + + #[test] + fn avi_prores_unreadable_first_alpha_header_keeps_shared_playback() { + use crate::stream::{DecodedFrame, MediaSource as Opened}; + use effectcraft_project::AlphaMode; + + let bytes: Arc<[u8]> = generated_avi_prores(true, true).into(); + let demuxed = avi::open(bytes.as_ref()).expect("generated AVI"); + let video = &demuxed.streams[0]; + assert_eq!(video.codec_params().codec, CodecId::ProRes); + assert_eq!((video.rate, video.scale), (24, 1)); + assert_eq!(video.chunks.len(), 2); + assert_eq!(video.chunks[0].size, 1); + assert!(video.keyframes_known && video.chunks[1].key); + + let path = "invalid-first-prores.avi"; + let opened = crate::stream::open_bytes(path, bytes.clone()).expect("first unreadable header does not reject AVI"); + let Opened::Craft(shared) = &opened else { panic!("AVI remains on the shared reader") }; + assert!(!shared.info().video.as_ref().unwrap().has_alpha); + assert_eq!(crate::probe_bytes(path, bytes).unwrap().alpha, AlphaMode::Ignore); + + let later = effectcraft_time::Tick(craft_time::TICKS_PER_SECOND / 24); + let DecodedFrame::Craft(frame) = opened.video_frame(later, 1.0).expect("indexed second keyframe remains playable") else { + panic!("expected a shared frame"); + }; + assert_eq!((frame.width, frame.height, frame.pts.0), (16, 16, later.0)); + assert!(matches!(frame.data, PixelData::Yuv16 { alpha: Some(_), .. })); + } + + #[test] + fn oversized_prores_alpha_probe_refuses_without_reading() { + let mut read_count = 0; + let alpha = prores_has_alpha(MAX_PRORES_ALPHA_SAMPLE_BYTES + 1, || { + read_count += 1; + None + }); + assert_eq!(alpha, None); + assert_eq!(read_count, 0); + } } From 8de16e41ba9333cab009e38bfb9cf54076c79958 Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Sat, 21 Nov 2026 23:14:13 +0700 Subject: [PATCH 359/451] media: preserve APV fallback outside the guarded MP4 subset (#4039) Co-authored-by: Codex --- crates/media/Cargo.toml | 2 + crates/media/src/craft_source.rs | 420 +++++++++++++++++++++++++++++-- 2 files changed, 402 insertions(+), 20 deletions(-) diff --git a/crates/media/Cargo.toml b/crates/media/Cargo.toml index cf93c6861..5c6e728db 100644 --- a/crates/media/Cargo.toml +++ b/crates/media/Cargo.toml @@ -54,3 +54,5 @@ tempfile = { workspace = true } effectcraft-effects = { workspace = true } # Pure-Rust AAC test fixture encoding (no external ffmpeg dependency). craft-audio = { workspace = true, features = ["aac-encode"] } +# APV import parity fixtures use the existing shared encoder. +craft-video = { workspace = true, features = ["apv-encode"] } diff --git a/crates/media/src/craft_source.rs b/crates/media/src/craft_source.rs index 2ea8a1440..64d1746bd 100644 --- a/crates/media/src/craft_source.rs +++ b/crates/media/src/craft_source.rs @@ -9,8 +9,9 @@ //! - **ISO-BMFF (`MP4`/`MOV`/`M4A`, video+audio & audio-only)**: //! - Shared (`craft-media::isobmff` + `craft-video` + `craft-audio`): `H264`, `Hevc`, `Av1`, //! `Vp9`, `Vp8`, `ProRes` (coded alpha via `craft_video::prores::probe`, #3999), `Dnxhd`, -//! `Mpeg2Video`; audio `Aac`, `Alac`, `Opus`, `Ac3`, `Mp3`/`Mp2`/`Mp1`. -//! - Fallback (`filmcraft-codecs`): `Mjpeg`, `Mpeg4Video`, `Ffv1`, `Apv`, or unsupported audio. +//! `Mpeg2Video`, and strictly admitted video-only `Apv` MP4; +//! audio `Aac`, `Alac`, `Opus`, `Ac3`, `Mp3`/`Mp2`/`Mp1`. +//! - Fallback (`filmcraft-codecs`): `Mjpeg`, `Mpeg4Video`, `Ffv1`, other `Apv`, or unsupported audio. //! - **Matroska / WebM (`MKV`/`MKA`/`WebM`, video+audio & audio-only)**: //! - Shared (`craft-media::matroska` + `craft-video` + `craft-audio`): `H264`, `Hevc`, `Av1`, //! `Vp9`, `Vp8`, `ProRes`, `Dnxhd`, `Mpeg2Video`; audio `Aac`, `Alac`, `Opus`, `Ac3`, @@ -68,6 +69,12 @@ const MAX_PRORES_ALPHA_SAMPLE_BYTES: u32 = 32 * 1024 * 1024; /// existing colour policy; the ProRes header parser requires the complete declared frame. const MAX_MXF_PRORES_COLOR_SAMPLE_BYTES: u32 = 4 * 1024 * 1024; +/// Only migrate APV MP4 files with bounded complete access-unit reads. +const MAX_SHARED_APV_SAMPLE_BYTES: u32 = 32 * 1024 * 1024; +// Match the Film GOP cache's per-source decoded-plane ceiling. +const MAX_SHARED_APV_CACHE_BYTES: usize = 384 << 20; +const ISOBMFF_IDENTITY_MATRIX: [i32; 9] = [0x10000, 0, 0, 0, 0x10000, 0, 0, 0, 0x4000_0000]; + fn worker_cap() -> usize { std::thread::available_parallelism().map_or(4, |n| n.get()).clamp(1, MAX_WORKERS) } @@ -83,16 +90,7 @@ fn prores_has_alpha(packet_size: u32, read: impl FnOnce() -> Option>) -> fn supports_video_codec(codec: CodecId) -> bool { matches!( codec, - CodecId::H264 - | CodecId::Hevc - | CodecId::Av1 - | CodecId::Vp9 - | CodecId::Vp8 - | CodecId::ProRes - | CodecId::Dnxhd - | CodecId::Mpeg2Video - | CodecId::Ffv1 - | CodecId::Apv + CodecId::H264 | CodecId::Hevc | CodecId::Av1 | CodecId::Vp9 | CodecId::Vp8 | CodecId::ProRes | CodecId::Dnxhd | CodecId::Mpeg2Video | CodecId::Ffv1 ) } @@ -792,6 +790,69 @@ fn isobmff_timecode_origin(file: &Mp4File, video_idx: usize, video_rate: FrameRa i64::try_from(i128::from(tc.start_frame?) - delta / divisor).ok().filter(|&origin| origin >= 0) } +/// Admit only the APV MP4 shape whose timing and explicit color do not need the legacy +/// edit-list, snap/rebase or inferred-color policies. Inspect the existing index only; +/// APV's auxiliary alpha is per access unit and must still be decoded from each frame. +fn simple_mp4_apv_profile(file: &Mp4File, track: &isobmff::Track) -> Option { + use craft_video::apv::Profile; + if file.major_brand.0 != *b"isom" || file.fragmented || file.tracks.len() != 1 || !track.edits.is_empty() || track.edit_offset != 0 { + return None; + } + let [entry] = track.entries.as_slice() else { return None }; + let isobmff::CodecConfig::Apv(cfg) = &entry.codec else { return None }; + let video = entry.video.as_ref()?; + let profile = Profile::from_idc(cfg.profile_idc)?; + // The parser also accepts omitted/incomplete configuration fields. A simple complete + // version-1 record has a single primary-frame descriptor, optionally with four color bytes. + let record_size = if cfg.color_description_present { 22 } else { 18 }; + if !matches!(profile, Profile::P422_10 | Profile::P4444_10) + || cfg.raw_record.len() != record_size + || !cfg.raw_record.starts_with(&[1, 1, 1, 1]) + || cfg.bit_depth_minus8 != 2 + || cfg.chroma_format_idc != profile.default_chroma().idc() + || cfg.frame_width == 0 + || cfg.frame_height == 0 + || (cfg.frame_width, cfg.frame_height) != (u32::from(video.width), u32::from(video.height)) + || (track.width, track.height) != (cfg.frame_width, cfg.frame_height) + || video.clean_aperture.is_some() + || video.mastering_display.is_some() + || video.content_light.is_some() + || video.pixel_aspect.is_some_and(|par| par != (1, 1)) + || track.matrix != ISOBMFF_IDENTITY_MATRIX + || !matches!(video.color.as_ref(), Some(isobmff::ColorInfo::Nclx { primaries: 1, transfer: 1, matrix: 1, full_range: false })) + { + return None; + } + let step = track.samples.first()?.duration; + if step == 0 { + return None; + } + let rate = FrameRate::COMMON.into_iter().find(|r| i128::from(track.timescale) * i128::from(r.den) == i128::from(step) * i128::from(r.num))?; + // Coarse timing needs the legacy nominal-grid snap policy before rounding. Admit only + // tracks the Film reader itself would treat as fine, using the same tick quantization. + let den = i64::from(track.timescale); + let unit = filmcraft_time::Tick::from_rational(1, 1, den); + let rate = filmcraft_time::FrameRate::new(rate.num, rate.den); + if unit.0.saturating_mul(2) >= rate.frame_duration().0 { + return None; + } + let mut pos = 0i64; + for sample in &track.samples { + if sample.description_index != 1 + || !sample.is_sync + || sample.size == 0 + || sample.size > MAX_SHARED_APV_SAMPLE_BYTES + || sample.duration != step + || sample.pts != pos + || sample.dts != pos + { + return None; + } + pos = pos.checked_add(i64::from(step))?; + } + (u64::try_from(pos).ok()? == track.duration).then_some(profile) +} + fn open_isobmff(name: &str, source: SharedBytes) -> Option> { let file = isobmff::open(source.clone()).ok()?; let video_idx = file.tracks.iter().position(|t| t.kind == isobmff::TrackKind::Video && !t.samples.is_empty() && !t.entries.is_empty() && t.timescale > 0); @@ -810,9 +871,14 @@ fn open_isobmff(name: &str, source: SharedBytes) -> Option> let (video_info, video_state, presentation, duration) = if let Some(v_idx) = video_idx { let video_track = &file.tracks[v_idx]; let video_params = video_track.codec_params(); - if !supports_video_codec(video_params.codec) { - return None; - } + let apv_profile = if video_params.codec == CodecId::Apv { + Some(simple_mp4_apv_profile(&file, video_track)?) + } else { + if !supports_video_codec(video_params.codec) { + return None; + } + None + }; let container_color = video_track.video().and_then(|v| v.color.as_ref()).map(color_from_isobmff); let color = container_color.unwrap_or(ColorInfo::REC709); let (mut width, mut height) = video_track @@ -839,18 +905,27 @@ fn open_isobmff(name: &str, source: SharedBytes) -> Option> // The coded alpha plane is authoritative for ProRes, not the MOV sample-entry depth. let sample = video_track.samples.first()?; prores_has_alpha(sample.size, || file.read_sample(&*source, v_idx, 0).ok())? + } else if let Some(profile) = apv_profile { + profile.default_chroma().has_alpha() } else { video_track.video().is_some_and(|v| v.depth == 32) }; let frame_rate = estimate_isobmff_frame_rate(video_track); let duration = Tick::from_units(i64::try_from(video_track.duration).unwrap_or(i64::MAX), i64::from(video_track.timescale)); - let bitrate = video_track.entries.first().and_then(|e| e.bitrate).map(|b| u64::from(b.avg_bitrate)).filter(|&b| b > 0); - let codec_name = video_params.codec.name().to_string(); + let (codec_name, pixel_format, bitrate) = if let Some(profile) = apv_profile { + let format = if has_alpha { "YUVA 4:4:4:4 10-bit" } else { "YUV 4:2:2 10-bit" }; + let bytes: u128 = video_track.samples.iter().map(|sample| u128::from(sample.size)).sum(); + let bitrate = (bytes * 8 * u128::from(video_track.timescale)).checked_div(u128::from(video_track.duration)).and_then(|b| u64::try_from(b).ok()); + (profile.name().into(), format.into(), bitrate) + } else { + let bitrate = video_track.entries.first().and_then(|e| e.bitrate).map(|b| u64::from(b.avg_bitrate)).filter(|&b| b > 0); + (video_params.codec.name().to_string(), String::new(), bitrate) + }; let video_decoder = match TrackDecoder::with_options(&video_params, TrackDecoderOptions { threads: Some(worker_cap()), draft: false }) { Ok(d) => d, Err(e) => return Some(Err(MediaError::Decode(e.to_string()))), }; - let v_info = VideoStreamInfo { width, height, frame_rate, par, codec: codec_name, pixel_format: String::new(), color, has_alpha, bitrate, hdr: None }; + let v_info = VideoStreamInfo { width, height, frame_rate, par, codec: codec_name, pixel_format, color, has_alpha, bitrate, hdr: None }; let v_state = Mutex::new(VideoState { decoder: video_decoder, next_decode_idx: 0, gop_start_idx: 0, flushed: false, decoded: Vec::new() }); (Some(v_info), Some(v_state), FramePresentation { container_color, par, rotation, aperture }, duration) } else { @@ -866,6 +941,7 @@ fn open_isobmff(name: &str, source: SharedBytes) -> Option> }; let start_timecode = video_idx.zip(video_info.as_ref()).and_then(|(idx, info)| isobmff_timecode_origin(&file, idx, info.frame_rate)); + let apv_cache = video_idx.is_some_and(|idx| matches!(file.tracks[idx].codec(), Some(isobmff::CodecConfig::Apv(_)))).then(ApvFrameCache::default); let container = ContainerFile::Isobmff(file); let (audio_tracks, audio_infos) = open_audio_tracks(&container, &*source, audio_candidates)?; if video_info.is_none() && audio_tracks.is_empty() { @@ -884,7 +960,16 @@ fn open_isobmff(name: &str, source: SharedBytes) -> Option> file_size: Some(source.len()), }; - Some(Ok(Arc::new(CraftMediaSource { info, source, file: container, video_track_idx: video_idx, presentation, video: video_state, audio_tracks }))) + Some(Ok(Arc::new(CraftMediaSource { + info, + source, + file: container, + video_track_idx: video_idx, + presentation, + video: video_state, + audio_tracks, + apv_cache, + }))) } fn open_matroska(name: &str, source: SharedBytes) -> Option> { @@ -978,6 +1063,7 @@ fn open_matroska(name: &str, source: SharedBytes) -> Option presentation: FramePresentation { container_color, par, rotation, aperture: None }, video: video_state, audio_tracks, + apv_cache: None, }))) } @@ -1023,6 +1109,7 @@ fn finish_container_source( presentation: FramePresentation { container_color: None, par: (1, 1), rotation: 0, aperture: None }, video: video_state, audio_tracks, + apv_cache: None, }))) } @@ -1192,6 +1279,7 @@ fn open_parsed_mxf(name: &str, source: SharedBytes, file: mxf::MxfFile) -> Optio presentation, video: video_state, audio_tracks, + apv_cache: None, }))) } @@ -1442,6 +1530,83 @@ struct CraftMediaSource { presentation: FramePresentation, video: Option>, audio_tracks: Vec, + apv_cache: Option, +} + +#[derive(Default)] +struct ApvFrameCache { + entries: Mutex>, + decode_gate: Mutex<()>, +} + +fn apv_cache_fits_pair(a: usize, b: usize) -> bool { + a.saturating_add(b) <= MAX_SHARED_APV_CACHE_BYTES +} + +impl ApvFrameCache { + fn get(&self, pts: i64) -> Option> { + let entries = self.entries.lock().unwrap_or_else(std::sync::PoisonError::into_inner); + entries.iter().find(|entry| entry.pts == pts).map(|entry| entry.frame.clone()) + } + + fn get_or_decode(&self, pts: i64, decode: impl FnOnce() -> Result) -> Result> { + if let Some(frame) = self.get(pts) { + return Ok(frame); + } + // The short cache lock is not held while waiting or decoding. The decoder and + // pixel adapter must be strictly serial here: Rayon could reenter the same source. + let _gate = self.decode_gate.lock().unwrap_or_else(std::sync::PoisonError::into_inner); + if let Some(frame) = self.get(pts) { + return Ok(frame); + } + let frame = Arc::new(decode()?); + let mut entries = self.entries.lock().unwrap_or_else(std::sync::PoisonError::into_inner); + if entries.len() == 2 { + entries.remove(0); + } + if entries.first().is_some_and(|other| !apv_cache_fits_pair(other.frame.byte_size(), frame.byte_size())) { + entries.clear(); + } + // Like Film, keep the current frame even if it alone exceeds the cache ceiling. + entries.push(CachedFrame { pts, draft: false, frame: frame.clone() }); + Ok(frame) + } +} + +impl CraftMediaSource { + fn apv_frame(&self, track: &isobmff::Track, video_idx: usize, cache: &ApvFrameCache, time: Tick) -> Result> { + // The admitted fine timebase uses Film's nearest-unit lookup, not the floor used + // by other shared routes. Track selection timing is distinct from the frame's pts. + let lookup = filmcraft_time::Tick(time.0.max(0)).to_rational_round(1, i64::from(track.timescale)); + let target = track.sample_at_presentation_time(lookup).ok_or_else(|| MediaError::Decode("no video samples".into()))?; + let pts = track.samples[target].pts; + cache.get_or_decode(pts, || { + if filmcraft_media::cancel::cancelled() { + return Err(MediaError::Cancelled); + } + // This is an in-memory copy or positional file read, then a serial decode + // and in-thread plane conversion; none can schedule a nested render. + let packet = self.file.read_sample(&*self.source, video_idx, target)?; + let options = craft_video::apv::DecodeOptions { threads: false, ..Default::default() }; + let mut decoded = craft_video::apv::decode_frame_with(&packet, &options).map_err(|e| MediaError::Decode(e.to_string()))?; + if decoded.chroma == craft_video::apv::ChromaFormat::Monochrome { + // A primary AU with an unexpected monochrome profile is still playable in Film: + // its adapter expands it to neutral 4:4:4 without dropping any auxiliary alpha. + let neutral = 1u16 << decoded.bit_depth.saturating_sub(1); + decoded.chroma = craft_video::apv::ChromaFormat::Yuv444; + decoded.cb = vec![neutral; decoded.y.len()]; + decoded.cr = vec![neutral; decoded.y.len()]; + } + let decoded = DecodedVideoFrame::try_from(decoded).map_err(|e| MediaError::Decode(e.to_string()))?; + let mut frame = to_craft_frame(decoded, self.presentation, Tick::ZERO)?; + // Film's explicit nclx wins for APV YUV, even when the AU says full range. + // The shared converter preserves both coded and per-AU auxiliary alpha. + if let Some(color) = self.presentation.container_color { + frame.color = color; + } + Ok(frame) + }) + } } impl MediaSource for CraftMediaSource { @@ -1453,6 +1618,12 @@ impl MediaSource for CraftMediaSource { let (Some(video_idx), Some(video_mutex)) = (self.video_track_idx, &self.video) else { return Err(MediaError::NoStream("video")); }; + if let Some(cache) = &self.apv_cache + && let ContainerFile::Isobmff(file) = &self.file + && let Some(track) = file.tracks.get(video_idx) + { + return self.apv_frame(track, video_idx, cache, req.time); + } let (target_idx, target_pts) = self.file.target_sample(video_idx, req.time).ok_or_else(|| MediaError::Decode("no video samples".into()))?; let want_draft = req.scale < 0.99; @@ -2455,6 +2626,215 @@ mod tests { OpusFixture { bytes, file: ContainerFile::Matroska(Box::new(file)), offsets, params, delay: OPUS_CODEC_DELAY_NS as u64 } } + #[test] + fn apv_cache_counts_both_frames_without_allocating_8k_planes() { + let yuva_8k = 7_680usize * 4_320 * 4 * 2; + assert!(apv_cache_fits_pair(yuva_8k, MAX_SHARED_APV_CACHE_BYTES - yuva_8k)); + assert!(!apv_cache_fits_pair(yuva_8k, yuva_8k)); + assert!(!apv_cache_fits_pair(usize::MAX, 1)); + } + + #[test] + fn apv_cache_releases_entry_lock_and_does_not_cache_errors_or_duplicate_a_hit() { + let cache = ApvFrameCache::default(); + let failed = cache.get_or_decode(1, || { + assert!(cache.entries.try_lock().is_ok()); + assert!(matches!(cache.decode_gate.try_lock(), Err(std::sync::TryLockError::WouldBlock))); + Err(MediaError::Cancelled) + }); + assert!(matches!(failed, Err(MediaError::Cancelled))); + let frame = cache + .get_or_decode(1, || { + assert!(cache.entries.try_lock().is_ok()); + Ok(VideoFrame { + width: 1, + height: 1, + data: PixelData::Yuv16 { + planes: [Arc::new(vec![200]), Arc::new(vec![512]), Arc::new(vec![512])], + chroma: Chroma::C444, + bits: 10, + alpha: None, + }, + color: ColorInfo::REC709, + par: (1, 1), + pts: Tick::ZERO, + }) + }) + .unwrap(); + let hit = cache.get_or_decode(1, || panic!("a cache hit must not decode again")).unwrap(); + assert!(Arc::ptr_eq(&frame, &hit)); + } + + struct ApvFixture { + bytes: Arc<[u8]>, + y: Vec>, + alpha: Vec>>, + } + + fn generated_apv_mp4(brand: isobmff::Brand, coded_alpha: bool, incomplete_config: bool, coarse_timebase: bool, rec709: bool) -> ApvFixture { + use std::io::Cursor; + + use craft_video::apv::{Encoder, EncoderConfig, Frame, Profile, decode_frame}; + use isobmff::{ApvConfig, Mp4Writer, SampleEntry, TrackConfig, WriteSample, WriterOptions}; + + let profile = if coded_alpha { Profile::P4444_10 } else { Profile::P422_10 }; + let mut config = EncoderConfig::new(profile, 16, 16); + config.qp = Some(16); + // The APV header and apvC both disagree with the authoritative explicit nclx. + config.color_description_present = true; + config.color.primaries = 9; + config.color.transfer = 16; + config.color.matrix = 9; + config.color.full_range = true; + let mut encoder = Encoder::with_config(config).unwrap(); + let mut record = encoder.decoder_config_record(); + if incomplete_config { + // The legacy decoder takes its dimensions from the AU rather than this record. + record[8..12].fill(0); + } + let mut entry = SampleEntry::apv(ApvConfig::from_record(record).unwrap(), 16, 16); + entry.video.as_mut().unwrap().color = Some(if rec709 { + isobmff::ColorInfo::Nclx { primaries: 1, transfer: 1, matrix: 1, full_range: false } + } else { + isobmff::ColorInfo::Nclx { primaries: 9, transfer: 16, matrix: 9, full_range: true } + }); + let mut writer = Mp4Writer::new(Cursor::new(Vec::new()), WriterOptions::new(brand)).unwrap(); + let (timescale, duration) = if coarse_timebase { (25, 1) } else { (25_000, 1_000) }; + let idx = writer.add_track(TrackConfig::new(entry, timescale)).unwrap(); + + let mut expected_y = Vec::new(); + let mut expected_alpha = Vec::new(); + for (i, y) in [160, 720].into_iter().enumerate() { + let mut frame = Frame::new(16, 16, profile.default_chroma(), 10, coded_alpha); + frame.y.fill(y); + if let Some(alpha) = frame.alpha.as_mut() { + alpha.fill(if i == 0 { 256 } else { 768 }); + } + let mut au = encoder.encode(&frame).unwrap(); + let mut alpha = if coded_alpha { decode_frame(&au).unwrap().alpha } else { None }; + if i == 1 && !coded_alpha { + let mono_profile = Profile::P400_10; + let mut mono_encoder = Encoder::new(mono_profile, 16, 16).unwrap(); + let mut mono = Frame::new(16, 16, mono_profile.default_chroma(), 10, false); + mono.y.fill(480); + let alpha_au = mono_encoder.encode(&mono).unwrap(); + alpha = Some(decode_frame(&alpha_au).unwrap().y); + // The first generated monochrome PBU becomes the matching auxiliary alpha. + let len = u32::from_be_bytes(alpha_au[4..8].try_into().unwrap()); + au.extend_from_slice(&len.to_be_bytes()); + au.push(27); + au.extend_from_slice(&alpha_au[9..8 + len as usize]); + } + expected_y.push(decode_frame(&au).unwrap().y); + expected_alpha.push(alpha); + writer.write_sample(idx, WriteSample { data: &au, duration, composition_offset: 0, is_sync: true }).unwrap(); + } + ApvFixture { bytes: writer.finish().unwrap().into_inner().into(), y: expected_y, alpha: expected_alpha } + } + + fn assert_apv_seek_parity(shared: &crate::stream::MediaSource, film: &crate::stream::MediaSource, step: i64, y: &[Vec], alpha: &[Option>]) { + use crate::stream::DecodedFrame; + + let boundary = step - craft_time::TICKS_PER_SECOND / 50_000; + for (at, i) in [(step, 1), (0, 0), (boundary - 1, 0), (boundary, 1), (step - 1, 1), (0, 0)] { + let time = effectcraft_time::Tick(at); + let DecodedFrame::Craft(new) = shared.video_frame(time, 1.0).unwrap() else { panic!("shared frame") }; + let DecodedFrame::Film(old) = film.video_frame(time, 1.0).unwrap() else { panic!("legacy frame") }; + assert_eq!(new.color, ColorInfo::REC709); + assert_eq!(old.color, filmcraft_color::ColorInfo::REC709); + // Film carries the presentation position in its cache key, not its APV pixel payload. + assert_eq!(old.pts.0, 0); + assert_eq!(new.pts.0, old.pts.0); + let PixelData::Yuv16 { planes: new_planes, bits, alpha: new_alpha, .. } = &new.data else { panic!("APV 10-bit YUV frame") }; + let filmcraft_frame::PixelData::Yuv16 { planes: old_planes, bits: old_bits, alpha: old_alpha, .. } = &old.data else { + panic!("legacy APV 10-bit YUV frame") + }; + assert_eq!(*bits, 10); + assert_eq!(bits, old_bits); + assert_eq!(new_planes[0].as_ref(), &y[i]); + for (new, old) in new_planes.iter().zip(old_planes) { + assert_eq!(new.as_ref(), old.as_ref()); + } + assert_eq!(new_alpha.as_deref(), alpha[i].as_ref()); + assert_eq!(new_alpha.as_deref(), old_alpha.as_deref()); + } + } + + #[test] + fn simple_apv_mp4_import_preserves_film_color_alpha_and_backward_seek() { + use crate::stream::MediaSource as Opened; + use effectcraft_project::{AlphaMode, ColorSpace}; + + let step = craft_time::TICKS_PER_SECOND / 25; + for coded_alpha in [false, true] { + let ApvFixture { bytes, y, alpha } = generated_apv_mp4(isobmff::Brand::Mp4, coded_alpha, false, false, true); + let path = "paired-apv.mp4"; + assert_ne!(y[0], y[1], "regression requires visibly different frames"); + assert_eq!(alpha[0].is_some(), coded_alpha); + assert!(alpha[1].is_some(), "late auxiliary/coded alpha fixture must be live"); + let direct_film = filmcraft_codecs::open_bytes(path, bytes.clone()).unwrap(); + let old_footage = crate::probe::footage_from_info(path, direct_film.info()); + let shared = crate::stream::open_bytes(path, bytes.clone()).unwrap(); + let Opened::Craft(source) = &shared else { panic!("admitted APV must use shared decoding") }; + let footage = crate::probe_bytes(path, bytes).unwrap(); + assert_eq!((footage.width, footage.height), (16, 16)); + assert_eq!(footage.frame_rate, old_footage.frame_rate); + assert_eq!(footage.native_rate.unwrap_or(footage.frame_rate), old_footage.native_rate.unwrap_or(old_footage.frame_rate)); + assert_eq!(footage.duration, old_footage.duration); + assert_eq!(footage.duration.0, step * 2); + assert_eq!(footage.pixel_aspect, old_footage.pixel_aspect); + assert_eq!(footage.file_timecode, None); + assert_eq!(footage.file_timecode, old_footage.file_timecode); + assert_eq!(footage.alpha, if coded_alpha { AlphaMode::Straight } else { AlphaMode::Ignore }); + assert_eq!(footage.alpha, old_footage.alpha); + assert_eq!(footage.color_profile, Some(ColorSpace::Rec709)); + assert_eq!(footage.color_profile, old_footage.color_profile); + assert_eq!(footage.codec, old_footage.codec); + let shared_video = source.info().video.as_ref().unwrap(); + let film_video = direct_film.info().video.as_ref().unwrap(); + assert_eq!(shared_video.pixel_format, film_video.pixel_format); + assert_eq!(shared_video.bitrate, film_video.bitrate); + + let film = Opened::Film(direct_film); + assert_apv_seek_parity(&shared, &film, step, &y, &alpha); + } + } + + #[test] + fn apv_mov_incomplete_apvc_and_coarse_timebase_keep_the_playable_film_route() { + use crate::stream::MediaSource as Opened; + for (brand, incomplete, coarse) in [(isobmff::Brand::Mov, false, false), (isobmff::Brand::Mp4, true, false), (isobmff::Brand::Mp4, false, true)] { + let bytes = generated_apv_mp4(brand, false, incomplete, coarse, true).bytes; + let parsed = isobmff::open(bytes.as_ref()).unwrap(); + assert_eq!(parsed.is_quicktime, brand == isobmff::Brand::Mov); + // Byte routing, independent of the apparent extension. + let opened = crate::stream::open_bytes("unadmitted-apv.mp4", bytes).unwrap(); + assert!(matches!(opened, Opened::Film(_))); + assert_eq!(opened.video_frame(effectcraft_time::Tick::ZERO, 1.0).unwrap().width(), 16); + } + } + + #[test] + fn clean_pq_apv_mp4_keeps_the_playable_film_route() { + use crate::stream::MediaSource as Opened; + use effectcraft_project::ColorSpace; + + // Same fine-timebase isom encode as the admitted test, differing only in nclx. + let bytes = generated_apv_mp4(isobmff::Brand::Mp4, false, false, false, false).bytes; + let parsed = isobmff::open(bytes.as_ref()).unwrap(); + assert_eq!(parsed.major_brand.0, *b"isom"); + assert_eq!(parsed.tracks[0].timescale, 25_000); + assert!(matches!( + parsed.tracks[0].video().and_then(|video| video.color.as_ref()), + Some(isobmff::ColorInfo::Nclx { primaries: 9, transfer: 16, matrix: 9, full_range: true }) + )); + let path = "pq-apv.mp4"; + let opened = crate::stream::open_bytes(path, bytes.clone()).unwrap(); + assert!(matches!(opened, Opened::Film(_))); + assert_eq!(opened.video_frame(effectcraft_time::Tick::ZERO, 1.0).unwrap().width(), 16); + assert_eq!(crate::probe_bytes(path, bytes).unwrap().color_profile, Some(ColorSpace::Rec2100Pq)); + } + fn generated_opus_mp4(lead: usize) -> OpusFixture { use std::io::Cursor; @@ -3739,7 +4119,7 @@ mod tests { #[test] fn ffv1_and_apv_video_codecs_route_through_craft_video() { assert!(supports_video_codec(CodecId::Ffv1)); - assert!(supports_video_codec(CodecId::Apv)); + assert!(!supports_video_codec(CodecId::Apv), "APV requires the guarded ISO-BMFF admission path"); let template = craft_video::ffv1::Frame { width: 16, From c22f034bf3638f8c10e263c8913327b9727aaf59 Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Sat, 21 Nov 2026 23:30:25 +0700 Subject: [PATCH 360/451] media: preserve Matroska FFV1 metadata without CodecPrivate (#4041) Co-authored-by: Codex --- crates/media/src/craft_source.rs | 87 ++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/crates/media/src/craft_source.rs b/crates/media/src/craft_source.rs index 64d1746bd..db07f56f5 100644 --- a/crates/media/src/craft_source.rs +++ b/crates/media/src/craft_source.rs @@ -993,6 +993,11 @@ fn open_matroska(name: &str, source: SharedBytes) -> Option if !video_track.frames_readable() { return None; } + // Native FFV1 without CodecPrivate cannot initialize the shared v3 decoder. + // Keep FilmCraft's metadata at open; an unsupported read stays a playback error. + if video_track.codec_private.is_empty() && matches!(&video_track.codec, matroska::Codec::Other(id) if id == "V_FFV1") { + return None; + } let video_params = video_track.codec_params(); if !supports_video_codec(video_params.codec) { return None; @@ -3147,6 +3152,88 @@ mod tests { assert_eq!(c.range, Range::Limited); } + #[test] + #[cfg(any(unix, windows))] + fn matroska_ffv1_missing_config_keeps_legacy_probe() { + use crate::stream::{DecodedFrame, MediaSource as Opened}; + use craft_video::ffv1::{Colorspace, Encoder, EncoderConfig, Frame}; + + let mut frame = Frame { + width: 16, + height: 16, + colorspace: Colorspace::YCbCr, + bit_depth: 8, + chroma_shift: (1, 1), + planes: vec![vec![48; 256], vec![96; 64], vec![160; 64]], + }; + let encoder = Encoder::new(&frame, EncoderConfig::default()).expect("FFV1 encoder"); + let first = encoder.encode(&frame).expect("first FFV1 keyframe"); + frame.planes[0].fill(192); + let second = encoder.encode(&frame).expect("second FFV1 keyframe"); + + // The control changes only the container configuration, not the two coded keyframes. + let mux = |configuration| -> Arc<[u8]> { + let mut track = matroska::TrackSpec::new(matroska::TrackKind::Video, "V_FFV1"); + track.video_size = Some((16, 16)); + track.default_duration_ns = Some(40_000_000); + track.codec_private = configuration; + let mut mux = matroska::MkvWriter::new(std::io::Cursor::new(Vec::new()), vec![track], matroska::MuxOptions::default()).expect("MKV writer"); + mux.write_frame(0, 0, true, &first, None).expect("write first keyframe"); + mux.write_frame(0, 40_000_000, true, &second, None).expect("write second keyframe"); + mux.finish().expect("finish MKV").into_inner().into() + }; + let configured = mux(encoder.config_record()); + let missing = mux(Vec::new()); + let directory = tempfile::tempdir().expect("FFV1 fixture directory"); + let configured_path = directory.path().join("configured.mkv"); + let missing_path = directory.path().join("no-config.mkv"); + std::fs::write(&configured_path, &configured).expect("write configured fixture"); + std::fs::write(&missing_path, &missing).expect("write no-config fixture"); + + let configured_probe = crate::probe(&configured_path).expect("public probe of configured FFV1"); + assert!(configured_probe.has_video); + assert_eq!((configured_probe.width, configured_probe.height), (16, 16)); + assert_eq!((configured_probe.frame_rate.num, configured_probe.frame_rate.den), (25, 1)); + let opened = crate::stream::open_source(&configured_path).expect("open in place").0.expect("open configured FFV1"); + assert!(matches!(&opened, Opened::Craft(_))); + let zero = effectcraft_time::Tick::ZERO; + let later = effectcraft_time::Tick(craft_time::TICKS_PER_SECOND / 25); + for (pts, luma) in [(zero, 48), (later, 192), (zero, 48)] { + let frame = match opened.video_frame(pts, 1.0).expect("decode configured FFV1") { + DecodedFrame::Craft(frame) => Some(frame), + DecodedFrame::Film(_) => None, + } + .expect("decoded through the shared FFV1 reader"); + assert_eq!(frame.pts.0, pts.0); + assert!(matches!(&frame.data, PixelData::Yuv8 { planes, chroma: Chroma::C420, alpha: None } + if planes[0].as_slice() == [luma; 256] && planes[1].as_slice() == [96; 64] && planes[2].as_slice() == [160; 64])); + } + + let name = "no-config.mkv"; + let legacy = filmcraft_codecs::open_bytes(name, missing.clone()).expect("legacy FFV1 metadata opens without config"); + let legacy_probe = crate::probe::footage_from_info(name, legacy.info()); + let legacy_error = legacy + .video_frame(filmcraft_media::FrameRequest { time: filmcraft_time::Tick::ZERO, scale: 1.0 }) + .err() + .map(crate::MediaError::from) + .expect("FilmCraft does not play FFV1"); + assert!(matches!(&legacy_error, crate::MediaError::Unsupported(message) if message.contains("no decoder"))); + + let missing_probe = crate::probe(&missing_path).expect("public probe preserves metadata without config"); + let memory_probe = crate::probe_bytes(name, missing).expect("public memory probe preserves metadata without config"); + for probe in [missing_probe, memory_probe] { + assert!(probe.has_video); + assert_eq!((probe.width, probe.height), (legacy_probe.width, legacy_probe.height)); + assert_eq!(probe.frame_rate, legacy_probe.frame_rate); + assert_eq!(probe.duration, legacy_probe.duration); + assert_eq!(probe.codec, legacy_probe.codec); + } + let opened = crate::stream::open_source(&missing_path).expect("open in place").0.expect("open FFV1 metadata without config"); + assert!(matches!(&opened, Opened::Film(_))); + let err = opened.video_frame(zero, 1.0).err().expect("unsupported is deferred to playback"); + assert_eq!(err.to_string(), legacy_error.to_string()); + } + #[test] fn rotate_frame_swaps_dimensions_and_orients_planes() { let frame = VideoFrame { From f4d45dfef3a280d96aff1d4eb5f1950160adefc2 Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Sat, 21 Nov 2026 23:35:49 +0700 Subject: [PATCH 361/451] media: fence fractional MOV PCM edits on the packet clock (#778) (#4031) Co-authored-by: Codex Co-authored-by: FredApps --- crates/media/src/craft_source.rs | 126 ++++++++++++++++++++++++++++--- 1 file changed, 114 insertions(+), 12 deletions(-) diff --git a/crates/media/src/craft_source.rs b/crates/media/src/craft_source.rs index db07f56f5..eb5c38a33 100644 --- a/crates/media/src/craft_source.rs +++ b/crates/media/src/craft_source.rs @@ -332,6 +332,34 @@ impl ContainerFile { let leading = u128::from(leading_duration); offset(leading)..offset(leading + u128::from(media.segment_duration)) } + + /// Exclusive native packet position of the PCM edit's end. Unlike audio_edit_range, + /// this follows the demuxer's truncated packet placement, not the movie output clock. + fn pcm_edit_packet_end(&self, track_idx: usize, native_rate: u32) -> Option { + let Self::Isobmff(file) = self else { return None }; + let track = file.tracks.get(track_idx)?; + // pcm_chunked alone describes how the sample table was indexed from entry one. + // With several descriptions the decoder may have selected a different entry. + let [entry] = track.entries.as_slice() else { return None }; + if !matches!(entry.codec, isobmff::CodecConfig::Pcm(_)) + || !track.pcm_chunked + || native_rate == 0 + || track.timescale != native_rate + || file.timescale == 0 + { + return None; + } + let (leading, media) = unit_rate_media_edit(&track.edits)?; + let movie_clock = u128::from(file.timescale); + let native_clock = u128::from(native_rate); + let packet_start = i128::from(track.edit_offset).checked_add(i128::from(media.media_time))?; + let expected_start = i128::try_from(u128::from(leading) * native_clock / movie_clock).ok()?; + if packet_start != expected_start { + return None; + } + let duration = i128::try_from((u128::from(media.segment_duration) * native_clock).div_ceil(movie_clock)).ok()?; + i64::try_from(packet_start.checked_add(duration)?).ok() + } } /// Where the container puts one audio packet, for [`contiguous_starts`]. @@ -1717,18 +1745,34 @@ impl MediaSource for CraftMediaSource { let decoded = match &entry.backend { AudioBackend::Decoder { seek_preroll_samples, state: state_mutex } => { - let mut state = state_mutex.lock().unwrap_or_else(std::sync::PoisonError::into_inner); - decode_audio_range( - &self.file, - &*self.source, - entry.track_idx, - native_rate, - channels_count, - *seek_preroll_samples, - &mut state, - native_start, - native_frames, - )? + let packet_frames = self + .file + .pcm_edit_packet_end(entry.track_idx, native_rate) + .map_or(native_frames, |end| usize::try_from((i128::from(end) - i128::from(native_start)).max(0)).unwrap_or(usize::MAX).min(native_frames)); + let mut channels = if packet_frames == 0 && native_frames != 0 { + vec![Vec::new(); channels_count] + } else { + let mut state = state_mutex.lock().unwrap_or_else(std::sync::PoisonError::into_inner); + decode_audio_range( + &self.file, + &*self.source, + entry.track_idx, + native_rate, + channels_count, + *seek_preroll_samples, + &mut state, + native_start, + packet_frames, + )? + }; + // A direct read still owes the full output window. For a resampled read, keep + // the clipped buffer short so its last valid sample remains the one-sided guard. + if sample_rate == native_rate && packet_frames < native_frames { + for channel in &mut channels { + channel.resize(native_frames, 0.0); + } + } + channels } AudioBackend::MxfPcm { presented_start, presented_len } => { if filmcraft_media::cancel::cancelled() { @@ -3116,6 +3160,64 @@ mod tests { } } + #[test] + fn mov_pcm_fractional_empty_edit_excludes_packet_tail() { + const RATE: u32 = 44_100; + let mut samples = vec![0i16; 1_024]; + samples[600] = 16_384; + samples[601] = -8_192; + let mux = |leading_ms| { + edited_pcm_mov( + RATE, + &samples, + vec![ + isobmff::Edit { segment_duration: leading_ms, media_time: -1, media_rate: 0x0001_0000 }, + isobmff::Edit { segment_duration: 2, media_time: 512, media_rate: 0x0001_0000 }, + ], + ) + }; + let bytes: Arc<[u8]> = mux(9).into(); + let demuxed = isobmff::open(bytes.as_ref()).expect("generated PCM MOV"); + assert_eq!(demuxed.timescale, 1_000); + assert_eq!(demuxed.tracks[0].timescale, RATE); + assert!(demuxed.tracks[0].pcm_chunked); + assert_eq!(demuxed.tracks[0].edit_offset, -116); + let source = open_bytes("fractional-edit.mov", bytes).expect("shared MOV route").expect("open mapped PCM"); + let read = |start, frames, rate| source.audio(start, frames, rate).expect("direct shared PCM read").channels.remove(0); + + // The output range still includes native position 485. The source edit ends + // before raw frame 601 (position 485), but includes raw frame 600 (position 484). + assert_eq!(read(484, 3, RATE), [0.5, 0.0, 0.0]); + assert_eq!(read(485, 2, RATE), [0.0, 0.0], "packet-content-only tail"); + assert_eq!(read(484, 1, RATE), [0.5], "backward seek retains the last visible source sample"); + assert_eq!(read(968, 4, RATE * 2), [0.5, 0.5, 0.0, 0.0], "do not interpolate with the excluded sample"); + + let aligned = open_bytes("aligned-edit.mov", mux(10).into()).expect("shared MOV").expect("aligned clocks"); + assert_eq!(aligned.audio(529, 3, RATE).expect("aligned PCM").channels[0], [0.5, 0.0, 0.0]); + let unedited = open_bytes("no-edit.mov", edited_pcm_mov(RATE, &samples, Vec::new()).into()).expect("shared MOV").expect("no edit"); + assert_eq!(unedited.audio(600, 2, RATE).expect("unedited PCM").channels[0], [0.5, -0.25]); + + let mut mixed = demuxed.clone(); + let track = &mut mixed.tracks[0]; + let mut non_pcm = track.entries[0].clone(); + non_pcm.codec = isobmff::CodecConfig::Mp3; + track.entries.push(non_pcm.clone()); + track.samples[0].description_index = 2; + assert_ne!(track.codec_params().codec, CodecId::Pcm, "first sample selects the other description"); + assert_eq!(ContainerFile::Isobmff(mixed.clone()).pcm_edit_packet_end(0, RATE), None, "mixed descriptions"); + let track = &mut mixed.tracks[0]; + track.entries = vec![non_pcm]; + track.samples[0].description_index = 1; + assert_eq!(ContainerFile::Isobmff(mixed).pcm_edit_packet_end(0, RATE), None, "sole non-PCM description"); + + let file = ContainerFile::Isobmff(demuxed.clone()); + assert_eq!(file.pcm_edit_packet_end(0, RATE), Some(485)); + assert_eq!(file.pcm_edit_packet_end(0, 48_000), None, "different track and native clocks"); + let mut parsed = demuxed; + parsed.tracks[0].edits[1].segment_duration = u64::MAX; + assert_eq!(ContainerFile::Isobmff(parsed).pcm_edit_packet_end(0, RATE), None, "unrepresentable native end"); + } + #[test] fn vui_overrides_container_color_and_falls_back_when_unspecified() { let container = color_from_isobmff(&isobmff::ColorInfo::Nclx { primaries: 9, transfer: 16, matrix: 9, full_range: false }); From fae7ad76412f29b104a4f070373020f70bd9b479 Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Sun, 22 Nov 2026 00:17:12 +0700 Subject: [PATCH 362/451] media: avoid nested ProRes decode work under the MOV reader lock (#4028) Co-authored-by: FredApps Co-authored-by: Codex --- crates/media/src/craft_source.rs | 97 +++++++++++++++++++++++++++++++- 1 file changed, 95 insertions(+), 2 deletions(-) diff --git a/crates/media/src/craft_source.rs b/crates/media/src/craft_source.rs index eb5c38a33..a6fe63270 100644 --- a/crates/media/src/craft_source.rs +++ b/crates/media/src/craft_source.rs @@ -51,7 +51,7 @@ use craft_media_source::{ }; use craft_time::{FrameRate, Tick}; use craft_video::frame::{ColorFamily, ColorTags, Plane, Samples, Subsampling, VideoFrame as DecodedVideoFrame}; -use craft_video::{TrackDecoder, TrackDecoderOptions}; +use craft_video::{TrackDecoder, TrackDecoderOptions, VideoError, prores}; /// Maximum worker threads per `TrackDecoder` instance. const MAX_WORKERS: usize = 8; @@ -1516,6 +1516,26 @@ struct VideoState { decoded: Vec, } +fn decode_track_packet( + decoder: &mut TrackDecoder, + is_isobmff: bool, + packet: &[u8], + pts: i64, + decode_prores: impl FnOnce(&[u8], &prores::DecodeOptions) -> prores::Result, +) -> std::result::Result, VideoError> { + if !is_isobmff || decoder.codec() != CodecId::ProRes { + return decoder.decode(packet, pts); + } + // The caller holds this source's VideoState lock. Do not let a ProRes band + // job yield to another request for the same source on the decode Rayon pool. + // ProRes packets carry a complete picture: TrackDecoder's ProRes arm adds + // the PTS to this same conversion and has no draft, reset or reorder work. + let options = prores::DecodeOptions { threads: false, ..Default::default() }; + let mut frame = DecodedVideoFrame::try_from(decode_prores(packet, &options)?)?; + frame.pts = Some(pts); + Ok(vec![frame]) +} + struct AudioTrackState { decoder: AudioTrackDecoder, audio_starts: AudioStarts, @@ -1681,6 +1701,7 @@ impl MediaSource for CraftMediaSource { } let sample_count = self.file.sample_count(video_idx); + let is_isobmff = matches!(&self.file, ContainerFile::Isobmff(_)); while !state.decoded.iter().any(|c| c.pts >= target_pts && c.draft == want_draft) { if filmcraft_media::cancel::cancelled() { return Err(MediaError::Cancelled); @@ -1689,7 +1710,8 @@ impl MediaSource for CraftMediaSource { let idx = state.next_decode_idx; let pts = self.file.sample_pts(video_idx, idx); let pkt = self.file.read_sample(&*self.source, video_idx, idx)?; - let frames = state.decoder.decode(&pkt, pts).map_err(|e| MediaError::Decode(e.to_string()))?; + let frames = + decode_track_packet(&mut state.decoder, is_isobmff, &pkt, pts, prores::decode_frame_with).map_err(|e| MediaError::Decode(e.to_string()))?; state.next_decode_idx = idx + 1; push_decoded(&mut state.decoded, frames, want_draft, self.presentation, &self.file, video_idx)?; } else if !state.flushed { @@ -3651,6 +3673,77 @@ mod tests { assert_eq!(resolve_color(ColorTags::UNSPECIFIED, color_from_mxf(&picture)), ColorInfo::REC709); } + #[test] + fn shared_prores_mov_uses_serial_packets_with_edited_frame_and_alpha_parity() { + use isobmff::{Brand, Edit, Mp4Writer, SampleEntry, TrackConfig, WriteSample, WriterOptions}; + + let mut encoder = prores::Encoder::new(prores::Profile::P4444, 64, 48); + let mut input = prores::Frame::new(64, 48, prores::ChromaFormat::Yuv444, 12, true).expect("ProRes frame"); + let mut entry = SampleEntry::prores(isobmff::FourCc(*b"ap4h"), 64, 48); + entry.video.as_mut().expect("visual entry").pixel_aspect = Some((4, 3)); + let mut config = TrackConfig::new(entry, 1_000); + config.edits = vec![ + Edit { segment_duration: 20, media_time: -1, media_rate: 0x0001_0000 }, + Edit { segment_duration: 120, media_time: 0, media_rate: 0x0001_0000 }, + ]; + let mut writer = Mp4Writer::new(std::io::Cursor::new(Vec::new()), WriterOptions::new(Brand::Mov)).expect("MOV writer"); + let track = writer.add_track(config).expect("picture track"); + let mut packets = Vec::new(); + for (luma, alpha) in [(512, 1_024), (1_536, 2_048), (3_072, 3_072)] { + input.y.fill(luma); + input.alpha.as_mut().expect("alpha input").fill(alpha); + let packet = encoder.encode(&input).expect("ProRes packet"); + writer.write_sample(track, WriteSample { data: &packet, duration: 40, composition_offset: 0, is_sync: true }).expect("MOV sample"); + packets.push(packet); + } + let bytes = writer.finish().expect("MOV finish").into_inner(); + let demuxed = isobmff::open(bytes.as_slice()).expect("MOV demux"); + assert_eq!(demuxed.tracks[track].edit_offset, 20); + let params = demuxed.tracks[track].codec_params(); + let crate::stream::MediaSource::Craft(source) = crate::stream::open_bytes("serial.mov", bytes.into()).expect("MOV opener") else { + panic!("generated ProRes cannot fall back to FilmCraft"); + }; + assert!(source.info().video.as_ref().expect("video").has_alpha); + + let mut decoder = TrackDecoder::new(¶ms).expect("ProRes decoder"); + let mut passed_serial_options = false; + let selected = decode_track_packet(&mut decoder, true, &packets[1], 40, |packet, options| { + assert!(!options.threads); + assert!(options.bit_depth.is_none()); + passed_serial_options = true; + prores::decode_frame_with(packet, options) + }) + .expect("serial packet"); + assert!(passed_serial_options, "the ISO-BMFF helper must select explicit serial decoding"); + assert_eq!(selected[0].pts, Some(40)); + + // Seek late, then backwards, then forwards. The original parallel TrackDecoder is an + // independent oracle for every plane, including alpha, of each chosen compressed frame. + let presentation = FramePresentation { container_color: None, par: (4, 3), rotation: 0, aperture: None }; + for (index, raw_pts, presented) in [(2, 80, 100), (0, 0, 20), (1, 40, 60)] { + let pts = Tick::from_units(presented, 1_000); + let actual = source.video_frame(FrameRequest::full(pts)).expect("shared MOV frame"); + let packet = &packets[index]; + let mut parallel = + decode_track_packet(&mut decoder, false, packet, raw_pts, |_, _| panic!("expected TrackDecoder")).expect("normal parallel packet"); + let expected = to_craft_frame(parallel.pop().expect("one frame"), presentation, pts).expect("parallel frame"); + assert!(parallel.is_empty()); + assert_eq!((actual.width, actual.height, actual.pts, actual.par, actual.color), (64, 48, pts, (4, 3), expected.color)); + let PixelData::Yuv16 { planes, bits, alpha: Some(alpha), .. } = &actual.data else { panic!("expected 12-bit ProRes with alpha") }; + let PixelData::Yuv16 { planes: expected_planes, bits: expected_bits, alpha: Some(expected_alpha), .. } = &expected.data else { + panic!("expected parallel ProRes with alpha"); + }; + assert_eq!((*bits, *expected_bits), (12, 12)); + assert_eq!(planes, expected_planes); + assert_eq!(alpha, expected_alpha); + assert!(alpha[0] > 0 && alpha[0] < 4_095); + } + + let regular_error = decoder.decode(&[], 0).expect_err("empty ProRes packet").to_string(); + let locked_error = decode_track_packet(&mut decoder, true, &[], 0, prores::decode_frame_with).expect_err("empty ProRes packet").to_string(); + assert_eq!(locked_error, regular_error); + } + #[test] fn mxf_descriptor_aspect_reaches_shared_probe_and_frame() { use craft_video::prores::{ChromaFormat, Encoder, Frame, Profile}; From eb5fa36bcfc74abc6dbceb2fd6656f044eb46950 Mon Sep 17 00:00:00 2001 From: Terra854 Date: Sun, 22 Nov 2026 01:53:34 +0800 Subject: [PATCH 363/451] media: preserve Matroska display aspect on import (#4029) --- crates/media/src/craft_source.rs | 63 +++++++++++++++++++++++++++++++- 1 file changed, 61 insertions(+), 2 deletions(-) diff --git a/crates/media/src/craft_source.rs b/crates/media/src/craft_source.rs index a6fe63270..bdba3747a 100644 --- a/crates/media/src/craft_source.rs +++ b/crates/media/src/craft_source.rs @@ -2497,7 +2497,9 @@ fn primaries_from_code(c: u8) -> Option { fn matroska_par(video: Option<&matroska::VideoInfo>, width: u32, height: u32) -> (u32, u32) { let Some(v) = video else { return (1, 1) }; - if v.display_unit == 0 + // RFC 9559 §5.1.4.1.28.14 defines 0 as pixels and 3 as a display ratio. + // Use the coded raster because this reader presents frames without Matroska cropping. + if matches!(v.display_unit, 0 | 3) && let (Some(dw), Some(dh)) = (v.display_width, v.display_height) && dw > 0 && dh > 0 @@ -2505,7 +2507,7 @@ fn matroska_par(video: Option<&matroska::VideoInfo>, width: u32, height: u32) -> && height > 0 && (dw != width || dh != height) { - return (dw * height, dh * width); + return dw.checked_mul(height).zip(dh.checked_mul(width)).unwrap_or((1, 1)); } (1, 1) } @@ -3744,6 +3746,63 @@ mod tests { assert_eq!(locked_error, regular_error); } + #[test] + fn matroska_display_aspect_reaches_shared_probe_and_frame() { + use craft_media::matroska::{ebml, element_ids::*}; + use craft_video::prores::{ChromaFormat, Encoder, Frame, Profile}; + + let element = |id, payload: &[u8]| { + let mut bytes = Vec::new(); + ebml::write_id(&mut bytes, id); + ebml::write_size(&mut bytes, payload.len() as u64, 1); + bytes.extend_from_slice(payload); + bytes + }; + + // Generate a single ProRes frame and wrap it using the public Matroska element IDs. + let profile = Profile::Hq; + let frame = Frame::new(16, 12, ChromaFormat::Yuv422, 10, false).expect("ProRes frame"); + let packet = Encoder::new(profile, 16, 12).encode(&frame).expect("encode ProRes"); + let mut block = vec![0x81, 0, 0, 0x80]; // Track 1, timestamp 0, keyframe. + // Matroska omits the eight-byte ProRes size and 'icpf' prefix. + block.extend_from_slice(&packet[8..]); + let cluster = element(CLUSTER, &[element(TIMESTAMP, &[0]), element(SIMPLE_BLOCK, &block)].concat()); + let header = element(EBML, &element(DOC_TYPE, b"matroska")); + + let cases = [(3, (16_u32, 9_u32), (4, 3)), (0, (32, 18), (4, 3)), (4, (16, 9), (1, 1)), (3, (u32::MAX, 1), (1, 1))]; + for (unit, display_size, expected) in cases { + let video = [ + element(PIXEL_WIDTH, &[16]), + element(PIXEL_HEIGHT, &[12]), + element(DISPLAY_UNIT, &[unit]), + element(DISPLAY_WIDTH, &display_size.0.to_be_bytes()), + element(DISPLAY_HEIGHT, &display_size.1.to_be_bytes()), + ] + .concat(); + let track = [ + element(TRACK_NUMBER, &[1]), + element(TRACK_UID, &[1]), + element(TRACK_TYPE, &[1]), + element(CODEC_ID, b"V_PRORES"), + element(CODEC_PRIVATE, &profile.fourcc()), + element(VIDEO, &video), + ] + .concat(); + let tracks = element(TRACKS, &element(TRACK_ENTRY, &track)); + let segment = element(SEGMENT, &[tracks, cluster.clone()].concat()); + let bytes: Arc<[u8]> = [header.clone(), segment].concat().into(); + + let footage = crate::probe::probe_bytes("aspect.mkv", bytes.clone()).expect("public Matroska probe"); + assert_eq!(footage.codec, "ProRes", "must use the shared Matroska route"); + assert_eq!((footage.width, footage.height), (16, 12)); + assert_eq!(footage.pixel_aspect, f64::from(expected.0) / f64::from(expected.1), "display unit {unit}"); + + let source = open_bytes("aspect.mkv", bytes).expect("recognized Matroska").expect("shared Matroska"); + let decoded = source.video_frame(FrameRequest { time: Tick::ZERO, scale: 1.0 }).expect("decode frame"); + assert_eq!(decoded.par.0 * expected.1, decoded.par.1 * expected.0, "display unit {unit}"); + } + } + #[test] fn mxf_descriptor_aspect_reaches_shared_probe_and_frame() { use craft_video::prores::{ChromaFormat, Encoder, Frame, Profile}; From 8bc329ac19dbaefd0279136501d59f8aa2d9cb68 Mon Sep 17 00:00:00 2001 From: Terra854 Date: Sun, 22 Nov 2026 01:53:37 +0800 Subject: [PATCH 364/451] media: preserve Matroska presentation duration (#4032) --- crates/media/src/craft_source.rs | 72 +++++++++++++++++++++++++++++++- 1 file changed, 70 insertions(+), 2 deletions(-) diff --git a/crates/media/src/craft_source.rs b/crates/media/src/craft_source.rs index bdba3747a..804c6ba73 100644 --- a/crates/media/src/craft_source.rs +++ b/crates/media/src/craft_source.rs @@ -2520,8 +2520,9 @@ fn matroska_duration(file: &MkvFile, track: &matroska::Track) -> Tick { let ns = (d * file.info.timestamp_scale as f64).round() as i64; return Tick::from_units(ns, 1_000_000_000); } - let last_end = track.samples.last().map_or(0, |s| s.pts.saturating_add(i64::try_from(s.duration).unwrap_or(0))); - Tick::from_units(track.ticks_to_ns(last_end), 1_000_000_000) + // Blocks are indexed in coding order, so a future reference can precede a B-picture. + let presentation_end = track.samples.iter().map(|s| s.pts.saturating_add(i64::try_from(s.duration).unwrap_or(0))).max().unwrap_or(0); + Tick::from_units(track.ticks_to_ns(presentation_end), 1_000_000_000) } fn tick_to_units(t: Tick, timescale: u32) -> i64 { @@ -4293,6 +4294,73 @@ mod tests { std::iter::repeat_n(sample.to_le_bytes(), count).flatten().collect() } + #[test] + fn matroska_duration_follows_presentation_order() { + use craft_media::matroska::{MkvWriter, MuxOptions, TrackKind, TrackSpec, ebml, element_ids}; + use craft_video::h264::{Encoder, EncoderConfig, PacketFormat, Profile, YuvFrame}; + use std::io::Cursor; + + fn child(data: &[u8], id: u32) -> ebml::Elem<'_> { + ebml::Children::new(data).find(|element| element.id == id).expect("Matroska element") + } + + // Generate three distinct pictures, with the B-picture coded after its future reference. + const PERIOD_NS: i64 = 40_000_000; + let mut cfg = EncoderConfig::new(16, 16, 25, 1); + cfg.profile = Profile::High; + cfg.bframes = 1; + cfg.format = PacketFormat::LengthPrefixed; + let mut encoder = Encoder::new(cfg).expect("H.264 encoder"); + let mut track = TrackSpec::new(TrackKind::Video, "V_MPEG4/ISO/AVC"); + track.codec_private = encoder.avcc(); + track.video_size = Some((16, 16)); + track.default_duration_ns = Some(PERIOD_NS as u64); + let mut mux = MkvWriter::new(Cursor::new(Vec::new()), vec![track], MuxOptions::default()).expect("Matroska writer"); + let mut packets = Vec::new(); + for (pts, luma) in [32, 96, 160].into_iter().enumerate() { + let pic = YuvFrame { y: &[luma; 256], u: &[128; 64], v: &[128; 64], y_stride: 16, uv_stride: 8 }; + packets.extend(encoder.encode(&pic, pts as i64).expect("encode picture")); + } + packets.extend(encoder.flush()); + for packet in packets { + mux.write_frame(0, packet.pts * PERIOD_NS, packet.keyframe, &packet.data, None).expect("write picture"); + } + let mut bytes = mux.finish().expect("finish Matroska").into_inner(); + + let (offset, header_len, payload_len) = { + let segment = child(&bytes, element_ids::SEGMENT); + let info = child(segment.data, element_ids::INFO); + let duration = child(info.data, element_ids::DURATION); + let offset = segment.offset + segment.header_len + info.offset + info.header_len + duration.offset; + (offset, duration.header_len, duration.data.len()) + }; + let end = offset + header_len + payload_len; + // Give the declaration a distinct value to check that it takes precedence. + bytes[offset + header_len..end].copy_from_slice(&160.0_f64.to_be_bytes()); + let declared = crate::probe::probe_bytes("duration.mkv", Arc::from(bytes.clone())).expect("probe declared duration"); + assert_eq!(declared.duration.0, Tick::from_units(160, 1_000).0); + + // Replace Duration with equally sized padding to keep all indexed file offsets. + let mut padding = Vec::new(); + ebml::write_id(&mut padding, element_ids::VOID); + let size_len = header_len - padding.len(); + ebml::write_size(&mut padding, payload_len as u64, size_len); + padding.resize(end - offset, 0); + bytes[offset..end].copy_from_slice(&padding); + let file = matroska::open(bytes.as_slice()).expect("demux Matroska"); + assert_eq!(file.info.duration, None); + assert_eq!(file.tracks[0].samples.iter().map(|sample| sample.pts).collect::>(), [0, 80, 40]); + + let bytes: Arc<[u8]> = bytes.into(); + let footage = crate::probe::probe_bytes("duration.mkv", bytes.clone()).expect("probe inferred duration"); + assert_eq!(footage.codec, "H.264", "must use the shared route"); + assert_eq!(footage.duration.0, Tick::from_units(120, 1_000).0); + let source = open_bytes("duration.mkv", bytes).expect("recognized Matroska").expect("shared Matroska"); + let time = Tick::from_units(80, 1_000); + let picture = source.video_frame(FrameRequest { time, scale: 1.0 }).expect("read final presented picture"); + assert_eq!(picture.pts, time); + } + #[test] fn matroska_durationless_lace_variable_pcm_preserves_all_blocks() { use std::io::Cursor; From 4e97ebe0ae1a79f14f8318fdf395ba4d70969a0c Mon Sep 17 00:00:00 2001 From: Terra854 Date: Sun, 22 Nov 2026 01:53:40 +0800 Subject: [PATCH 365/451] media: include the final AAC transport packet in duration (#4033) --- crates/media/src/craft_source.rs | 64 +++++++++++++++++++++++++++++++- 1 file changed, 62 insertions(+), 2 deletions(-) diff --git a/crates/media/src/craft_source.rs b/crates/media/src/craft_source.rs index 804c6ba73..80b7cd366 100644 --- a/crates/media/src/craft_source.rs +++ b/crates/media/src/craft_source.rs @@ -676,6 +676,7 @@ where audio_tracks.push(AudioTrackEntry { track_idx: idx, native_rate, + fixed_packet_samples: fixed_samples, backend: AudioBackend::Decoder { seek_preroll_samples, state: Mutex::new(AudioTrackState { decoder: dec, audio_starts, next_sample: 0, decoded_pos: initial_pos, buf: Vec::new() }), @@ -1115,10 +1116,18 @@ fn finish_container_source( duration: Tick, audio_candidates: Vec<(usize, usize, CodecParams, u64)>, ) -> Option> { - let (audio_tracks, audio_infos) = open_audio_tracks(&container, &*source, audio_candidates)?; + let (mut audio_tracks, audio_infos) = open_audio_tracks(&container, &*source, audio_candidates)?; if video.is_none() && audio_tracks.is_empty() { return None; } + let duration = if video.is_none() + && let ContainerFile::Mpeg { file, .. } = &container + && matches!(file.format, mpegts::Format::Ts { .. }) + { + audio_tracks.iter_mut().filter_map(|entry| adts_track_end(file, entry)).fold(duration, |end, track_end| end.max(track_end)) + } else { + duration + }; let kind = if video.is_some() { MediaKind::Movie } else { MediaKind::AudioOnly }; let (video_track_idx, video_info, video_state) = match video { Some(v) => (Some(v.track_idx), Some(v.info), Some(v.state)), @@ -1146,6 +1155,17 @@ fn finish_container_source( }))) } +/// Use the same packet starts and sample count as playback to include the final ADTS packet. +fn adts_track_end(file: &mpegts::File, entry: &mut AudioTrackEntry) -> Option { + if file.streams.get(entry.track_idx)?.codec != mpegts::Codec::AacAdts { + return None; + } + let samples = entry.fixed_packet_samples?; + let AudioBackend::Decoder { state, .. } = &mut entry.backend else { return None }; + let last_start = *state.get_mut().ok()?.audio_starts.positions.iter().max()?; + Some(Tick::from_units(last_start.saturating_add(samples), i64::from(entry.native_rate))) +} + fn mxf_sound_window(track: &mxf::EssenceTrack) -> (u64, u64) { let (sp_num, sp_den) = track.samples_per_edit_unit(); let sp_den = i128::from(sp_den.max(1)); @@ -1239,7 +1259,12 @@ fn open_parsed_mxf(name: &str, source: SharedBytes, file: mxf::MxfFile) -> Optio let channels = sound.channels.max(1); let (presented_start, presented_len) = mxf_sound_window(t); audio_infos.push(AudioStreamInfo { sample_rate: rate, channels, codec: t.codec.codec_id().name().to_string(), bits_per_sample: Some(sound.bits) }); - audio_tracks.push(AudioTrackEntry { track_idx: idx, native_rate: rate, backend: AudioBackend::MxfPcm { presented_start, presented_len } }); + audio_tracks.push(AudioTrackEntry { + track_idx: idx, + native_rate: rate, + fixed_packet_samples: None, + backend: AudioBackend::MxfPcm { presented_start, presented_len }, + }); } let (video_info, video_state, presentation, duration) = if let Some(v_idx) = video_idx { @@ -1554,6 +1579,7 @@ enum AudioBackend { struct AudioTrackEntry { track_idx: usize, native_rate: u32, + fixed_packet_samples: Option, backend: AudioBackend, } @@ -3423,6 +3449,40 @@ mod tests { } } + #[test] + fn adts_transport_duration_includes_the_final_packet() { + use craft_audio::aac::{Encoder, EncoderConfig}; + use mpegts::mux::{Codec, Config, Frame, Muxer, Stream}; + + const RATE: u32 = 48_000; + const SAMPLES: i64 = 1024; + const PTS_PER_PACKET: i64 = 1_920; + const ORIGIN_PTS: i64 = 90_000; + let mut encoder = Encoder::new(EncoderConfig::cbr(RATE, 1, 96_000).with_adts(true)).expect("ADTS encoder"); + let samples: Vec = (0..8192).map(|i| (f64::from(i) * 0.13).sin() as f32 * 0.4).collect(); + let mut packets = encoder.encode(&[&samples]); + packets.extend(encoder.flush()); + let three_packets = packets.get(..3).expect("three encoded packets"); + + for last_slot in [2, 3] { + let mut mux = Muxer::new(Vec::new(), Config::default(), &[Stream::new(0x100, Codec::AacAdts)]).expect("TS muxer"); + for (data, slot) in three_packets.iter().zip([0, 1, last_slot]) { + let pts = ORIGIN_PTS + slot * PTS_PER_PACKET; + mux.write_frame(0, &Frame { data, pts, dts: None, key: true }).expect("write ADTS packet"); + } + let bytes: Arc<[u8]> = mux.finish().expect("finish TS").into(); + let source = open_bytes("audio.ts", bytes.clone()).expect("recognized TS").expect("shared TS audio"); + let final_packet = source.audio(last_slot * SAMPLES, SAMPLES as usize, RATE).expect("read final packet"); + assert!(final_packet.channels[0].iter().any(|sample| sample.abs() > 0.02), "the final packet carries audible samples"); + + let footage = crate::probe::probe_bytes("audio.ts", bytes).expect("public TS probe"); + assert!(footage.has_audio && !footage.has_video); + assert_eq!(footage.codec, "AAC"); + let end = Tick::from_units((last_slot + 1) * SAMPLES, i64::from(RATE)); + assert_eq!(footage.duration.0, end.0, "final packet at slot {last_slot}"); + } + } + #[test] fn plane_stride_and_container_helpers_cover_variants() { if let Ok(p8) = Plane::new(2, 2, 4, 8, Samples::U8(vec![1, 2, 9, 9, 3, 4])) { From fcf35f3f9ffea13e49b985343d2f42f3741342e1 Mon Sep 17 00:00:00 2001 From: Terra854 Date: Sun, 22 Nov 2026 01:53:44 +0800 Subject: [PATCH 366/451] media: derive AVI video duration from indexed frames (#4037) --- crates/media/src/craft_source.rs | 56 ++++++++++++++++++++++++++++++-- 1 file changed, 54 insertions(+), 2 deletions(-) diff --git a/crates/media/src/craft_source.rs b/crates/media/src/craft_source.rs index 80b7cd366..3512107f1 100644 --- a/crates/media/src/craft_source.rs +++ b/crates/media/src/craft_source.rs @@ -1380,8 +1380,10 @@ fn open_avi(name: &str, source: SharedBytes) -> Option> { let (width, height) = video_stream.video.as_ref().map_or((0, 0), |v| (v.width.unsigned_abs(), v.height.unsigned_abs())); let fps = f64::from(video_stream.rate) / f64::from(video_stream.scale.max(1)); let frame_rate = snap_common_fps(fps).unwrap_or_else(|| FrameRate::new(i64::from(video_stream.rate), i64::from(video_stream.scale))); - let total_units = i64::from(video_stream.length.max(video_stream.chunks.len() as u32)); - let duration = Tick::from_units(total_units.saturating_mul(i64::from(video_stream.scale)), i64::from(video_stream.rate.max(1))); + // Seeking treats each indexed video chunk as one frame. A stale header + // length can describe pictures beyond the end of the index. + let frames = i64::try_from(video_stream.chunks.len()).unwrap_or(i64::MAX); + let duration = Tick::from_rational(frames, i64::from(video_stream.scale), i64::from(video_stream.rate)); let video_decoder = match TrackDecoder::with_options(&video_params, TrackDecoderOptions { threads: Some(worker_cap()), draft: false }) { Ok(d) => d, Err(e) => return Some(Err(MediaError::Decode(e.to_string()))), @@ -4181,6 +4183,56 @@ mod tests { assert!(contiguous_starts([], 512).is_empty()); } + #[test] + fn avi_video_duration_uses_indexed_frames() { + use craft_video::prores::{ChromaFormat, ColorInfo as ProResColor, Encoder, EncoderConfig, Frame as ProResFrame, Interlace, Profile}; + + let mut config = EncoderConfig::new(Profile::P4444, 16, 16); + config.encode_alpha = false; + config.threads = false; + let mut encoder = Encoder::with_config(config); + let stream = avi::StreamSpec::Video(avi::VideoSpec::new(*b"ap4h", 16, 16, 30_000, 1_001)); + let mut writer = avi::AviWriter::new(std::io::Cursor::new(Vec::new()), vec![stream], avi::MuxOptions::default()).expect("AVI writer"); + for luma in [256, 768] { + let frame = ProResFrame { + width: 16, + height: 16, + chroma: ChromaFormat::Yuv444, + bit_depth: 10, + y: vec![luma; 256], + cb: vec![512; 256], + cr: vec![512; 256], + alpha: None, + interlace: Interlace::Progressive, + color: ProResColor::default(), + aspect_ratio: 0, + frame_rate_code: 0, + }; + writer.write_chunk(0, &encoder.encode(&frame).expect("encode ProRes"), true).expect("write picture"); + } + let mut bytes = writer.finish().expect("finish AVI").into_inner(); + // dwLength is 32 bytes into the strh payload, after the 8-byte chunk header. + let length_offset = bytes.windows(4).position(|tag| tag == b"strh").expect("stream header") + 8 + 32; + let frame_period = Tick::from_rational(1, 1_001, 30_000); + for declared_length in [1u32, 2, 100] { + bytes[length_offset..length_offset + 4].copy_from_slice(&declared_length.to_le_bytes()); + let stream = &avi::open(bytes.as_slice()).expect("demux fixture").streams[0]; + assert_eq!(stream.length, declared_length); + assert_eq!(stream.chunks.len(), 2); + let input: Arc<[u8]> = Arc::from(bytes.as_slice()); + let footage = crate::probe::probe_bytes("indexed.avi", input.clone()).expect("public probe"); + assert_eq!(footage.codec, "ProRes"); + assert_eq!(footage.duration, effectcraft_time::Tick::from_rational(2, 1_001, 30_000), "declared length {declared_length}"); + + let source = open_bytes("indexed.avi", input).expect("recognized AVI").expect("shared AVI"); + let last = source.video_frame(FrameRequest { time: frame_period, scale: 1.0 }).expect("seek to last picture"); + let PixelData::Yuv16 { planes: [y, ..], .. } = &last.data else { + panic!("expected the decoded ProRes luma plane"); + }; + assert!(y[0] > 512, "expected the brighter second picture"); + } + } + #[test] fn avi_and_mpeg_helpers_and_in_memory_route() { assert_eq!(tick_to_rational_units(Tick(craft_time::TICKS_PER_SECOND), 24, 1), 24); From 6e3459a8ebc88cce8362fece73ed44f657e2fb7f Mon Sep 17 00:00:00 2001 From: Terra854 Date: Sun, 22 Nov 2026 01:53:47 +0800 Subject: [PATCH 367/451] media: use the shared reader for uncompressed RGB AVI (#4050) --- crates/media/src/craft_source.rs | 59 +++++++++-- crates/media/src/craft_source/raw_avi.rs | 96 ++++++++++++++++++ .../media/src/craft_source/raw_avi_tests.rs | 99 +++++++++++++++++++ 3 files changed, 246 insertions(+), 8 deletions(-) create mode 100644 crates/media/src/craft_source/raw_avi.rs create mode 100644 crates/media/src/craft_source/raw_avi_tests.rs diff --git a/crates/media/src/craft_source.rs b/crates/media/src/craft_source.rs index 3512107f1..48a6b679e 100644 --- a/crates/media/src/craft_source.rs +++ b/crates/media/src/craft_source.rs @@ -25,9 +25,9 @@ //! - **AVI / MPEG-TS / MPEG-PS**: //! - Shared (`craft-media::avi`, `craft-media::mpegts` + `craft-video` + `craft-audio`): //! `H264`, `Hevc`, `Mpeg2Video`, `Av1`, `Vp9`, `Vp8`, `ProRes`, `Dnxhd`; audio `Aac`, -//! `Ac3`/`Eac3`, `Mp3`/`Mp2`/`Mp1`, `Pcm`. +//! `Ac3`/`Eac3`, `Mp3`/`Mp2`/`Mp1`, `Pcm`. AVI also accepts complete 24/32-bit `BI_RGB` streams. //! - Fallback (`filmcraft-codecs`): unsupported codecs (`Mjpeg`, `Mpeg4Video`, `Ffv1`, `Theora`, -//! `Apv`, raw RGB AVI) or unsupported audio. +//! `Apv`, other raw AVI layouts) or unsupported audio. //! - **Other containers & standalone audio**: //! - Shared (`craft_audio::Decoder` with `decode-native`): standalone `WAV`, `AIFF`, `MP3`/`MP2`/`MP1`, //! `AAC` (ADTS), `AC-3`, and `Ogg` (`Opus`). @@ -53,6 +53,9 @@ use craft_time::{FrameRate, Tick}; use craft_video::frame::{ColorFamily, ColorTags, Plane, Samples, Subsampling, VideoFrame as DecodedVideoFrame}; use craft_video::{TrackDecoder, TrackDecoderOptions, VideoError, prores}; +mod raw_avi; +use raw_avi::RawAvi; + /// Maximum worker threads per `TrackDecoder` instance. const MAX_WORKERS: usize = 8; @@ -955,7 +958,7 @@ fn open_isobmff(name: &str, source: SharedBytes) -> Option> Err(e) => return Some(Err(MediaError::Decode(e.to_string()))), }; let v_info = VideoStreamInfo { width, height, frame_rate, par, codec: codec_name, pixel_format, color, has_alpha, bitrate, hdr: None }; - let v_state = Mutex::new(VideoState { decoder: video_decoder, next_decode_idx: 0, gop_start_idx: 0, flushed: false, decoded: Vec::new() }); + let v_state = VideoState::packet(video_decoder); (Some(v_info), Some(v_state), FramePresentation { container_color, par, rotation, aperture }, duration) } else { let duration = audio_candidates @@ -1064,7 +1067,7 @@ fn open_matroska(name: &str, source: SharedBytes) -> Option bitrate: None, hdr: None, }; - let v_state = Mutex::new(VideoState { decoder: video_decoder, next_decode_idx: 0, gop_start_idx: 0, flushed: false, decoded: Vec::new() }); + let v_state = VideoState::packet(video_decoder); (Some(v_info), Some(v_state), container_color, par, rotation, duration) } else { let duration = audio_candidates.iter().map(|&(idx, _, _, _)| matroska_duration(&file, &file.tracks[idx])).max().unwrap_or(Tick::ZERO); @@ -1299,7 +1302,7 @@ fn open_parsed_mxf(name: &str, source: SharedBytes, file: mxf::MxfFile) -> Optio bitrate: None, hdr: None, }; - let v_state = Mutex::new(VideoState { decoder: video_decoder, next_decode_idx: 0, gop_start_idx: 0, flushed: false, decoded: Vec::new() }); + let v_state = VideoState::packet(video_decoder); (Some(v_info), Some(v_state), FramePresentation { container_color, par, rotation: 0, aperture: None }, duration) } else { let duration = audio_tracks @@ -1371,6 +1374,25 @@ fn open_avi(name: &str, source: SharedBytes) -> Option> { return None; } + if let Some(idx) = video_idx + && let Some(raw) = RawAvi::new(&file.streams[idx]) + { + // Shared AVI audio positions are relative to the first chunk. Keep the + // legacy path for a track with a separate stream start. + if audio_candidates.iter().any(|&(audio, _, _, _)| file.streams[audio].start != 0) { + return None; + } + let duration = audio_candidates + .iter() + .map(|&(audio, _, _, _)| { + let s = &file.streams[audio]; + Tick::from_units(i64::from(s.length).saturating_mul(i64::from(s.scale.max(1))), i64::from(s.rate.max(1))) + }) + .fold(raw.duration(file.streams[idx].chunks.len()), Tick::max); + let video = ContainerVideoPart { track_idx: idx, info: raw.info(&file.streams[idx]), state: Mutex::new(VideoState::RawAvi(raw)) }; + return finish_container_source(name, "avi", source, ContainerFile::Avi(Box::new(file)), Some(video), duration, audio_candidates); + } + let (video, duration) = if let Some(v_idx) = video_idx { let video_stream = &file.streams[v_idx]; let video_params = video_stream.codec_params(); @@ -1395,7 +1417,7 @@ fn open_avi(name: &str, source: SharedBytes) -> Option> { let alpha = video_stream.chunks.first().and_then(|chunk| prores_has_alpha(chunk.size, || file.read_chunk(&*source, v_idx, 0).ok())); info.has_alpha = alpha.unwrap_or(false); } - let state = Mutex::new(VideoState { decoder: video_decoder, next_decode_idx: 0, gop_start_idx: 0, flushed: false, decoded: Vec::new() }); + let state = VideoState::packet(video_decoder); (Some(ContainerVideoPart { track_idx: v_idx, info, state }), duration) } else { let duration = audio_candidates @@ -1516,7 +1538,7 @@ fn open_mpeg(name: &str, fmt: mpegts::Format, source: SharedBytes) -> Option, } -struct VideoState { +enum VideoState { + Packet(PacketVideoState), + RawAvi(RawAvi), +} + +impl VideoState { + fn packet(decoder: TrackDecoder) -> Mutex { + Mutex::new(Self::Packet(PacketVideoState { decoder, next_decode_idx: 0, gop_start_idx: 0, flushed: false, decoded: Vec::new() })) + } +} + +struct PacketVideoState { decoder: TrackDecoder, next_decode_idx: usize, gop_start_idx: usize, @@ -1709,6 +1742,13 @@ impl MediaSource for CraftMediaSource { let want_draft = req.scale < 0.99; let mut state = video_mutex.lock().unwrap_or_else(std::sync::PoisonError::into_inner); + let state = match &mut *state { + VideoState::Packet(state) => state, + VideoState::RawAvi(raw) => { + let ContainerFile::Avi(file) = &self.file else { return Err(MediaError::NoStream("AVI video")) }; + return raw.frame(file, &*self.source, video_idx, target_idx); + } + }; if let Some(hit) = state.decoded.iter().find(|c| c.pts == target_pts && c.draft == want_draft) { return Ok(hit.frame.clone()); } @@ -2626,6 +2666,9 @@ fn estimate_matroska_frame_rate(track: &matroska::Track) -> FrameRate { FrameRate::FPS_30 } +#[cfg(all(test, any(unix, windows)))] +mod raw_avi_tests; + #[cfg(test)] mod tests { use super::*; diff --git a/crates/media/src/craft_source/raw_avi.rs b/crates/media/src/craft_source/raw_avi.rs new file mode 100644 index 000000000..76dd8f517 --- /dev/null +++ b/crates/media/src/craft_source/raw_avi.rs @@ -0,0 +1,96 @@ +use std::sync::Arc; + +use craft_color::ColorInfo; +use craft_frame::VideoFrame; +use craft_media::{ByteSource, avi}; +use craft_media_source::{MediaError, Result, VideoStreamInfo}; +use craft_time::{FrameRate, Tick}; +use craft_video::raw_video::{self, RawFormat, RawPixels}; + +pub(super) struct RawAvi { + format: RawFormat, + width: u32, + height: u32, + bottom_up: bool, + payload_bytes: usize, + rate: FrameRate, + cached: Option<(usize, Arc)>, +} + +impl RawAvi { + pub(super) fn new(stream: &avi::Stream) -> Option { + let bitmap = stream.video.as_ref()?; + let format = raw_video::RawFormat::from_avi(bitmap.compression, bitmap.bit_count)?; + if !matches!(format, RawFormat::Bgr24 | RawFormat::Bgrx32) || stream.start != 0 { + return None; + } + let width = u32::try_from(bitmap.width).ok()?; + let height = bitmap.height.unsigned_abs(); + if !(1..=16_384).contains(&width) || !(1..=16_384).contains(&height) { + return None; + } + let stride = (u64::from(width) * u64::from(bitmap.bit_count / 8)).next_multiple_of(4); + let payload_bytes = stride * u64::from(height); + let decoded_bytes = u64::from(width) * u64::from(height) * 4; + // A request can hold its input and new picture while the old picture is cached. + if payload_bytes + 2 * decoded_bytes > craft_video::budget::DECODE_MEMORY_BUDGET { + return None; + } + // Empty AVI slots and partial chunks need the legacy reader's recovery policy. + if stream.chunks.iter().any(|chunk| u64::from(chunk.size) < payload_bytes) { + return None; + } + Some(Self { + format, + width, + height, + bottom_up: bitmap.height > 0, + payload_bytes: usize::try_from(payload_bytes).ok()?, + rate: FrameRate::new(i64::from(stream.rate), i64::from(stream.scale)), + cached: None, + }) + } + + pub(super) fn duration(&self, slots: usize) -> Tick { + self.rate.tick_of(i64::try_from(slots).unwrap_or(i64::MAX)) + } + + pub(super) fn info(&self, stream: &avi::Stream) -> VideoStreamInfo { + let bytes: u128 = stream.chunks.iter().map(|chunk| u128::from(chunk.size)).sum(); + let bytes_per_slot = bytes as f64 / stream.chunks.len() as f64; + VideoStreamInfo { + width: self.width, + height: self.height, + frame_rate: self.rate, + par: (1, 1), + codec: self.format.label().to_string(), + pixel_format: String::new(), + color: ColorInfo::SRGB_FULL, + has_alpha: false, + bitrate: Some((bytes_per_slot * 8.0 * self.rate.as_f64()) as u64), + hdr: None, + } + } + + pub(super) fn frame(&mut self, file: &avi::AviFile, source: &dyn ByteSource, stream: usize, index: usize) -> Result> { + if let Some((cached_index, frame)) = &self.cached + && *cached_index == index + { + return Ok(frame.clone()); + } + if filmcraft_media::cancel::cancelled() { + return Err(MediaError::Cancelled); + } + let packet = file.read_chunk_range(source, stream, index, 0, self.payload_bytes).map_err(|e| MediaError::Io(e.to_string()))?; + let pixels = raw_video::decode(self.format, self.width, self.height, self.bottom_up, &packet) + .map_err(|e| MediaError::Decode(format!("uncompressed AVI picture: {e:?}")))?; + let RawPixels::Rgba(pixels) = pixels else { + return Err(MediaError::Unsupported("unexpected uncompressed AVI pixel layout".into())); + }; + let mut frame = VideoFrame::rgba8(self.width, self.height, pixels).map_err(|e| MediaError::Decode(e.to_string()))?; + frame.pts = self.rate.tick_of(i64::try_from(index).unwrap_or(i64::MAX)); + let frame = Arc::new(frame); + self.cached = Some((index, frame.clone())); + Ok(frame) + } +} diff --git a/crates/media/src/craft_source/raw_avi_tests.rs b/crates/media/src/craft_source/raw_avi_tests.rs new file mode 100644 index 000000000..96ce62454 --- /dev/null +++ b/crates/media/src/craft_source/raw_avi_tests.rs @@ -0,0 +1,99 @@ +use std::io::Cursor; +use std::sync::Arc; + +use craft_color::ColorInfo; +use craft_frame::PixelData; +use craft_media::avi; +use craft_media_source::FrameRequest; +use craft_time::Tick; + +use crate::stream::{self, MediaSource}; + +const WIDTH: u32 = 3; +const HEIGHT: u32 = 2; +const FPS: u32 = 25; +const AUDIO_RATE: u32 = 8_000; +const AUDIO_PER_FRAME: usize = (AUDIO_RATE / FPS) as usize; + +fn rgba(frame: u8, x: u8, y: u8) -> [u8; 4] { + [16 + 30 * frame, 21 + 71 * y, 5 + 17 * x, 255] +} + +fn bitmap(frame: u8, depth: u16, bottom_up: bool) -> Vec { + let stride = (WIDTH as usize * usize::from(depth / 8)).next_multiple_of(4); + let mut bytes = Vec::new(); + for row in 0..HEIGHT as u8 { + let y = if bottom_up { HEIGHT as u8 - 1 - row } else { row }; + for x in 0..WIDTH as u8 { + let [r, g, b, _] = rgba(frame, x, y); + bytes.extend([b, g, r]); + if depth == 32 { + bytes.push(43); + } + } + bytes.resize((usize::from(row) + 1) * stride, 111); + } + bytes +} + +// Original in-memory fixture. The shared AVI muxer writes deterministic test pixels and PCM. +fn fixture(depth: u16, bottom_up: bool, sparse: bool) -> Result, avi::Error> { + let mut video = avi::VideoSpec::new([0; 4], WIDTH, HEIGHT, FPS, 1); + if !bottom_up { + video.format.height = -(HEIGHT as i32); + } + video.format.bit_count = depth; + video.format.size_image = bitmap(0, depth, bottom_up).len() as u32; + let audio = avi::AudioSpec::pcm(AUDIO_RATE, 1, 16); + let mut writer = + avi::AviWriter::new(Cursor::new(Vec::new()), vec![avi::StreamSpec::Video(video), avi::StreamSpec::Audio(audio)], avi::MuxOptions::default())?; + for i in 0..3u8 { + let picture = if sparse && i == 1 { Vec::new() } else { bitmap(i, depth, bottom_up) }; + let sound = (1000 * (i16::from(i) + 1)).to_le_bytes().repeat(AUDIO_PER_FRAME); + writer.write_chunk(0, &picture, true)?; + writer.write_chunk(1, &sound, true)?; + } + Ok(writer.finish()?.into_inner()) +} + +#[test] +fn raw_rgb_avi_preserves_pixels_and_pcm_across_indexed_seeks() -> Result<(), Box> { + let dir = tempfile::tempdir()?; + for (name, depth, bottom_up) in [("bottom-up.avi", 24, true), ("top-down.avi", 32, false)] { + let bytes: Arc<[u8]> = fixture(depth, bottom_up, false)?.into(); + let path = dir.path().join(name); + std::fs::write(&path, &bytes)?; + let disk = stream::open_source(&path).ok_or("unrecognized AVI")?.0?; + let memory = stream::open_bytes(name, bytes)?; + for opened in [disk, memory] { + let MediaSource::Craft(source) = opened else { panic!("{name}: expected shared raw AVI route") }; + let info = source.info(); + let video = info.video.as_ref().ok_or("missing video")?; + assert_eq!((video.width, video.height, video.has_alpha), (WIDTH, HEIGHT, false)); + assert_eq!(video.codec, format!("Uncompressed RGB {depth}-bit")); + assert_eq!(info.duration, Tick::from_units(3, i64::from(FPS))); + for i in [2u8, 0, 1] { + let time = Tick::from_units(2 * i64::from(i) + 1, 2 * i64::from(FPS)); + let frame = source.video_frame(FrameRequest { time, scale: 1.0 })?; + assert_eq!(frame.pts, Tick::from_units(i64::from(i), i64::from(FPS))); + assert_eq!((frame.par, frame.color), ((1, 1), ColorInfo::SRGB_FULL)); + let PixelData::Rgba8(pixels) = &frame.data else { panic!("expected 8-bit RGBA") }; + let expected: Vec = (0..HEIGHT as u8).flat_map(|y| (0..WIDTH as u8).flat_map(move |x| rgba(i, x, y))).collect(); + assert_eq!(pixels.as_slice(), expected); + } + let audio = source.audio(AUDIO_PER_FRAME as i64 - 2, 4, AUDIO_RATE)?; + assert_eq!(audio.channels, [vec![1000.0 / 32768.0, 1000.0 / 32768.0, 2000.0 / 32768.0, 2000.0 / 32768.0]]); + } + } + Ok(()) +} + +#[test] +fn raw_rgb_avi_with_dropped_slot_keeps_legacy_playback() -> Result<(), Box> { + let opened = stream::open_bytes("sparse.avi", fixture(24, true, true)?.into())?; + let MediaSource::Film(source) = opened else { panic!("expected legacy AVI slot handling") }; + let time = filmcraft_time::Tick::from_units(1, i64::from(FPS)); + let frame = source.video_frame(filmcraft_media::FrameRequest { time, scale: 1.0 })?; + assert_eq!((frame.width, frame.height), (WIDTH, HEIGHT)); + Ok(()) +} From f7ab031c3cc4ff84783a52cce8d502300d3408b7 Mon Sep 17 00:00:00 2001 From: Terra854 Date: Sun, 22 Nov 2026 01:53:50 +0800 Subject: [PATCH 368/451] media: present monochrome frames from the shared decoder (#4051) --- ATTRIBUTION.md | 1 + crates/media/src/craft_source.rs | 33 +++++++++++- .../src/craft_source/monochrome_tests.rs | 49 ++++++++++++++++++ .../tests/fixtures/generate-monochrome-av1.sh | 9 ++++ .../media/tests/fixtures/monochrome-av1.mkv | Bin 0 -> 1243 bytes .../fixtures/monochrome-av1.mkv.attribution | 7 +++ 6 files changed, 98 insertions(+), 1 deletion(-) create mode 100644 crates/media/src/craft_source/monochrome_tests.rs create mode 100755 crates/media/tests/fixtures/generate-monochrome-av1.sh create mode 100644 crates/media/tests/fixtures/monochrome-av1.mkv create mode 100644 crates/media/tests/fixtures/monochrome-av1.mkv.attribution diff --git a/ATTRIBUTION.md b/ATTRIBUTION.md index 7043e6128..74dbce1fa 100644 --- a/ATTRIBUTION.md +++ b/ATTRIBUTION.md @@ -162,3 +162,4 @@ under [`docs/brand/LICENSE-brand.txt`](docs/brand/LICENSE-brand.txt). Forks and | Asset | Author | Source | Licence | |---|---|---|---| | `crates/media/tests/fixtures/pce61-ffmpeg.aac-fixture` | Dylan M. Taylor | Original sine waves; reproducible recipe in `crates/media/tests/fixtures/README.md` | MIT OR Apache-2.0 | +| `crates/media/tests/fixtures/monochrome-av1.mkv` | Terra854 | Original grayscale ramps from `crates/media/tests/fixtures/generate-monochrome-av1.sh` | MIT OR Apache-2.0 | diff --git a/crates/media/src/craft_source.rs b/crates/media/src/craft_source.rs index 48a6b679e..a0212d14d 100644 --- a/crates/media/src/craft_source.rs +++ b/crates/media/src/craft_source.rs @@ -2293,7 +2293,35 @@ fn to_craft_frame(vf: DecodedVideoFrame, presentation: FramePresentation, pts: T PixelData::Yuv16 { planes: [y, cb, cr], chroma, bits: u32::from(bit_depth), alpha: a } } } - ColorFamily::Rgb | ColorFamily::Gray => return Err(MediaError::Unsupported("non-YCbCr pixel format".into())), + ColorFamily::Gray => { + let y = planes.into_iter().next().ok_or_else(|| MediaError::Decode("missing grayscale plane".into()))?; + let luma = aperture.and_then(|clap| clean_aperture_region(clap, (width, height))); + if let Some(r) = luma { + (width, height) = (r.w as u32, r.h as u32); + } + // Chroma is constant, so subsampling does not change the visible grayscale picture. + let chroma = Chroma::C420; + let chroma_len = (width as usize) + .div_ceil(2) + .checked_mul((height as usize).div_ceil(2)) + .ok_or_else(|| MediaError::Decode("monochrome chroma size overflows".into()))?; + match bit_depth { + 8 => { + let y = Arc::new(plane_u8(y, luma)?); + let alpha = alpha.map(|p| plane_u8(p, luma)).transpose()?.map(Arc::new); + let neutral = Arc::new(vec![128; chroma_len]); + PixelData::Yuv8 { planes: [y, neutral.clone(), neutral], chroma, alpha } + } + 9..=16 => { + let y = Arc::new(plane_u16(y, luma)?); + let alpha = alpha.map(|p| plane_u16(p, luma)).transpose()?.map(Arc::new); + let neutral = Arc::new(vec![1u16 << (bit_depth - 1); chroma_len]); + PixelData::Yuv16 { planes: [y, neutral.clone(), neutral], chroma, bits: u32::from(bit_depth), alpha } + } + _ => return Err(MediaError::Unsupported("monochrome bit depth below 8".into())), + } + } + ColorFamily::Rgb => return Err(MediaError::Unsupported("non-YCbCr pixel format".into())), }; let frame = VideoFrame { width, height, data, color, par, pts }; @@ -4793,3 +4821,6 @@ mod tests { assert_eq!(read_count, 0); } } + +#[cfg(test)] +mod monochrome_tests; diff --git a/crates/media/src/craft_source/monochrome_tests.rs b/crates/media/src/craft_source/monochrome_tests.rs new file mode 100644 index 000000000..e3251550d --- /dev/null +++ b/crates/media/src/craft_source/monochrome_tests.rs @@ -0,0 +1,49 @@ +use super::*; +use crate::stream::{self, MediaSource as OpenedSource}; + +#[test] +fn shared_monochrome_av1_retains_luma_on_backward_seek() -> std::result::Result<(), Box> { + let bytes: Arc<[u8]> = Arc::from(include_bytes!("../../tests/fixtures/monochrome-av1.mkv").as_slice()); + let OpenedSource::Craft(source) = stream::open_bytes("monochrome-av1.mkv", bytes)? else { + panic!("expected the shared AV1 reader"); + }; + for i in [2u8, 0, 1] { + let pts = Tick::from_units(i64::from(i), 25); + let frame = source.video_frame(FrameRequest { time: pts, scale: 1.0 })?; + assert_eq!((frame.width, frame.height, frame.pts, frame.color.range), (16, 12, pts, Range::Full)); + let PixelData::Yuv8 { planes: [y, cb, cr], chroma: Chroma::C420, alpha: None } = &frame.data else { + panic!("expected 8-bit luma with neutral chroma"); + }; + let expected: Vec = (0..12).flat_map(|row| (0..16).map(move |col| 16 + 64 * i + col + 2 * row)).collect(); + assert_eq!(y.as_slice(), expected); + assert_eq!(cb.as_slice(), [128; 48]); + assert_eq!(cr.as_slice(), cb.as_slice()); + let rgba = frame.to_rgba8()?; + for (pixel, &sample) in rgba.as_chunks::<4>().0.iter().zip(&expected) { + assert_eq!(*pixel, [sample, sample, sample, 255]); + } + } + Ok(()) +} + +#[test] +fn monochrome_10_bit_preserves_aperture_rotation_alpha_and_layout() -> std::result::Result<(), Box> { + let y = Plane::packed(5, 5, 10, Samples::U16((64..89).collect()))?; + let alpha = Plane::packed(5, 5, 10, Samples::U16((900..925).collect()))?; + let mut decoded = DecodedVideoFrame::new(5, 5, ColorFamily::Gray, Subsampling::S444, vec![y], Some(alpha))?; + decoded.sar = Some((3, 2)); + let aperture = isobmff::CleanAperture { width: (3, 1), height: (3, 1), horiz_offset: (0, 1), vert_offset: (0, 1) }; + let presentation = FramePresentation { container_color: Some(ColorInfo::REC709), par: (1, 1), rotation: 1, aperture: Some(aperture) }; + let pts = Tick::from_units(4, 25); + let frame = to_craft_frame(decoded, presentation, pts)?; + assert_eq!((frame.width, frame.height, frame.par, frame.pts), (3, 3, (2, 3), pts)); + assert_eq!(frame.color, ColorInfo::REC709); + let PixelData::Yuv16 { planes: [y, cb, cr], chroma: Chroma::C420, bits: 10, alpha: Some(alpha) } = &frame.data else { + panic!("expected 10-bit luma and alpha"); + }; + assert_eq!(y.as_slice(), [80, 75, 70, 81, 76, 71, 82, 77, 72]); + assert_eq!(alpha.as_slice(), [916, 911, 906, 917, 912, 907, 918, 913, 908]); + assert_eq!(cb.as_slice(), [512; 4]); + assert_eq!(cr.as_slice(), cb.as_slice()); + Ok(()) +} diff --git a/crates/media/tests/fixtures/generate-monochrome-av1.sh b/crates/media/tests/fixtures/generate-monochrome-av1.sh new file mode 100755 index 000000000..ecfdfc830 --- /dev/null +++ b/crates/media/tests/fixtures/generate-monochrome-av1.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env sh +set -eu +cd "$(dirname "$0")" +ffmpeg -hide_banner -loglevel error \ + -f lavfi -i "nullsrc=s=16x12:r=25,format=gray,geq=lum='16+64*N+X+2*Y'" \ + -frames:v 3 -c:v libaom-av1 -pix_fmt gray -color_range pc \ + -color_primaries bt709 -color_trc bt709 -colorspace bt709 \ + -g 1 -crf 0 -b:v 0 -aom-params lossless=1 -cpu-used 6 -threads 16 \ + -fflags +bitexact -flags:v +bitexact -f matroska -y monochrome-av1.mkv diff --git a/crates/media/tests/fixtures/monochrome-av1.mkv b/crates/media/tests/fixtures/monochrome-av1.mkv new file mode 100644 index 0000000000000000000000000000000000000000..37749f35e37fcccf6b0043c56a681dcbdce8e12d GIT binary patch literal 1243 zcmb1gy}x*|Q(GgW({~{L)X3uWxsk)EsUtVBq$s~QJJG2fDAd}>BoW+@&d2})EXxIb zXO|q<-{RsP{oQwWckt>KQO}iW!D|{9LU>{!>#~8oGrqfffO0}1htq@CG%+hcxH7@J zfs#!unQtJbF$9ARr7i(-&$9h3$2&UAwXSb$=67=NZD{dHEK3V_1XC`Z9S(62D?yHR z^4s5{wS8sSI*5~)?5{U679Z_^x`}a4BZJb`InAYcDIJXrZLMMPj$ww)jf~2Vn_HNY zq8J`b*w84jtC43`BU9*xme8F*>RlrP%zI1>49Sc78yRF6xHy3ZGS0ub^-~B`lJOdK zy*+B$;0OUwlE1aTrT=qkesS@|Os!UeM$xKSj z&(%#VGfY3R&~ILoDkN#xY7k~^3z+q6g8^-~L Date: Sun, 22 Nov 2026 01:53:55 +0800 Subject: [PATCH 369/451] media: present full-range 8-bit RGB from the shared decoder (#4052) --- crates/media/src/craft_source.rs | 29 ++++++++ crates/media/src/craft_source/rgb8_tests.rs | 81 +++++++++++++++++++++ 2 files changed, 110 insertions(+) create mode 100644 crates/media/src/craft_source/rgb8_tests.rs diff --git a/crates/media/src/craft_source.rs b/crates/media/src/craft_source.rs index a0212d14d..6534852a6 100644 --- a/crates/media/src/craft_source.rs +++ b/crates/media/src/craft_source.rs @@ -2245,6 +2245,9 @@ fn push_decoded( Ok(()) } +#[cfg(test)] +mod rgb8_tests; + fn to_craft_frame(vf: DecodedVideoFrame, presentation: FramePresentation, pts: Tick) -> Result { let FramePresentation { container_color, par: default_par, rotation, aperture } = presentation; let (mut width, mut height) = (vf.width(), vf.height()); @@ -2261,6 +2264,28 @@ fn to_craft_frame(vf: DecodedVideoFrame, presentation: FramePresentation, pts: T let (planes, alpha) = vf.into_planes(); let data = match family { + ColorFamily::Rgb if color.range == Range::Full && planes.iter().chain(alpha.iter()).all(|p| p.bit_depth() == 8) => { + let luma = aperture.and_then(|clap| clean_aperture_region(clap, (width, height))); + if let Some(r) = luma { + (width, height) = (r.w as u32, r.h as u32); + } + let bytes = (width as usize) + .checked_mul(height as usize) + .and_then(|n| n.checked_mul(4)) + .filter(|&n| n <= craft_frame::DEFAULT_MAX_FRAME_BYTES) + .ok_or_else(|| MediaError::Decode("RGB picture exceeds the frame buffer limit".into()))?; + let [r, g, b]: [Plane; 3] = planes.try_into().map_err(|_| MediaError::Decode("expected three RGB planes".into()))?; + let r = plane_u8(r, luma)?; + let g = plane_u8(g, luma)?; + let b = plane_u8(b, luma)?; + let alpha = alpha.map(|a| plane_u8(a, luma)).transpose()?.into_iter().flatten().chain(std::iter::repeat(255)); + let mut rgba = Vec::new(); + rgba.try_reserve_exact(bytes).map_err(|_| MediaError::Decode("could not allocate the RGB picture".into()))?; + for (((r, g), b), a) in r.into_iter().zip(g).zip(b).zip(alpha) { + rgba.extend_from_slice(&[r, g, b, a]); + } + PixelData::Rgba8(Arc::new(rgba)) + } ColorFamily::YCbCr => { let chroma = match subsampling { Subsampling::S420 => Chroma::C420, @@ -2393,6 +2418,10 @@ fn rotate_frame(mut frame: VideoFrame, turns: u8) -> VideoFrame { let (w, h) = (frame.width as usize, frame.height as usize); let (nw, nh) = if turns % 2 == 1 { (frame.height, frame.width) } else { (frame.width, frame.height) }; let data = match frame.data { + PixelData::Rgba8(pixels) => { + let rotated = rotate_plane(pixels.as_chunks::<4>().0, w, h, turns); + PixelData::Rgba8(Arc::new(rotated.into_flattened())) + } PixelData::Yuv8 { planes: [y, cb, cr], chroma, alpha } => { let (cw, ch, out_chroma) = match chroma { Chroma::C420 => (w.div_ceil(2), h.div_ceil(2), Chroma::C420), diff --git a/crates/media/src/craft_source/rgb8_tests.rs b/crates/media/src/craft_source/rgb8_tests.rs new file mode 100644 index 000000000..2cc78d441 --- /dev/null +++ b/crates/media/src/craft_source/rgb8_tests.rs @@ -0,0 +1,81 @@ +use std::io::Cursor; + +use craft_video::ffv1::{self, Colorspace, Encoder, EncoderConfig}; + +use super::*; +use crate::stream::{self, MediaSource as OpenedSource}; + +type TestResult = std::result::Result<(), Box>; + +const WIDTH: u32 = 5; +const HEIGHT: u32 = 3; + +fn rgba(frame: u8, x: u8, y: u8) -> [u8; 4] { + [15 + 55 * frame + x, 59 + 3 * y, 191 + x + y, 255] +} + +#[test] +fn shared_ffv1_rgb8_keeps_opaque_pixels_across_backward_seek() -> TestResult { + let mut raw = ffv1::Frame { width: WIDTH, height: HEIGHT, colorspace: Colorspace::Rgb, bit_depth: 8, chroma_shift: (0, 0), planes: vec![Vec::new(); 3] }; + let encoder = Encoder::new(&raw, EncoderConfig::default())?; + let mut track = matroska::TrackSpec::new(matroska::TrackKind::Video, "V_FFV1"); + track.codec_private = encoder.config_record(); + track.video_size = Some((WIDTH, HEIGHT)); + track.default_duration_ns = Some(40_000_000); + let mut writer = matroska::MkvWriter::new(Cursor::new(Vec::new()), vec![track], matroska::MuxOptions::default())?; + + // Original per-channel ramps, encoded and muxed in memory. + let mut expected = Vec::new(); + for n in 0u8..3 { + let pixels: Vec<[u8; 4]> = (0..HEIGHT as u8).flat_map(|y| (0..WIDTH as u8).map(move |x| rgba(n, x, y))).collect(); + for (c, plane) in raw.planes.iter_mut().enumerate() { + *plane = pixels.iter().map(|pixel| u16::from(pixel[c])).collect(); + } + writer.write_frame(0, i64::from(n) * 40_000_000, true, &encoder.encode(&raw)?, Some(40_000_000))?; + expected.push(pixels.into_flattened()); + } + let bytes = writer.finish()?.into_inner(); + let OpenedSource::Craft(source) = stream::open_bytes("rgb-ffv1.mkv", bytes.into())? else { + panic!("expected the shared FFV1 reader"); + }; + for n in [2, 0, 1] { + let pts = Tick::from_units(n as i64, 25); + let frame = source.video_frame(FrameRequest { time: pts, scale: 1.0 })?; + assert_eq!((frame.width, frame.height, frame.pts, frame.color.range), (WIDTH, HEIGHT, pts, Range::Full)); + let PixelData::Rgba8(pixels) = &frame.data else { panic!("expected packed RGBA8") }; + assert_eq!(pixels.as_slice(), expected[n]); + } + Ok(()) +} + +fn presentation() -> FramePresentation { + FramePresentation { container_color: Some(ColorInfo::SRGB_FULL), par: (1, 1), rotation: 0, aperture: None } +} + +#[test] +fn packed_rgb_keeps_stride_aperture_rotation_and_straight_alpha() -> TestResult { + let make_plane = |base: u8| { + let samples: Vec = (0u8..3).flat_map(|y| [base + y * 4, base + y * 4 + 1, base + y * 4 + 2, 250]).collect(); + Plane::new(3, 3, 4, 8, Samples::U8(samples)) + }; + let mut decoded = + DecodedVideoFrame::new(3, 3, ColorFamily::Rgb, Subsampling::S444, vec![make_plane(10)?, make_plane(30)?, make_plane(50)?], Some(make_plane(0)?))?; + decoded.sar = Some((3, 2)); + let aperture = isobmff::CleanAperture { width: (1, 1), height: (3, 1), horiz_offset: (0, 1), vert_offset: (0, 1) }; + let presentation = FramePresentation { aperture: Some(aperture), rotation: 1, ..presentation() }; + let pts = Tick::from_units(4, 25); + let frame = to_craft_frame(decoded, presentation, pts)?; + assert_eq!((frame.width, frame.height, frame.par, frame.pts), (3, 1, (2, 3), pts)); + assert_eq!(frame.color, ColorInfo::SRGB_FULL); + let PixelData::Rgba8(pixels) = &frame.data else { panic!("expected packed RGBA8") }; + assert_eq!(pixels.as_slice(), [19, 39, 59, 9, 15, 35, 55, 5, 11, 31, 51, 1]); + Ok(()) +} + +#[test] +fn higher_depth_rgb_is_not_quantized_to_packed_bytes() -> TestResult { + let channel = Plane::packed(1, 1, 10, Samples::U16(vec![900]))?; + let decoded = DecodedVideoFrame::new(1, 1, ColorFamily::Rgb, Subsampling::S444, vec![channel; 3], None)?; + assert!(matches!(to_craft_frame(decoded, presentation(), Tick::ZERO), Err(MediaError::Unsupported(_)))); + Ok(()) +} From f02e6412ce80bbe28c5185ae47da4d64f2ff2a73 Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Sun, 22 Nov 2026 01:03:27 +0700 Subject: [PATCH 370/451] media: read AAC configuration through the shared byte source (#4046) Co-authored-by: Codex --- crates/media/src/aac.rs | 16 ++++++++-------- crates/media/src/pool.rs | 6 +++--- crates/media/src/stream.rs | 4 ++-- crates/media/tests/it/aac_layout.rs | 7 +++++++ 4 files changed, 20 insertions(+), 13 deletions(-) diff --git a/crates/media/src/aac.rs b/crates/media/src/aac.rs index 356a8dff5..0aa987bf0 100644 --- a/crates/media/src/aac.rs +++ b/crates/media/src/aac.rs @@ -7,7 +7,7 @@ use std::io; use craft_audio::aac::AudioSpecificConfig; -use filmcraft_media::ByteReader; +use craft_media::ByteSource; /// How far into an MPEG TS / PS file the audio streams are looked for: the stream is indexed as /// far as this, not through the whole file. @@ -16,7 +16,7 @@ const MPEG_HEAD: u64 = 8 << 20; /// The configuration of the audio track FilmCraft plays, if it is AAC: from an MP4 / MOV `header` /// (its ftyp and moov, or the whole file) and `file`, or else from `file`, read as Matroska or /// MPEG TS / PS. -pub(crate) fn config(header: Option<&[u8]>, file: Option<&dyn ByteReader>) -> Option { +pub(crate) fn config(header: Option<&[u8]>, file: Option<&dyn ByteSource>) -> Option { let asc = match header.and_then(|h| mp4(h, file)) { Some(asc) => asc, None => { @@ -32,7 +32,7 @@ pub(crate) fn config(header: Option<&[u8]>, file: Option<&dyn ByteReader>) -> Op /// The track FilmCraft's MP4 source plays: the first audio track with samples, a sample /// description and a timescale, read from the whole file as it is (a fragmented movie's samples /// are in its fragments, not the `moov`). -fn mp4(header: &[u8], file: Option<&dyn ByteReader>) -> Option> { +fn mp4(header: &[u8], file: Option<&dyn ByteSource>) -> Option> { let mp4 = match file { Some(f) => craft_media::isobmff::open(Head(f, f.len())), None => craft_media::isobmff::open(header), @@ -50,7 +50,7 @@ fn mp4(header: &[u8], file: Option<&dyn ByteReader>) -> Option> { /// The track FilmCraft's Matroska source plays: the first audio track with frames, found by /// indexing the clusters as that source does. -fn matroska(file: &dyn ByteReader) -> Option> { +fn matroska(file: &dyn ByteSource) -> Option> { let mkv = craft_media::matroska::open(Head(file, file.len())).ok()?; match &mkv.tracks.iter().find(|t| t.kind == craft_media::matroska::TrackKind::Audio && !t.samples.is_empty())?.codec { craft_media::matroska::Codec::Aac { asc } => Some(asc.clone()), @@ -61,12 +61,12 @@ fn matroska(file: &dyn ByteReader) -> Option> { /// The configuration of the stream FilmCraft's MPEG source plays: the first audio stream whose /// first unit it can read. Only AAC is asked about, so the streams before that one were refused /// whatever their codec, and an ADTS stream played has no configuration outside its frames. -fn latm(file: &dyn ByteReader) -> Option> { +fn latm(file: &dyn ByteSource) -> Option> { use craft_media::mpegts::{self, Codec}; let head = Head(file, file.len().min(MPEG_HEAD)); let mpeg = mpegts::open(&head).ok()?; let audio = mpeg.streams.iter().enumerate().filter(|(_, s)| s.kind() == mpegts::Kind::Audio && !s.units.is_empty()); - let played = audio.take(filmcraft_media::MAX_AUDIO_STREAMS).find_map(|(i, s)| { + let played = audio.take(craft_media_source::MAX_AUDIO_STREAMS).find_map(|(i, s)| { let first = mpeg.read_unit(&head, i, 0).ok()?; match s.codec { Codec::AacAdts => mpegts::frame_info(&s.codec, &first).map(|_| None), @@ -77,8 +77,8 @@ fn latm(file: &dyn ByteReader) -> Option> { played? } -/// The first `.1` bytes of a file, as the byte source FilmCraft's demuxers read. -struct Head<'a>(&'a dyn ByteReader, u64); +/// The first `.1` bytes available to the AAC container scan. +struct Head<'a>(&'a dyn ByteSource, u64); impl Head<'_> { fn read(&self, offset: u64, buf: &mut [u8]) -> io::Result<()> { diff --git a/crates/media/src/pool.rs b/crates/media/src/pool.rs index 7bb4ae78b..041b235db 100644 --- a/crates/media/src/pool.rs +++ b/crates/media/src/pool.rs @@ -568,7 +568,7 @@ struct Opened { impl Opened { /// `src` with what its container says: `header` is an MP4/MOV's ftyp and moov (or the whole /// file), `file` the file for other containers' AAC configuration. - fn new(src: MediaSource, header: Option<&[u8]>, file: Option<&dyn filmcraft_media::ByteReader>) -> Opened { + fn new(src: MediaSource, header: Option<&[u8]>, file: Option<&dyn craft_media::ByteSource>) -> Opened { let turn = header.map_or(Orientation::NoTransforms, crate::probe::video_turn); Opened { order: channel_order(&src, header, file), src, turn } } @@ -576,7 +576,7 @@ impl Opened { /// The order `src`'s audio channels decode in; multichannel AAC's by its configuration, where /// the container's header shows it ([`crate::aac::config`]). -fn channel_order(src: &MediaSource, header: Option<&[u8]>, file: Option<&dyn filmcraft_media::ByteReader>) -> Order { +fn channel_order(src: &MediaSource, header: Option<&[u8]>, file: Option<&dyn craft_media::ByteSource>) -> Order { match src.primary_audio() { Some((_, channels, codec)) if codec.contains("AAC") && channels > 2 => { crate::aac::config(header, file).map_or(Order::Aac, |asc| crate::downmix::aac_order(&asc)) @@ -1220,7 +1220,7 @@ impl Inner { let opened = bytes.and_then(|bytes| { let name = std::path::Path::new(&**path).file_name().map(|n| n.to_string_lossy().to_string()).unwrap_or_default(); let src = crate::stream::open_bytes(&name, bytes.clone())?; - Ok(Opened::new(src, Some(&bytes), Some(&filmcraft_media::reader::MemReader(bytes.clone())))) + Ok(Opened::new(src, Some(&bytes), Some(&bytes))) }); (opened, read) }); diff --git a/crates/media/src/stream.rs b/crates/media/src/stream.rs index 3bcb9b970..5bebba64a 100644 --- a/crates/media/src/stream.rs +++ b/crates/media/src/stream.rs @@ -191,12 +191,12 @@ pub(crate) fn open_source(_path: &Path) -> Option<(Result, FileStam /// `path` read in place (`None` when it can't be opened, or without a native file system). #[cfg(any(unix, windows))] -pub(crate) fn file_reader(path: &Path) -> Option> { +pub(crate) fn file_reader(path: &Path) -> Option> { Some(Box::new(FileReader::open(path).ok()?)) } #[cfg(not(any(unix, windows)))] -pub(crate) fn file_reader(_path: &Path) -> Option> { +pub(crate) fn file_reader(_path: &Path) -> Option> { None } diff --git a/crates/media/tests/it/aac_layout.rs b/crates/media/tests/it/aac_layout.rs index 5adf762b2..014655a40 100644 --- a/crates/media/tests/it/aac_layout.rs +++ b/crates/media/tests/it/aac_layout.rs @@ -300,6 +300,13 @@ fn mpeg_aac_mixes_by_the_stream_played() { } let p = write(&format!("latm-first-{latm_first}.ts"), &ts.out); check(label, case.content, &mix(&MediaPool::new(), &probe(&p).expect("probe"))); + + let path = format!("/mem/latm-first-{latm_first}.ts"); + let bytes: Arc<[u8]> = ts.out.into(); + let pool = MediaPool::new(); + pool.add_bytes(&path, bytes.clone()); + let footage = probe_bytes(&path, bytes).expect("probe registered MPEG bytes"); + check(&format!("{label} in memory"), case.content, &mix(&pool, &footage)); } } From 951c8b4da72f60ea690ae508a1549996edb5c7e6 Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Sun, 22 Nov 2026 01:03:31 +0700 Subject: [PATCH 371/451] Seek independent ProRes frames in scanned AVI streams (#4047) Co-authored-by: Codex --- crates/media/src/craft_source.rs | 81 ++++++++++++++++++++++++++++++-- 1 file changed, 77 insertions(+), 4 deletions(-) diff --git a/crates/media/src/craft_source.rs b/crates/media/src/craft_source.rs index 6534852a6..15ae6bb10 100644 --- a/crates/media/src/craft_source.rs +++ b/crates/media/src/craft_source.rs @@ -264,6 +264,11 @@ impl ContainerFile { } } + fn scanned_avi_has_picture(&self, track_idx: usize, sample_idx: usize) -> bool { + let Self::Avi(file) = self else { return false }; + file.streams.get(track_idx).is_some_and(|s| !s.keyframes_known && s.chunks.get(sample_idx).is_some_and(|c| c.size != 0)) + } + fn sample_pts(&self, track_idx: usize, sample_idx: usize) -> i64 { match self { ContainerFile::Isobmff(f) => f.tracks[track_idx].samples[sample_idx].pts, @@ -1753,7 +1758,10 @@ impl MediaSource for CraftMediaSource { return Ok(hit.frame.clone()); } - let sync_idx = self.file.sync_sample_before(video_idx, target_idx); + // A scan cannot identify AVI keyframes, but each nonempty ProRes chunk is + // an independent picture. Do not read an earlier, possibly damaged chunk. + let direct_avi_prores = state.decoder.codec() == CodecId::ProRes && self.file.scanned_avi_has_picture(video_idx, target_idx); + let sync_idx = if direct_avi_prores { target_idx } else { self.file.sync_sample_before(video_idx, target_idx) }; let draft_changed = state.decoder.draft() != want_draft; if draft_changed { state.decoder.set_draft(want_draft); @@ -4764,13 +4772,17 @@ mod tests { } fn generated_avi_prores(with_alpha: bool, invalid_first: bool) -> Vec { + generated_avi_prores_pictures(with_alpha, invalid_first, &[512]) + } + + fn generated_avi_prores_pictures(with_alpha: bool, invalid_first: bool, luma: &[u16]) -> Vec { use craft_video::prores::{ChromaFormat, ColorInfo as ProResColor, Encoder, EncoderConfig, Frame as ProResFrame, Interlace, Profile}; let mut cfg = EncoderConfig::new(Profile::P4444, 16, 16); cfg.encode_alpha = with_alpha; cfg.threads = false; let mut enc = Encoder::with_config(cfg); - let frame = ProResFrame { + let mut frame = ProResFrame { width: 16, height: 16, chroma: ChromaFormat::Yuv444, @@ -4784,7 +4796,6 @@ mod tests { aspect_ratio: 0, frame_rate_code: 0, }; - let pkt = enc.encode(&frame).expect("encode prores"); let mut w = avi::AviWriter::new( std::io::Cursor::new(Vec::new()), vec![avi::StreamSpec::Video(avi::VideoSpec::new(*b"ap4h", 16, 16, 24, 1))], @@ -4794,7 +4805,11 @@ mod tests { if invalid_first { w.write_chunk(0, &[0], true).expect("write nonempty invalid first chunk"); } - w.write_chunk(0, &pkt, true).expect("write prores chunk"); + for &y in luma { + frame.y.fill(y); + let pkt = enc.encode(&frame).expect("encode prores"); + w.write_chunk(0, &pkt, true).expect("write prores chunk"); + } w.finish().expect("finish avi").into_inner() } @@ -4839,6 +4854,64 @@ mod tests { assert!(matches!(frame.data, PixelData::Yuv16 { alpha: Some(_), .. })); } + // The fixture is a tiny AVI generated by this test. Neutralize only RIFF index + // records (not coincidental FourCC strings inside compressed pictures). + fn make_generated_avi_indexless(mut bytes: &mut [u8]) { + while !bytes.is_empty() { + let size = u32::from_le_bytes(bytes[4..8].try_into().expect("generated RIFF length")) as usize; + let (chunk, rest) = bytes.split_at_mut(8 + size + size % 2); + match &chunk[..4] { + b"RIFF" | b"LIST" => make_generated_avi_indexless(&mut chunk[12..8 + size]), + b"indx" | b"idx1" | b"ix00" => chunk[..4].copy_from_slice(b"JUNK"), + b"avih" => chunk[20] &= !0x10, // Clear AVIF_HASINDEX in dwFlags. + _ => {} + } + bytes = rest; + } + } + + fn avi_prores_test_picture(source: &crate::stream::MediaSource, time: effectcraft_time::Tick) -> Arc { + let crate::stream::DecodedFrame::Craft(frame) = source.video_frame(time, 1.0).expect("read shared ProRes picture") else { + panic!("expected the shared AVI reader"); + }; + assert_eq!(frame.pts.0, time.0); + frame + } + + fn avi_prores_test_pixels(frame: &VideoFrame) -> (&[u16], &[u16]) { + let PixelData::Yuv16 { planes, alpha: Some(alpha), .. } = &frame.data else { panic!("expected a YUV picture with coded alpha") }; + (&planes[0], alpha) + } + + #[test] + fn indexless_avi_prores_seeks_independent_pictures_past_a_bad_first_chunk() { + const SLOT: i64 = craft_time::TICKS_PER_SECOND / 24; + let mut bytes = generated_avi_prores_pictures(true, true, &[512, 768]); + let indexed = crate::stream::open_bytes("indexed-prores.avi", Arc::from(bytes.clone())).expect("open indexed control"); + let first = effectcraft_time::Tick(SLOT); + let second = effectcraft_time::Tick(2 * SLOT); + let expected_first = avi_prores_test_picture(&indexed, first); + let expected_second = avi_prores_test_picture(&indexed, second); + assert_ne!(avi_prores_test_pixels(&expected_first).0, avi_prores_test_pixels(&expected_second).0); + + make_generated_avi_indexless(&mut bytes); + let demuxed = avi::open(bytes.as_slice()).expect("open scanned AVI"); + assert_eq!(demuxed.index, avi::IndexSource::Scan); + let video = &demuxed.streams[0]; + assert!(!video.keyframes_known); + assert_eq!((video.chunks.len(), video.chunks[0].size), (3, 1)); + + let opened = crate::stream::open_bytes("scanned-prores.avi", Arc::from(bytes)).expect("open indexless AVI"); + let cold = avi_prores_test_picture(&opened, second); + assert_eq!(avi_prores_test_pixels(&cold), avi_prores_test_pixels(&expected_second)); + assert!(opened.video_frame(effectcraft_time::Tick(0), 1.0).is_err(), "the requested corrupt picture remains an error"); + + let after_error = avi_prores_test_picture(&opened, second); + assert_eq!(avi_prores_test_pixels(&after_error), avi_prores_test_pixels(&expected_second)); + let backward = avi_prores_test_picture(&opened, first); + assert_eq!(avi_prores_test_pixels(&backward), avi_prores_test_pixels(&expected_first)); + } + #[test] fn oversized_prores_alpha_probe_refuses_without_reading() { let mut read_count = 0; From abb7b66de53fd1d9e42f790a3616a477bcbeeb50 Mon Sep 17 00:00:00 2001 From: Terra854 Date: Sun, 22 Nov 2026 02:22:30 +0800 Subject: [PATCH 372/451] psd: share legacy Mac Roman layer-name decoding (#4056) --- Cargo.lock | 1 + Cargo.toml | 1 + crates/psd/Cargo.toml | 1 + crates/psd/src/parse.rs | 7 +------ crates/psd/src/read.rs | 15 ++++++++++----- crates/psd/src/tests/unicode_name.rs | 26 ++++++++++++++++++++++++++ 6 files changed, 40 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 48e59a0b4..68eb957f3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2426,6 +2426,7 @@ dependencies = [ name = "effectcraft-psd" version = "0.24.1" dependencies = [ + "craft-codepage", "craft-psd", "miniz_oxide 0.9.1", ] diff --git a/Cargo.toml b/Cargo.toml index 3301c483e..011553b8c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,6 +23,7 @@ craft-ps = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", craft-exr = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "3b8e426a260695af840a2cd79a064d40778f939e" } craft-gif = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" } craft-psd = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "08da5e1486ee640de1d2cccd8fe8dd32b1d3b62c" } +craft-codepage = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" } craft-svg = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "3dff4793f1a5bd1f99a4fe3280d48f515158dff3" } craft-webp = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" } craft-lottie = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" } diff --git a/crates/psd/Cargo.toml b/crates/psd/Cargo.toml index 818331cce..aa9e77e07 100644 --- a/crates/psd/Cargo.toml +++ b/crates/psd/Cargo.toml @@ -11,6 +11,7 @@ workspace = true [dependencies] craft-psd = { workspace = true } +craft-codepage = { workspace = true } miniz_oxide = "0.9" [dev-dependencies] diff --git a/crates/psd/src/parse.rs b/crates/psd/src/parse.rs index 2f1ccd2b3..b5a69bb4f 100644 --- a/crates/psd/src/parse.rs +++ b/crates/psd/src/parse.rs @@ -102,7 +102,7 @@ impl Psd { hidden: rec.flags.hidden(), protect_transparency: rec.flags.transparency_protected(), channels, - name: mac_roman_string(&rec.name), + name: crate::read::decode_mac_roman(&rec.name), ..Default::default() }; if let craft_psd::MaskData::Mask(m) = &rec.mask { @@ -489,11 +489,6 @@ fn error(e: &craft_psd::PsdError) -> Error { } } -/// A Pascal string's bytes in the system (Mac Roman) encoding; ASCII covers the common case. -fn mac_roman_string(b: &[u8]) -> String { - b.iter().map(|&b| if b < 0x80 { b as char } else { super::read::mac_roman(b) }).collect() -} - /// App representation only; binary field framing belongs to craft-psd. fn from_shared_adjustment(value: craft_psd::adjust::Adjustment) -> Adjustment { use craft_psd::adjust::Adjustment as Shared; diff --git a/crates/psd/src/read.rs b/crates/psd/src/read.rs index 307998066..158675d89 100644 --- a/crates/psd/src/read.rs +++ b/crates/psd/src/read.rs @@ -80,12 +80,17 @@ impl<'a> Reader<'a> { let padded = total.div_ceil(pad) * pad; self.skip(padded - total)?; // Pascal strings are in the system (Mac Roman) encoding; ASCII covers the common case. - Ok(s.iter().map(|&b| if b < 0x80 { b as char } else { mac_roman(b) }).collect()) + Ok(decode_mac_roman(s)) } } -/// Mac OS Roman upper half (0x80..=0xFF), as published by the Unicode Consortium mapping table. -pub(crate) fn mac_roman(b: u8) -> char { - const T: &str = "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ\u{F8FF}ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"; - T.chars().nth((b - 0x80) as usize).unwrap_or('?') +/// Decode the legacy Pascal names in PSD and PSB. +pub(crate) fn decode_mac_roman(bytes: &[u8]) -> String { + bytes + .iter() + .map(|&byte| { + // Keep the ordinary space EffectCraft used for this byte in legacy Pascal names. + if byte == 0xca { ' ' } else { craft_codepage::windows_byte(craft_codepage::MAC_ROMAN_CODE_PAGE, byte) } + }) + .collect() } diff --git a/crates/psd/src/tests/unicode_name.rs b/crates/psd/src/tests/unicode_name.rs index 8785b1a49..a5616099c 100644 --- a/crates/psd/src/tests/unicode_name.rs +++ b/crates/psd/src/tests/unicode_name.rs @@ -84,3 +84,29 @@ fn missing_empty_or_malformed_unicode_name_keeps_pascal_name() { assert_eq!(Psd::parse(file.to_bytes().unwrap()).unwrap().layers[0].name, "Pascal"); } } + +#[test] +fn pascal_layer_name_keeps_legacy_mac_roman_and_unicode_precedence() { + let mut doc = WDoc::new(1, 1); + doc.rle = false; // The raw pixels have the same layout in PSD and PSB. + doc.layers = vec![WLayer::empty("Fallback", vec![])]; + let bytes = write(&doc); + for version in [craft_psd::Version::Psd, craft_psd::Version::Psb] { + let mut file = craft_psd::PsdFile::from_bytes(&bytes).unwrap(); + file.header.version = version; + file.layer_info.as_mut().unwrap().layers[0].name = b"Caf\x8e\xca\xdb".to_vec(); + + for (unicode, expected) in + [(None, "Caf\u{e9} \u{20ac}"), (Some(vec![0, 0, 0, 1, 0]), "Caf\u{e9} \u{20ac}"), (Some(record(&[0x0041, 0x00a0, 0x0042])), "A\u{a0}B")] + { + let layer = &mut file.layer_info.as_mut().unwrap().layers[0]; + layer.blocks.retain(|b| b.key != *b"luni"); + if let Some(data) = unicode { + layer.blocks.push(craft_psd::tagged::TaggedBlock::new(*b"luni", data)); + } + let parsed = Psd::parse(file.to_bytes().unwrap()).unwrap(); + assert_eq!(parsed.psb, version.is_psb()); + assert_eq!(parsed.layers[0].name, expected); + } + } +} From ea64796b6e8213fc7b7a64eeb6864e3fd378ace4 Mon Sep 17 00:00:00 2001 From: Terra854 Date: Sun, 22 Nov 2026 02:24:09 +0800 Subject: [PATCH 373/451] media: derive audio-only AVI PCM duration from indexed blocks (#4042) Co-authored-by: Dylan M. Taylor --- crates/media/src/craft_source.rs | 39 +++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/crates/media/src/craft_source.rs b/crates/media/src/craft_source.rs index 15ae6bb10..b100c40de 100644 --- a/crates/media/src/craft_source.rs +++ b/crates/media/src/craft_source.rs @@ -1427,9 +1427,15 @@ fn open_avi(name: &str, source: SharedBytes) -> Option> { } else { let duration = audio_candidates .iter() - .map(|&(idx, _, _, _)| { - let s = &file.streams[idx]; - Tick::from_units(i64::from(s.length).saturating_mul(i64::from(s.scale.max(1))), i64::from(s.rate.max(1))) + .map(|(idx, _, params, _)| { + let s = &file.streams[*idx]; + let units = if params.codec == CodecId::Pcm && s.sample_size > 0 { + // Playback counts complete blocks within each indexed chunk. + s.chunks.iter().fold(0i64, |units, chunk| units.saturating_add(i64::from(chunk.size / s.sample_size))) + } else { + i64::from(s.length) + }; + Tick::from_units(units.saturating_mul(i64::from(s.scale.max(1))), i64::from(s.rate.max(1))) }) .max() .unwrap_or(Tick::ZERO); @@ -4514,6 +4520,33 @@ mod tests { std::iter::repeat_n(sample.to_le_bytes(), count).flatten().collect() } + #[test] + fn audio_only_avi_counts_complete_indexed_pcm_blocks() { + let stream = avi::StreamSpec::Audio(avi::AudioSpec::pcm(48_000, 1, 16)); + let mut writer = avi::AviWriter::new(std::io::Cursor::new(Vec::new()), vec![stream], avi::MuxOptions::default()).expect("AVI writer"); + writer.write_chunk(0, &pcm_s16le_bytes(8_192, 7), true).expect("first chunk"); + writer.write_chunk(0, &pcm_s16le_bytes(16_384, 13), true).expect("second chunk"); + let mut bytes = writer.finish().expect("finish AVI").into_inner(); + // dwLength follows the AVI stream header's first 32 payload bytes. + let length_offset = bytes.windows(4).position(|tag| tag == b"strh").expect("stream header") + 8 + 32; + let mut durations = Vec::new(); + for declared_length in [1u32, 20, 200] { + bytes[length_offset..length_offset + 4].copy_from_slice(&declared_length.to_le_bytes()); + let stream = &avi::open(bytes.as_slice()).expect("demux fixture").streams[0]; + assert_eq!(stream.length, declared_length); + assert_eq!(stream.chunks.len(), 2); + let input: Arc<[u8]> = Arc::from(bytes.as_slice()); + let footage = crate::probe::probe_bytes("indexed-pcm.avi", input.clone()).expect("public probe"); + assert!(footage.has_audio && !footage.has_video); + durations.push(footage.duration); + + let source = open_bytes("indexed-pcm.avi", input).expect("recognized AVI").expect("shared AVI"); + let tail = source.audio(19, 2, 48_000).expect("read final sample and EOF"); + assert_eq!(tail.channels[0], [0.5, 0.0]); + } + assert_eq!(durations, [effectcraft_time::Tick::from_units(20, 48_000); 3]); + } + #[test] fn matroska_duration_follows_presentation_order() { use craft_media::matroska::{MkvWriter, MuxOptions, TrackKind, TrackSpec, ebml, element_ids}; From 716d03e4621163d1af5d54448eb5ac3a8a8723e7 Mon Sep 17 00:00:00 2001 From: Terra854 Date: Sun, 22 Nov 2026 02:28:05 +0800 Subject: [PATCH 374/451] media: probe Matroska ProRes coded alpha (#4034) * media: probe Matroska ProRes coded alpha * Keep shared Matroska reads when ProRes alpha is unknown --- crates/media/src/craft_source.rs | 69 +++++++++++++++++++++++++++++++- 1 file changed, 68 insertions(+), 1 deletion(-) diff --git a/crates/media/src/craft_source.rs b/crates/media/src/craft_source.rs index b100c40de..720298b9d 100644 --- a/crates/media/src/craft_source.rs +++ b/crates/media/src/craft_source.rs @@ -1056,6 +1056,17 @@ fn open_matroska(name: &str, source: SharedBytes) -> Option let frame_rate = estimate_matroska_frame_rate(video_track); let duration = matroska_duration(&file, video_track); let codec_name = video_params.codec.name().to_string(); + let coded_alpha = if video_params.codec == CodecId::ProRes { + // Bound the reconstructed packet, including the prefix restored by Matroska. + // Unknown alpha must not disable the shared reader for later pictures. + video_track + .sample_size(0) + .and_then(|size| u32::try_from(size).ok()) + .and_then(|size| prores_has_alpha(size, || file.read_sample(&*source, v_idx, 0).ok())) + .unwrap_or(false) + } else { + false + }; let video_decoder = match TrackDecoder::with_options(&video_params, TrackDecoderOptions { threads: Some(worker_cap()), draft: false }) { Ok(d) => d, Err(e) => return Some(Err(MediaError::Decode(e.to_string()))), @@ -1068,7 +1079,7 @@ fn open_matroska(name: &str, source: SharedBytes) -> Option codec: codec_name, pixel_format: String::new(), color, - has_alpha: false, + has_alpha: coded_alpha, bitrate: None, hdr: None, }; @@ -3625,6 +3636,62 @@ mod tests { assert_eq!(tick_to_units(Tick(craft_time::TICKS_PER_SECOND), 90000), 90000); } + fn prores_matroska(packets: &[&[u8]]) -> Arc<[u8]> { + use craft_media::matroska::{MkvWriter, MuxOptions, TrackKind, TrackSpec}; + use craft_video::prores::Profile; + use std::io::Cursor; + + let mut track = TrackSpec::new(TrackKind::Video, "V_PRORES"); + track.video_size = Some((16, 16)); + track.codec_private = Profile::P4444.fourcc().to_vec(); + track.default_duration_ns = Some(40_000_000); + let mut mux = MkvWriter::new(Cursor::new(Vec::new()), vec![track], MuxOptions::default()).expect("Matroska writer"); + for (index, packet) in packets.iter().enumerate() { + mux.write_frame(0, index as i64 * 40_000_000, true, packet, None).expect("write ProRes"); + } + mux.finish().expect("finish Matroska").into_inner().into() + } + + #[test] + fn matroska_prores_coded_alpha_reaches_the_public_probe() { + use craft_video::prores::{ChromaFormat, Encoder, EncoderConfig, Frame, Profile}; + use effectcraft_project::AlphaMode; + + for with_alpha in [true, false] { + let mut config = EncoderConfig::new(Profile::P4444, 16, 16); + config.encode_alpha = with_alpha; + config.threads = false; + let mut picture = Frame::new(16, 16, ChromaFormat::Yuv444, 10, with_alpha).expect("allocate picture"); + if let Some(alpha) = &mut picture.alpha { + alpha.fill(512); + } + let packet = Encoder::with_config(config).encode(&picture).expect("encode ProRes"); + let bytes = prores_matroska(&[&packet]); + + let source = open_bytes("alpha.mkv", bytes.clone()).expect("recognized Matroska").expect("shared Matroska"); + let frame = source.video_frame(FrameRequest { time: Tick::ZERO, scale: 1.0 }).expect("decode ProRes"); + assert_eq!(matches!(frame.data, PixelData::Yuv16 { alpha: Some(_), .. }), with_alpha); + + let footage = crate::probe::probe_bytes("alpha.mkv", bytes).expect("public Matroska probe"); + assert_eq!(footage.codec, "ProRes"); + assert_eq!(footage.alpha, if with_alpha { AlphaMode::Straight } else { AlphaMode::Ignore }); + } + } + + #[test] + fn matroska_prores_unreadable_alpha_probe_keeps_the_shared_route() { + use craft_video::prores::{ChromaFormat, Encoder, Frame, Profile}; + + let picture = Frame::new(16, 16, ChromaFormat::Yuv444, 10, false).expect("allocate picture"); + let packet = Encoder::new(Profile::P4444, 16, 16).encode(&picture).expect("encode ProRes"); + let bytes = prores_matroska(&[&[0; 3], &packet]); + let source = open_bytes("later-frame.mkv", bytes).expect("recognized Matroska").expect("shared Matroska"); + assert!(!source.info().video.as_ref().expect("video info").has_alpha); + let time = Tick::from_units(40, 1_000); + let later = source.video_frame(FrameRequest { time, scale: 1.0 }).expect("read intact second picture"); + assert_eq!(later.pts, time); + } + #[test] fn clean_aperture_rounds_signed_offsets_and_ignores_invalid_regions() { let aperture = isobmff::CleanAperture { width: (17, 2), height: (15, 2), horiz_offset: (1, 2), vert_offset: (-1, 2) }; From a28fcd18dd3b3df9a696086169c4f7831a4f7b30 Mon Sep 17 00:00:00 2001 From: Terra854 Date: Sun, 22 Nov 2026 02:30:18 +0800 Subject: [PATCH 375/451] media: route standalone FLAC through craft-audio (#4045) Co-authored-by: Dylan M. Taylor --- crates/media/Cargo.toml | 6 +- crates/media/src/craft_source.rs | 34 ++- .../media/src/craft_source/standalone_flac.rs | 225 ++++++++++++++++++ 3 files changed, 256 insertions(+), 9 deletions(-) create mode 100644 crates/media/src/craft_source/standalone_flac.rs diff --git a/crates/media/Cargo.toml b/crates/media/Cargo.toml index 5c6e728db..6a2ddcfdd 100644 --- a/crates/media/Cargo.toml +++ b/crates/media/Cargo.toml @@ -27,7 +27,7 @@ craft-dpx = { workspace = true } craft-exr = { workspace = true, features = ["decode"] } craft-gif = { workspace = true, features = ["frames"] } craft-webp = { workspace = true, features = ["frames"] } -craft-audio = { workspace = true, features = ["decode-native", "aac-decode", "alac-decode", "opus-decode", "ac3-decode", "mp3-decode", "mpa-decode"] } +craft-audio = { workspace = true, features = ["decode-native", "aac-decode", "alac-decode", "opus-decode", "ac3-decode", "mp3-decode", "mpa-decode", "flac-decode"] } craft-color = { workspace = true } craft-frame = { workspace = true } craft-media = { workspace = true, features = ["mpegts", "avi", "mxf"] } @@ -52,7 +52,7 @@ gif = { workspace = true } tempfile = { workspace = true } # (tests render comps that read layers through effects; already a dependency of effectcraft-render) effectcraft-effects = { workspace = true } -# Pure-Rust AAC test fixture encoding (no external ffmpeg dependency). -craft-audio = { workspace = true, features = ["aac-encode"] } +# Pure-Rust AAC and FLAC fixture encoding. +craft-audio = { workspace = true, features = ["aac-encode", "flac-encode"] } # APV import parity fixtures use the existing shared encoder. craft-video = { workspace = true, features = ["apv-encode"] } diff --git a/crates/media/src/craft_source.rs b/crates/media/src/craft_source.rs index 720298b9d..ea98cd383 100644 --- a/crates/media/src/craft_source.rs +++ b/crates/media/src/craft_source.rs @@ -30,9 +30,10 @@ //! `Apv`, other raw AVI layouts) or unsupported audio. //! - **Other containers & standalone audio**: //! - Shared (`craft_audio::Decoder` with `decode-native`): standalone `WAV`, `AIFF`, `MP3`/`MP2`/`MP1`, -//! `AAC` (ADTS), `AC-3`, and `Ogg` (`Opus`). -//! - Fallback (`filmcraft-codecs`): `Ogg Vorbis`, `FLAC`, `CAF`, or unsupported WAV/AIFF -//! encodings. +//! `AAC` (ADTS), `AC-3`, and `Ogg` (`Opus`). Bounded standalone FLAC uses the shared native +//! FLAC decoder and the same resampling policy. +//! - Fallback (`filmcraft-codecs`): `Ogg Vorbis`, `CAF`, or FLAC and WAV/AIFF input the shared +//! readers decline. use std::sync::{Arc, Mutex}; @@ -56,6 +57,8 @@ use craft_video::{TrackDecoder, TrackDecoderOptions, VideoError, prores}; mod raw_avi; use raw_avi::RawAvi; +mod standalone_flac; + /// Maximum worker threads per `TrackDecoder` instance. const MAX_WORKERS: usize = 8; @@ -134,6 +137,9 @@ pub(crate) fn open_reader(name: &str, head: &[u8], reader: &SharedBytes) -> Opti if let Some(fmt) = mpegts::sniff(head) { return open_mpeg(name, fmt, reader.clone()); } + if let Some(source) = standalone_flac::open_reader(name, head, reader) { + return Some(Ok(source)); + } open_standalone_audio(name, head, reader.clone()) } @@ -154,6 +160,9 @@ pub(crate) fn open_bytes(name: &str, bytes: Arc<[u8]>) -> Option::len(&bytes).min(64); @@ -2004,7 +2013,14 @@ impl MediaSource for StandaloneAudioSource { /// Step the fractional input position as an exact integer quotient and remainder; /// rounding happens only when interpolating a sample, independent of the window. -fn resample_audio_with_phase(decoded: &[Vec], native_rate: u32, sample_rate: u32, frames: usize, phase: u64, first_output: usize) -> Vec> { +fn resample_audio_with_phase( + decoded: &[impl AsRef<[f32]>], + native_rate: u32, + sample_rate: u32, + frames: usize, + phase: u64, + first_output: usize, +) -> Vec> { let mut out = vec![vec![0.0; frames]; decoded.len()]; let divisor = u64::from(sample_rate); let first = first_output as u128 * u128::from(native_rate) + u128::from(phase); @@ -2014,6 +2030,7 @@ fn resample_audio_with_phase(decoded: &[Vec], native_rate: u32, sample_rate let remainder_step = u64::from(native_rate % sample_rate); let inverse_rate = f64::from(sample_rate).recip(); for (samples, dst) in decoded.iter().zip(&mut out) { + let samples = samples.as_ref(); let (mut index, mut remainder) = (first_index, first_remainder); for sample in dst.iter_mut().skip(first_output) { let Some(&a) = samples.get(index) else { break }; @@ -2075,11 +2092,16 @@ fn resampling_window(start: i64, frames: usize, native_rate: u32, sample_rate: u if sample_rate == native_rate { return Some((start, frames, 0)); } + let (origin, phase) = resampling_origin(start, native_rate, sample_rate)?; + let len = ((frames as u128 * u128::from(native_rate)).div_ceil(u128::from(sample_rate)) + 2) as usize; + Some((origin, len, phase)) +} + +fn resampling_origin(start: i64, native_rate: u32, sample_rate: u32) -> Option<(i64, u64)> { let scaled = i128::from(start) * i128::from(native_rate); let divisor = i128::from(sample_rate); let origin = i64::try_from(scaled.div_euclid(divisor)).ok()?; - let len = ((frames as u128 * u128::from(native_rate)).div_ceil(u128::from(sample_rate)) + 2) as usize; - Some((origin, len, scaled.rem_euclid(divisor) as u64)) + Some((origin, scaled.rem_euclid(divisor) as u64)) } fn drain_audio_window(buf: &mut [Vec], decoded_pos: &mut i64, channels_count: usize, start: i64, frames: usize) -> Vec> { diff --git a/crates/media/src/craft_source/standalone_flac.rs b/crates/media/src/craft_source/standalone_flac.rs new file mode 100644 index 000000000..e4b94d6e0 --- /dev/null +++ b/crates/media/src/craft_source/standalone_flac.rs @@ -0,0 +1,225 @@ +//! Standalone FLAC through the pinned shared decoder. The source retains bounded decoded PCM. + +use std::sync::Arc; + +use craft_audio::{AudioBuffer, flac}; +use craft_frame::VideoFrame; +use craft_media_source::{AudioStreamInfo, DEFAULT_MAX_MEDIA_BYTES, FrameRequest, MediaError, MediaInfo, MediaKind, MediaSource, Result, SharedSource}; +#[cfg(any(unix, windows))] +use craft_media_source::{SharedBytes, read_range}; +use craft_time::Tick; + +use super::{resample_audio_with_phase, resampling_origin}; + +/// Preserve the previous reader's ceiling for an individual PCM request. +const MAX_AUDIO_REQUEST_BYTES: usize = 512 << 20; + +fn looks_like_flac(name: &str, head: &[u8]) -> bool { + head.starts_with(b"fLaC") + || head.starts_with(b"ID3") && std::path::Path::new(name).extension().and_then(|ext| ext.to_str()).is_some_and(|ext| ext.eq_ignore_ascii_case("flac")) +} + +#[cfg(any(unix, windows))] +pub(super) fn open_reader(name: &str, head: &[u8], source: &SharedBytes) -> Option { + if !looks_like_flac(name, head) { + return None; + } + let bytes = read_range(&**source, 0, usize::try_from(source.len()).ok()?).ok()?; + open_bytes(name, &bytes) +} + +pub(super) fn open_bytes(name: &str, bytes: &[u8]) -> Option { + if !looks_like_flac(name, bytes) || bytes.len() > DEFAULT_MAX_MEDIA_BYTES { + return None; + } + // Keep both the compressed and decoded inputs within the shared media buffer budget. + // Declining the file leaves the prior reader available, including its broader recovery. + let max_values = (DEFAULT_MAX_MEDIA_BYTES / std::mem::size_of::()) as u64; + let decoded = flac::decode_with_limit(bytes, max_values).ok()?; + let rate = decoded.info.sample_rate; + let frames = decoded.channels.first()?.len(); + if frames == 0 || rate == 0 { + return None; + } + + let scale = 2.0_f32.powi(1 - i32::from(decoded.info.bits_per_sample)); + let samples = decoded.channels.into_iter().map(|plane| plane.into_iter().map(|sample| sample as f32 * scale).collect()).collect(); + let info = MediaInfo { + name: name.into(), + kind: MediaKind::AudioOnly, + duration: Tick::from_units(i64::try_from(frames).ok()?, i64::from(rate)), + video: None, + audio_streams: vec![AudioStreamInfo { + sample_rate: rate, + channels: u32::from(decoded.info.channels), + codec: "FLAC".into(), + bits_per_sample: Some(u32::from(decoded.info.bits_per_sample)), + }], + container: "FLAC".into(), + start_timecode: None, + file_size: Some(bytes.len() as u64), + }; + Some(Arc::new(FlacSource { info, rate, samples })) +} + +struct FlacSource { + info: MediaInfo, + rate: u32, + samples: Vec>, +} + +impl MediaSource for FlacSource { + fn info(&self) -> &MediaInfo { + &self.info + } + + fn video_frame(&self, _req: FrameRequest) -> Result> { + Err(MediaError::NoStream("video")) + } + + fn audio(&self, start: i64, frames: usize, sample_rate: u32) -> Result { + if sample_rate == 0 { + return Err(MediaError::Decode("audio sample rate must be nonzero".into())); + } + if frames.checked_mul(self.samples.len()).and_then(|n| n.checked_mul(std::mem::size_of::())).is_none_or(|n| n > MAX_AUDIO_REQUEST_BYTES) { + return Err(MediaError::Decode("FLAC audio request exceeds the PCM buffer limit".into())); + } + let prefix = if start < 0 { usize::try_from(start.unsigned_abs()).unwrap_or(frames).min(frames) } else { 0 }; + let Some((origin, phase)) = resampling_origin(start.max(0), self.rate, sample_rate) else { + return Ok(AudioBuffer::new(sample_rate, self.samples.len() as u16, frames)); + }; + let origin = usize::try_from(origin).unwrap_or(usize::MAX); + let tail: Vec<&[f32]> = self.samples.iter().map(|plane| plane.get(origin..).unwrap_or_default()).collect(); + // Keep the true end of the PCM tail so interpolation holds the final sample until + // the clip ends. Padding this input tail would fade the final sample into silence. + let mut channels = resample_audio_with_phase(&tail, self.rate, sample_rate, frames - prefix, phase, 0); + if prefix != 0 { + for channel in &mut channels { + channel.resize(frames, 0.0); + channel.rotate_right(prefix); + } + } + Ok(AudioBuffer { sample_rate, channels }) + } +} + +#[cfg(test)] +mod tests { + use std::sync::Arc; + + use craft_audio::{AudioBuffer, BitDepth, EncodeFormat, EncodeOptions}; + use craft_media_source::{MediaError, MediaKind, SharedSource}; + use craft_time::Tick; + + use crate::stream::{self, MediaSource as OpenedSource}; + + const RATE: u32 = 48_000; + const FRAMES: usize = 4_501; + + fn fixture() -> (Vec, AudioBuffer) { + let left = (0..FRAMES).map(|i| ((i * 23 % 350) as f32 - 170.0) / 512.0).collect(); + let right = (0..FRAMES).map(|i| (220.0 - (i * 37 % 470) as f32) / 512.0).collect(); + let pcm = AudioBuffer { sample_rate: RATE, channels: vec![left, right] }; + let opts = EncodeOptions::new(EncodeFormat::Flac).with_bit_depth(BitDepth::Int24); + (craft_audio::encode(&pcm, &opts).unwrap(), pcm) + } + + fn require_shared(opened: OpenedSource) -> SharedSource { + let OpenedSource::Craft(source) = opened else { panic!("FLAC should use the shared reader") }; + source + } + + #[test] + #[cfg(any(unix, windows))] + fn standalone_flac_uses_shared_source_for_disk_and_memory() { + let (bytes, pcm) = fixture(); + let bytes: Arc<[u8]> = bytes.into(); + let memory = require_shared(stream::open_bytes("music.flac", bytes.clone()).unwrap()); + let dir = tempfile::tempdir().unwrap(); + let path = dir.path().join("music.flac"); + std::fs::write(&path, &bytes).unwrap(); + let disk = require_shared(stream::open_source(&path).unwrap().0.unwrap()); + let legacy = filmcraft_codecs::open_bytes("music.flac", bytes.clone()).unwrap(); + + for source in [memory, disk] { + let info = source.info(); + let stream = info.audio().unwrap(); + assert_eq!(info.kind, MediaKind::AudioOnly); + assert_eq!(info.duration, Tick::from_units(FRAMES as i64, i64::from(RATE))); + assert_eq!(info.file_size, Some(bytes.len() as u64)); + assert_eq!(info.container, legacy.info().container); + assert_eq!(stream.codec, legacy.info().audio().unwrap().codec); + assert_eq!((stream.sample_rate, stream.channels, stream.bits_per_sample), (RATE, 2, Some(24))); + let decoded = source.audio(0, FRAMES, RATE).unwrap(); + assert_eq!((decoded.sample_rate, decoded.num_channels(), decoded.frames()), (RATE, 2, FRAMES)); + for (got, want) in decoded.channels.iter().flatten().zip(pcm.channels.iter().flatten()) { + assert_eq!(got, want); + } + + // Seek backwards, across the encoder's block boundary, and around both clip edges. + for (rate, start, frames) in [(RATE, 4091, 20), (RATE, -3, 8), (96_000, 8998, 10), (44_100, 251, 39), (44_100, 61, 39)] { + let got = source.audio(start, frames, rate).unwrap(); + let want = legacy.audio(start, frames, rate).unwrap(); + assert_eq!(got.channels[0].len(), frames); + for (got, want) in got.channels.iter().zip(&want.channels) { + for (got, want) in got.iter().zip(want) { + assert!((got - want).abs() <= 1e-6, "output rate {rate}, start {start}: {got} vs {want}"); + } + } + } + + let full = source.audio(61, 63, 44_100).unwrap(); + let left = source.audio(61, 23, 44_100).unwrap(); + let right = source.audio(84, 40, 44_100).unwrap(); + for ((whole, left), right) in full.channels.iter().zip(&left.channels).zip(&right.channels) { + assert_eq!(&whole[..23], left); + assert_eq!(&whole[23..], right); + } + assert!(matches!(source.audio(0, usize::MAX, RATE), Err(MediaError::Decode(_)))); + assert!(matches!(source.audio(0, 1, 0), Err(MediaError::Decode(_)))); + } + } + + #[test] + #[cfg(any(unix, windows))] + fn standalone_flac_keeps_legacy_trailer_compatibility() { + let (mut bytes, pcm) = fixture(); + bytes.extend_from_slice(b"trailing bytes"); + let dir = tempfile::tempdir().unwrap(); + let path = dir.path().join("trailer.flac"); + std::fs::write(&path, &bytes).unwrap(); + let disk = stream::open_source(&path).unwrap().0.unwrap(); + let memory = stream::open_bytes("trailer.flac", bytes.into()).unwrap(); + for opened in [disk, memory] { + let OpenedSource::Film(source) = opened else { panic!("the existing reader should accept the trailer") }; + let prefix = source.audio(0, 32, RATE).unwrap(); + assert_eq!((prefix.channels[0].as_slice(), prefix.channels[1].as_slice()), (&pcm.channels[0][..32], &pcm.channels[1][..32])); + } + } + + #[test] + #[cfg(any(unix, windows))] + fn native_flac_opener_declines_an_oversized_file_without_reading_it() { + use std::sync::atomic::{AtomicBool, Ordering}; + + use craft_media::ByteSource; + use craft_media_source::{DEFAULT_MAX_MEDIA_BYTES, SharedBytes}; + + struct OversizedFile(AtomicBool); + impl ByteSource for OversizedFile { + fn len(&self) -> u64 { + DEFAULT_MAX_MEDIA_BYTES as u64 + 1 + } + + fn read_at(&self, _: u64, _: &mut [u8]) -> std::io::Result<()> { + self.0.store(true, Ordering::Relaxed); + Err(std::io::Error::other("oversized input was read")) + } + } + + let file = Arc::new(OversizedFile(AtomicBool::new(false))); + let source: SharedBytes = file.clone(); + assert!(super::open_reader("oversized.flac", b"fLaC", &source).is_none()); + assert!(!file.0.load(Ordering::Relaxed)); + } +} From f70208cef39195dc82db75068a920730c0283aef Mon Sep 17 00:00:00 2001 From: Terra854 Date: Sun, 22 Nov 2026 02:31:03 +0800 Subject: [PATCH 376/451] media: route MP4 and Matroska FLAC through craft-audio (#4049) * media: route MP4 and Matroska FLAC through craft-audio * media: propagate errors when generating FLAC test fixtures --------- Co-authored-by: Dylan M. Taylor --- Cargo.lock | 54 ++++---- Cargo.toml | 14 +-- crates/media/src/craft_source.rs | 71 ++++++----- .../src/craft_source/flac_tracks_tests.rs | 116 ++++++++++++++++++ 4 files changed, 194 insertions(+), 61 deletions(-) create mode 100644 crates/media/src/craft_source/flac_tracks_tests.rs diff --git a/Cargo.lock b/Cargo.lock index 68eb957f3..5ec8226e3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1207,10 +1207,10 @@ dependencies = [ [[package]] name = "craft-audio" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3dff4793f1a5bd1f99a4fe3280d48f515158dff3#3dff4793f1a5bd1f99a4fe3280d48f515158dff3" +source = "git+https://github.com/storytold/craft-libs?rev=587339c787682592ed46bab5a15cae52e60da2e3#587339c787682592ed46bab5a15cae52e60da2e3" dependencies = [ - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=3dff4793f1a5bd1f99a4fe3280d48f515158dff3)", - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=3dff4793f1a5bd1f99a4fe3280d48f515158dff3)", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=587339c787682592ed46bab5a15cae52e60da2e3)", + "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=587339c787682592ed46bab5a15cae52e60da2e3)", "log", "thiserror 2.0.21", ] @@ -1266,7 +1266,7 @@ source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c [[package]] name = "craft-color" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3dff4793f1a5bd1f99a4fe3280d48f515158dff3#3dff4793f1a5bd1f99a4fe3280d48f515158dff3" +source = "git+https://github.com/storytold/craft-libs?rev=587339c787682592ed46bab5a15cae52e60da2e3#587339c787682592ed46bab5a15cae52e60da2e3" dependencies = [ "serde", ] @@ -1341,10 +1341,10 @@ source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c [[package]] name = "craft-frame" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3dff4793f1a5bd1f99a4fe3280d48f515158dff3#3dff4793f1a5bd1f99a4fe3280d48f515158dff3" +source = "git+https://github.com/storytold/craft-libs?rev=587339c787682592ed46bab5a15cae52e60da2e3#587339c787682592ed46bab5a15cae52e60da2e3" dependencies = [ "craft-color", - "craft-time 0.1.0 (git+https://github.com/storytold/craft-libs?rev=3dff4793f1a5bd1f99a4fe3280d48f515158dff3)", + "craft-time 0.1.0 (git+https://github.com/storytold/craft-libs?rev=587339c787682592ed46bab5a15cae52e60da2e3)", "rayon", "serde", ] @@ -1415,7 +1415,7 @@ source = "git+https://github.com/storytold/craft-libs?rev=30596f73c5ef851ba3dad9 [[package]] name = "craft-media" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3dff4793f1a5bd1f99a4fe3280d48f515158dff3#3dff4793f1a5bd1f99a4fe3280d48f515158dff3" +source = "git+https://github.com/storytold/craft-libs?rev=587339c787682592ed46bab5a15cae52e60da2e3#587339c787682592ed46bab5a15cae52e60da2e3" dependencies = [ "chrono", "thiserror 2.0.21", @@ -1441,13 +1441,13 @@ dependencies = [ [[package]] name = "craft-media-source" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3dff4793f1a5bd1f99a4fe3280d48f515158dff3#3dff4793f1a5bd1f99a4fe3280d48f515158dff3" +source = "git+https://github.com/storytold/craft-libs?rev=587339c787682592ed46bab5a15cae52e60da2e3#587339c787682592ed46bab5a15cae52e60da2e3" dependencies = [ - "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=3dff4793f1a5bd1f99a4fe3280d48f515158dff3)", + "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=587339c787682592ed46bab5a15cae52e60da2e3)", "craft-color", "craft-frame", - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=3dff4793f1a5bd1f99a4fe3280d48f515158dff3)", - "craft-time 0.1.0 (git+https://github.com/storytold/craft-libs?rev=3dff4793f1a5bd1f99a4fe3280d48f515158dff3)", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=587339c787682592ed46bab5a15cae52e60da2e3)", + "craft-time 0.1.0 (git+https://github.com/storytold/craft-libs?rev=587339c787682592ed46bab5a15cae52e60da2e3)", "serde", "thiserror 2.0.21", ] @@ -1584,7 +1584,7 @@ dependencies = [ [[package]] name = "craft-time" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3dff4793f1a5bd1f99a4fe3280d48f515158dff3#3dff4793f1a5bd1f99a4fe3280d48f515158dff3" +source = "git+https://github.com/storytold/craft-libs?rev=57288edafdc45552e30481cc649021de446abfa0#57288edafdc45552e30481cc649021de446abfa0" dependencies = [ "serde", "thiserror 2.0.21", @@ -1593,7 +1593,7 @@ dependencies = [ [[package]] name = "craft-time" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57288edafdc45552e30481cc649021de446abfa0#57288edafdc45552e30481cc649021de446abfa0" +source = "git+https://github.com/storytold/craft-libs?rev=587339c787682592ed46bab5a15cae52e60da2e3#587339c787682592ed46bab5a15cae52e60da2e3" dependencies = [ "serde", "thiserror 2.0.21", @@ -1697,9 +1697,9 @@ dependencies = [ [[package]] name = "craft-video" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3dff4793f1a5bd1f99a4fe3280d48f515158dff3#3dff4793f1a5bd1f99a4fe3280d48f515158dff3" +source = "git+https://github.com/storytold/craft-libs?rev=587339c787682592ed46bab5a15cae52e60da2e3#587339c787682592ed46bab5a15cae52e60da2e3" dependencies = [ - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=3dff4793f1a5bd1f99a4fe3280d48f515158dff3)", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=587339c787682592ed46bab5a15cae52e60da2e3)", "rav1e", "rayon", "thiserror 2.0.21", @@ -1745,6 +1745,16 @@ dependencies = [ "thiserror 2.0.21", ] +[[package]] +name = "craft-xml" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=587339c787682592ed46bab5a15cae52e60da2e3#587339c787682592ed46bab5a15cae52e60da2e3" +dependencies = [ + "quick-xml 0.41.0", + "serde", + "thiserror 2.0.21", +] + [[package]] name = "craft-xml" version = "0.1.0" @@ -2146,11 +2156,11 @@ dependencies = [ name = "effectcraft-export" version = "0.24.1" dependencies = [ - "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=3dff4793f1a5bd1f99a4fe3280d48f515158dff3)", + "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=587339c787682592ed46bab5a15cae52e60da2e3)", "craft-exr", "craft-gif", - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=3dff4793f1a5bd1f99a4fe3280d48f515158dff3)", - "craft-video 0.1.0 (git+https://github.com/storytold/craft-libs?rev=3dff4793f1a5bd1f99a4fe3280d48f515158dff3)", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=587339c787682592ed46bab5a15cae52e60da2e3)", + "craft-video 0.1.0 (git+https://github.com/storytold/craft-libs?rev=587339c787682592ed46bab5a15cae52e60da2e3)", "effectcraft-color", "effectcraft-effects", "effectcraft-keyframe", @@ -2312,17 +2322,17 @@ name = "effectcraft-media" version = "0.24.1" dependencies = [ "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=30596f73c5ef851ba3dad9cf145669f391e2eb0d)", - "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=3dff4793f1a5bd1f99a4fe3280d48f515158dff3)", + "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=587339c787682592ed46bab5a15cae52e60da2e3)", "craft-color", "craft-docpath", "craft-dpx 0.1.0 (git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87)", "craft-exr", "craft-frame", "craft-gif", - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=3dff4793f1a5bd1f99a4fe3280d48f515158dff3)", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=587339c787682592ed46bab5a15cae52e60da2e3)", "craft-media-source", - "craft-time 0.1.0 (git+https://github.com/storytold/craft-libs?rev=3dff4793f1a5bd1f99a4fe3280d48f515158dff3)", - "craft-video 0.1.0 (git+https://github.com/storytold/craft-libs?rev=3dff4793f1a5bd1f99a4fe3280d48f515158dff3)", + "craft-time 0.1.0 (git+https://github.com/storytold/craft-libs?rev=587339c787682592ed46bab5a15cae52e60da2e3)", + "craft-video 0.1.0 (git+https://github.com/storytold/craft-libs?rev=587339c787682592ed46bab5a15cae52e60da2e3)", "craft-webp", "effectcraft-color", "effectcraft-effects", diff --git a/Cargo.toml b/Cargo.toml index 011553b8c..e5753ceff 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -97,13 +97,13 @@ same-file = "1.0" tempfile = "3.27" # codecs + containers shared by the Craft apps (crates/media, crates/export); keep all in sync. -craft-media = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "3dff4793f1a5bd1f99a4fe3280d48f515158dff3", default-features = false, features = ["isobmff", "matroska"] } -craft-media-source = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "3dff4793f1a5bd1f99a4fe3280d48f515158dff3" } -craft-frame = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "3dff4793f1a5bd1f99a4fe3280d48f515158dff3" } -craft-color = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "3dff4793f1a5bd1f99a4fe3280d48f515158dff3" } -craft-time = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "3dff4793f1a5bd1f99a4fe3280d48f515158dff3" } -craft-audio = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "3dff4793f1a5bd1f99a4fe3280d48f515158dff3", default-features = false, features = ["aac-decode", "aac-encode", "alac-decode", "opus-decode", "opus-encode", "ac3-decode", "mp3-decode", "mpa-decode"] } -craft-video = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "3dff4793f1a5bd1f99a4fe3280d48f515158dff3", features = ["h264-decode", "h264-encode", "prores", "hevc-encode", "vp9-encode", "av1", "threads"] } +craft-media = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "587339c787682592ed46bab5a15cae52e60da2e3", default-features = false, features = ["isobmff", "matroska"] } +craft-media-source = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "587339c787682592ed46bab5a15cae52e60da2e3" } +craft-frame = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "587339c787682592ed46bab5a15cae52e60da2e3" } +craft-color = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "587339c787682592ed46bab5a15cae52e60da2e3" } +craft-time = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "587339c787682592ed46bab5a15cae52e60da2e3" } +craft-audio = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "587339c787682592ed46bab5a15cae52e60da2e3", default-features = false, features = ["aac-decode", "aac-encode", "alac-decode", "opus-decode", "opus-encode", "ac3-decode", "mp3-decode", "mpa-decode"] } +craft-video = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "587339c787682592ed46bab5a15cae52e60da2e3", features = ["h264-decode", "h264-encode", "prores", "hevc-encode", "vp9-encode", "av1", "threads"] } # footage decoding: FilmCraft's pure-Rust crates, pinned to a revision (plan/adr/0001). # Only `crates/media`, `crates/export` and `crates/interchange` may depend on these. diff --git a/crates/media/src/craft_source.rs b/crates/media/src/craft_source.rs index ea98cd383..5405c5b9e 100644 --- a/crates/media/src/craft_source.rs +++ b/crates/media/src/craft_source.rs @@ -10,14 +10,14 @@ //! - Shared (`craft-media::isobmff` + `craft-video` + `craft-audio`): `H264`, `Hevc`, `Av1`, //! `Vp9`, `Vp8`, `ProRes` (coded alpha via `craft_video::prores::probe`, #3999), `Dnxhd`, //! `Mpeg2Video`, and strictly admitted video-only `Apv` MP4; -//! audio `Aac`, `Alac`, `Opus`, `Ac3`, `Mp3`/`Mp2`/`Mp1`. +//! audio `Aac`, `Alac`, `Flac`, `Opus`, `Ac3`, `Mp3`/`Mp2`/`Mp1`. //! - Fallback (`filmcraft-codecs`): `Mjpeg`, `Mpeg4Video`, `Ffv1`, other `Apv`, or unsupported audio. //! - **Matroska / WebM (`MKV`/`MKA`/`WebM`, video+audio & audio-only)**: //! - Shared (`craft-media::matroska` + `craft-video` + `craft-audio`): `H264`, `Hevc`, `Av1`, -//! `Vp9`, `Vp8`, `ProRes`, `Dnxhd`, `Mpeg2Video`; audio `Aac`, `Alac`, `Opus`, `Ac3`, +//! `Vp9`, `Vp8`, `ProRes`, `Dnxhd`, `Mpeg2Video`; audio `Aac`, `Alac`, `Flac`, `Opus`, `Ac3`, //! `Mp3`/`Mp2`/`Mp1` (with `CodecDelay` + `SeekPreRoll` timing). //! - Fallback (`filmcraft-codecs`): `alpha_mode == 1` (`BlockAdditional` alpha), unreadable/zlib -//! encodings, `Mjpeg`/`Ffv1`/`Theora`/`Apv`, or unsupported audio (`Vorbis`/`Flac`/`Pcm`). +//! encodings, `Mjpeg`/`Ffv1`/`Theora`/`Apv`, or unsupported audio (`Vorbis`/`Pcm`). //! - **MXF (`MXF`, video+audio & audio-only OP1a/OP-Atom)**: //! - Shared (`craft-media::mxf` + `craft-video` + `MxfFile::read_pcm`): `H264`, `Hevc`, `Av1`, //! `Vp9`, `Vp8`, `ProRes`, `Dnxhd`, `Mpeg2Video`; sound `Pcm` and `Aes3` (D-10). @@ -420,7 +420,7 @@ fn place_packet(packet: PacketTime, next: &mut Option, tolerance: u64) -> i start } -struct OpusPrefix { +struct PacketTimingPrefix { len: usize, next: Option, tolerance: u64, @@ -428,27 +428,28 @@ struct OpusPrefix { } struct AudioStarts { - // For Opus, unvisited entries still hold raw container stamps. Resolve in place + // Unvisited entries still hold raw container stamps. Resolve in place // as packets arrive, reusing this table for the finished timeline. positions: Vec, - opus: Option, + pending: Option, } impl AudioStarts { fn complete(positions: Vec) -> Self { - Self { positions, opus: None } + Self { positions, pending: None } } - fn opus(positions: Vec, tolerance: i64) -> Self { + fn from_packet_timing(positions: Vec, tolerance: i64) -> Self { // Open resolves exactly the bounded lookahead before anyone can seek. let min_pending_stamp = positions.iter().skip(AUDIO_LOOKAHEAD).copied().min().unwrap_or(i64::MIN); - let opus = (!positions.is_empty()).then_some(OpusPrefix { len: 0, next: None, tolerance: tolerance.max(0).unsigned_abs(), min_pending_stamp }); - Self { positions, opus } + let pending = + (!positions.is_empty()).then_some(PacketTimingPrefix { len: 0, next: None, tolerance: tolerance.max(0).unsigned_abs(), min_pending_stamp }); + Self { positions, pending } } fn start(&self, file: &ContainerFile, track: usize, idx: usize) -> Option { let stamp = *self.positions.get(idx)?; - let Some(prefix) = &self.opus else { return Some(stamp) }; + let Some(prefix) = &self.pending else { return Some(stamp) }; if idx < prefix.len { return Some(stamp); } @@ -459,22 +460,26 @@ impl AudioStarts { }) } - fn observe(&mut self, file: &ContainerFile, track: usize, idx: usize, packet: &[u8]) { - let Some(prefix) = &mut self.opus else { return }; + fn observe(&mut self, file: &ContainerFile, track: usize, idx: usize, packet: &[u8], decoder: &AudioTrackDecoder) { + let Some(prefix) = &mut self.pending else { return }; if idx != prefix.len { return; } - let timing = - PacketTime { stamp: self.positions[idx], stamped: file.audio_packet_is_stamped(track, idx), samples: opus_packet_samples(packet).map(i64::from) }; + let samples = match decoder.codec() { + CodecId::Opus => opus_packet_samples(packet).map(i64::from), + CodecId::Flac => decoder.flac_packet_frames(packet).and_then(|n| i64::try_from(n).ok()), + _ => None, + }; + let timing = PacketTime { stamp: self.positions[idx], stamped: file.audio_packet_is_stamped(track, idx), samples }; self.positions[idx] = place_packet(timing, &mut prefix.next, prefix.tolerance); prefix.len += 1; if prefix.len == self.positions.len() { - self.opus = None; + self.pending = None; } } fn seek_proves_first_packet(&self, target: i64) -> bool { - let Some(prefix) = &self.opus else { return false }; + let Some(prefix) = &self.pending else { return false }; // A normal read that starts before the very first packet looks like a // backward seek. It need not read the suffix if the ordinary seek // would back up to packet 0 anyway. Stamped starts can only move by the @@ -485,18 +490,18 @@ impl AudioStarts { && self.positions.get(AUDIO_SEEK_BACKUP_PACKETS + 1..prefix.len).is_some_and(|p| p.iter().all(|&start| start > target)) } - fn finish_for_seek(&mut self, file: &ContainerFile, source: &dyn ByteSource, track: usize) -> Result<()> { + fn finish_for_seek(&mut self, file: &ContainerFile, source: &dyn ByteSource, track: usize, decoder: &AudioTrackDecoder) -> Result<()> { // The exact recurrence can carry a timing phase across arbitrarily many // rounded or laced packets. A first discontinuous seek may still have to // index the unread suffix; normal open and sequential decode never do this. - while let Some(idx) = self.opus.as_ref().map(|prefix| prefix.len) { + while let Some(idx) = self.pending.as_ref().map(|prefix| prefix.len) { if filmcraft_media::cancel::cancelled() { return Err(MediaError::Cancelled); } // Do not commit a guessed duration after an I/O error; the next // request can retry this packet without re-reading the valid prefix. let packet = file.read_sample(source, track, idx)?; - self.observe(file, track, idx, &packet); + self.observe(file, track, idx, &packet, decoder); } Ok(()) } @@ -556,8 +561,8 @@ fn compute_audio_starts(container: &ContainerFile, track_idx: usize, codec: Code let ts = i128::from(track.timescale.max(1)); let stamps: Vec = (0..track.samples.len()).map(|i| isobmff_audio_position(track, i, native_rate)).collect(); let unit = i64::try_from((rate + ts - 1) / ts).unwrap_or(i64::MAX); - if codec == CodecId::Opus { - return AudioStarts::opus(stamps, unit.saturating_mul(2).saturating_add(1)); + if matches!(codec, CodecId::Opus | CodecId::Flac) { + return AudioStarts::from_packet_timing(stamps, unit.saturating_mul(2).saturating_add(1)); } let Some(frame) = fixed_samples else { return AudioStarts::complete(stamps); @@ -579,8 +584,8 @@ fn compute_audio_starts(container: &ContainerFile, track_idx: usize, codec: Code i64::try_from(audio_frames_from_ns(ns, native_rate) - delay_frames).unwrap_or(0) }; let tick_samples = i64::try_from(i128::from(track.ticks_to_ns(2)) * rate / 1_000_000_000).unwrap_or(i64::MAX).saturating_add(1); - if codec == CodecId::Opus { - return AudioStarts::opus(track.samples.iter().map(|s| stamp_for(s.pts)).collect(), tick_samples); + if matches!(codec, CodecId::Opus | CodecId::Flac) { + return AudioStarts::from_packet_timing(track.samples.iter().map(|s| stamp_for(s.pts)).collect(), tick_samples); } let Some(frame) = fixed_samples else { return AudioStarts::complete(track.samples.iter().map(|s| stamp_for(s.pts)).collect()); @@ -671,9 +676,9 @@ where let codec = dec.codec(); let fixed_samples = fixed_packet_samples(&mut dec, codec, &lookahead); let mut audio_starts = compute_audio_starts(container, idx, codec, native_rate, fixed_samples); - if codec == CodecId::Opus { + if audio_starts.pending.is_some() { for (s_idx, pkt) in lookahead.iter().enumerate() { - audio_starts.observe(container, idx, s_idx, pkt); + audio_starts.observe(container, idx, s_idx, pkt, &dec); } } let seek_preroll_samples = match container { @@ -688,7 +693,7 @@ where sample_rate: native_rate, channels, codec: params.codec.name().to_string(), - bits_per_sample: params.pcm.map(|p| u32::from(p.bits)), + bits_per_sample: dec.flac_stream_info().map(|info| u32::from(info.bits_per_sample)).or_else(|| params.pcm.map(|p| u32::from(p.bits))), }); audio_tracks.push(AudioTrackEntry { track_idx: idx, @@ -2201,7 +2206,7 @@ fn decode_audio_range( let (seek_idx, decoded_pos) = if moves_backward && state.next_sample == 0 && state.audio_starts.seek_proves_first_packet(target) { (0, state.decoded_pos) } else { - state.audio_starts.finish_for_seek(file, source, track_idx)?; + state.audio_starts.finish_for_seek(file, source, track_idx, &state.decoder)?; file.audio_seek_info(track_idx, &state.audio_starts.positions, seek_preroll_samples, start) }; state.decoder.reset(); @@ -2233,7 +2238,7 @@ fn decode_audio_range( break; } let pkt = file.read_sample(source, track_idx, idx)?; - state.audio_starts.observe(file, track_idx, idx, &pkt); + state.audio_starts.observe(file, track_idx, idx, &pkt, &state.decoder); state.next_sample = idx + 1; let block = state.decoder.decode(&pkt).map_err(|e| MediaError::Decode(e.to_string()))?; let buf_len = state.buf.first().map_or(0, Vec::len) as i64; @@ -2770,6 +2775,8 @@ fn estimate_matroska_frame_rate(track: &matroska::Track) -> FrameRate { FrameRate::FPS_30 } +#[cfg(all(test, any(unix, windows)))] +mod flac_tracks_tests; #[cfg(all(test, any(unix, windows)))] mod raw_avi_tests; @@ -3154,7 +3161,7 @@ mod tests { assert_eq!(backward, decode(&mut reference[0], &source.bytes, backward_start, OPUS_FRAME)); let (_, state) = tracks[0].decoder_parts(); assert_eq!(state.audio_starts.positions.as_slice(), expected_positions); - assert!(state.audio_starts.opus.is_none()); + assert!(state.audio_starts.pending.is_none()); early } @@ -3185,7 +3192,7 @@ mod tests { let (preroll, state) = fresh[0].decoder_parts(); let error = decode_audio_range(file, source, 0, OPUS_RATE, 1, preroll, state, start, 3 * OPUS_FRAME).unwrap_err(); assert!(matches!(error, MediaError::Io(_))); - assert_eq!(state.audio_starts.opus.as_ref().unwrap().len, transient_packet); + assert_eq!(state.audio_starts.pending.as_ref().unwrap().len, transient_packet); assert_eq!((state.next_sample, state.decoded_pos), (0, first)); } let cold = decode(&mut fresh[0], source, start, 3 * OPUS_FRAME); @@ -3193,7 +3200,7 @@ mod tests { assert!(cold[0].iter().any(|s| s.abs() > 1e-5)); let (_, state) = fresh[0].decoder_parts(); assert_eq!(state.audio_starts.positions.as_slice(), expected_positions); - assert!(state.audio_starts.opus.is_none()); + assert!(state.audio_starts.pending.is_none()); } #[test] diff --git a/crates/media/src/craft_source/flac_tracks_tests.rs b/crates/media/src/craft_source/flac_tracks_tests.rs new file mode 100644 index 000000000..8395c81d1 --- /dev/null +++ b/crates/media/src/craft_source/flac_tracks_tests.rs @@ -0,0 +1,116 @@ +use std::io::Cursor; +use std::sync::Arc; + +use craft_audio::flac::{Encoder, EncoderConfig, STREAMINFO_OFFSET}; +use craft_media::{isobmff, matroska}; +use craft_media_source::MediaKind; + +use crate::stream::{self, MediaSource as OpenedSource}; + +const RATE: u32 = 96_000; +const BLOCK: usize = 1_000; +const FRAMES: usize = 196 * BLOCK + 221; +const COLD_SEEK: usize = 2 * RATE as usize + BLOCK + 200; + +struct Fixture { + private: Vec, + packets: Vec>, + samples: Vec>, +} + +impl Fixture { + fn new() -> Result> { + let left: Vec = (0..FRAMES).map(|i| (i as i32 * 307 % 65_536) - 30_000).collect(); + let right: Vec = (0..FRAMES).map(|i| 28_000 - (i as i32 * 701 % 59_000)).collect(); + let mut config = EncoderConfig::new(RATE, 2, 24); + config.block_size = BLOCK as u16; + let mut encoder = Encoder::new(config)?; + let mut packets = encoder.encode_frames(&[&left, &right])?; + packets.push(encoder.finish()); + let mut private = encoder.header(&[]); + let offset = STREAMINFO_OFFSET as usize; + private[offset..offset + 34].copy_from_slice(&encoder.streaminfo()); + Ok(Self { private, packets, samples: vec![left, right] }) + } + + fn mp4(&self) -> Result, Box> { + let offset = STREAMINFO_OFFSET as usize; + let mut entry = isobmff::SampleEntry::flac(self.private[offset..offset + 34].try_into()?); + entry.audio.as_mut().ok_or("FLAC sample entry needs an audio header")?.sample_rate = 48_000.0; + let mut writer = isobmff::Mp4Writer::new(Cursor::new(Vec::new()), isobmff::WriterOptions::new(isobmff::Brand::Mp4))?; + writer.add_track(isobmff::TrackConfig::new(entry, RATE))?; + for (i, packet) in self.packets.iter().enumerate() { + let duration = (FRAMES - i * BLOCK).min(BLOCK) as u32; + writer.write_sample(0, isobmff::WriteSample { data: packet, duration, composition_offset: 0, is_sync: true })?; + } + Ok(writer.finish()?.into_inner()) + } + + fn mkv(&self, private: &[u8]) -> Result, Box> { + let mut track = matroska::TrackSpec::new(matroska::TrackKind::Audio, "A_FLAC"); + track.audio = Some((f64::from(RATE), 2, Some(24))); + track.codec_private = private.to_vec(); + let mut writer = matroska::MkvWriter::new(Cursor::new(Vec::new()), vec![track], matroska::MuxOptions::default())?; + for (i, packet) in self.packets.iter().enumerate() { + // The muxer rounds starts to its millisecond clock. A 1000-frame packet + // at 96 kHz does not start on a millisecond boundary after packet zero. + let pts = (i * BLOCK) as i64 * 1_000_000_000 / i64::from(RATE); + let duration = (FRAMES - i * BLOCK).min(BLOCK) as u64 * 1_000_000_000 / u64::from(RATE); + writer.write_frame(0, pts, true, packet, Some(duration))?; + } + Ok(writer.finish()?.into_inner()) + } +} + +#[test] +fn flac_in_mp4_and_matroska_uses_shared_samples_after_cold_and_backward_seeks() -> Result<(), Box> { + let fixture = Fixture::new()?; + let dir = tempfile::tempdir().unwrap(); + for (name, bytes) in [("audio.mp4", fixture.mp4()?), ("audio.mka", fixture.mkv(&fixture.private)?)] { + let bytes: Arc<[u8]> = bytes.into(); + let path = dir.path().join(name); + std::fs::write(&path, &bytes).unwrap(); + let disk = stream::open_source(&path).unwrap().0.unwrap(); + let memory = stream::open_bytes(name, bytes).unwrap(); + for opened in [disk, memory] { + let OpenedSource::Craft(source) = opened else { panic!("{name}: expected the shared FLAC reader") }; + let info = source.info(); + assert_eq!(info.kind, MediaKind::AudioOnly); + let audio = info.audio().unwrap(); + assert_eq!((audio.codec.as_str(), audio.sample_rate, audio.channels, audio.bits_per_sample), ("FLAC", RATE, 2, Some(24))); + + for (start, frames) in [(COLD_SEEK, 48), (991, 33), (FRAMES - 25, 50), (0, FRAMES)] { + let decoded = source.audio(start as i64, frames, RATE).unwrap(); + assert_eq!((decoded.num_channels(), decoded.frames()), (2, frames)); + for (actual, expected) in decoded.channels.iter().zip(&fixture.samples) { + for (i, &sample) in actual.iter().enumerate() { + let want = expected.get(start + i).copied().unwrap_or(0) as f32 / 8_388_608.0; + assert_eq!(sample, want, "{name} sample {}", start + i); + } + } + } + + let whole = source.audio(451, 93, 44_100).unwrap(); + let first = source.audio(451, 31, 44_100).unwrap(); + let second = source.audio(482, 62, 44_100).unwrap(); + for ((whole, first), second) in whole.channels.iter().zip(&first.channels).zip(&second.channels) { + assert_eq!(&whole[..31], first, "{name} first resampled segment"); + assert_eq!(&whole[31..], second, "{name} second resampled segment"); + } + } + } + Ok(()) +} + +#[test] +fn flac_without_the_expected_private_marker_keeps_matroska_fallback() -> Result<(), Box> { + let fixture = Fixture::new()?; + let mut private = fixture.private.clone(); + private[..4].copy_from_slice(b"test"); + let OpenedSource::Film(source) = stream::open_bytes("legacy.mka", fixture.mkv(&private)?.into()).unwrap() else { + panic!("expected the legacy FLAC reader"); + }; + let decoded = source.audio(0, 16, RATE).unwrap(); + assert!(decoded.channels[0].iter().any(|&sample| sample != 0.0)); + Ok(()) +} From 563fea6582498e5b64a980ba3458a9d583e043bc Mon Sep 17 00:00:00 2001 From: Terra854 Date: Sun, 22 Nov 2026 02:33:27 +0800 Subject: [PATCH 377/451] media: use the shared GIF text control fix (#4040) * media: use the shared GIF text control fix * chore: repin craft-gif to storytold/craft-libs main (ba25ccd2) --------- Co-authored-by: Dylan M. Taylor --- Cargo.lock | 2 +- Cargo.toml | 2 +- crates/media/src/gif_anim.rs | 26 ++++++++++++++++++++++++++ 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5ec8226e3..81cc29132 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1352,7 +1352,7 @@ dependencies = [ [[package]] name = "craft-gif" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" +source = "git+https://github.com/storytold/craft-libs?rev=ba25ccd233934d1b2f74e3c0f235168bf5f13ef3#ba25ccd233934d1b2f74e3c0f235168bf5f13ef3" dependencies = [ "gif", "image", diff --git a/Cargo.toml b/Cargo.toml index e5753ceff..c1c46eb1d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,7 @@ craft-ecproj-format = { version = "0.1.0", git = "https://github.com/storytold/c craft-dpx = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" } craft-ps = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "808730f49b9637b7909fe2ae56f9d63fdb100cae", default-features = false, features = ["read"] } craft-exr = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "3b8e426a260695af840a2cd79a064d40778f939e" } -craft-gif = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" } +craft-gif = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "ba25ccd233934d1b2f74e3c0f235168bf5f13ef3" } craft-psd = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "08da5e1486ee640de1d2cccd8fe8dd32b1d3b62c" } craft-codepage = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" } craft-svg = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "3dff4793f1a5bd1f99a4fe3280d48f515158dff3" } diff --git a/crates/media/src/gif_anim.rs b/crates/media/src/gif_anim.rs index dc5f55e27..146f18932 100644 --- a/crates/media/src/gif_anim.rs +++ b/crates/media/src/gif_anim.rs @@ -223,6 +223,32 @@ mod tests { assert!(e.to_lowercase().contains("memory"), "{e}"); } + #[test] + fn gif_probe_and_playback_respect_text_control_scope() { + let mut bytes = Vec::new(); + { + let mut encoder = gif::Encoder::new(&mut bytes, 2, 2, &[255, 0, 0, 0, 0, 255]).unwrap(); + for (index, delay, transparent) in [(0, 23, Some(0)), (1, 7, None)] { + let frame = gif::Frame { width: 2, height: 2, delay, transparent, buffer: vec![index; 4].into(), ..gif::Frame::default() }; + encoder.write_frame(&frame).unwrap(); + } + } + let offset = craft_gif::scan(&bytes, 1).unwrap().frames[0].offset; + // A text grid consumes the first Graphic Control Extension. The first + // image then uses the app's default display delay of 100 ms. + let text = [0x21, 0x01, 12, 0, 0, 0, 0, 2, 0, 2, 0, 1, 1, 1, 0, 1, b'X', 0]; + bytes.splice(offset..offset, text); + let bytes: std::sync::Arc<[u8]> = bytes.into(); + let footage = probe_bytes("text-control.gif", bytes.clone()).unwrap(); + let pool = MediaPool::new(); + pool.add_bytes("text-control.gif", bytes); + + assert_eq!( + (footage.duration, colour_at(&pool, &footage, 0.09), colour_at(&pool, &footage, 0.11)), + (Tick::from_units(17, 100), [1.0, 0.0, 0.0], [0.0, 0.0, 1.0]) + ); + } + #[test] fn a_zero_delay_is_ten_hundredths_like_in_browsers() { let f = probe_bytes("a.gif", gif(&[(RED, 0), (GREEN, 1)]).into()).unwrap(); From 8fc2bc99c6cd4b83a3ae739db8089164d6374da2 Mon Sep 17 00:00:00 2001 From: Terra854 Date: Sun, 22 Nov 2026 03:02:47 +0800 Subject: [PATCH 378/451] media: route MXF through the shared header probe (#4058) Co-authored-by: Dylan M. Taylor --- crates/media/src/craft_source.rs | 79 ++++++++++++++++++++++++++------ crates/media/src/stream.rs | 9 ++-- 2 files changed, 69 insertions(+), 19 deletions(-) diff --git a/crates/media/src/craft_source.rs b/crates/media/src/craft_source.rs index 5405c5b9e..97a2d8b95 100644 --- a/crates/media/src/craft_source.rs +++ b/crates/media/src/craft_source.rs @@ -113,34 +113,34 @@ fn looks_like_matroska(head: &[u8]) -> bool { head.starts_with(&[0x1A, 0x45, 0xDF, 0xA3]) } -/// True when `head` contains an MXF SMPTE KLV partition pack key. -fn looks_like_mxf(head: &[u8]) -> bool { - head.windows(12).any(|w| w == [0x06, 0x0e, 0x2b, 0x34, 0x02, 0x05, 0x01, 0x01, 0x0d, 0x01, 0x02, 0x01]) -} +/// The MXF sniffer needs the 16-byte partition key after the bounded 64 KiB run-in. +#[cfg(any(unix, windows))] +pub(crate) const NATIVE_SNIFF_HEAD_LEN: usize = 64 * 1024 + 16; /// Open an in-place ISO-BMFF, Matroska/WebM, MXF, AVI, MPEG-TS/PS, or standalone audio source via `craft-media` / `craft-video` / `craft-audio`. /// Returns `None` when the container/codec/audio combination should fall back to `filmcraft-codecs`. #[cfg(any(unix, windows))] pub(crate) fn open_reader(name: &str, head: &[u8], reader: &SharedBytes) -> Option> { - if looks_like_isobmff(head) { + let usual_head = &head[..head.len().min(craft_media_source::HEAD_LEN)]; + if looks_like_isobmff(usual_head) { return open_isobmff(name, reader.clone()); } - if looks_like_matroska(head) { + if looks_like_matroska(usual_head) { return open_matroska(name, reader.clone()); } - if looks_like_mxf(head) { + if mxf::sniff(head) { return open_mxf(name, reader.clone()); } - if avi::sniff(head) { + if avi::sniff(usual_head) { return open_avi(name, reader.clone()); } - if let Some(fmt) = mpegts::sniff(head) { + if let Some(fmt) = mpegts::sniff(usual_head) { return open_mpeg(name, fmt, reader.clone()); } - if let Some(source) = standalone_flac::open_reader(name, head, reader) { + if let Some(source) = standalone_flac::open_reader(name, usual_head, reader) { return Some(Ok(source)); } - open_standalone_audio(name, head, reader.clone()) + open_standalone_audio(name, usual_head, reader.clone()) } /// Open an in-memory ISO-BMFF, Matroska/WebM, MXF, AVI, MPEG-TS/PS, or standalone audio source via `craft-media` / `craft-video` / `craft-audio`. @@ -151,7 +151,7 @@ pub(crate) fn open_bytes(name: &str, bytes: Arc<[u8]>) -> Option Option<(Result, FileStamp let stamp = reader.stamp; let name = name_of(path); let craft_reader: craft_media_source::SharedBytes = reader.clone(); - if let Ok(head) = craft_media_source::read_range(&*craft_reader, 0, craft_media_source::HEAD_LEN) + if let Ok(head) = craft_media_source::read_range(&*craft_reader, 0, crate::craft_source::NATIVE_SNIFF_HEAD_LEN) && let Some(res) = crate::craft_source::open_reader(&name, &head, &craft_reader) { return Some((res.map(MediaSource::Craft).map_err(MediaError::from), stamp)); @@ -261,9 +261,10 @@ pub(crate) fn probe_source(path: &Path) -> Option> { return None; } let reader = Arc::new(FileReader::open(path).ok()?); - let head = filmcraft_media::reader::read_range(&*reader, 0, filmcraft_media::reader::HEAD_LEN).ok()?; + let head = filmcraft_media::reader::read_range(&*reader, 0, crate::craft_source::NATIVE_SNIFF_HEAD_LEN).ok()?; + let legacy_head = &head[..head.len().min(filmcraft_media::reader::HEAD_LEN)]; let name = path.to_string_lossy(); - if crate::layered::sniff(&name, &head) || image::guess_format(&head).is_ok() { + if crate::layered::sniff(&name, legacy_head) || image::guess_format(legacy_head).is_ok() { return None; } let name = name_of(path); @@ -272,7 +273,7 @@ pub(crate) fn probe_source(path: &Path) -> Option> { return Some(res.map(MediaSource::Craft).map_err(MediaError::from)); } let fc_reader: filmcraft_media::SharedReader = reader; - filmcraft_codecs::reader_openers().into_iter().find_map(|open| open(&name, &head, &fc_reader)).map(|r| r.map(MediaSource::Film).map_err(Into::into)) + filmcraft_codecs::reader_openers().into_iter().find_map(|open| open(&name, legacy_head, &fc_reader)).map(|r| r.map(MediaSource::Film).map_err(Into::into)) } #[cfg(not(any(unix, windows)))] From 2f16feb12f4d5ef601b35b2858f9c9a87077f61e Mon Sep 17 00:00:00 2001 From: Terra854 Date: Sun, 22 Nov 2026 03:10:33 +0800 Subject: [PATCH 379/451] media: present full-range high-depth RGB from the shared decoder (#4063) --- crates/media/src/craft_source.rs | 42 +++++++++- crates/media/src/craft_source/rgb8_tests.rs | 6 +- .../media/src/craft_source/wide_rgb_tests.rs | 82 +++++++++++++++++++ 3 files changed, 126 insertions(+), 4 deletions(-) create mode 100644 crates/media/src/craft_source/wide_rgb_tests.rs diff --git a/crates/media/src/craft_source.rs b/crates/media/src/craft_source.rs index 97a2d8b95..782496b7e 100644 --- a/crates/media/src/craft_source.rs +++ b/crates/media/src/craft_source.rs @@ -2300,6 +2300,9 @@ fn push_decoded( #[cfg(test)] mod rgb8_tests; +#[cfg(test)] +mod wide_rgb_tests; + fn to_craft_frame(vf: DecodedVideoFrame, presentation: FramePresentation, pts: Tick) -> Result { let FramePresentation { container_color, par: default_par, rotation, aperture } = presentation; let (mut width, mut height) = (vf.width(), vf.height()); @@ -2311,7 +2314,7 @@ fn to_craft_frame(vf: DecodedVideoFrame, presentation: FramePresentation, pts: T Some(sar) => sar, None => default_par, }; - let color = resolve_color(tags, container_color); + let mut color = resolve_color(tags, container_color); let bit_depth = vf.bit_depth(); let (planes, alpha) = vf.into_planes(); @@ -2338,6 +2341,38 @@ fn to_craft_frame(vf: DecodedVideoFrame, presentation: FramePresentation, pts: T } PixelData::Rgba8(Arc::new(rgba)) } + ColorFamily::Rgb if color.range == Range::Full && (9..=16).contains(&bit_depth) && planes.iter().all(|p| p.bit_depth() == bit_depth) => { + let luma = aperture.and_then(|clap| clean_aperture_region(clap, (width, height))); + if let Some(r) = luma { + (width, height) = (r.w as u32, r.h as u32); + } + let samples = (width as usize) + .checked_mul(height as usize) + .and_then(|n| n.checked_mul(4)) + .filter(|&n| n <= craft_frame::DEFAULT_MAX_FRAME_BYTES / size_of::()) + .ok_or_else(|| MediaError::Decode("RGB picture exceeds the frame buffer limit".into()))?; + let [r, g, b]: [Plane; 3] = planes.try_into().map_err(|_| MediaError::Decode("expected three RGB planes".into()))?; + let r = plane_u16(r, luma)?; + let g = plane_u16(g, luma)?; + let b = plane_u16(b, luma)?; + let alpha_max = alpha.as_ref().map_or(1, |a| ((1u32 << a.bit_depth()) - 1) as u16); + let alpha = alpha.map(|a| plane_u16(a, luma)).transpose()?.into_iter().flatten().chain(std::iter::repeat(alpha_max)); + // One transfer lookup per code avoids evaluating the curve per pixel and keeps + // every decoded code distinct, including at 16 bits. + let max_code = (1usize << bit_depth) - 1; + let mut transfer = Vec::new(); + transfer.try_reserve_exact(max_code + 1).map_err(|_| MediaError::Decode("could not allocate the RGB transfer table".into()))?; + transfer.extend((0..=max_code).map(|code| craft_color::to_linear(code as f32 / max_code as f32, color.transfer))); + let linear = |value: u16| transfer[usize::from(value).min(max_code)]; + let mut rgba = Vec::new(); + rgba.try_reserve_exact(samples).map_err(|_| MediaError::Decode("could not allocate the RGB picture".into()))?; + for (((r, g), b), a) in r.into_iter().zip(g).zip(b).zip(alpha) { + let a = (f32::from(a) / f32::from(alpha_max)).min(1.0); + rgba.extend_from_slice(&[linear(r) * a, linear(g) * a, linear(b) * a, a]); + } + color.transfer = Transfer::Linear; + PixelData::RgbaF32(Arc::new(rgba)) + } ColorFamily::YCbCr => { let chroma = match subsampling { Subsampling::S420 => Chroma::C420, @@ -2474,6 +2509,10 @@ fn rotate_frame(mut frame: VideoFrame, turns: u8) -> VideoFrame { let rotated = rotate_plane(pixels.as_chunks::<4>().0, w, h, turns); PixelData::Rgba8(Arc::new(rotated.into_flattened())) } + PixelData::RgbaF32(pixels) => { + let rotated = rotate_plane(pixels.as_chunks::<4>().0, w, h, turns); + PixelData::RgbaF32(Arc::new(rotated.into_flattened())) + } PixelData::Yuv8 { planes: [y, cb, cr], chroma, alpha } => { let (cw, ch, out_chroma) = match chroma { Chroma::C420 => (w.div_ceil(2), h.div_ceil(2), Chroma::C420), @@ -2513,7 +2552,6 @@ fn rotate_frame(mut frame: VideoFrame, turns: u8) -> VideoFrame { alpha: alpha.map(|a| Arc::new(rotate_plane(&a, w, h, turns))), } } - other => other, }; frame.width = nw; frame.height = nh; diff --git a/crates/media/src/craft_source/rgb8_tests.rs b/crates/media/src/craft_source/rgb8_tests.rs index 2cc78d441..8650f0a75 100644 --- a/crates/media/src/craft_source/rgb8_tests.rs +++ b/crates/media/src/craft_source/rgb8_tests.rs @@ -73,9 +73,11 @@ fn packed_rgb_keeps_stride_aperture_rotation_and_straight_alpha() -> TestResult } #[test] -fn higher_depth_rgb_is_not_quantized_to_packed_bytes() -> TestResult { +fn limited_range_high_depth_rgb_remains_unsupported() -> TestResult { let channel = Plane::packed(1, 1, 10, Samples::U16(vec![900]))?; let decoded = DecodedVideoFrame::new(1, 1, ColorFamily::Rgb, Subsampling::S444, vec![channel; 3], None)?; - assert!(matches!(to_craft_frame(decoded, presentation(), Tick::ZERO), Err(MediaError::Unsupported(_)))); + let color = ColorInfo { range: Range::Limited, ..ColorInfo::SRGB_FULL }; + let presentation = FramePresentation { container_color: Some(color), ..presentation() }; + assert!(matches!(to_craft_frame(decoded, presentation, Tick::ZERO), Err(MediaError::Unsupported(_)))); Ok(()) } diff --git a/crates/media/src/craft_source/wide_rgb_tests.rs b/crates/media/src/craft_source/wide_rgb_tests.rs new file mode 100644 index 000000000..ceb963750 --- /dev/null +++ b/crates/media/src/craft_source/wide_rgb_tests.rs @@ -0,0 +1,82 @@ +use std::io::Cursor; + +use craft_video::ffv1::{self, Colorspace, Encoder, EncoderConfig}; + +use super::*; +use crate::stream::{self, MediaSource as OpenedSource}; + +type TestResult = std::result::Result<(), Box>; + +fn assert_samples(actual: &[f32], expected: &[f32]) { + assert_eq!(actual.len(), expected.len()); + for (i, (&got, &want)) in actual.iter().zip(expected).enumerate() { + assert!((got - want).abs() < 1e-6, "sample {i}: expected {want}, got {got}"); + } +} + +#[test] +fn full_range_rgb_ffv1_keeps_wide_samples_across_backward_seek() -> TestResult { + const WIDTH: u32 = 5; + const HEIGHT: u32 = 3; + let mut raw = ffv1::Frame { width: WIDTH, height: HEIGHT, colorspace: Colorspace::Rgb, bit_depth: 10, chroma_shift: (0, 0), planes: vec![Vec::new(); 3] }; + let encoder = Encoder::new(&raw, EncoderConfig::default())?; + let mut track = matroska::TrackSpec::new(matroska::TrackKind::Video, "V_FFV1"); + track.codec_private = encoder.config_record(); + track.video_size = Some((WIDTH, HEIGHT)); + track.default_duration_ns = Some(40_000_000); + let mut writer = matroska::MkvWriter::new(Cursor::new(Vec::new()), vec![track], matroska::MuxOptions::default())?; + + let mut expected = Vec::new(); + for n in 0u16..3 { + let codes: Vec<[u16; 3]> = (0..WIDTH as u16 * HEIGHT as u16).map(|p| [256 + 96 * n + p, 500 + p, 910 - p]).collect(); + for (c, plane) in raw.planes.iter_mut().enumerate() { + *plane = codes.iter().map(|pixel| pixel[c]).collect(); + } + writer.write_frame(0, i64::from(n) * 40_000_000, true, &encoder.encode(&raw)?, Some(40_000_000))?; + // The existing Rec.709 fallback uses the sRGB preview curve. All fixture codes are + // above its linear segment, and adjacent codes must survive the full conversion. + expected.push( + codes + .into_iter() + .flat_map(|pixel| { + let [r, g, b] = pixel.map(|c| ((f32::from(c) / 1023.0 + 0.055) / 1.055).powf(2.4)); + [r, g, b, 1.0] + }) + .collect::>(), + ); + } + let bytes = writer.finish()?.into_inner(); + let OpenedSource::Craft(source) = stream::open_bytes("wide-rgb-ffv1.mkv", bytes.into())? else { + panic!("expected the shared FFV1 reader"); + }; + for n in [2, 0, 1] { + let pts = Tick::from_units(n as i64, 25); + let frame = source.video_frame(FrameRequest { time: pts, scale: 1.0 })?; + assert_eq!((frame.width, frame.height, frame.pts), (WIDTH, HEIGHT, pts)); + assert_eq!((frame.color.range, frame.color.transfer), (Range::Full, Transfer::Linear)); + let PixelData::RgbaF32(pixels) = &frame.data else { panic!("expected linear floating-point RGBA") }; + assert_samples(pixels, &expected[n]); + } + Ok(()) +} + +#[test] +fn full_range_wide_rgb_crops_rotates_and_premultiplies() -> TestResult { + let plane = |rows| Plane::new(3, 2, 4, 10, Samples::U16(rows)); + let red = plane(vec![8, 1023, 11, 999, 12, 1023, 13, 999])?; + let green = plane(vec![20, 512, 21, 999, 22, 256, 23, 999])?; + let blue = plane(vec![24, 1, 25, 999, 26, 1023, 27, 999])?; + let alpha = plane(vec![0, 512, 0, 999, 0, 0, 0, 999])?; + let mut decoded = DecodedVideoFrame::new(3, 2, ColorFamily::Rgb, Subsampling::S444, vec![red, green, blue], Some(alpha))?; + decoded.sar = Some((5, 4)); + let aperture = isobmff::CleanAperture { width: (1, 1), height: (2, 1), horiz_offset: (0, 1), vert_offset: (0, 1) }; + let color = ColorInfo { transfer: Transfer::Linear, ..ColorInfo::SRGB_FULL }; + let presentation = FramePresentation { container_color: Some(color), par: (1, 1), rotation: 1, aperture: Some(aperture) }; + let pts = Tick::from_units(4, 25); + let frame = to_craft_frame(decoded, presentation, pts)?; + assert_eq!((frame.width, frame.height, frame.par, frame.pts, frame.color), (2, 1, (4, 5), pts, color)); + let PixelData::RgbaF32(pixels) = &frame.data else { panic!("expected linear floating-point RGBA") }; + let half = 512.0 / 1023.0; + assert_samples(pixels, &[0.0, 0.0, 0.0, 0.0, half, half * half, half / 1023.0, half]); + Ok(()) +} From 61dfd6c4dc2b67ac72a2b2c7946a2685099f477a Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sat, 21 Nov 2026 14:34:09 -0500 Subject: [PATCH 380/451] EPS: enable sampled images, scale step budget, and align CMYK with After Effects (#4057) * pdf,eps: enable EPS image rendering, scale step budget, and align CMYK with After Effects (#3677) * chore: repin craft-ps to 068e079c for save/restore dictionary journaling (#790) * chore: align craft-pdf/hayro revs and xtask pdf-deps pin to 068e079c --- Cargo.lock | 10 +++--- Cargo.toml | 8 ++--- crates/pdf/src/color.rs | 37 +++++++++++++++++++--- crates/pdf/src/lib.rs | 6 ++-- crates/pdf/src/tests.rs | 2 +- crates/pdf/src/tests/import.rs | 58 ++++++++++++++++++++++++++++++++-- xtask/src/pdf_deps.rs | 2 +- 7 files changed, 102 insertions(+), 21 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 81cc29132..cab80bb90 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1319,7 +1319,7 @@ dependencies = [ [[package]] name = "craft-eps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=808730f49b9637b7909fe2ae56f9d63fdb100cae#808730f49b9637b7909fe2ae56f9d63fdb100cae" +source = "git+https://github.com/storytold/craft-libs?rev=068e079c7be4b100a8a6b305b31ac881e069727e#068e079c7be4b100a8a6b305b31ac881e069727e" [[package]] name = "craft-exr" @@ -1485,7 +1485,7 @@ dependencies = [ [[package]] name = "craft-pdf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=808730f49b9637b7909fe2ae56f9d63fdb100cae#808730f49b9637b7909fe2ae56f9d63fdb100cae" +source = "git+https://github.com/storytold/craft-libs?rev=068e079c7be4b100a8a6b305b31ac881e069727e#068e079c7be4b100a8a6b305b31ac881e069727e" dependencies = [ "hayro-syntax", "thiserror 2.0.21", @@ -1494,7 +1494,7 @@ dependencies = [ [[package]] name = "craft-ps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=808730f49b9637b7909fe2ae56f9d63fdb100cae#808730f49b9637b7909fe2ae56f9d63fdb100cae" +source = "git+https://github.com/storytold/craft-libs?rev=068e079c7be4b100a8a6b305b31ac881e069727e#068e079c7be4b100a8a6b305b31ac881e069727e" dependencies = [ "craft-eps", "kurbo", @@ -3761,7 +3761,7 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a" [[package]] name = "hayro-jbig2" version = "0.3.0" -source = "git+https://github.com/storytold/craft-libs?rev=808730f49b9637b7909fe2ae56f9d63fdb100cae#808730f49b9637b7909fe2ae56f9d63fdb100cae" +source = "git+https://github.com/storytold/craft-libs?rev=068e079c7be4b100a8a6b305b31ac881e069727e#068e079c7be4b100a8a6b305b31ac881e069727e" dependencies = [ "hayro-ccitt", ] @@ -3775,7 +3775,7 @@ checksum = "c75ab947623ef4ccaa7acf0579edf7cbb5a73838e3839a7be73335e522f433a1" [[package]] name = "hayro-syntax" version = "0.7.2" -source = "git+https://github.com/storytold/craft-libs?rev=808730f49b9637b7909fe2ae56f9d63fdb100cae#808730f49b9637b7909fe2ae56f9d63fdb100cae" +source = "git+https://github.com/storytold/craft-libs?rev=068e079c7be4b100a8a6b305b31ac881e069727e#068e079c7be4b100a8a6b305b31ac881e069727e" dependencies = [ "hayro-jbig2", "hayro-jpeg2000", diff --git a/Cargo.toml b/Cargo.toml index c1c46eb1d..b993313dd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,13 +13,13 @@ repository = "https://github.com/storytold/effectcraft" [workspace.dependencies] craft-timeline = { git = "https://github.com/storytold/craft-libs", rev = "0d6dd8bed815b8366869a800d2bf22588ca62dcb", default-features = false } craft-mime = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" } -craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "808730f49b9637b7909fe2ae56f9d63fdb100cae", version = "=0.1.0", default-features = false, features = ["read"] } +craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "068e079c7be4b100a8a6b305b31ac881e069727e", version = "=0.1.0", default-features = false, features = ["read"] } craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" } craft-jsonrpc = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "bc186ca719958fcce3b6ee24794277eabed14609" } craft-quit = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" } craft-ecproj-format = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" } craft-dpx = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" } -craft-ps = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "808730f49b9637b7909fe2ae56f9d63fdb100cae", default-features = false, features = ["read"] } +craft-ps = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "068e079c7be4b100a8a6b305b31ac881e069727e", default-features = false, features = ["read"] } craft-exr = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "3b8e426a260695af840a2cd79a064d40778f939e" } craft-gif = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "ba25ccd233934d1b2f74e3c0f235168bf5f13ef3" } craft-psd = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "08da5e1486ee640de1d2cccd8fe8dd32b1d3b62c" } @@ -231,8 +231,8 @@ lto = "thin" codegen-units = 1 [patch.crates-io] -hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "808730f49b9637b7909fe2ae56f9d63fdb100cae", version = "=0.7.2" } -hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "808730f49b9637b7909fe2ae56f9d63fdb100cae", version = "=0.3.0" } +hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "068e079c7be4b100a8a6b305b31ac881e069727e", version = "=0.7.2" } +hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "068e079c7be4b100a8a6b305b31ac881e069727e", version = "=0.3.0" } ecolor = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" } emath = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" } epaint = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" } diff --git a/crates/pdf/src/color.rs b/crates/pdf/src/color.rs index 8b150f907..ff141990e 100644 --- a/crates/pdf/src/color.rs +++ b/crates/pdf/src/color.rs @@ -53,10 +53,7 @@ impl Cs { match self { Cs::Gray => [g(0); 3], Cs::Rgb | Cs::Pattern => [g(0), g(1), g(2)], - Cs::Cmyk => { - let k = g(3); - [(1.0 - g(0)) * (1.0 - k), (1.0 - g(1)) * (1.0 - k), (1.0 - g(2)) * (1.0 - k)] - } + Cs::Cmyk => cmyk_to_rgb(g(0), g(1), g(2), g(3)), Cs::Lab => lab_to_rgb(c.first().copied().unwrap_or(0.0), c.get(1).copied().unwrap_or(0.0), c.get(2).copied().unwrap_or(0.0)), Cs::Indexed { base, hival, lookup } => { let i = (c.first().copied().unwrap_or(0.0).round().max(0.0) as usize).min(*hival); @@ -69,6 +66,38 @@ impl Cs { } } +/// The screen colour of each solid overprint of cyan, magenta and yellow, indexed by +/// `c * 4 + m * 2 + y`. Paper is white. +const INK_SOLIDS: [[f64; 3]; 8] = [ + [1.0, 1.0, 1.0], + [0.9422, 0.9861, 0.1296], + [0.9734, 0.1382, 0.5601], + [1.0, 0.1424, 0.0305], + [0.0754, 0.6765, 0.8047], + [0.0, 0.5965, 0.2797], + [0.2292, 0.0166, 0.5538], + [0.0251, 0.002, 0.0], +]; +/// How each ink's value (C, M, Y, K) becomes the area it covers. +const INK_COVERAGE: [f64; 4] = [1.0774, 1.0434, 1.0474, 1.1823]; + +/// DeviceCMYK (each 0 to 1) to RGB, as the Neugebauer equations model halftone printing: the +/// solid colour of every combination of the inks, weighted by the area that combination +/// covers. The solids and the coverage curves are fitted to what After Effects shows for a +/// chart of 1,296 CMYK patches. `(1 - c)(1 - k)` makes every pale pink a bright magenta. +pub(crate) fn cmyk_to_rgb(c: f64, m: f64, y: f64, k: f64) -> [f64; 3] { + let area = |i: usize, v: f64| v.clamp(0.0, 1.0).powf(INK_COVERAGE[i]); + let (ac, am, ay, ak) = (area(0, c), area(1, m), area(2, y), area(3, k)); + let mut out = [0.0; 3]; + for (i, solid) in INK_SOLIDS.iter().enumerate() { + let w = (if i & 4 != 0 { ac } else { 1.0 - ac }) * (if i & 2 != 0 { am } else { 1.0 - am }) * (if i & 1 != 0 { ay } else { 1.0 - ay }); + for (o, s) in out.iter_mut().zip(solid) { + *o += w * s; + } + } + out.map(|v| v * (1.0 - ak)) +} + fn lab_to_rgb(l: f64, a: f64, b: f64) -> [f64; 3] { let fy = (l + 16.0) / 116.0; let fx = fy + a / 500.0; diff --git a/crates/pdf/src/lib.rs b/crates/pdf/src/lib.rs index 4fd5d701c..884ffc1f8 100644 --- a/crates/pdf/src/lib.rs +++ b/crates/pdf/src/lib.rs @@ -253,11 +253,11 @@ fn eps_fallback_font(name: &[u8]) -> Option<&'static [u8]> { } fn parse_eps(bytes: &[u8]) -> Result { + let steps = (bytes.len() as u64).saturating_mul(4).clamp(8_000_000, 256_000_000); let limits = craft_ps::read::Limits { - // Preserve EffectCraft's established 8,000,000-unit PostScript execution budget. - steps: 8_000_000, + steps, stack_overflow_noop: true, - skip_images: true, + skip_images: false, keep_unpainted: true, zero_division_zero: true, fallback_font: Some(eps_fallback_font), diff --git a/crates/pdf/src/tests.rs b/crates/pdf/src/tests.rs index c1f519595..9ac6bb6b1 100644 --- a/crates/pdf/src/tests.rs +++ b/crates/pdf/src/tests.rs @@ -129,7 +129,7 @@ fn pdf_forms_rotation_cmyk_and_alpha() { // The form (CMYK red, clipped to its 10×10 box, scaled ×2) covers PDF (0..20, 0..20); the // half-transparent black square covers PDF (0..10, 0..10). /Rotate 90: PDF (x, y) → (y, x). let red = img.get(15, 15); - assert!(red[0] > 0.99 && red[1] < 0.01 && red[3] > 0.99, "{red:?}"); + assert!(red[0] > 0.99 && (red[1] - 0.1424).abs() < 0.01 && (red[2] - 0.0305).abs() < 0.01, "CMYK 0 1 1 0, as After Effects shows it: {red:?}"); let dark = img.get(5, 5); assert!((dark[0] - 0.5).abs() < 0.02 && dark[3] > 0.99, "{dark:?}"); assert_eq!(img.get(30, 30)[3], 0.0, "form clipped to its bounding box"); diff --git a/crates/pdf/src/tests/import.rs b/crates/pdf/src/tests/import.rs index 80be350f6..68d6487c0 100644 --- a/crates/pdf/src/tests/import.rs +++ b/crates/pdf/src/tests/import.rs @@ -49,9 +49,7 @@ fn eps_with_aliased_operators_device_queries_and_embedded_data_draws() { fn eps_filter_on_a_string_source_does_not_skip_the_program() { let square = "1 0 0 setrgbcolor 50 25 moveto 150 25 lineto 150 75 lineto 50 75 lineto closepath fill\n"; let img = "gsave 1 1 8 [1 0 0 1 0 0] (FF) /ASCIIHexDecode filter image grestore\n"; - // Images aren't drawn yet, so this parses without `eps`'s nothing-skipped check. - let doc = parse(format!("%!PS-Adobe-3.0 EPSF-3.0\n%%BoundingBox: 0 0 200 100\n{img}{square}").as_bytes()).unwrap(); - assert_eq!(doc.skipped, ["image"]); + let doc = eps(format!("{img}{square}").as_bytes()); assert!(coverage(&render(&doc), 50, 25, 150, 75) > 4900.0, "drawing after an image read from a string"); } @@ -643,3 +641,57 @@ fn eps_unembedded_reencoded_accent_uses_bundled_glyph() { assert!(ia > 50.0 && (ia - ib).abs() < 1.0, "EPS accent {ia} vs PDF accent {ib}"); assert_eq!(ink_x(&a), ink_x(&b)); } + +#[test] +fn eps_images_are_drawn() { + // Hexadecimal data read by a procedure; the program goes on after it. + let doc = eps(b"gsave 100 50 scale 2 1 8 [2 0 0 -1 0 1] { currentfile 6 string readhexstring pop } false 3 colorimage\nFF0000 00FF00\ngrestore 0 0 1 setrgbcolor 150 0 10 10 rectfill\n"); + let img = render(&doc); + let (red, green) = (img.get(25, 75), img.get(75, 75)); + assert!(red[0] > 0.9 && red[1] < 0.1 && red[3] > 0.99, "{red:?}"); + assert!(green[1] > 0.9 && green[0] < 0.1 && green[3] > 0.99, "{green:?}"); + assert!(img.get(155, 95)[2] > 0.99, "drawing continues after the image data"); + + // A stencil paints the current colour where its sample is 0. + let doc = eps(b"1 0 0 setrgbcolor 100 50 scale 2 1 false [2 0 0 -1 0 1] {<40>} imagemask\n"); + let img = render(&doc); + assert!(img.get(25, 75)[0] > 0.9 && img.get(25, 75)[3] > 0.9, "{:?}", img.get(25, 75)); + assert_eq!(img.get(75, 75)[3], 0.0); +} + +#[test] +fn cmyk_converts_as_the_measured_chart_does() { + // Measured from After Effects' rendering of a CMYK chart, within 3 of 255. + for (cmyk, want) in [ + ([0.0, 0.0, 0.0, 0.0], [255.0, 255.0, 255.0]), + ([0.0, 0.0, 0.0, 1.0], [0.0, 0.0, 0.0]), + ([0.0, 0.25, 0.0, 0.0], [255.0, 205.0, 229.0]), + ([0.0, 0.1, 0.0, 0.0], [255.0, 235.0, 244.0]), + ] { + let got = crate::color::cmyk_to_rgb(cmyk[0], cmyk[1], cmyk[2], cmyk[3]).map(|v| v * 255.0); + for (g, w) in got.iter().zip(want) { + assert!((g - w).abs() < 3.0, "{cmyk:?}: {got:?} vs {want:?}"); + } + } +} + +#[test] +fn a_prolog_keeps_the_built_in_cmyk_conversion() { + // The idiom of Illustrator's EPS prolog: define the operator only when it does not exist. + let doc = eps(b"/setcmykcolor where { pop } { /setcmykcolor { pop pop pop pop 0 1 0 setrgbcolor } def } ifelse 0 1 1 0 setcmykcolor 0 0 10 10 rectfill\n"); + let c = render(&doc).get(5, 95); + assert!(c[0] > 0.9 && c[1] < 0.3, "{c:?}"); + let doc = eps(b"0.1 0.2 0.3 0.4 setcmykcolor currentcmykcolor 0.4 eq exch 0.3 eq and exch 0.2 eq and exch 0.1 eq and { 0 0 10 10 rectfill } if\n"); + assert_eq!(shape_names(&doc).len(), 1); +} + +#[test] +fn eps_restore_undoes_dictionary_changes() { + // Illustrator's prolog counts graphics states in a dictionary and relies on `restore` to + // take the count back down. + let doc = eps(b"/w 10 def /d 1 dict def d /v 1 put save /w 40 def d /v 2 put restore 0 0 w 10 rectfill d /v get 1 eq { 100 0 10 10 rectfill } if\n"); + let img = render(&doc); + assert_eq!(img.get(20, 95)[3], 0.0, "w is 10 again"); + assert!(img.get(5, 95)[3] > 0.99); + assert!(img.get(105, 95)[3] > 0.99, "d's entry is 1 again"); +} diff --git a/xtask/src/pdf_deps.rs b/xtask/src/pdf_deps.rs index e3aab07a7..15da0dac7 100644 --- a/xtask/src/pdf_deps.rs +++ b/xtask/src/pdf_deps.rs @@ -5,7 +5,7 @@ use std::process::Command; use serde_json::Value; -const REV: &str = "808730f49b9637b7909fe2ae56f9d63fdb100cae"; +const REV: &str = "068e079c7be4b100a8a6b305b31ac881e069727e"; const PACKAGES: &[(&str, &str)] = &[("craft-pdf", "0.1.0"), ("craft-ps", "0.1.0"), ("hayro-syntax", "0.7.2"), ("hayro-jbig2", "0.3.0")]; pub fn run(root: &Path) -> Result<(), String> { From 1e139e5914d295e8dcad66ab3dc9cd2b22515963 Mon Sep 17 00:00:00 2001 From: Terra854 Date: Sun, 22 Nov 2026 04:46:43 +0800 Subject: [PATCH 381/451] Use shared cancellation in EffectCraft media reads (#4044) * Use the shared cancellation flag in EffectCraft media reads * chore: repin craft-libs media crates to main (ba25ccd2) * deps: align the FilmCraft cancellation context * chore: use origin/main craft-libs pin (587339c7) * chore: repin craft-libs media crates to main (6a061a30) * chore: align craft-media-source (ba25ccd2) and filmcraft (3d746514) to share one cancellation context * deps: use the merged FilmCraft cancellation revision * chore: align craft-media-source (6a061a30) and filmcraft (d6cc257f) --------- Co-authored-by: Dylan M. Taylor --- Cargo.lock | 243 ++++++++++++++----------------- Cargo.toml | 30 ++-- crates/media/src/craft_source.rs | 27 +++- 3 files changed, 145 insertions(+), 155 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cab80bb90..0514a0568 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1182,11 +1182,11 @@ dependencies = [ [[package]] name = "craft-aaf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b3643af6477326e840f86be78c89357f5308ba1d#b3643af6477326e840f86be78c89357f5308ba1d" +source = "git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17#dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17" dependencies = [ - "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=b3643af6477326e840f86be78c89357f5308ba1d)", - "craft-cfb 0.1.0 (git+https://github.com/storytold/craft-libs?rev=b3643af6477326e840f86be78c89357f5308ba1d)", - "craft-timeline 0.1.0 (git+https://github.com/storytold/craft-libs?rev=b3643af6477326e840f86be78c89357f5308ba1d)", + "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", + "craft-cfb", + "craft-timeline 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", "thiserror 2.0.21", ] @@ -1207,10 +1207,10 @@ dependencies = [ [[package]] name = "craft-audio" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=587339c787682592ed46bab5a15cae52e60da2e3#587339c787682592ed46bab5a15cae52e60da2e3" +source = "git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6#6a061a30bdd4a6cc24329334d5e44241896edba6" dependencies = [ - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=587339c787682592ed46bab5a15cae52e60da2e3)", - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=587339c787682592ed46bab5a15cae52e60da2e3)", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6)", + "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6)", "log", "thiserror 2.0.21", ] @@ -1218,36 +1218,20 @@ dependencies = [ [[package]] name = "craft-audio" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=82062077bba679ba5236e2d1a391f02d1533cbab#82062077bba679ba5236e2d1a391f02d1533cbab" +source = "git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17#dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17" dependencies = [ - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=82062077bba679ba5236e2d1a391f02d1533cbab)", - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=82062077bba679ba5236e2d1a391f02d1533cbab)", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", + "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", "log", "rayon", "symphonia 0.6.1", "thiserror 2.0.21", ] -[[package]] -name = "craft-audio" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b3643af6477326e840f86be78c89357f5308ba1d#b3643af6477326e840f86be78c89357f5308ba1d" -dependencies = [ - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=b3643af6477326e840f86be78c89357f5308ba1d)", - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=b3643af6477326e840f86be78c89357f5308ba1d)", - "log", - "thiserror 2.0.21", -] - [[package]] name = "craft-cfb" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=7f3fdc0dfebd03f33a241f91f916e9a78d3e5c93#7f3fdc0dfebd03f33a241f91f916e9a78d3e5c93" - -[[package]] -name = "craft-cfb" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b3643af6477326e840f86be78c89357f5308ba1d#b3643af6477326e840f86be78c89357f5308ba1d" +source = "git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17#dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17" [[package]] name = "craft-cms" @@ -1266,7 +1250,7 @@ source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c [[package]] name = "craft-color" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=587339c787682592ed46bab5a15cae52e60da2e3#587339c787682592ed46bab5a15cae52e60da2e3" +source = "git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6#6a061a30bdd4a6cc24329334d5e44241896edba6" dependencies = [ "serde", ] @@ -1301,7 +1285,7 @@ dependencies = [ [[package]] name = "craft-dpx" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=82062077bba679ba5236e2d1a391f02d1533cbab#82062077bba679ba5236e2d1a391f02d1533cbab" +source = "git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17#dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17" dependencies = [ "thiserror 2.0.21", ] @@ -1333,6 +1317,15 @@ dependencies = [ "thiserror 2.0.21", ] +[[package]] +name = "craft-exr" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=8b40f1a4b0718916e7c136c1b91b38a5c7531a0e#8b40f1a4b0718916e7c136c1b91b38a5c7531a0e" +dependencies = [ + "flate2", + "serde_json", +] + [[package]] name = "craft-fonts-build" version = "0.1.0" @@ -1341,10 +1334,10 @@ source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c [[package]] name = "craft-frame" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=587339c787682592ed46bab5a15cae52e60da2e3#587339c787682592ed46bab5a15cae52e60da2e3" +source = "git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6#6a061a30bdd4a6cc24329334d5e44241896edba6" dependencies = [ "craft-color", - "craft-time 0.1.0 (git+https://github.com/storytold/craft-libs?rev=587339c787682592ed46bab5a15cae52e60da2e3)", + "craft-time 0.1.0 (git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6)", "rayon", "serde", ] @@ -1358,6 +1351,14 @@ dependencies = [ "image", ] +[[package]] +name = "craft-hdr" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17#dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17" +dependencies = [ + "thiserror 2.0.21", +] + [[package]] name = "craft-i18n" version = "0.1.0" @@ -1384,7 +1385,7 @@ dependencies = [ [[package]] name = "craft-jpeg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=937ac93c5cf3cd4b6a81e195b078fe161eb081b9#937ac93c5cf3cd4b6a81e195b078fe161eb081b9" +source = "git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17#dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17" dependencies = [ "thiserror 2.0.21", ] @@ -1415,7 +1416,7 @@ source = "git+https://github.com/storytold/craft-libs?rev=30596f73c5ef851ba3dad9 [[package]] name = "craft-media" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=587339c787682592ed46bab5a15cae52e60da2e3#587339c787682592ed46bab5a15cae52e60da2e3" +source = "git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6#6a061a30bdd4a6cc24329334d5e44241896edba6" dependencies = [ "chrono", "thiserror 2.0.21", @@ -1424,30 +1425,22 @@ dependencies = [ [[package]] name = "craft-media" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=82062077bba679ba5236e2d1a391f02d1533cbab#82062077bba679ba5236e2d1a391f02d1533cbab" +source = "git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17#dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17" dependencies = [ "chrono", "thiserror 2.0.21", ] -[[package]] -name = "craft-media" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b3643af6477326e840f86be78c89357f5308ba1d#b3643af6477326e840f86be78c89357f5308ba1d" -dependencies = [ - "thiserror 2.0.21", -] - [[package]] name = "craft-media-source" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=587339c787682592ed46bab5a15cae52e60da2e3#587339c787682592ed46bab5a15cae52e60da2e3" +source = "git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6#6a061a30bdd4a6cc24329334d5e44241896edba6" dependencies = [ - "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=587339c787682592ed46bab5a15cae52e60da2e3)", + "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6)", "craft-color", "craft-frame", - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=587339c787682592ed46bab5a15cae52e60da2e3)", - "craft-time 0.1.0 (git+https://github.com/storytold/craft-libs?rev=587339c787682592ed46bab5a15cae52e60da2e3)", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6)", + "craft-time 0.1.0 (git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6)", "serde", "thiserror 2.0.21", ] @@ -1515,6 +1508,17 @@ dependencies = [ "thiserror 2.0.21", ] +[[package]] +name = "craft-psd" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17#dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17" +dependencies = [ + "encoding_rs", + "flate2", + "rayon", + "thiserror 2.0.21", +] + [[package]] name = "craft-quit" version = "0.1.0" @@ -1529,7 +1533,7 @@ dependencies = [ [[package]] name = "craft-raw" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=bea91b1861eea3889bec9d26338076f2ff31c4ac#bea91b1861eea3889bec9d26338076f2ff31c4ac" +source = "git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17#dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17" dependencies = [ "craft-tiff", "miniz_oxide 0.9.1", @@ -1558,7 +1562,7 @@ dependencies = [ [[package]] name = "craft-tga" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=82062077bba679ba5236e2d1a391f02d1533cbab#82062077bba679ba5236e2d1a391f02d1533cbab" +source = "git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17#dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17" dependencies = [ "thiserror 2.0.21", ] @@ -1566,7 +1570,7 @@ dependencies = [ [[package]] name = "craft-tiff" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=bea91b1861eea3889bec9d26338076f2ff31c4ac#bea91b1861eea3889bec9d26338076f2ff31c4ac" +source = "git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17#dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17" dependencies = [ "serde", "thiserror 2.0.21", @@ -1584,7 +1588,7 @@ dependencies = [ [[package]] name = "craft-time" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57288edafdc45552e30481cc649021de446abfa0#57288edafdc45552e30481cc649021de446abfa0" +source = "git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6#6a061a30bdd4a6cc24329334d5e44241896edba6" dependencies = [ "serde", "thiserror 2.0.21", @@ -1593,16 +1597,7 @@ dependencies = [ [[package]] name = "craft-time" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=587339c787682592ed46bab5a15cae52e60da2e3#587339c787682592ed46bab5a15cae52e60da2e3" -dependencies = [ - "serde", - "thiserror 2.0.21", -] - -[[package]] -name = "craft-time" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b3643af6477326e840f86be78c89357f5308ba1d#b3643af6477326e840f86be78c89357f5308ba1d" +source = "git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17#dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17" dependencies = [ "serde", "thiserror 2.0.21", @@ -1619,22 +1614,14 @@ dependencies = [ [[package]] name = "craft-timeline" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57288edafdc45552e30481cc649021de446abfa0#57288edafdc45552e30481cc649021de446abfa0" +source = "git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17#dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17" dependencies = [ - "craft-time 0.1.0 (git+https://github.com/storytold/craft-libs?rev=57288edafdc45552e30481cc649021de446abfa0)", - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=57288edafdc45552e30481cc649021de446abfa0)", + "craft-time 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", + "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", "serde", "serde_json", ] -[[package]] -name = "craft-timeline" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b3643af6477326e840f86be78c89357f5308ba1d#b3643af6477326e840f86be78c89357f5308ba1d" -dependencies = [ - "craft-time 0.1.0 (git+https://github.com/storytold/craft-libs?rev=b3643af6477326e840f86be78c89357f5308ba1d)", -] - [[package]] name = "craft-ui" version = "0.1.0" @@ -1697,9 +1684,9 @@ dependencies = [ [[package]] name = "craft-video" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=587339c787682592ed46bab5a15cae52e60da2e3#587339c787682592ed46bab5a15cae52e60da2e3" +source = "git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6#6a061a30bdd4a6cc24329334d5e44241896edba6" dependencies = [ - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=587339c787682592ed46bab5a15cae52e60da2e3)", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6)", "rav1e", "rayon", "thiserror 2.0.21", @@ -1708,9 +1695,9 @@ dependencies = [ [[package]] name = "craft-video" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=82062077bba679ba5236e2d1a391f02d1533cbab#82062077bba679ba5236e2d1a391f02d1533cbab" +source = "git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17#dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17" dependencies = [ - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=82062077bba679ba5236e2d1a391f02d1533cbab)", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", "rav1e", "rayon", "thiserror 2.0.21", @@ -1738,7 +1725,7 @@ dependencies = [ [[package]] name = "craft-xml" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=57288edafdc45552e30481cc649021de446abfa0#57288edafdc45552e30481cc649021de446abfa0" +source = "git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6#6a061a30bdd4a6cc24329334d5e44241896edba6" dependencies = [ "quick-xml 0.41.0", "serde", @@ -1748,27 +1735,7 @@ dependencies = [ [[package]] name = "craft-xml" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=587339c787682592ed46bab5a15cae52e60da2e3#587339c787682592ed46bab5a15cae52e60da2e3" -dependencies = [ - "quick-xml 0.41.0", - "serde", - "thiserror 2.0.21", -] - -[[package]] -name = "craft-xml" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=82062077bba679ba5236e2d1a391f02d1533cbab#82062077bba679ba5236e2d1a391f02d1533cbab" -dependencies = [ - "quick-xml 0.41.0", - "serde", - "thiserror 2.0.21", -] - -[[package]] -name = "craft-xml" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b3643af6477326e840f86be78c89357f5308ba1d#b3643af6477326e840f86be78c89357f5308ba1d" +source = "git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17#dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17" dependencies = [ "quick-xml 0.41.0", "serde", @@ -1778,7 +1745,7 @@ dependencies = [ [[package]] name = "craft-y4m" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=25c7a8959cf70cf8c3f076d05baadb0990710569#25c7a8959cf70cf8c3f076d05baadb0990710569" +source = "git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17#dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17" dependencies = [ "thiserror 2.0.21", ] @@ -2156,11 +2123,11 @@ dependencies = [ name = "effectcraft-export" version = "0.24.1" dependencies = [ - "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=587339c787682592ed46bab5a15cae52e60da2e3)", - "craft-exr", + "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6)", + "craft-exr 0.1.0 (git+https://github.com/storytold/craft-libs?rev=3b8e426a260695af840a2cd79a064d40778f939e)", "craft-gif", - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=587339c787682592ed46bab5a15cae52e60da2e3)", - "craft-video 0.1.0 (git+https://github.com/storytold/craft-libs?rev=587339c787682592ed46bab5a15cae52e60da2e3)", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6)", + "craft-video 0.1.0 (git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6)", "effectcraft-color", "effectcraft-effects", "effectcraft-keyframe", @@ -2322,17 +2289,17 @@ name = "effectcraft-media" version = "0.24.1" dependencies = [ "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=30596f73c5ef851ba3dad9cf145669f391e2eb0d)", - "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=587339c787682592ed46bab5a15cae52e60da2e3)", + "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6)", "craft-color", "craft-docpath", "craft-dpx 0.1.0 (git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87)", - "craft-exr", + "craft-exr 0.1.0 (git+https://github.com/storytold/craft-libs?rev=3b8e426a260695af840a2cd79a064d40778f939e)", "craft-frame", "craft-gif", - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=587339c787682592ed46bab5a15cae52e60da2e3)", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6)", "craft-media-source", - "craft-time 0.1.0 (git+https://github.com/storytold/craft-libs?rev=587339c787682592ed46bab5a15cae52e60da2e3)", - "craft-video 0.1.0 (git+https://github.com/storytold/craft-libs?rev=587339c787682592ed46bab5a15cae52e60da2e3)", + "craft-time 0.1.0 (git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6)", + "craft-video 0.1.0 (git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6)", "craft-webp", "effectcraft-color", "effectcraft-effects", @@ -2437,7 +2404,7 @@ name = "effectcraft-psd" version = "0.24.1" dependencies = [ "craft-codepage", - "craft-psd", + "craft-psd 0.1.0 (git+https://github.com/storytold/craft-libs?rev=08da5e1486ee640de1d2cccd8fe8dd32b1d3b62c)", "miniz_oxide 0.9.1", ] @@ -2445,7 +2412,7 @@ dependencies = [ name = "effectcraft-raster" version = "0.24.1" dependencies = [ - "craft-exr", + "craft-exr 0.1.0 (git+https://github.com/storytold/craft-libs?rev=3b8e426a260695af840a2cd79a064d40778f939e)", "effectcraft-color", "effectcraft-geom", "rayon", @@ -3031,28 +2998,28 @@ dependencies = [ [[package]] name = "filmcraft-bitstream" version = "0.20.1" -source = "git+https://github.com/storytold/filmcraft?rev=3f137a7ed420cac79b32145f5243b7f98b31f71c#3f137a7ed420cac79b32145f5243b7f98b31f71c" +source = "git+https://github.com/storytold/filmcraft?rev=d6cc257f55e83b16af4be6bf9c371e6798f00af6#d6cc257f55e83b16af4be6bf9c371e6798f00af6" dependencies = [ - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=82062077bba679ba5236e2d1a391f02d1533cbab)", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", ] [[package]] name = "filmcraft-cfb" version = "0.20.1" -source = "git+https://github.com/storytold/filmcraft?rev=3f137a7ed420cac79b32145f5243b7f98b31f71c#3f137a7ed420cac79b32145f5243b7f98b31f71c" +source = "git+https://github.com/storytold/filmcraft?rev=d6cc257f55e83b16af4be6bf9c371e6798f00af6#d6cc257f55e83b16af4be6bf9c371e6798f00af6" dependencies = [ - "craft-cfb 0.1.0 (git+https://github.com/storytold/craft-libs?rev=7f3fdc0dfebd03f33a241f91f916e9a78d3e5c93)", + "craft-cfb", ] [[package]] name = "filmcraft-codecs" version = "0.20.1" -source = "git+https://github.com/storytold/filmcraft?rev=3f137a7ed420cac79b32145f5243b7f98b31f71c#3f137a7ed420cac79b32145f5243b7f98b31f71c" +source = "git+https://github.com/storytold/filmcraft?rev=d6cc257f55e83b16af4be6bf9c371e6798f00af6#d6cc257f55e83b16af4be6bf9c371e6798f00af6" dependencies = [ - "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=82062077bba679ba5236e2d1a391f02d1533cbab)", + "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", "craft-jpeg", - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=82062077bba679ba5236e2d1a391f02d1533cbab)", - "craft-video 0.1.0 (git+https://github.com/storytold/craft-libs?rev=82062077bba679ba5236e2d1a391f02d1533cbab)", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", + "craft-video 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", "craft-y4m", "filmcraft-bitstream", "filmcraft-color", @@ -3071,7 +3038,7 @@ dependencies = [ [[package]] name = "filmcraft-color" version = "0.20.1" -source = "git+https://github.com/storytold/filmcraft?rev=3f137a7ed420cac79b32145f5243b7f98b31f71c#3f137a7ed420cac79b32145f5243b7f98b31f71c" +source = "git+https://github.com/storytold/filmcraft?rev=d6cc257f55e83b16af4be6bf9c371e6798f00af6#d6cc257f55e83b16af4be6bf9c371e6798f00af6" dependencies = [ "serde", ] @@ -3079,7 +3046,7 @@ dependencies = [ [[package]] name = "filmcraft-dng" version = "0.20.1" -source = "git+https://github.com/storytold/filmcraft?rev=3f137a7ed420cac79b32145f5243b7f98b31f71c#3f137a7ed420cac79b32145f5243b7f98b31f71c" +source = "git+https://github.com/storytold/filmcraft?rev=d6cc257f55e83b16af4be6bf9c371e6798f00af6#d6cc257f55e83b16af4be6bf9c371e6798f00af6" dependencies = [ "craft-raw", "craft-tiff", @@ -3091,7 +3058,7 @@ dependencies = [ [[package]] name = "filmcraft-frame" version = "0.20.1" -source = "git+https://github.com/storytold/filmcraft?rev=3f137a7ed420cac79b32145f5243b7f98b31f71c#3f137a7ed420cac79b32145f5243b7f98b31f71c" +source = "git+https://github.com/storytold/filmcraft?rev=d6cc257f55e83b16af4be6bf9c371e6798f00af6#d6cc257f55e83b16af4be6bf9c371e6798f00af6" dependencies = [ "filmcraft-color", "filmcraft-time", @@ -3102,7 +3069,7 @@ dependencies = [ [[package]] name = "filmcraft-geom" version = "0.20.1" -source = "git+https://github.com/storytold/filmcraft?rev=3f137a7ed420cac79b32145f5243b7f98b31f71c#3f137a7ed420cac79b32145f5243b7f98b31f71c" +source = "git+https://github.com/storytold/filmcraft?rev=d6cc257f55e83b16af4be6bf9c371e6798f00af6#d6cc257f55e83b16af4be6bf9c371e6798f00af6" dependencies = [ "serde", ] @@ -3110,17 +3077,18 @@ dependencies = [ [[package]] name = "filmcraft-interchange" version = "0.20.1" -source = "git+https://github.com/storytold/filmcraft?rev=3f137a7ed420cac79b32145f5243b7f98b31f71c#3f137a7ed420cac79b32145f5243b7f98b31f71c" +source = "git+https://github.com/storytold/filmcraft?rev=d6cc257f55e83b16af4be6bf9c371e6798f00af6#d6cc257f55e83b16af4be6bf9c371e6798f00af6" dependencies = [ "craft-aaf", - "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=82062077bba679ba5236e2d1a391f02d1533cbab)", - "craft-timeline 0.1.0 (git+https://github.com/storytold/craft-libs?rev=57288edafdc45552e30481cc649021de446abfa0)", + "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", + "craft-timeline 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", "filmcraft-cfb", "filmcraft-color", "filmcraft-geom", "filmcraft-media", "filmcraft-project", "filmcraft-time", + "roxmltree", "serde", "serde_json", "thiserror 2.0.21", @@ -3129,28 +3097,33 @@ dependencies = [ [[package]] name = "filmcraft-isobmff" version = "0.20.1" -source = "git+https://github.com/storytold/filmcraft?rev=3f137a7ed420cac79b32145f5243b7f98b31f71c#3f137a7ed420cac79b32145f5243b7f98b31f71c" +source = "git+https://github.com/storytold/filmcraft?rev=d6cc257f55e83b16af4be6bf9c371e6798f00af6#d6cc257f55e83b16af4be6bf9c371e6798f00af6" dependencies = [ - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=82062077bba679ba5236e2d1a391f02d1533cbab)", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", ] [[package]] name = "filmcraft-matroska" version = "0.20.1" -source = "git+https://github.com/storytold/filmcraft?rev=3f137a7ed420cac79b32145f5243b7f98b31f71c#3f137a7ed420cac79b32145f5243b7f98b31f71c" +source = "git+https://github.com/storytold/filmcraft?rev=d6cc257f55e83b16af4be6bf9c371e6798f00af6#d6cc257f55e83b16af4be6bf9c371e6798f00af6" dependencies = [ - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=82062077bba679ba5236e2d1a391f02d1533cbab)", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", ] [[package]] name = "filmcraft-media" version = "0.20.1" -source = "git+https://github.com/storytold/filmcraft?rev=3f137a7ed420cac79b32145f5243b7f98b31f71c#3f137a7ed420cac79b32145f5243b7f98b31f71c" +source = "git+https://github.com/storytold/filmcraft?rev=d6cc257f55e83b16af4be6bf9c371e6798f00af6#d6cc257f55e83b16af4be6bf9c371e6798f00af6" dependencies = [ - "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=82062077bba679ba5236e2d1a391f02d1533cbab)", - "craft-dpx 0.1.0 (git+https://github.com/storytold/craft-libs?rev=82062077bba679ba5236e2d1a391f02d1533cbab)", - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=82062077bba679ba5236e2d1a391f02d1533cbab)", + "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", + "craft-dpx 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", + "craft-exr 0.1.0 (git+https://github.com/storytold/craft-libs?rev=8b40f1a4b0718916e7c136c1b91b38a5c7531a0e)", + "craft-hdr", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", + "craft-media-source", + "craft-psd 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", "craft-tga", + "craft-tiff", "filmcraft-color", "filmcraft-dng", "filmcraft-frame", @@ -3164,7 +3137,7 @@ dependencies = [ [[package]] name = "filmcraft-project" version = "0.20.1" -source = "git+https://github.com/storytold/filmcraft?rev=3f137a7ed420cac79b32145f5243b7f98b31f71c#3f137a7ed420cac79b32145f5243b7f98b31f71c" +source = "git+https://github.com/storytold/filmcraft?rev=d6cc257f55e83b16af4be6bf9c371e6798f00af6#d6cc257f55e83b16af4be6bf9c371e6798f00af6" dependencies = [ "filmcraft-color", "filmcraft-geom", @@ -3179,9 +3152,9 @@ dependencies = [ [[package]] name = "filmcraft-time" version = "0.20.1" -source = "git+https://github.com/storytold/filmcraft?rev=3f137a7ed420cac79b32145f5243b7f98b31f71c#3f137a7ed420cac79b32145f5243b7f98b31f71c" +source = "git+https://github.com/storytold/filmcraft?rev=d6cc257f55e83b16af4be6bf9c371e6798f00af6#d6cc257f55e83b16af4be6bf9c371e6798f00af6" dependencies = [ - "craft-timeline 0.1.0 (git+https://github.com/storytold/craft-libs?rev=57288edafdc45552e30481cc649021de446abfa0)", + "craft-timeline 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index b993313dd..94f7ce933 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -97,25 +97,25 @@ same-file = "1.0" tempfile = "3.27" # codecs + containers shared by the Craft apps (crates/media, crates/export); keep all in sync. -craft-media = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "587339c787682592ed46bab5a15cae52e60da2e3", default-features = false, features = ["isobmff", "matroska"] } -craft-media-source = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "587339c787682592ed46bab5a15cae52e60da2e3" } -craft-frame = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "587339c787682592ed46bab5a15cae52e60da2e3" } -craft-color = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "587339c787682592ed46bab5a15cae52e60da2e3" } -craft-time = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "587339c787682592ed46bab5a15cae52e60da2e3" } -craft-audio = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "587339c787682592ed46bab5a15cae52e60da2e3", default-features = false, features = ["aac-decode", "aac-encode", "alac-decode", "opus-decode", "opus-encode", "ac3-decode", "mp3-decode", "mpa-decode"] } -craft-video = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "587339c787682592ed46bab5a15cae52e60da2e3", features = ["h264-decode", "h264-encode", "prores", "hevc-encode", "vp9-encode", "av1", "threads"] } +craft-media = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "6a061a30bdd4a6cc24329334d5e44241896edba6", default-features = false, features = ["isobmff", "matroska"] } +craft-media-source = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "6a061a30bdd4a6cc24329334d5e44241896edba6" } +craft-frame = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "6a061a30bdd4a6cc24329334d5e44241896edba6" } +craft-color = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "6a061a30bdd4a6cc24329334d5e44241896edba6" } +craft-time = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "6a061a30bdd4a6cc24329334d5e44241896edba6" } +craft-audio = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "6a061a30bdd4a6cc24329334d5e44241896edba6", default-features = false, features = ["aac-decode", "aac-encode", "alac-decode", "opus-decode", "opus-encode", "ac3-decode", "mp3-decode", "mpa-decode"] } +craft-video = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "6a061a30bdd4a6cc24329334d5e44241896edba6", features = ["h264-decode", "h264-encode", "prores", "hevc-encode", "vp9-encode", "av1", "threads"] } # footage decoding: FilmCraft's pure-Rust crates, pinned to a revision (plan/adr/0001). # Only `crates/media`, `crates/export` and `crates/interchange` may depend on these. -filmcraft-codecs = { git = "https://github.com/storytold/filmcraft", rev = "3f137a7ed420cac79b32145f5243b7f98b31f71c" } -filmcraft-media = { git = "https://github.com/storytold/filmcraft", rev = "3f137a7ed420cac79b32145f5243b7f98b31f71c" } -filmcraft-frame = { git = "https://github.com/storytold/filmcraft", rev = "3f137a7ed420cac79b32145f5243b7f98b31f71c" } -filmcraft-color = { git = "https://github.com/storytold/filmcraft", rev = "3f137a7ed420cac79b32145f5243b7f98b31f71c" } -filmcraft-time = { git = "https://github.com/storytold/filmcraft", rev = "3f137a7ed420cac79b32145f5243b7f98b31f71c" } +filmcraft-codecs = { git = "https://github.com/storytold/filmcraft", rev = "d6cc257f55e83b16af4be6bf9c371e6798f00af6" } +filmcraft-media = { git = "https://github.com/storytold/filmcraft", rev = "d6cc257f55e83b16af4be6bf9c371e6798f00af6" } +filmcraft-frame = { git = "https://github.com/storytold/filmcraft", rev = "d6cc257f55e83b16af4be6bf9c371e6798f00af6" } +filmcraft-color = { git = "https://github.com/storytold/filmcraft", rev = "d6cc257f55e83b16af4be6bf9c371e6798f00af6" } +filmcraft-time = { git = "https://github.com/storytold/filmcraft", rev = "d6cc257f55e83b16af4be6bf9c371e6798f00af6" } # timeline interchange (EDL, FCP7 XML, FCPXML, OTIO) for Premiere Pro interop (crates/interchange only) -filmcraft-interchange = { git = "https://github.com/storytold/filmcraft", rev = "3f137a7ed420cac79b32145f5243b7f98b31f71c" } -filmcraft-project = { git = "https://github.com/storytold/filmcraft", rev = "3f137a7ed420cac79b32145f5243b7f98b31f71c" } -filmcraft-geom = { git = "https://github.com/storytold/filmcraft", rev = "3f137a7ed420cac79b32145f5243b7f98b31f71c" } +filmcraft-interchange = { git = "https://github.com/storytold/filmcraft", rev = "d6cc257f55e83b16af4be6bf9c371e6798f00af6" } +filmcraft-project = { git = "https://github.com/storytold/filmcraft", rev = "d6cc257f55e83b16af4be6bf9c371e6798f00af6" } +filmcraft-geom = { git = "https://github.com/storytold/filmcraft", rev = "d6cc257f55e83b16af4be6bf9c371e6798f00af6" } # gpu (the same wgpu eframe / egui-wgpu use) wgpu = { version = "30.0.1", features = ["fragile-send-sync-non-atomic-wasm"] } diff --git a/crates/media/src/craft_source.rs b/crates/media/src/craft_source.rs index 782496b7e..8a1363194 100644 --- a/crates/media/src/craft_source.rs +++ b/crates/media/src/craft_source.rs @@ -47,6 +47,7 @@ use craft_media::matroska::{self, MkvFile}; use craft_media::mpegts; use craft_media::mxf::{self, MxfFile, SoundFormat}; use craft_media::{ByteSource, CodecId, CodecParams}; +use craft_media_source::cancel::cancelled; use craft_media_source::{ AudioStreamInfo, FrameRequest, MAX_AUDIO_STREAMS, MediaError, MediaInfo, MediaKind, MediaSource, Result, SharedBytes, SharedSource, VideoStreamInfo, }; @@ -495,7 +496,7 @@ impl AudioStarts { // rounded or laced packets. A first discontinuous seek may still have to // index the unread suffix; normal open and sequential decode never do this. while let Some(idx) = self.pending.as_ref().map(|prefix| prefix.len) { - if filmcraft_media::cancel::cancelled() { + if cancelled() { return Err(MediaError::Cancelled); } // Do not commit a guessed duration after an I/O error; the next @@ -1810,7 +1811,7 @@ impl MediaSource for CraftMediaSource { let sample_count = self.file.sample_count(video_idx); let is_isobmff = matches!(&self.file, ContainerFile::Isobmff(_)); while !state.decoded.iter().any(|c| c.pts >= target_pts && c.draft == want_draft) { - if filmcraft_media::cancel::cancelled() { + if cancelled() { return Err(MediaError::Cancelled); } if state.next_decode_idx < sample_count { @@ -1904,7 +1905,7 @@ impl MediaSource for CraftMediaSource { channels } AudioBackend::MxfPcm { presented_start, presented_len } => { - if filmcraft_media::cancel::cancelled() { + if cancelled() { return Err(MediaError::Cancelled); } let ContainerFile::Mxf(mxf_file) = &self.file else { @@ -2077,7 +2078,7 @@ fn decode_standalone_range(native_rate: u32, channels_count: usize, state: &mut } while state.decoded_pos + state.buf.first().map_or(0, Vec::len) as i64 <= end { - if filmcraft_media::cancel::cancelled() { + if cancelled() { return Err(MediaError::Cancelled); } let Some(block) = state.decoder.next_block().map_err(|e| MediaError::Decode(e.to_string()))? else { @@ -2223,7 +2224,7 @@ fn decode_audio_range( let sample_count = file.sample_count(track_idx); while state.next_sample < sample_count { - if filmcraft_media::cancel::cancelled() { + if cancelled() { return Err(MediaError::Cancelled); } let idx = state.next_sample; @@ -4611,6 +4612,22 @@ mod tests { mux.finish().unwrap() } + #[test] + fn shared_video_read_observes_filmcraft_request_cancellation() { + use std::sync::atomic::AtomicBool; + + let source = crate::stream::open_bytes("cancelled.ts", generated_two_frame_ts().into()).unwrap(); + assert!(matches!(source, crate::stream::MediaSource::Craft(_))); + let cancel = Arc::new(AtomicBool::new(true)); + let request = || source.video_frame(effectcraft_time::Tick::ZERO, 1.0); + let interrupted = filmcraft_media::cancel::with_cancel(&cancel, request); + assert!(matches!(interrupted, Err(crate::MediaError::Cancelled))); + + let interrupted = craft_media_source::cancel::with_cancel(&cancel, request); + assert!(matches!(interrupted, Err(crate::MediaError::Cancelled))); + assert!(request().is_ok()); + } + #[test] fn regular_video_only_h264_ts_duration_keeps_the_last_picture_playable() { let bytes = generated_two_frame_ts(); From 8489edfc90e262e5e1f226304eb4b527997cc1e5 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sat, 21 Nov 2026 15:52:25 -0500 Subject: [PATCH 382/451] psd: share plane reading, RLE row counts, and ZIP framing via craft-psd (#786) (#4061) * psd: share plane reading, RLE row counts, and ZIP framing via craft-psd (#786) * psd: fix parity test imports and ImageResource::new arity * psd: fix borrow conflict in parity test helper * psd: use shared zip_decompress_up_to in opt reference decoder * psd: remove shadowed imports in parity tests --- Cargo.lock | 2 +- Cargo.toml | 2 +- crates/psd/Cargo.toml | 2 +- crates/psd/src/limits.rs | 5 -- crates/psd/src/pixels.rs | 99 ++++++++++++------------ crates/psd/src/tests.rs | 3 +- crates/psd/src/tests/opt.rs | 5 +- crates/psd/src/tests/parity.rs | 136 +++++++++++++++++++++++++++++++++ 8 files changed, 190 insertions(+), 64 deletions(-) create mode 100644 crates/psd/src/tests/parity.rs diff --git a/Cargo.lock b/Cargo.lock index 0514a0568..1b3f768a3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1500,7 +1500,7 @@ dependencies = [ [[package]] name = "craft-psd" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=08da5e1486ee640de1d2cccd8fe8dd32b1d3b62c#08da5e1486ee640de1d2cccd8fe8dd32b1d3b62c" +source = "git+https://github.com/storytold/craft-libs?rev=53198114310dbc2b41e18e4eaf2fd83e69964189#53198114310dbc2b41e18e4eaf2fd83e69964189" dependencies = [ "encoding_rs", "flate2", diff --git a/Cargo.toml b/Cargo.toml index 94f7ce933..1dbbffffd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,7 @@ craft-dpx = { version = "0.1.0", git = "https://github.com/storytold/craft-libs" craft-ps = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "068e079c7be4b100a8a6b305b31ac881e069727e", default-features = false, features = ["read"] } craft-exr = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "3b8e426a260695af840a2cd79a064d40778f939e" } craft-gif = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "ba25ccd233934d1b2f74e3c0f235168bf5f13ef3" } -craft-psd = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "08da5e1486ee640de1d2cccd8fe8dd32b1d3b62c" } +craft-psd = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "53198114310dbc2b41e18e4eaf2fd83e69964189" } craft-codepage = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" } craft-svg = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "3dff4793f1a5bd1f99a4fe3280d48f515158dff3" } craft-webp = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" } diff --git a/crates/psd/Cargo.toml b/crates/psd/Cargo.toml index aa9e77e07..3bf2e0aff 100644 --- a/crates/psd/Cargo.toml +++ b/crates/psd/Cargo.toml @@ -12,7 +12,7 @@ workspace = true [dependencies] craft-psd = { workspace = true } craft-codepage = { workspace = true } -miniz_oxide = "0.9" [dev-dependencies] craft-psd = { workspace = true, features = ["testgen"] } +miniz_oxide = "0.9" diff --git a/crates/psd/src/limits.rs b/crates/psd/src/limits.rs index 6db366c00..5c301be7d 100644 --- a/crates/psd/src/limits.rs +++ b/crates/psd/src/limits.rs @@ -105,11 +105,6 @@ impl Budget { } } -/// Inflate a zlib stream to at most `limit` bytes. -pub(crate) fn inflate(src: &[u8], limit: usize) -> Result> { - miniz_oxide::inflate::decompress_to_vec_zlib_with_limit(src, limit).map_err(|e| Error::Invalid(format!("zip: {:?}", e.status))) -} - /// Give back what a channel buffer from `Psd::channel_bytes` / `Psd::decode_plane` was charged: /// a borrowed one (uncompressed data, or a plane of an inflated stream charged as a whole) was not. pub(crate) fn release_bytes(budget: &mut Budget, raw: Cow<'_, [u8]>) { diff --git a/crates/psd/src/pixels.rs b/crates/psd/src/pixels.rs index 8ce6f2d63..aabd7c2ce 100644 --- a/crates/psd/src/pixels.rs +++ b/crates/psd/src/pixels.rs @@ -1,8 +1,9 @@ #[cfg(test)] use super::counters; -use super::limits::{Budget, DECODE_BUDGET, Error, Result, decode_pixels, finite_sample, inflate, release_bytes, too_large}; +use super::limits::{Budget, DECODE_BUDGET, Error, Result, decode_pixels, finite_sample, release_bytes, too_large}; use super::model::{ColorMode, Layer, Pixels, Rect}; use super::{Psd, Reader}; +use craft_psd::compression::PlaneStream; use std::borrow::Cow; impl Psd { @@ -32,13 +33,15 @@ impl Psd { pub(crate) fn plane_bytes<'a>(&self, comp: u16, r: &mut Reader<'a>, w: usize, h: usize, budget: &mut Budget) -> Result> { let rowb = self.row_bytes(w); let size = rowb.checked_mul(h).ok_or_else(|| too_large(w, h))?; - Ok(match self.open_planes(comp, r, 1, 1, (w, h), budget)? { - PlaneStream::Raw => Cow::Borrowed(r.bytes(size)?), - PlaneStream::Rle(counts) => Cow::Owned(Self::unpack_plane(&counts, 0, r, rowb, h, budget)?), - PlaneStream::Zip(mut v) => { - v.resize(size, 0); - self.zip_plane(comp, &mut v, 0, w, h, budget)?; - Cow::Owned(v) + let mut stream = self.open_planes(comp, r, 1, 1, (w, h), budget)?; + Ok(match &mut stream { + PlaneStream::Raw { .. } => Cow::Borrowed(stream.next_raw_plane(size).map_err(compression_err)?), + PlaneStream::Rle { .. } => Cow::Owned(Self::unpack_plane(&mut stream, 0, rowb, h, budget)?), + PlaneStream::Zip { data } => { + // Single-channel recovery: zero-pad short ZIP streams before un-predicting. + data.resize(size, 0); + self.zip_plane(comp, data, 0, w, h, budget)?; + Cow::Owned(std::mem::take(data)) } }) } @@ -47,39 +50,31 @@ impl Psd { /// `w`×`h` samples, of which the first `want` are decoded: the RLE row sizes of every plane, /// or the inflated ZIP data, which holds all planes one after another (charged to `budget` /// before it is inflated). - fn open_planes(&self, comp: u16, r: &mut Reader, total: usize, want: usize, size: (usize, usize), budget: &mut Budget) -> Result { + fn open_planes<'a>(&self, comp: u16, r: &mut Reader<'a>, total: usize, want: usize, size: (usize, usize), budget: &mut Budget) -> Result> { let (w, h) = size; - let size = self.row_bytes(w).checked_mul(h).ok_or_else(|| too_large(w, h))?; - Ok(match comp { - 0 => PlaneStream::Raw, - 1 => { - let n = total.saturating_mul(h); - let mut counts = Vec::with_capacity(n.min(r.remaining() / 2)); - for _ in 0..n { - counts.push(if self.psb { r.u32()? as usize } else { r.u16()? as usize }); - } - PlaneStream::Rle(counts) - } - 2 | 3 => { - let rest = r.bytes(r.remaining())?; - // One stream holds every plane: what it may decode to is what they need. - let all = size.checked_mul(want).ok_or_else(|| too_large(w, h))?; - budget.charge(all as u64)?; - PlaneStream::Zip(inflate(rest, all)?) - } - c => return Err(Error::Unsupported(format!("compression {c}"))), - }) + let plane_size = self.row_bytes(w).checked_mul(h).ok_or_else(|| too_large(w, h))?; + let zip_limit = if matches!(comp, 2 | 3) { plane_size.checked_mul(want).ok_or_else(|| too_large(w, h))? } else { 0 }; + let rest = r.bytes(r.remaining())?; + PlaneStream::open( + craft_psd::Compression::from_u16(comp), + rest, + total, + h, + if self.psb { craft_psd::Version::Psb } else { craft_psd::Version::Psd }, + zip_limit, + |bytes| budget.charge(bytes as u64).map_err(|e| craft_psd::PsdError::Unsupported(e.to_string())), + ) + .map_err(compression_err) } /// The raw bytes (`row_bytes(w)` × `h`, ZIP prediction undone) of plane `c`: raw and RLE - /// planes are read from `r` in order, raw ones borrowed from the file data, ZIP ones from the - /// inflated buffer (un-predicted in place; already charged by `open_planes`), RLE ones charged - /// to `budget`. + /// planes are read from `stream` in order, raw ones borrowed from the file data, ZIP ones from + /// the inflated buffer (un-predicted in place; already charged by `open_planes`), RLE ones + /// charged to `budget`. fn decode_plane<'x, 'a: 'x>( &self, comp: u16, - planes: &'x mut PlaneStream, - r: &mut Reader<'a>, + planes: &'x mut PlaneStream<'a>, c: usize, size: (usize, usize), budget: &mut Budget, @@ -88,20 +83,20 @@ impl Psd { let rowb = self.row_bytes(w); let size = rowb.checked_mul(h).ok_or_else(|| too_large(w, h))?; Ok(match planes { - PlaneStream::Raw => Cow::Borrowed(r.bytes(size)?), - PlaneStream::Rle(counts) => Cow::Owned(Self::unpack_plane(counts, c, r, rowb, h, budget)?), - PlaneStream::Zip(v) => Cow::Borrowed(self.zip_plane(comp, v, c, w, h, budget)?), + PlaneStream::Raw { .. } => Cow::Borrowed(planes.next_raw_plane(size).map_err(compression_err)?), + PlaneStream::Rle { .. } => Cow::Owned(Self::unpack_plane(planes, c, rowb, h, budget)?), + PlaneStream::Zip { data } => Cow::Borrowed(self.zip_plane(comp, data, c, w, h, budget)?), }) } - /// Unpack the `h` RLE rows of plane `c` (row byte counts `counts`, plane after plane) into a - /// buffer charged to `budget`. - fn unpack_plane(counts: &[usize], c: usize, r: &mut Reader, rowb: usize, h: usize, budget: &mut Budget) -> Result> { + /// Unpack the `h` RLE rows of plane `c` into a buffer charged to `budget`, using padded + /// PackBits recovery. + fn unpack_plane(planes: &mut PlaneStream<'_>, c: usize, rowb: usize, h: usize, budget: &mut Budget) -> Result> { let mut out = budget.vec::(rowb.checked_mul(h).ok_or(Error::Truncated)?)?; - for row in 0..h { - let n = *counts.get(c * h + row).ok_or(Error::Truncated)?; - unpack_bits(r.bytes(n)?, rowb, &mut out)?; - } + planes.next_rle_plane_into(c, rowb, h, true, &mut out).map_err(|e| match e { + craft_psd::PsdError::UnexpectedEof { .. } | craft_psd::PsdError::Decompress(_) => Error::Truncated, + other => Error::Invalid(other.to_string()), + })?; Ok(out) } @@ -263,7 +258,7 @@ impl Psd { let mut black = if self.mode == ColorMode::Cmyk && want > 3 { Some(budget.filled(n, 0.0f32)?) } else { None }; let mut stream = self.open_planes(comp, &mut r, nch, want, (w, h), &mut budget)?; for c in 0..want { - let raw = self.decode_plane(comp, &mut stream, &mut r, c, (w, h), &mut budget)?; + let raw = self.decode_plane(comp, &mut stream, c, (w, h), &mut budget)?; self.store_merged_channel(c, &raw, &mut data, &mut black); release_bytes(&mut budget, raw); } @@ -461,16 +456,16 @@ impl Psd { } } -/// The pixel data of a run of planes, as prepared by `Psd::open_planes`. -enum PlaneStream { - Raw, - /// RLE row byte counts of every plane, plane after plane. - Rle(Vec), - /// The inflated ZIP data of all planes. - Zip(Vec), +fn compression_err(e: craft_psd::PsdError) -> Error { + match e { + craft_psd::PsdError::UnexpectedEof { .. } => Error::Truncated, + craft_psd::PsdError::Unsupported(s) => Error::Unsupported(s), + other => Error::Invalid(other.to_string()), + } } /// PackBits decoding of one row (appends exactly `row` bytes, zero-padded). +#[cfg(test)] pub(crate) fn unpack_bits(src: &[u8], row: usize, out: &mut Vec) -> Result<()> { // The production caller already charges/reserves the complete plane in Budget. // Keep the shared recovery API bounded to this row; never relax the app budget. diff --git a/crates/psd/src/tests.rs b/crates/psd/src/tests.rs index 51e875416..3d18841db 100644 --- a/crates/psd/src/tests.rs +++ b/crates/psd/src/tests.rs @@ -7,6 +7,7 @@ mod fixed_adjustments; mod fixed_writers; mod integration; mod opt; +mod parity; mod scalar_blocks; mod section_divider; mod shared_corpus; @@ -527,7 +528,7 @@ fn a_failed_inflate_reports_its_status_not_its_output() { let mut z = miniz_oxide::deflate::compress_to_vec_zlib(&vec![0u8; 1 << 20], 6); let n = z.len(); z[n - 1] ^= 0xff; - let Err(Error::Invalid(msg)) = crate::limits::inflate(&z, 1 << 21) else { panic!("the checksum fails") }; + let Err(craft_psd::PsdError::Decompress(msg)) = craft_psd::compression::zip_decompress_up_to(&z, 1 << 21) else { panic!("the checksum fails") }; assert!(msg.len() < 100, "{} bytes", msg.len()); } diff --git a/crates/psd/src/tests/opt.rs b/crates/psd/src/tests/opt.rs index c4fdefcfe..a14287427 100644 --- a/crates/psd/src/tests/opt.rs +++ b/crates/psd/src/tests/opt.rs @@ -69,7 +69,7 @@ fn ref_decode_channel(p: &Psd, offset: usize, len: usize, w: usize, h: usize) -> } 2 | 3 => { let rest = r.bytes(r.remaining())?; - let mut v = miniz_oxide::inflate::decompress_to_vec_zlib_with_limit(rest, rowb * h).map_err(|e| Error::Invalid(format!("zip: {:?}", e.status)))?; + let mut v = craft_psd::compression::zip_decompress_up_to(rest, rowb * h).map_err(|e| Error::Invalid(e.to_string()))?; v.resize(rowb * h, 0); if comp == 3 { ref_unpredict(p.depth, &mut v, w, h); @@ -112,8 +112,7 @@ fn ref_composite(p: &Psd) -> Result { } 2 | 3 => { let rest = r.bytes(r.remaining())?; - let v = - miniz_oxide::inflate::decompress_to_vec_zlib_with_limit(rest, want * rowb * h).map_err(|e| Error::Invalid(format!("zip: {:?}", e.status)))?; + let v = craft_psd::compression::zip_decompress_up_to(rest, want * rowb * h).map_err(|e| Error::Invalid(e.to_string()))?; for (c, pl) in planes.iter_mut().enumerate().take(want) { let mut plane = v.get(c * rowb * h..(c + 1) * rowb * h).ok_or(Error::Truncated)?.to_vec(); if comp == 3 { diff --git a/crates/psd/src/tests/parity.rs b/crates/psd/src/tests/parity.rs new file mode 100644 index 000000000..c3b5b945a --- /dev/null +++ b/crates/psd/src/tests/parity.rs @@ -0,0 +1,136 @@ +//! Parity and recovery tests for PSD/PSB composite alpha, malformed resources, +//! RLE/ZIP plane framing, and save/reopen round-trips. + +use crate::write::*; +use crate::*; +use craft_psd::{Compression, ImageResource, Version}; + +/// Convert an encoded PSD into a PSB (or vice versa) with the specified compression +/// for both layers and the merged image, using `craft_psd::PsdFile`. +fn reencode_with(bytes: &[u8], version: Version, comp: Compression, merged_alpha: bool) -> Vec { + let mut file = craft_psd::PsdFile::from_bytes(bytes).expect("parse"); + let depth = file.header.depth; + let old_ver = file.header.version; + file.header.version = version; + file.write_as_psb = version.is_psb(); + if let Some(info) = file.layer_info.as_mut() { + info.merged_alpha = merged_alpha; + for rec in &mut info.layers { + let rects: Vec<(usize, usize)> = rec.channels.iter().map(|ch| rec.channel_rect(ch.id).size().expect("channel rect")).collect(); + for (ch, (w, h)) in rec.channels.iter_mut().zip(rects) { + if w > 0 && h > 0 { + let decoded = ch.decode(w, h, depth, old_ver).expect("decode channel"); + *ch = craft_psd::ChannelData::encode(ch.id, comp, &decoded, w, h, depth, version).expect("encode channel"); + } + } + } + } + let decoded_merged = file.image_data.decode(&craft_psd::Header { version: old_ver, ..file.header.clone() }).expect("decode merged"); + file.image_data = craft_psd::ImageData::encode(comp, &decoded_merged, &file.header).expect("encode merged"); + file.to_bytes().expect("write") +} + +#[test] +fn psd_and_psb_composite_alpha_flag_controls_alpha_channel() { + let mut doc = WDoc::new(4, 3); + doc.layers = vec![WLayer::solid("Semi", Rect::new(0, 0, 4, 3), [0.8, 0.4, 0.2, 0.5])]; + let base = write(&doc); + + for version in [Version::Psd, Version::Psb] { + let with_alpha = reencode_with(&base, version, Compression::Rle, true); + let p_alpha = Psd::parse(with_alpha).expect("parse with alpha"); + assert_eq!(p_alpha.psb, version.is_psb()); + assert!(p_alpha.merged_alpha); + let comp_alpha = p_alpha.composite().expect("composite with alpha"); + assert!((comp_alpha.data[0][3] - 0.5).abs() < 0.02, "{version:?}: {:?}", comp_alpha.data[0]); + + let without_alpha = reencode_with(&base, version, Compression::Rle, false); + let p_opaque = Psd::parse(without_alpha).expect("parse without alpha"); + assert_eq!(p_opaque.psb, version.is_psb()); + assert!(!p_opaque.merged_alpha); + let comp_opaque = p_opaque.composite().expect("composite without alpha"); + assert_eq!(comp_opaque.data[0][3], 1.0, "{version:?}: {:?}", comp_opaque.data[0]); + } +} + +#[test] +fn malformed_resources_recover_in_both_psd_and_psb() { + let mut doc = WDoc::new(6, 4); + doc.layers = vec![WLayer::solid("L", Rect::new(1, 1, 3, 2), [0.2, 0.6, 0.9, 0.75])]; + let base = write(&doc); + + for version in [Version::Psd, Version::Psb] { + let mut file = craft_psd::PsdFile::from_bytes(&reencode_with(&base, version, Compression::Rle, true)).expect("parse"); + file.resources.push(ImageResource::new(1005, vec![0; 16])); + let intact = file.to_bytes().expect("write"); + let want = Psd::parse(intact.clone()).expect("intact parse"); + + // Corrupt the first resource's declared length so it overruns the resource section. + let mut damaged = intact; + let res_at = 30 + u32::from_be_bytes(damaged[26..30].try_into().expect("cmd len")) as usize; + let name_len = 1 + usize::from(damaged[res_at + 4 + 6]); + let len_at = res_at + 4 + 6 + name_len + name_len % 2; + damaged[len_at..len_at + 4].copy_from_slice(&0x7fff_fff0u32.to_be_bytes()); + + let recovered = Psd::parse(damaged).expect("recovered parse"); + assert!(recovered.warnings.is_empty(), "{version:?}: {:?}", recovered.warnings); + assert_eq!(recovered.psb, version.is_psb()); + assert_eq!(recovered.merged_alpha, want.merged_alpha); + assert_eq!(recovered.layers.len(), want.layers.len()); + assert_eq!(recovered.composite().expect("comp").data, want.composite().expect("want comp").data); + assert_eq!(recovered.layer_pixels(0, false).expect("layer").data, want.layer_pixels(0, false).expect("want layer").data); + } +} + +#[test] +fn rle_and_zip_planes_decode_across_psd_and_psb() { + let mut doc = WDoc::new(8, 6); + doc.layers = + vec![WLayer::solid("Base", Rect::new(0, 0, 8, 6), [0.25, 0.5, 0.75, 1.0]), WLayer::solid("Overlay", Rect::new(2, 1, 4, 4), [1.0, 0.25, 0.0, 0.6])]; + let base = write(&doc); + let reference = Psd::parse(base.clone()).expect("base parse"); + let ref_comp = reference.composite().expect("ref comp").data; + let ref_l0 = reference.layer_pixels(0, false).expect("ref l0").data; + let ref_l1 = reference.layer_pixels(1, true).expect("ref l1").data; + + for version in [Version::Psd, Version::Psb] { + for comp in [Compression::Raw, Compression::Rle, Compression::Zip, Compression::ZipPrediction] { + let bytes = reencode_with(&base, version, comp, true); + let p = Psd::parse(bytes).expect("parse"); + assert_eq!(p.psb, version.is_psb()); + assert_eq!(p.composite().expect("comp").data, ref_comp, "{version:?} {comp:?} composite"); + assert_eq!(p.layer_pixels(0, false).expect("l0").data, ref_l0, "{version:?} {comp:?} l0"); + assert_eq!(p.layer_pixels(1, true).expect("l1").data, ref_l1, "{version:?} {comp:?} l1"); + } + } +} + +#[test] +fn save_and_reopen_parity_preserves_psd_and_psb_documents() { + let mut doc = WDoc::new(10, 8); + doc.layers = vec![ + WLayer::group_end(), + WLayer::solid("Child", Rect::new(1, 2, 5, 4), [0.4, 0.8, 0.2, 0.9]).with_blend(b"mul ").with_opacity(200), + WLayer::group("Folder", true, *b"pass"), + ]; + let initial = write(&doc); + + for version in [Version::Psd, Version::Psb] { + for comp in [Compression::Rle, Compression::ZipPrediction] { + let saved = reencode_with(&initial, version, comp, true); + let reopened_bytes = craft_psd::PsdFile::from_bytes(&saved).expect("parse saved").to_bytes().expect("resave"); + assert_eq!(reopened_bytes, saved, "{version:?} {comp:?} round-trip bytes"); + + let a = Psd::parse(saved).expect("parse first"); + let b = Psd::parse(reopened_bytes).expect("parse reopened"); + assert_eq!(a.psb, b.psb); + assert_eq!(a.merged_alpha, b.merged_alpha); + assert_eq!(a.layers.len(), b.layers.len()); + for (la, lb) in a.layers.iter().zip(&b.layers) { + assert_eq!((&la.name, la.blend, la.opacity, la.section), (&lb.name, lb.blend, lb.opacity, lb.section)); + } + assert_eq!(a.composite().expect("comp a").data, b.composite().expect("comp b").data); + assert_eq!(a.layer_pixels(1, true).expect("l1 a").data, b.layer_pixels(1, true).expect("l1 b").data); + } + } +} From 5fe33d0a9b20803b9d64b6f67be5277360a1a595 Mon Sep 17 00:00:00 2001 From: NullTron Date: Sat, 21 Nov 2026 13:19:34 +0530 Subject: [PATCH 383/451] fix(effects): sample particle producers at their birth time (#1955) --- crates/effects/src/lib.rs | 8 +- crates/effects/src/psim.rs | 35 ++++- crates/effects/src/sim.rs | 2 +- crates/effects/src/sim/engine.rs | 161 ++++++++++++++++--- crates/effects/src/sim/particle_fx.rs | 5 - crates/effects/src/sim/tests.rs | 182 ++++++++++++++++++++-- crates/effects/src/sim3.rs | 2 +- crates/effects/src/util.rs | 34 +++- crates/engine/src/tests/essential_more.rs | 110 ++++++++++++- crates/expr/src/host.rs | 12 +- crates/expr/src/tests.rs | 69 ++++++++ crates/gpu/src/particles.rs | 70 +++++++-- crates/gpu/src/shaders/particles.wgsl | 16 +- crates/gpu/src/tests/deferred_jobs.rs | 41 +++++ crates/gpu/src/tests/particles.rs | 112 ++++++++++++- crates/project/src/essential.rs | 2 +- crates/render/src/cache.rs | 25 +-- crates/render/src/cache/dependencies.rs | 4 +- crates/render/src/eval.rs | 59 +++++-- crates/render/src/fx_host.rs | 31 +++- crates/render/src/pipeline.rs | 38 +++-- crates/render/src/tests/collapse.rs | 154 +++++++++++++++++- crates/render/src/text.rs | 2 +- docs/architecture.md | 12 +- 24 files changed, 1062 insertions(+), 124 deletions(-) diff --git a/crates/effects/src/lib.rs b/crates/effects/src/lib.rs index 75a4f7ad3..8fc5bd111 100644 --- a/crates/effects/src/lib.rs +++ b/crates/effects/src/lib.rs @@ -567,8 +567,8 @@ pub trait EffectHost: Sync { } /// Parameter `id` (a [`flatten_params`] id such as `birthRate`) of effect `effect_index` in /// the layer's stack (the running effect's [`EffectEnv::effect_index`]) at another **layer - /// time**: Particle Emitter 3D samples its Birth Rate at every step it simulates (#1373). - /// `None` when unavailable. + /// time**: stepped particle systems sample their Birth Rate (#1373) and producer position + /// at every step they simulate. `None` when unavailable. fn param_at(&self, _effect_index: usize, _id: &str, _layer_time: f64) -> Option { None } @@ -1524,8 +1524,8 @@ pub fn is_time_dependent(id: &str) -> bool { } /// Does effect `id` read its own parameters at earlier times (the stepped particle systems sample -/// their Birth Rate at every step, #1373)? Caches keyed on the current values can't see what an -/// expression returned then. +/// their Birth Rate and producer position at every step, #1373)? Caches keyed on the current +/// values can't see what an expression returned then. pub fn reads_param_history(id: &str) -> bool { matches!(id, "ec.sim.ccparticleworld" | "ec.sim.ccparticlesystems2" | "ec.sim.ccmrmercury") } diff --git a/crates/effects/src/psim.rs b/crates/effects/src/psim.rs index 5716a2dcb..492242018 100644 --- a/crates/effects/src/psim.rs +++ b/crates/effects/src/psim.rs @@ -13,7 +13,6 @@ #[derive(Clone, Copy, Debug, PartialEq)] pub struct EngineDesc { pub life: f32, - pub producer: [f32; 3], pub radius: [f32; 3], /// Animation (0 Explosive … 9 Fractal Uni). pub anim: u32, @@ -61,6 +60,10 @@ pub struct SimRequest<'a> { pub steps: u64, /// Birth step of every particle id born before `steps` (ascending). pub births: &'a [u32], + /// Engine producer position at the start of each simulated step, in the system's own + /// coordinates: entry `i` is the position used by particles born in step `i` and by the force + /// centre during step `i`. + pub producers: &'a [[f32; 3]], pub system: ParticleSystem, } @@ -110,3 +113,33 @@ pub fn births_at(steps: u64, cap: usize, rate: impl Fn(u64) -> f64) -> Option u64 { + for value in position { + hash = (hash ^ u64::from(value.to_bits())).wrapping_mul(0x0100_0000_01b3).rotate_left(5); + } + hash +} + +/// Fingerprint of the first `steps` producer positions. +pub fn producer_hash(producers: &[[f32; 3]], steps: u64) -> u64 { + let count = usize::try_from(steps).unwrap_or(usize::MAX); + let mut hash = 0; + for position in producers.iter().take(count) { + hash = producer_hash_step(hash, *position); + } + hash +} + +/// Rolling fingerprints of the producer history after each step (the empty prefix is zero). +pub fn producer_prefixes(producers: &[[f32; 3]]) -> Vec { + let mut out = Vec::with_capacity(producers.len().saturating_add(1)); + out.push(0); + let mut hash = 0; + for position in producers { + hash = producer_hash_step(hash, *position); + out.push(hash); + } + out +} diff --git a/crates/effects/src/sim.rs b/crates/effects/src/sim.rs index ca5bc5126..f02f1f0aa 100644 --- a/crates/effects/src/sim.rs +++ b/crates/effects/src/sim.rs @@ -28,7 +28,7 @@ mod weather; pub(crate) use common::{h, hs, pct, pt, spec}; pub use engine::particle_state; #[cfg(test)] -use engine::{MERCURY, PS2, PW_EFFECT_CAMERA, Stepped, rate_history, sim_key, simulate_rates}; +use engine::{MERCURY, PS2, PW, PW_EFFECT_CAMERA, Stepped, rate_history, sim_key, simulate_rates}; #[cfg(test)] pub(crate) use engine::{PState, PW_ANIMS, Phys, simulate}; pub(crate) use engine::{SPS, steps_at}; diff --git a/crates/effects/src/sim/engine.rs b/crates/effects/src/sim/engine.rs index 8d9914e31..8904e7a53 100644 --- a/crates/effects/src/sim/engine.rs +++ b/crates/effects/src/sim/engine.rs @@ -15,6 +15,94 @@ pub(crate) fn steps_at(t: f64) -> u64 { if t <= 0.0 { 0 } else { ((t * SPS + 1e-6).floor() as u64).min(crate::util::MAX_SIM_STEPS) } } +/// The parameter path of a simulation producer and the coordinates its positions use. +#[derive(Clone, Copy, Debug)] +pub(crate) enum ProducerPath { + /// One point parameter. `by_height` converts layer pixels to the systems' height-relative units. + Point { id: &'static str, by_height: bool }, + /// Three scalar parameters in world coordinates. + Components { x: &'static str, y: &'static str, z: &'static str }, +} + +impl ProducerPath { + fn raw_current(self, ctx: &EffectCtx) -> [f64; 3] { + match self { + Self::Point { id, .. } => { + let p = ctx.params.v2(id); + [p[0], p[1], 0.0] + } + Self::Components { x, y, z } => [ctx.params.f(x), ctx.params.f(y), ctx.params.f(z)], + } + } + + fn convert(self, ctx: &EffectCtx, raw: [f64; 3]) -> [f32; 3] { + let unit = match self { + Self::Point { by_height: true, .. } => ctx.layer_size[1].max(1.0), + _ => 1.0, + }; + let finite = |v: f64| if v.is_finite() { (v / unit) as f32 } else { 0.0 }; + [finite(raw[0]), finite(raw[1]), finite(raw[2])] + } + + /// The producer position at the start of every simulated step. + pub(crate) fn history(self, ctx: &EffectCtx) -> Vec<[f32; 3]> { + let steps = steps_at(ctx.time); + if steps == 0 { + return vec![]; + } + let current_raw = self.raw_current(ctx).map(|v| if v.is_finite() { v } else { 0.0 }); + let current = self.convert(ctx, current_raw); + let host = ctx.env.host; + let index = ctx.env.effect_index; + match self { + Self::Point { id, .. } => { + let dynamic = host.is_some_and(|h| !h.param_is_static(index, id)); + if !dynamic { + return vec![current; steps as usize]; + } + (0..steps) + .map(|i| { + let raw = host + .and_then(|h| h.param_at(index, id, i as f64 / SPS)) + .map(|v| { + let p = v.as_vec2(); + [p[0], p[1], 0.0] + }) + .unwrap_or(current_raw); + self.convert(ctx, raw) + }) + .collect() + } + Self::Components { x, y, z } => { + let static_x = host.is_some_and(|h| h.param_is_static(index, x)); + let static_y = host.is_some_and(|h| h.param_is_static(index, y)); + let static_z = host.is_some_and(|h| h.param_is_static(index, z)); + (0..steps) + .map(|i| { + let time = i as f64 / SPS; + let value = |id: &str, now: f64, is_static: bool| { + if is_static { + now + } else { + host.and_then(|h| h.param_at(index, id, time)).map(|v| v.as_f64()).filter(|v| v.is_finite()).unwrap_or(now) + } + }; + self.convert(ctx, [value(x, current_raw[0], static_x), value(y, current_raw[1], static_y), value(z, current_raw[2], static_z)]) + }) + .collect() + } + } + } + + /// Parameter ids left out of the main cache key; their history is fingerprinted separately. + pub(crate) fn cache_skips(self) -> Vec<&'static str> { + match self { + Self::Point { id, .. } => vec![id], + Self::Components { x, y, z } => vec![x, y, z], + } + } +} + #[derive(Clone, Debug)] pub(crate) struct Particle { pub p: [f32; 3], @@ -34,6 +122,9 @@ pub(crate) struct PState { /// The birth rates of the steps so far (see [`rates_hash`]): a checkpoint is only resumed /// from with the same history. pub hist: u64, + /// The producer positions of the steps so far: a checkpoint is only resumed from with the + /// same producer history. + pub producer_hist: u64, } /// `hist` after one more step at `rate` particles per second. @@ -47,7 +138,6 @@ pub(crate) struct Phys { /// Particles per second. pub rate: f64, pub life: f32, - pub producer: [f32; 3], pub radius: [f32; 3], pub anim: u32, pub speed: f32, @@ -82,14 +172,14 @@ fn rand_dir(i: u32, k: u32, seed: u32, flat: bool) -> [f32; 3] { } impl Phys { - fn spawn(&self, id: u32) -> Particle { + fn spawn(&self, id: u32, producer: [f32; 3]) -> Particle { let seed = self.seed; let mut p = [0.0f32; 3]; // Uniform in the producer ellipsoid. let u = rand_dir(id, 1, seed, self.flat); let rr = h(id, 3, seed).powf(if self.flat { 0.5 } else { 1.0 / 3.0 }); for k in 0..3 { - p[k] = self.producer[k] + u[k] * self.radius[k] * rr; + p[k] = producer[k] + u[k] * self.radius[k] * rr; } if self.flat { p[2] = 0.0; @@ -118,13 +208,13 @@ impl Phys { /// One step at the constant [`Phys::rate`] (the tests' reference). #[cfg(test)] - pub(crate) fn step(&self, st: &mut PState, step: u64) { - self.step_at_rate(st, step, self.rate); + pub(crate) fn step(&self, st: &mut PState, step: u64, producer: [f32; 3]) { + self.step_at_rate(st, step, self.rate, producer); } /// One step with `rate` particles per second born during it (rather than [`Phys::rate`]): /// the rate only decides the births, particles already alive move and age as ever. - pub(crate) fn step_at_rate(&self, st: &mut PState, step: u64, rate: f64) { + pub(crate) fn step_at_rate(&self, st: &mut PState, step: u64, rate: f64, producer: [f32; 3]) { let dt = (1.0 / SPS) as f32; let t = step as f32 * dt; let mut drag = self.resistance; @@ -138,19 +228,19 @@ impl Phys { match self.anim { 4 => { // Twirly: swirl around the vertical axis through the producer. - let (dx, dz) = (q.p[0] - self.producer[0], q.p[2] - self.producer[2]); + let (dx, dz) = (q.p[0] - producer[0], q.p[2] - producer[2]); let k = 4.0 * self.extra; a[0] += -dz * k; a[2] += dx * k; if self.flat { - let dy = q.p[1] - self.producer[1]; + let dy = q.p[1] - producer[1]; a[0] += -dy * k; a[1] += dx * k; } } 5 => { // Vortex: strong tangential + inward pull. - let (dx, dy) = (q.p[0] - self.producer[0], q.p[1] - self.producer[1]); + let (dx, dy) = (q.p[0] - producer[0], q.p[1] - producer[1]); let k = 6.0 * self.extra; a[0] += -dy * k - dx * 2.0; a[1] += dx * k - dy * 2.0; @@ -183,6 +273,7 @@ impl Phys { }); st.parts.retain(|q| q.age < q.life); st.hist = rates_hash(st.hist, rate); + st.producer_hist = crate::psim::producer_hash_step(st.producer_hist, producer); st.carry += rate / SPS; let n = st.carry.floor() as u32; st.carry -= n as f64; @@ -193,7 +284,7 @@ impl Phys { let id = st.next_id; st.next_id = st.next_id.wrapping_add(1); // Sub-step birth offset keeps continuous streams smooth. - let mut q = self.spawn(id); + let mut q = self.spawn(id, producer); let frac = h(id, 12, seed) * dt; for k in 0..3 { q.p[k] += q.v[k] * frac; @@ -214,7 +305,6 @@ impl Phys { let dt = (1.0 / SPS) as f32; crate::psim::EngineDesc { life: self.life, - producer: self.producer, radius: self.radius, anim: self.anim, speed: self.speed, @@ -232,20 +322,21 @@ impl Phys { /// The state at layer time `ctx.time` from the host's particle backend (GPU particles), or /// `None` (simulate on the CPU). `rates`: the birth rate of each step, when it changes over time /// (else [`Phys::rate`]). -pub(super) fn accelerated(ctx: &EffectCtx, key: u64, phys: &Phys, rates: Option<&[f64]>) -> Option> { +pub(super) fn accelerated(ctx: &EffectCtx, key: u64, phys: &Phys, rates: Option<&[f64]>, producers: &[[f32; 3]]) -> Option> { let backend = ctx.env.host?.particles()?; let steps = steps_at(ctx.time); let births = match rates { Some(r) => crate::psim::births_at(steps, phys.max, |i| r.get(i as usize).copied().unwrap_or(0.0))?, None => crate::psim::births(phys.rate, steps, phys.max)?, }; - let req = crate::psim::SimRequest { key, steps, births: &births, system: crate::psim::ParticleSystem::Engine(phys.desc()) }; + let req = crate::psim::SimRequest { key, steps, births: &births, producers, system: crate::psim::ParticleSystem::Engine(phys.desc()) }; let parts = backend.simulate(&req)?; Some(std::sync::Arc::new(PState { parts: parts.into_iter().map(|q| Particle { p: q.p, v: q.v, age: q.age, life: q.life, rnd: q.rnd, id: q.id }).collect(), carry: 0.0, next_id: births.len() as u32, hist: 0, + producer_hist: crate::psim::producer_hash(producers, steps), })) } @@ -267,15 +358,23 @@ pub(super) fn rate_history(ctx: &EffectCtx, id: &str, k: f64) -> Vec { /// Run a particle system through `rates` (one birth rate per step, see [`rate_history`]) with /// `cache`, resuming only from checkpoints reached with the same rates. -pub(super) fn simulate_rates(cache: &SimCache, key: u64, phys: &Phys, rates: &[f64]) -> std::sync::Arc { +pub(super) fn simulate_rates(cache: &SimCache, key: u64, phys: &Phys, rates: &[f64], producers: &[[f32; 3]]) -> std::sync::Arc { // `hist` of the state after each number of steps. let mut prefix = Vec::with_capacity(rates.len() + 1); prefix.push(0u64); for r in rates { prefix.push(rates_hash(prefix.last().copied().unwrap_or(0), *r)); } + let producer_prefix = crate::psim::producer_prefixes(producers); let rate = |i: u64| rates.get(i as usize).copied().unwrap_or(0.0); - cache.run_where(key, rates.len() as u64, PState::default, |st, i| phys.step_at_rate(st, i, rate(i)), |s, st| prefix.get(s as usize) == Some(&st.hist)) + let producer = |i: u64| producers.get(i as usize).copied().unwrap_or([0.0; 3]); + cache.run_where( + key, + rates.len() as u64, + PState::default, + |st, i| phys.step_at_rate(st, i, rate(i), producer(i)), + |s, st| prefix.get(s as usize) == Some(&st.hist) && producer_prefix.get(s as usize) == Some(&st.producer_hist), + ) } /// A stepped particle system's particles at `ctx.time`, born at the Birth Rate of their own @@ -286,6 +385,7 @@ pub(super) struct Stepped<'a> { pub(super) cache: &'a SimCache, pub(super) salt: u64, pub(super) skip: &'a [&'a str], + pub(super) producer: ProducerPath, pub(super) k: f64, pub(super) gpu: bool, } @@ -293,20 +393,31 @@ pub(super) struct Stepped<'a> { impl Stepped<'_> { pub(super) fn state(&self, ctx: &EffectCtx, phys: &Phys) -> std::sync::Arc { let rates = rate_history(ctx, "birthRate", self.k); + let producers = self.producer.history(ctx); let mut skip = self.skip.to_vec(); skip.push("birthRate"); + skip.extend(self.producer.cache_skips()); let key = params_key_except(ctx, &Buf { img: Image::new(0, 0), offset: [0.0; 2], scale: 1.0 }, self.salt, &skip); - let gpu = if self.gpu { accelerated(ctx, key, phys, Some(&rates)) } else { None }; - gpu.unwrap_or_else(|| simulate_rates(self.cache, key, phys, &rates)) + let gpu = if self.gpu { accelerated(ctx, key, phys, Some(&rates), &producers) } else { None }; + gpu.unwrap_or_else(|| simulate_rates(self.cache, key, phys, &rates, &producers)) } } /// CC Particle World. -const PW: Stepped = Stepped { cache: &PW_CACHE, salt: 1, skip: &[PW_EFFECT_CAMERA], k: PW_RATE, gpu: true }; +pub(super) const PW: Stepped = Stepped { + cache: &PW_CACHE, + salt: 1, + skip: &[PW_EFFECT_CAMERA], + producer: ProducerPath::Components { x: "producer/producerX", y: "producer/producerY", z: "producer/producerZ" }, + k: PW_RATE, + gpu: true, +}; /// CC Particle Systems II. -pub(super) const PS2: Stepped = Stepped { cache: &PS2_CACHE, salt: 2, skip: &[], k: PS2_RATE, gpu: true }; +pub(super) const PS2: Stepped = + Stepped { cache: &PS2_CACHE, salt: 2, skip: &[], producer: ProducerPath::Point { id: "producer/position", by_height: true }, k: PS2_RATE, gpu: true }; /// CC Mr. Mercury (its blobs are simulated on the CPU). -pub(super) const MERCURY: Stepped = Stepped { cache: &MERCURY_CACHE, salt: 3, skip: &[], k: MERCURY_RATE, gpu: false }; +pub(super) const MERCURY: Stepped = + Stepped { cache: &MERCURY_CACHE, salt: 3, skip: &[], producer: ProducerPath::Point { id: "producer", by_height: true }, k: MERCURY_RATE, gpu: false }; /// CC Particle World's particles at `ctx.time`, born at the Birth Rate of their own time. pub(super) fn pw_state(ctx: &EffectCtx, phys: &Phys) -> std::sync::Arc { @@ -326,17 +437,19 @@ pub fn particle_state(id: &str, ctx: &EffectCtx) -> Option u64 { - params_key_except(ctx, &Buf { img: Image::new(0, 0), offset: [0.0; 2], scale: 1.0 }, salt, &[PW_EFFECT_CAMERA]) + let mut skip = vec![PW_EFFECT_CAMERA, "birthRate"]; + skip.extend(PW.producer.cache_skips()); + params_key_except(ctx, &Buf { img: Image::new(0, 0), offset: [0.0; 2], scale: 1.0 }, salt, &skip) } /// Run a particle system at its constant [`Phys::rate`] to layer time `t` through `cache` (the /// tests' reference). #[cfg(test)] -pub(crate) fn simulate(cache: &SimCache, key: u64, t: f64, phys: &Phys) -> std::sync::Arc { - cache.run(key, steps_at(t), PState::default, |st, i| phys.step(st, i)) +pub(crate) fn simulate(cache: &SimCache, key: u64, t: f64, phys: &Phys, producer: [f32; 3]) -> std::sync::Arc { + cache.run(key, steps_at(t), PState::default, |st, i| phys.step(st, i, producer)) } pub(crate) const PARTICLE_TYPES: &[&str] = diff --git a/crates/effects/src/sim/particle_fx.rs b/crates/effects/src/sim/particle_fx.rs index c2f493ab5..d15a6188d 100644 --- a/crates/effects/src/sim/particle_fx.rs +++ b/crates/effects/src/sim/particle_fx.rs @@ -15,7 +15,6 @@ pub(super) fn pw_phys(ctx: &EffectCtx) -> Phys { Phys { rate: pr.f("birthRate").max(0.0) * PW_RATE, life: pr.f("longevity").max(0.0) as f32, - producer: [pr.f("producer/producerX") as f32, pr.f("producer/producerY") as f32, pr.f("producer/producerZ") as f32], radius: [pr.f("producer/radiusX").max(0.0) as f32, pr.f("producer/radiusY").max(0.0) as f32, pr.f("producer/radiusZ").max(0.0) as f32], anim: pr.e("physics/animation"), speed: pr.f("physics/velocity") as f32 * 0.5, @@ -251,12 +250,10 @@ pub(super) fn ps2_phys(ctx: &EffectCtx) -> Phys { let pr = ctx.params; let lh = ctx.layer_size[1] as f32; let unit = lh.max(1.0); - let pos = pr.v2("producer/position"); let dir = (pr.f("physics/direction") as f32).to_radians(); Phys { rate: pr.f("birthRate").max(0.0) * PS2_RATE, life: pr.f("longevity").max(0.0) as f32, - producer: [pos[0] as f32 / unit, pos[1] as f32 / unit, 0.0], radius: [pr.f("producer/radiusX").max(0.0) as f32 / unit, pr.f("producer/radiusY").max(0.0) as f32 / unit, 0.0], anim: [0u32, 1, 2, 3, 4, 5, 6, 7, 8, 9][pr.e("physics/animation").min(9) as usize], speed: pr.f("physics/velocity") as f32 * 0.25, @@ -321,12 +318,10 @@ pub struct Blob { pub(super) fn mercury_phys(ctx: &EffectCtx) -> Phys { let pr = ctx.params; let unit = (ctx.layer_size[1] as f32).max(1.0); - let pos = pr.v2("producer"); let dir = (pr.f("direction") as f32).to_radians(); Phys { rate: pr.f("birthRate").max(0.0) * MERCURY_RATE, life: pr.f("longevity").max(0.0) as f32, - producer: [pos[0] as f32 / unit, pos[1] as f32 / unit, 0.0], radius: [pr.f("radiusX").max(0.0) as f32 / unit, pr.f("radiusY").max(0.0) as f32 / unit, 0.0], anim: [0u32, 1, 2, 3, 4, 5, 6, 7, 8, 9][pr.e("animation").min(9) as usize], speed: pr.f("velocity") as f32 * 0.3, diff --git a/crates/effects/src/sim/tests.rs b/crates/effects/src/sim/tests.rs index 4c708dae4..592a3b0ba 100644 --- a/crates/effects/src/sim/tests.rs +++ b/crates/effects/src/sim/tests.rs @@ -227,7 +227,6 @@ fn engine_resume_equals_from_scratch() { let phys = Phys { rate: 90.0, life: 1.5, - producer: [0.0; 3], radius: [0.05; 3], anim, speed: 0.5, @@ -242,10 +241,10 @@ fn engine_resume_equals_from_scratch() { }; let a: SimCache = SimCache::new(2); let b: SimCache = SimCache::new(2); - let direct = simulate(&a, 1, 2.0, &phys); - let _ = simulate(&b, 1, 1.0, &phys); - let _ = simulate(&b, 1, 0.37, &phys); - let resumed = simulate(&b, 1, 2.0, &phys); + let direct = simulate(&a, 1, 2.0, &phys, [0.0; 3]); + let _ = simulate(&b, 1, 1.0, &phys, [0.0; 3]); + let _ = simulate(&b, 1, 0.37, &phys, [0.0; 3]); + let resumed = simulate(&b, 1, 2.0, &phys, [0.0; 3]); assert_eq!(direct.parts.len(), resumed.parts.len(), "anim {anim}"); assert!(direct.parts.iter().zip(&resumed.parts).all(|(p, q)| p.p == q.p && p.v == q.v && p.id == q.id), "anim {anim}"); assert!(!direct.parts.is_empty()); @@ -566,6 +565,34 @@ fn half_resolution_scales_sprites() { // ---------------------------------------------------------- Birth Rate over time (#1373) +/// A host whose producer moves from `start_x` at layer time 0 to `start_x + 60 · t`. +struct MovingProducer { + index: usize, + start_x: f64, +} + +impl crate::EffectHost for MovingProducer { + fn layer(&self, _: u64, _: bool) -> Option { + None + } + fn audio(&self, _: u64, _: f64, _: usize, _: u32) -> Option> { + None + } + fn param_at(&self, effect_index: usize, id: &str, t: f64) -> Option { + if effect_index != self.index { + return None; + } + let x = self.start_x + 60.0 * t; + match id { + "producer/position" | "producer" => Some(Value::Vec2([x, 50.0])), + "producer/producerX" => Some(num(x)), + "producer/producerY" => Some(num(50.0)), + "producer/producerZ" => Some(num(0.0)), + _ => None, + } + } +} + /// A host that evaluates effect `index`'s Birth Rate at other layer times as `rate(t)`. struct Rate { index: usize, @@ -624,8 +651,13 @@ fn pw_at(seed: f64, now: f64, t: f64, host: Option<&Rate>) -> Vec Vec { let p = pw_params(seed, now); let ctx = pw_ctx(&p, t, Some(host), host.index); - let key = params_key_except(&ctx, &Buf { img: Image::new(0, 0), offset: [0.0; 2], scale: 1.0 }, 1, &[PW_EFFECT_CAMERA, "birthRate"]); - let st = simulate_rates(&SimCache::new(1), key, &pw_phys(&ctx), &rate_history(&ctx, "birthRate", PW_RATE)); + let rates = rate_history(&ctx, "birthRate", PW_RATE); + let producers = PW.producer.history(&ctx); + let mut skip = PW.skip.to_vec(); + skip.push("birthRate"); + skip.extend(PW.producer.cache_skips()); + let key = params_key_except(&ctx, &Buf { img: Image::new(0, 0), offset: [0.0; 2], scale: 1.0 }, 1, &skip); + let st = simulate_rates(&SimCache::new(1), key, &pw_phys(&ctx), &rates, &producers); st.parts.iter().map(|q| crate::psim::SimParticle { p: q.p, v: q.v, age: q.age, life: q.life, rnd: q.rnd, id: q.id }).collect() } @@ -699,7 +731,7 @@ fn a_constant_birth_rate_is_unchanged() { let p = pw_params(105.0, 2.0); let ctx = pw_ctx(&p, 1.3, None, 0); let phys = pw_phys(&ctx); - let before = simulate(&SimCache::new(1), sim_key(&ctx, 1), 1.3, &phys); + let before = simulate(&SimCache::new(1), sim_key(&ctx, 1), 1.3, &phys, [0.0; 3]); let now = pw_at(105.0, 2.0, 1.3, Some(&host)); assert_eq!(now.len(), before.parts.len()); assert!(now.iter().zip(&before.parts).all(|(a, b)| a.id == b.id && a.p == b.p && a.v == b.v && a.age == b.age)); @@ -714,7 +746,8 @@ fn the_birth_schedule_follows_the_rate_history() { let p = pw_params(106.0, 0.0); let ctx = pw_ctx(&p, 0.7, Some(&host), 0); let rates = rate_history(&ctx, "birthRate", PW_RATE); - let st = simulate_rates(&SimCache::new(1), 9, &pw_phys(&ctx), &rates); + let producers = PW.producer.history(&ctx); + let st = simulate_rates(&SimCache::new(1), 9, &pw_phys(&ctx), &rates, &producers); let births = crate::psim::births_at(rates.len() as u64, 40_000, |i| rates[i as usize]).unwrap(); assert_eq!(st.next_id as usize, births.len()); assert!(births.iter().all(|&b| f64::from(b) / SPS < 0.5), "nothing born once the ramp reaches 0"); @@ -762,8 +795,11 @@ fn sys_fresh(sys: &System, seed: u32, now: f64, t: f64, host: &Rate) -> Vec<(u32 let ctx = sys_ctx(&p, t, Some(host), seed); let mut skip = sys.stepped.skip.to_vec(); skip.push("birthRate"); + skip.extend(sys.stepped.producer.cache_skips()); let key = params_key_except(&ctx, &Buf { img: Image::new(0, 0), offset: [0.0; 2], scale: 1.0 }, sys.stepped.salt, &skip); - let st = simulate_rates(&SimCache::new(1), key, &(sys.phys)(&ctx), &rate_history(&ctx, "birthRate", sys.stepped.k)); + let rates = rate_history(&ctx, "birthRate", sys.stepped.k); + let producers = sys.stepped.producer.history(&ctx); + let st = simulate_rates(&SimCache::new(1), key, &(sys.phys)(&ctx), &rates, &producers); st.parts.iter().map(|q| (q.id, q.p, q.age)).collect() } @@ -819,10 +855,134 @@ fn particle_systems_ii_and_mr_mercury_are_unchanged_at_a_constant_rate() { for sys in &SYSTEMS { let p = sys_params(sys.id, 2.0); let ctx = sys_ctx(&p, 1.3, None, 203); - let before = simulate(&SimCache::new(1), 1, 1.3, &(sys.phys)(&ctx)); + let producers = sys.stepped.producer.history(&ctx); + let producer = producers.last().copied().unwrap_or([0.0; 3]); + let before = simulate(&SimCache::new(1), 1, 1.3, &(sys.phys)(&ctx), producer); let before: Vec<_> = before.parts.iter().map(|q| (q.id, q.p, q.age)).collect(); assert!(!before.is_empty()); assert_eq!(sys_at(sys, 203, 2.0, 1.3, Some(&host)), before, "{}: keyed to a constant", sys.id); assert_eq!(sys_at(sys, 203, 2.0, 1.3, None), before, "{}: no host", sys.id); } } + +/// #1955: a particle is born where its producer was during that step, not where the producer +/// is when the frame is rendered. +#[test] +fn stepped_particles_are_born_at_their_producer_positions() { + let cases: [(&str, &Stepped<'static>, fn(&EffectCtx) -> Phys); 3] = + [("ec.sim.ccparticleworld", &PW, pw_phys), ("ec.sim.ccparticlesystems2", &PS2, ps2_phys), ("ec.sim.ccmrmercury", &MERCURY, mercury_phys)]; + for (id, stepped, phys_fn) in cases { + let mut p = sys_params(id, 1.0); + p.values.insert("longevity".into(), num(5.0)); + for (key, value) in [ + ("producer/radiusX", num(0.0)), + ("producer/radiusY", num(0.0)), + ("producer/radiusZ", num(0.0)), + ("radiusX", num(0.0)), + ("radiusY", num(0.0)), + ("physics/velocity", num(0.0)), + ("physics/gravity", num(0.0)), + ("gravity", num(0.0)), + ("velocity", num(0.0)), + ] { + if p.values.contains_key(key) { + p.values.insert(key.into(), value); + } + } + match id { + "ec.sim.ccparticleworld" => { + p.values.insert("producer/producerX".into(), num(80.0)); + p.values.insert("producer/producerY".into(), num(50.0)); + p.values.insert("producer/producerZ".into(), num(0.0)); + } + "ec.sim.ccparticlesystems2" => { + p.values.insert("producer/position".into(), pt(80.0, 50.0)); + } + "ec.sim.ccmrmercury" => { + p.values.insert("producer".into(), pt(80.0, 50.0)); + } + _ => {} + } + let host = MovingProducer { index: 0, start_x: 20.0 }; + let env = EffectEnv { host: Some(&host), effect_index: 0, ..Default::default() }; + let ctx = EffectCtx { params: &p, time: 1.0, layer_size: [100.0, 100.0], seed: 301, adjustment: false, env }; + let phys = phys_fn(&ctx); + let state = stepped.state(&ctx, &phys); + let births = crate::psim::births_at(steps_at(ctx.time), 40_000, |_| phys.rate).unwrap(); + assert!(!state.parts.is_empty(), "{id}: particles born"); + for q in &state.parts { + let birth = births[q.id as usize] as f32; + // The producer moves 60 units per second. Particle Emitter 3D uses world units; + // the 2D systems use layer-height-relative units in this 100-pixel-high layer. + let want = if id == "ec.sim.ccparticleworld" { [20.0 + birth, 50.0, 0.0] } else { [(20.0 + birth) / 100.0, 0.5, 0.0] }; + let distance = (0..3).map(|k| (q.p[k] - want[k]).abs()).fold(0.0f32, f32::max); + assert!(distance < 1e-5, "{id}: particle {} born at {want:?}, not {:?}", q.id, q.p); + } + } +} + +/// A producer's current position stays out of the simulation key even in production-shaped +/// parameters, where it has both a canonical id and a positional alias. +#[test] +fn current_producer_positions_do_not_change_stepped_simulation_keys() { + use effectcraft_project::build::Ids; + let cases: [(&str, &Stepped<'static>, &[(&str, &str, Value)], (&str, Value)); 3] = [ + ( + "ec.sim.ccparticleworld", + &PW, + &[ + ("producer/producerX", "#1/producerX", num(80.0)), + ("producer/producerY", "#1/producerY", num(50.0)), + ("producer/producerZ", "#1/producerZ", num(0.0)), + ], + ("longevity", num(2.0)), + ), + ("ec.sim.ccparticlesystems2", &PS2, &[("producer/position", "#1/position", pt(80.0, 50.0))], ("longevity", num(2.0))), + ("ec.sim.ccmrmercury", &MERCURY, &[("producer", "producer", pt(80.0, 50.0))], ("radiusX", num(2.0))), + ]; + for (id, stepped, producers, (other, other_value)) in cases { + let spec = crate::find(id).unwrap(); + let mut next = 1; + let group = crate::instantiate(spec, &mut Ids(&mut next), spec.name, [100.0, 100.0]); + let mut p = crate::flatten_params(&group, &mut |pr| pr.value.clone()); + let key = |p: &crate::Params| { + let ctx = EffectCtx { params: p, time: 1.0, layer_size: [100.0, 100.0], seed: 303, adjustment: false, env: EffectEnv::default() }; + let mut skip = stepped.skip.to_vec(); + skip.push("birthRate"); + skip.extend(stepped.producer.cache_skips()); + params_key_except(&ctx, &Buf { img: Image::new(0, 0), offset: [0.0; 2], scale: 1.0 }, stepped.salt, &skip) + }; + let before = key(&p); + for (canonical, alias, value) in producers { + assert!(p.values.contains_key(*canonical), "{id}: {canonical}"); + assert!(p.values.contains_key(*alias), "{id}: {alias}"); + p.values.insert((*canonical).into(), (*value).clone()); + p.values.insert((*alias).into(), (*value).clone()); + } + assert_eq!(key(&p), before, "{id}: the current producer position changed the key"); + p.values.insert(other.into(), other_value); + assert_ne!(key(&p), before, "{id}: another parameter still changes the key"); + } +} + +/// The producer's current value is not part of the simulation key, but an earlier producer +/// value is: a checkpoint reached with another producer history is not reused. +#[test] +fn a_changed_producer_history_drops_stale_checkpoints() { + let state = |start_x| { + let mut p = sys_params("ec.sim.ccparticlesystems2", 1.0); + p.values.insert("longevity".into(), num(5.0)); + p.values.insert("producer/position".into(), pt(80.0, 50.0)); + p.values.insert("producer/radiusX".into(), num(0.0)); + p.values.insert("producer/radiusY".into(), num(0.0)); + p.values.insert("physics/velocity".into(), num(0.0)); + p.values.insert("physics/gravity".into(), num(0.0)); + let host = MovingProducer { index: 0, start_x }; + let env = EffectEnv { host: Some(&host), effect_index: 0, ..Default::default() }; + let ctx = EffectCtx { params: &p, time: 1.0, layer_size: [100.0, 100.0], seed: 302, adjustment: false, env }; + let phys = ps2_phys(&ctx); + PS2.state(&ctx, &phys).parts.first().map(|q| q.p).unwrap() + }; + assert!((state(20.0)[0] - 0.2).abs() < 1e-5, "{:?}", state(20.0)); + assert!((state(60.0)[0] - 0.6).abs() < 1e-5, "{:?}", state(60.0)); +} diff --git a/crates/effects/src/sim3.rs b/crates/effects/src/sim3.rs index c2a286390..08cf6ae6a 100644 --- a/crates/effects/src/sim3.rs +++ b/crates/effects/src/sim3.rs @@ -681,7 +681,7 @@ fn pg_accelerated(ctx: &EffectCtx, key: u64, pg: &Pg) -> Option u64 { params_key_except(ctx, b, salt, &[]) } +/// Whether a flattened parameter is one of the paths in `skip`. +/// +/// [`crate::flatten_params`] gives a grouped parameter both its canonical path (for example +/// `producer/position`) and a positional alias (for example `#1/position`). The aliases carry +/// the same value, so skipping only the canonical path would still let the current producer +/// position change a simulation key. Group metadata maps each alias back to its canonical path. +fn skipped_param(ctx: &crate::EffectCtx, id: &str, skip: &[&str]) -> bool { + if skip.iter().any(|s| id.starts_with(s)) { + return true; + } + if !id.contains('#') { + return false; + } + let mut canonical = String::new(); + let mut prefix = String::new(); + for part in id.split('/') { + let group = part.strip_prefix('#').filter(|n| !n.is_empty() && n.bytes().all(|b| b.is_ascii_digit())).and_then(|_| { + let metadata = format!("{prefix}{part}/@match"); + match ctx.params.values.get(&metadata) { + Some(crate::Value::Str(group)) => Some(group.as_str()), + _ => None, + } + }); + canonical.push_str(group.unwrap_or(part)); + canonical.push('/'); + prefix.push_str(part); + prefix.push('/'); + } + canonical.pop(); + skip.iter().any(|s| canonical.starts_with(s)) +} + /// [`params_key`] without the parameters whose ids start with one of `skip` (ones that only /// change how the simulation is viewed, so animating them doesn't restart it). pub fn params_key_except(ctx: &crate::EffectCtx, b: &crate::Buf, salt: u64, skip: &[&str]) -> u64 { use std::hash::{Hash, Hasher}; let mut h = std::collections::hash_map::DefaultHasher::new(); - let mut keys: Vec<&String> = ctx.params.values.keys().filter(|k| !skip.iter().any(|s| k.starts_with(s))).collect(); + let mut keys: Vec<&String> = ctx.params.values.keys().filter(|k| !skipped_param(ctx, k, skip)).collect(); keys.sort(); for k in keys { k.hash(&mut h); diff --git a/crates/engine/src/tests/essential_more.rs b/crates/engine/src/tests/essential_more.rs index c87d36eec..4513f54db 100644 --- a/crates/engine/src/tests/essential_more.rs +++ b/crates/engine/src/tests/essential_more.rs @@ -306,8 +306,8 @@ fn instance_keys_stay_out_of_a_layer_that_blends_frames() { assert!(pr.keys.is_empty()); } -/// An override from a collapsed parent reaches the nested instance as a value only: the keys the -/// nested instance property carries itself must not be copied onto its own target. +/// A static override from a collapsed parent reaches the nested instance as a value only: the +/// keys the nested instance property carries itself must not be copied onto its own target. #[test] fn collapsed_parent_override_replaces_the_nested_instance_keys() { let mut s = Session::default(); @@ -338,3 +338,109 @@ fn collapsed_parent_override_replaces_the_nested_instance_keys() { assert!((over[0].value.as_f64() - 80.0).abs() < 1e-6, "value {:?}", over[0].value); assert!(over[0].keys.is_empty(), "the nested instance's own keys are stale"); } + +/// Top → Mid → Inner, with a keyed Essential override on the Top instance. The Inner target is +/// `target`; the Mid instance is `nested`. `time_remap` makes the nested source time differ from +/// the Mid instance's layer time. +fn collapsed_parent_scene(time_remap: bool) -> (Session, effectcraft_project::ItemId, effectcraft_project::ItemId, u64, u64, u64) { + let mut s = Session::default(); + s.execute("comp.new", json!({"name": "Inner", "width": 32, "height": 32, "frameRate": 30, "duration": 4})).unwrap(); + let target = s.execute("layer.newSolid", json!({"name": "A", "color": "#ffffff"})).unwrap()["layer"].as_u64().unwrap(); + s.execute("essential.addProperty", json!({"layer": target, "path": "transform/opacity"})).unwrap(); + s.execute("comp.new", json!({"name": "Mid", "width": 32, "height": 32, "frameRate": 30, "duration": 4})).unwrap(); + let mid = s.active_comp_id().unwrap(); + let inner = s.project.find_by_name("Inner").unwrap().id; + let nested = s.execute("layer.addItem", json!({"item": inner.0, "time": 0.0})).unwrap()["layer"].as_u64().unwrap(); + let nested_path = s.execute("essential.instance", json!({"layer": nested})).unwrap()["controls"][0]["path"].as_str().unwrap().to_string(); + s.execute("prop.addKey", json!({"layer": nested, "path": nested_path, "time": 0.0, "value": 0.0})).unwrap(); + s.execute("prop.addKey", json!({"layer": nested, "path": nested_path, "time": 1.0, "value": 100.0})).unwrap(); + let ctl = s.execute("essential.addProperty", json!({"layer": nested, "path": nested_path})).unwrap()["controls"][0].as_u64().unwrap(); + s.execute("layer.setSwitch", json!({"layers": [nested], "switch": "collapse", "value": true})).unwrap(); + if time_remap { + s.execute("layer.enableTimeRemap", json!({"layers": [nested]})).unwrap(); + } + s.execute("comp.new", json!({"name": "Top", "width": 32, "height": 32, "frameRate": 30, "duration": 4})).unwrap(); + let top = s.active_comp_id().unwrap(); + let inst = s.execute("layer.addItem", json!({"item": mid.0, "time": 0.0})).unwrap()["layer"].as_u64().unwrap(); + s.execute("layer.setSwitch", json!({"layers": [inst], "switch": "collapse", "value": true})).unwrap(); + let controls = s.execute("essential.instance", json!({"layer": inst})).unwrap()["controls"].clone(); + let top_path = controls.as_array().unwrap().iter().find(|c| c["control"].as_u64() == Some(ctl)).unwrap()["path"].as_str().unwrap().to_string(); + s.execute("prop.addKey", json!({"layer": inst, "path": top_path, "time": 0.0, "value": 10.0})).unwrap(); + s.execute("prop.addKey", json!({"layer": inst, "path": top_path, "time": 1.0, "value": 90.0})).unwrap(); + (s, top, inner, target, nested, inst) +} + +/// A keyed override from a collapsed parent replaces the nested instance's own history with the +/// parent's, so the nested target can still sample the producer at its birth times. +#[test] +fn a_collapsed_parent_keeps_its_override_history_for_the_nested_instance() { + use effectcraft_project::LayerId; + + let (mut s, top, inner, target, nested, inst) = collapsed_parent_scene(false); + // The Inner target starts late and is stretched: the parent's source-time keys must be moved + // into this target's own layer time. + { + let layer = std::sync::Arc::make_mut(&mut s.project).comp_mut(inner).unwrap().layer_mut(LayerId(target)).unwrap(); + layer.start_time = Tick::from_seconds_f64(0.5); + layer.stretch = 125.0; + } + + let r = effectcraft_render::Renderer::new(&s.project, &*s.footage, crate::render::RenderOpts::default()); + let ctx = effectcraft_render::EvalCtx::new(&s.project, top, s.project.comp(top).unwrap(), Tick::from_seconds_f64(0.25)); + let layer = ctx.comp.layer(LayerId(inst)).unwrap(); + let collapsed = r.collapsed(&ctx, layer).expect("the instance collapses"); + let (_, nctx) = r.collapse_into(&ctx, layer, &collapsed, 1.0).expect("a nested context"); + let nl = nctx.comp.layer(LayerId(nested)).unwrap(); + let over = effectcraft_render::essential_overrides(&nctx, nl); + assert_eq!(over.len(), 1); + assert!((over[0].value.as_f64() - 30.0).abs() < 1e-6, "value {:?}", over[0].value); + assert_eq!(over[0].keys.len(), 2, "the parent's history reaches the nested target"); + assert_eq!(over[0].keys[0].value, KV::Scalar(10.0)); + assert_eq!(over[0].keys[1].value, KV::Scalar(90.0)); + + // The flattened path puts source times 0 and 1 at -0.4 and 0.4 in the target's layer time. + let flat = essential::with_overrides(&s.project, inner, &over).unwrap(); + let flat_target = flat.comp(inner).unwrap().layer(LayerId(target)).unwrap(); + let flat_prop = flat_target.props.prop("transform/opacity").unwrap(); + assert_eq!(flat_prop.keys[0].time, Tick::from_seconds_f64(-0.4)); + assert_eq!(flat_prop.keys[1].time, Tick::from_seconds_f64(0.4)); + + // The collapsed path reads the same values at those exact target-layer times. + let nested_collapsed = r.collapsed(&nctx, nl).expect("the nested instance collapses"); + let (_, target_ctx) = r.collapse_into(&nctx, nl, &nested_collapsed, 1.0).expect("the target context"); + let target_layer = target_ctx.comp.layer(LayerId(target)).unwrap(); + let target_prop = target_layer.props.prop("transform/opacity").unwrap(); + assert_eq!(target_ctx.value_at_layer_time(target_layer, target_prop, Tick::from_seconds_f64(-0.4)), KV::Scalar(10.0)); + assert_eq!(target_ctx.value_at_layer_time(target_layer, target_prop, Tick::from_seconds_f64(0.4)), KV::Scalar(90.0)); +} + +/// A remapped nested source has a different time domain, so its inherited history stays out just +/// as it does on the flattened path. Both paths use the same current value. +#[test] +fn a_remapped_nested_instance_drops_inherited_history_consistently() { + use effectcraft_project::LayerId; + + let (s, top, inner, target, nested, inst) = collapsed_parent_scene(true); + let r = effectcraft_render::Renderer::new(&s.project, &*s.footage, crate::render::RenderOpts::default()); + let ctx = effectcraft_render::EvalCtx::new(&s.project, top, s.project.comp(top).unwrap(), Tick::from_seconds_f64(0.25)); + let layer = ctx.comp.layer(LayerId(inst)).unwrap(); + let collapsed = r.collapsed(&ctx, layer).expect("the instance collapses"); + let (_, nctx) = r.collapse_into(&ctx, layer, &collapsed, 1.0).expect("a nested context"); + let nl = nctx.comp.layer(LayerId(nested)).unwrap(); + let over = effectcraft_render::essential_overrides(&nctx, nl); + assert_eq!(over.len(), 1); + assert!(over[0].keys.is_empty(), "the remapped source has no usable inherited history"); + + let flat = essential::with_overrides(&s.project, inner, &over).unwrap(); + let flat_target = flat.comp(inner).unwrap().layer(LayerId(target)).unwrap(); + let flat_prop = flat_target.props.prop("transform/opacity").unwrap(); + let flat_ctx = effectcraft_render::EvalCtx::new(&flat, inner, flat.comp(inner).unwrap(), Tick::from_seconds_f64(0.25)); + let flat_value = flat_ctx.value(flat_target, flat_prop); + + let nested_collapsed = r.collapsed(&nctx, nl).expect("the nested instance collapses"); + let (_, target_ctx) = r.collapse_into(&nctx, nl, &nested_collapsed, 1.0).expect("the target context"); + let target_layer = target_ctx.comp.layer(LayerId(target)).unwrap(); + let target_prop = target_layer.props.prop("transform/opacity").unwrap(); + let collapsed_value = target_ctx.value(target_layer, target_prop); + assert_eq!(collapsed_value, flat_value); +} diff --git a/crates/expr/src/host.rs b/crates/expr/src/host.rs index 90ef00c4a..cc340988d 100644 --- a/crates/expr/src/host.rs +++ b/crates/expr/src/host.rs @@ -469,8 +469,10 @@ impl<'a> Resolver<'a> { Req::PropInfo { comp, layer, path } => { let (l, p) = self.prop(*comp, *layer, path)?; let dims = prop_dims(l, p); - let times = p.keys.iter().map(|k| Resp::Num(l.comp_time(k.time).seconds())).collect(); - let values = p.keys.iter().map(|k| value_resp(&k.value, dims)).collect(); + let ctx = self.ctx_at(*comp, self.ctx.time.seconds())?; + let effective = ctx.effective_property(l, p); + let times = effective.keys.iter().map(|k| Resp::Num(l.comp_time(k.time).seconds())).collect(); + let values = effective.keys.iter().map(|k| value_resp(&k.value, dims)).collect(); let index = path.rsplit('/').next().and_then(|last| { let parent = path.rsplit_once('/').map(|(g, _)| g); let g = match parent { @@ -497,13 +499,15 @@ impl<'a> Resolver<'a> { Req::Value { comp, layer, path, t, pre } => { let (l, p) = self.prop(*comp, *layer, path)?; let t = f64::from_bits(*t); - let v = if *pre { p.value_at(l.layer_time(Tick::from_seconds_f64(t))) } else { self.ctx_at(*comp, t)?.value(l, p) }; + let ctx = self.ctx_at(*comp, t)?; + let v = if *pre { ctx.effective_property(l, p).value_at(l.layer_time(Tick::from_seconds_f64(t))) } else { ctx.value(l, p) }; value_resp(&v, prop_dims(l, p)) } Req::Doc { comp, layer, path, t, pre } => { let (l, p) = self.prop(*comp, *layer, path)?; let t = f64::from_bits(*t); - let v = if *pre { p.value_at(l.layer_time(Tick::from_seconds_f64(t))) } else { self.ctx_at(*comp, t)?.value(l, p) }; + let ctx = self.ctx_at(*comp, t)?; + let v = if *pre { ctx.effective_property(l, p).value_at(l.layer_time(Tick::from_seconds_f64(t))) } else { ctx.value(l, p) }; match v { Value::Text(d) => Resp::Str(doc_json(&d)), Value::Str(s) => Resp::Str(doc_json(&effectcraft_keyframe::TextDoc::plain(&s))), diff --git a/crates/expr/src/tests.rs b/crates/expr/src/tests.rs index dafb52e6a..c36598d77 100644 --- a/crates/expr/src/tests.rs +++ b/crates/expr/src/tests.rs @@ -1974,6 +1974,75 @@ fn a_layer_parameters_own_expression_reads_its_layer() { } } +#[test] +fn a_collapsed_essential_override_is_the_history_an_expression_reads() { + use effectcraft_project::essential::{self, EgControl, EgKind, EssentialGraphics}; + use effectcraft_project::{Expression, GroupKind}; + + let mut p = Project::default(); + let mut inner = Comp::new(64, 32, FrameRate::FPS_30, Tick::from_seconds_f64(2.0)); + let mut target = solid(&mut p, &inner, "Target", [1.0, 1.0, 1.0], 64, 32); + let opacity = target.props.prop_mut(OPA).unwrap(); + opacity.keys = vec![Keyframe::new(secs(0.0), Value::Scalar(0.0)), Keyframe::new(secs(1.0), Value::Scalar(100.0))]; + opacity.expr = Some(Expression { + text: "thisProperty.valueAtTime(0) + thisProperty.numKeys + thisProperty.key(1).value + thisProperty.nearestKey(0.9).value".into(), + enabled: true, + }); + let target_id = target.id; + let opacity_id = opacity.uid; + inner.layers = vec![target].into(); + inner.essential = Some(EssentialGraphics { + controls: vec![EgControl { + id: 1, + name: "Opacity".into(), + kind: EgKind::Property { layer: target_id, prop: opacity_id, links: vec![] }, + as_type: None, + }], + ..Default::default() + }); + let inner_id = p.add_item("Inner", Label::Sandstone, None, ItemKind::Comp(inner.into())); + + let mut outer = Comp::new(64, 32, FrameRate::FPS_30, Tick::from_seconds_f64(2.0)); + let mut instance = build::layer(&mut p, &outer, "Inner", LayerSource::Comp { item: inner_id }, (64, 32), None); + let mut next = p.next_id; + let mut ids = Ids(&mut next); + let mut control = ids.prop(&essential::match_id(1), "Opacity", Value::Scalar(20.0)); + control.keys = vec![Keyframe::new(secs(0.0), Value::Scalar(20.0)), Keyframe::new(secs(1.0), Value::Scalar(80.0))]; + let mut group = ids.group(essential::GROUP, "Essential Properties"); + group.kind = GroupKind::Essential { overridden: vec![control.uid] }; + group.children.push(control.into()); + instance.props.children.push(group.into()); + p.next_id = next; + instance.switches.collapse = true; + outer.layers = vec![instance].into(); + let outer_id = p.add_item("Outer", Label::Sandstone, None, ItemKind::Comp(outer.into())); + + // The flattened path replaces the target property's keys with the instance override's. + let ctx = EvalCtx::new(&p, outer_id, p.comp(outer_id).unwrap(), secs(0.25)); + let outer_layer = &ctx.comp.layers[0]; + let overrides = effectcraft_render::essential_overrides(&ctx, outer_layer); + let flat = essential::with_overrides(&p, inner_id, &overrides).unwrap(); + let mut flat_ctx = EvalCtx::new(&flat, inner_id, flat.comp(inner_id).unwrap(), secs(0.25)); + flat_ctx.expr = Some(&Expressions); + let flat_target = flat_ctx.comp.layer(target_id).unwrap(); + let flat_value = flat_ctx.value(flat_target, flat_target.props.prop(OPA).unwrap()).as_f64(); + + // The collapsed path carries the same history in its override. An expression on the target + // reads that effective history, just as it does on the flattened path. + let mut r = Renderer::new(&p, &NoFootage, RenderOpts::default()); + r.expr = Some(&Expressions); + let mut collapsed_ctx = EvalCtx::new(&p, outer_id, p.comp(outer_id).unwrap(), secs(0.25)); + collapsed_ctx.expr = Some(&Expressions); + let outer_layer = &collapsed_ctx.comp.layers[0]; + let collapsed = r.collapsed(&collapsed_ctx, outer_layer).expect("the precomp collapses"); + let (_, nested_ctx) = r.collapse_into(&collapsed_ctx, outer_layer, &collapsed, 1.0).unwrap(); + let nested_target = nested_ctx.comp.layer(target_id).unwrap(); + let collapsed_value = nested_ctx.value(nested_target, nested_target.props.prop(OPA).unwrap()).as_f64(); + + assert_close!(flat_value, 122.0); + assert_close!(collapsed_value, flat_value); +} + #[test] fn time_to_frames_rounds_durations_away_from_zero() { let f = fx(); diff --git a/crates/gpu/src/particles.rs b/crates/gpu/src/particles.rs index 9ac103557..c9077a19a 100644 --- a/crates/gpu/src/particles.rs +++ b/crates/gpu/src/particles.rs @@ -5,7 +5,7 @@ use std::sync::{Mutex, OnceLock}; -use effectcraft_effects::psim::{ParticleSystem, SimParticle, SimRequest}; +use effectcraft_effects::psim::{ParticleSystem, SimParticle, SimRequest, producer_prefixes}; use crate::context::GpuContext; @@ -25,6 +25,8 @@ struct Checkpoint { n: u32, /// The birth steps of its particles (see [`born`]). born: u64, + /// Fingerprint of the producer history that reached this checkpoint. + producer: u64, buf: wgpu::Buffer, used: u64, } @@ -74,6 +76,7 @@ fn pipes(g: &GpuContext) -> &Pipes { buffer(1, wgpu::BufferBindingType::Storage { read_only: true }), buffer(2, wgpu::BufferBindingType::Storage { read_only: true }), buffer(3, wgpu::BufferBindingType::Storage { read_only: false }), + buffer(4, wgpu::BufferBindingType::Storage { read_only: true }), ], }); let layout = d.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor { @@ -93,6 +96,18 @@ fn pipes(g: &GpuContext) -> &Pipes { }) } +/// Producer positions packed for the shader's `vec4` storage buffer. +fn packed_producers(producers: &[[f32; 3]]) -> Vec { + let mut out = Vec::new(); + for position in producers { + out.extend_from_slice(&position[0].to_le_bytes()); + out.extend_from_slice(&position[1].to_le_bytes()); + out.extend_from_slice(&position[2].to_le_bytes()); + out.extend_from_slice(&0.0f32.to_le_bytes()); + } + out +} + /// The shader's parameter block. fn uniforms(req: &SimRequest, n: u32, s0: u64, prev_n: u32) -> Vec { let dt = (1.0 / effectcraft_effects::psim::SPS) as f32; @@ -103,8 +118,7 @@ fn uniforms(req: &SimRequest, n: u32, s0: u64, prev_n: u32) -> Vec { ParticleSystem::Engine(e) => { u2 = [e.anim, e.flat as u32, e.seed, prev_n]; f[0] = [e.life, e.speed, e.extra, e.cone]; - f[1] = [e.producer[0], e.producer[1], e.producer[2], 0.0]; - f[2] = [e.radius[0], e.radius[1], e.radius[2], 0.0]; + f[1] = [e.radius[0], e.radius[1], e.radius[2], 0.0]; f[3] = [e.gravity[0], e.gravity[1], e.gravity[2], 0.0]; f[4] = [e.axis[0], e.axis[1], e.axis[2], 0.0]; f[5] = [e.damp, dt, 0.0, 0.0]; @@ -141,10 +155,31 @@ pub(crate) fn simulate(g: &GpuContext, req: &SimRequest) -> Option u32::MAX as u64 { return None; } - let n = req.births.len() as u32; + let n = u32::try_from(req.births.len()).ok()?; if n == 0 { return Some(vec![]); } + let steps = usize::try_from(req.steps).ok()?; + if steps == 0 { + return None; + } + // Engine systems sample a producer at every step. The Cannon's position stays in its + // descriptor. + let producers = match req.system { + ParticleSystem::Engine(_) => { + if req.producers.len() < steps { + return None; + } + &req.producers[..steps] + } + ParticleSystem::Cannon(_) => &[][..], + }; + // Check the storage-buffer size before allocating the history fingerprint or its bytes. + let producer_size = if producers.is_empty() { 16 } else { steps.checked_mul(16)? }; + if u64::try_from(producer_size).ok()? > g.device.limits().max_storage_buffer_binding_size { + return None; + } + let producer_prefix = if producers.is_empty() { vec![0; steps.checked_add(1)?] } else { producer_prefixes(producers) }; let deferred = g.deferred.clone(); let key = deferred.as_ref().map(|_| sim_key(req)); if let (Some(d), Some(k)) = (&deferred, key) { @@ -167,7 +202,17 @@ pub(crate) fn simulate(g: &GpuContext, req: &SimRequest) -> Option { k.used = now; (k.steps, Some(k.buf.clone()), k.n) @@ -178,6 +223,8 @@ pub(crate) fn simulate(g: &GpuContext, req: &SimRequest) -> Option = req.births.iter().flat_map(|b| b.to_le_bytes()).collect(); let births = g.buffer_init(Some("births"), &births, wgpu::BufferUsages::STORAGE); + let producer_bytes = if producers.is_empty() { packed_producers(&[[0.0; 3]]) } else { packed_producers(producers) }; + let producers = g.buffer_init(Some("particle producers"), &producer_bytes, wgpu::BufferUsages::STORAGE); let prev = prev.unwrap_or_else(|| { d.create_buffer(&wgpu::BufferDescriptor { label: Some("particles"), size: STATE_BYTES, usage: wgpu::BufferUsages::STORAGE, mapped_at_creation: false }) }); @@ -196,6 +243,7 @@ pub(crate) fn simulate(g: &GpuContext, req: &SimRequest) -> Option Option u128 { k.u64(req.steps); k.u64(req.births.len() as u64); k.bytes(&req.births.iter().flat_map(|b| b.to_le_bytes()).collect::>()); + let producer_count = usize::try_from(req.steps).ok().and_then(|steps| req.producers.get(..steps)).map_or(0, |producers| producers.len()); + k.u64(producer_count as u64); + k.bytes(&packed_producers(req.producers.get(..producer_count).unwrap_or(&[]))); k.debug(&req.system); k.finish() } @@ -256,12 +307,13 @@ fn parse(bytes: &[u8]) -> Vec { } /// Keep a simulated state on the GPU as a checkpoint (the oldest go beyond the limit). -fn keep_checkpoint(g: &GpuContext, req: &SimRequest, n: u32, next: wgpu::Buffer) { +fn keep_checkpoint(g: &GpuContext, req: &SimRequest, n: u32, next: wgpu::Buffer, producer_prefix: &[u64]) { if let Ok(mut c) = g.particle_states.lock() { let now = c.clock; c.list.retain(|k| !(k.key == req.key && k.steps == req.steps)); let (_, h) = born(req.births, req.steps); - c.list.push(Checkpoint { key: req.key, steps: req.steps, n, born: h, buf: next, used: now }); + let producer = producer_prefix.get(req.steps as usize).copied().unwrap_or(0); + c.list.push(Checkpoint { key: req.key, steps: req.steps, n, born: h, producer, buf: next, used: now }); while c.list.len() > CHECKPOINTS { let Some(i) = c.list.iter().enumerate().min_by_key(|(_, k)| k.used).map(|(i, _)| i) else { break }; c.list.remove(i); diff --git a/crates/gpu/src/shaders/particles.wgsl b/crates/gpu/src/shaders/particles.wgsl index ac12b8fc7..8e0db4859 100644 --- a/crates/gpu/src/shaders/particles.wgsl +++ b/crates/gpu/src/shaders/particles.wgsl @@ -9,8 +9,8 @@ struct PSim { u: vec4, // Animation, flat, seed, particles in `prev`. u2: vec4, - // Engine: f[0] = (life, speed, extra, cone), f[1] = producer, f[2] = radius, - // f[3] = gravity, f[4] = axis, f[5] = (damp, dt). + // Engine: f[0] = (life, speed, extra, cone), f[1] = radius, f[3] = gravity, + // f[4] = axis, f[5] = (damp, dt). // Cannon: f[0] = (pos.x, pos.y, barrel angle, barrel radius), f[1] = (dir spread, vel, // vel spread, grav spread), f[2] = (gravity.x, gravity.y, dt), f[3] = bounds. f: array, 6>, @@ -29,6 +29,8 @@ struct PState { @group(1) @binding(1) var births: array; @group(1) @binding(2) var prev: array; @group(1) @binding(3) var next: array; +// Producer position at each simulated step, in the system's own coordinates. +@group(1) @binding(4) var producers: array>; const PS_TAU: f32 = 6.2831855; @@ -70,11 +72,11 @@ struct Part { } // sim::Phys::spawn (+ the step's sub-step birth offset). -fn ps_spawn_engine(id: u32) -> Part { +fn ps_spawn_engine(id: u32, birth: u32) -> Part { let flat = S.u2.y != 0u; let anim = S.u2.x; - let producer = S.f[1].xyz; - let radius = S.f[2].xyz; + let producer = producers[birth].xyz; + let radius = S.f[1].xyz; let u = ps_rand_dir(id, 1u, flat); var e = 1.0 / 3.0; if (flat) { @@ -129,7 +131,7 @@ fn ps_step_engine(q: Part, j: u32) -> Part { let seed = S.u2.z; let dt = S.f[5].y; let t = f32(j) * dt; - let producer = S.f[1].xyz; + let producer = producers[j].xyz; let gravity = S.f[3].xyz; let extra = S.f[0].z; var a = gravity; @@ -247,7 +249,7 @@ fn particles(@builtin(global_invocation_id) gid: vec3) { if (cannon) { q = ps_spawn_cannon(id); } else { - q = ps_spawn_engine(id); + q = ps_spawn_engine(id, b); } j = b + 1u; } diff --git a/crates/gpu/src/tests/deferred_jobs.rs b/crates/gpu/src/tests/deferred_jobs.rs index 7e5edbedd..b755642b5 100644 --- a/crates/gpu/src/tests/deferred_jobs.rs +++ b/crates/gpu/src/tests/deferred_jobs.rs @@ -3,6 +3,7 @@ //! passes; and the job loops' pass driver (`effectcraft_render::passes`) settles natively. use effectcraft_effects::EffectCtx; +use effectcraft_effects::psim::{EngineDesc, ParticleSim, ParticleSystem, SimRequest}; use effectcraft_project::BitDepth; use effectcraft_render::three_d::adv; use effectcraft_render::{Accelerator, Backend, LayerCache, NoFootage, RenderOpts, Renderer}; @@ -47,6 +48,46 @@ fn particles_resolve_in_passes() { } } +/// The deferred readback key includes the producer history: a request with a different history +/// starts its own readback instead of returning the previous history's particles. +#[test] +fn particle_producer_history_is_part_of_the_deferred_key() { + let Some((g, _lock)) = deferred_gpu() else { return }; + let system = ParticleSystem::Engine(EngineDesc { + life: 10.0, + radius: [0.0; 3], + anim: 0, + speed: 0.0, + gravity: [0.0; 3], + axis: [0.0, -1.0, 0.0], + extra: 0.0, + cone: 0.0, + damp: 1.0, + seed: 51, + flat: true, + }); + let births = [0u32]; + let first_producers = [[10.0, 0.0, 0.0]]; + let first = SimRequest { key: 0x1955_0def, steps: 1, births: &births, producers: &first_producers, system }; + g.frame_begin(); + g.pass_begin(); + assert!(g.simulate(&first).unwrap().is_empty() && g.pass_missed(), "the first readback starts"); + settle(g); + g.pass_begin(); + let ready = g.simulate(&first).unwrap(); + assert!(!ready.is_empty() && !g.pass_missed(), "the first readback is ready"); + assert!((ready[0].p[0] - 10.0).abs() < 1e-4, "{:?}", ready[0].p); + + let changed_producers = [[99.0, 0.0, 0.0]]; + let changed = SimRequest { key: first.key, steps: 1, births: &births, producers: &changed_producers, system }; + g.pass_begin(); + assert!(g.simulate(&changed).unwrap().is_empty() && g.pass_missed(), "the producer history was not part of the deferred key"); + settle(g); + g.pass_begin(); + let changed = g.simulate(&changed).unwrap(); + assert!(!changed.is_empty() && (changed[0].p[0] - 99.0).abs() < 1e-4, "{:?}", changed[0].p); +} + #[test] fn advanced_3d_resolves_in_passes() { let Some((g, _lock)) = deferred_gpu() else { return }; diff --git a/crates/gpu/src/tests/particles.rs b/crates/gpu/src/tests/particles.rs index e11dd6585..f3f1206ec 100644 --- a/crates/gpu/src/tests/particles.rs +++ b/crates/gpu/src/tests/particles.rs @@ -3,7 +3,7 @@ //! ids) at positions within tolerance, from scratch and when advancing / seeking from GPU //! checkpoints. -use effectcraft_effects::psim::{ParticleSim, SimParticle}; +use effectcraft_effects::psim::{EngineDesc, ParticleSim, ParticleSystem, SimParticle, SimRequest}; use effectcraft_effects::{EffectCtx, EffectEnv, EffectHost, LayerPixels, Params}; use effectcraft_keyframe::Value; @@ -24,6 +24,38 @@ impl EffectHost for Host { } } +/// A host whose producer moves from `start_x` at layer time 0 to `start_x + 60 · t`. +struct MovingProducer { + gpu: Option<&'static Gpu>, + index: usize, + start_x: f64, +} + +impl EffectHost for MovingProducer { + fn layer(&self, _id: u64, _masks_and_effects: bool) -> Option { + None + } + fn audio(&self, _id: u64, _start: f64, _frames: usize, _rate: u32) -> Option> { + None + } + fn particles(&self) -> Option<&dyn ParticleSim> { + self.gpu.map(|g| g as &dyn ParticleSim) + } + fn param_at(&self, effect_index: usize, id: &str, t: f64) -> Option { + if effect_index != self.index { + return None; + } + let x = self.start_x + 60.0 * t; + match id { + "producer/position" | "producer" => Some(Value::Vec2([x, 50.0])), + "producer/producerX" => Some(n(x)), + "producer/producerY" => Some(n(50.0)), + "producer/producerZ" => Some(n(0.0)), + _ => None, + } + } +} + pub(crate) fn params(id: &str, vals: &[(&str, Value)]) -> Params { let spec = effectcraft_effects::find(id).unwrap(); let size = [320.0, 240.0]; @@ -179,6 +211,84 @@ fn particle_systems_ii_matches_the_cpu() { } } +/// #1955: a moving producer is sampled at every simulation step on both the CPU and the GPU. +#[test] +fn moving_producers_match_the_cpu_on_the_gpu() { + let Some(g) = gpu() else { return }; + for id in ["ec.sim.ccparticleworld", "ec.sim.ccparticlesystems2"] { + let p = if id == "ec.sim.ccparticleworld" { + params( + id, + &[ + ("birthRate", n(2.0)), + ("longevity", n(5.0)), + ("producer/producerX", n(80.0)), + ("producer/producerY", n(50.0)), + ("producer/producerZ", n(0.0)), + ("producer/radiusX", n(0.0)), + ("producer/radiusY", n(0.0)), + ("producer/radiusZ", n(0.0)), + ("physics/animation", Value::Enum(4)), + ("physics/velocity", n(0.0)), + ("physics/gravity", n(0.0)), + ], + ) + } else { + params( + id, + &[ + ("birthRate", n(2.0)), + ("longevity", n(5.0)), + ("producer/position", Value::Vec2([80.0, 50.0])), + ("producer/radiusX", n(0.0)), + ("producer/radiusY", n(0.0)), + ("physics/animation", Value::Enum(5)), + ("physics/velocity", n(0.0)), + ("physics/gravity", n(0.0)), + ], + ) + }; + let cpu_host = MovingProducer { gpu: None, index: 0, start_x: 20.0 }; + let gpu_host = MovingProducer { gpu: Some(g), index: 0, start_x: 20.0 }; + let ctx = |env| EffectCtx { params: &p, time: 1.0, layer_size: [320.0, 240.0], seed: 31, adjustment: false, env }; + let cpu = effectcraft_effects::particle_state(id, &ctx(EffectEnv { host: Some(&cpu_host), ..Default::default() })).unwrap(); + let before = crate::particles::DISPATCHES.load(std::sync::atomic::Ordering::Relaxed); + let gpu = effectcraft_effects::particle_state(id, &ctx(EffectEnv { host: Some(&gpu_host), ..Default::default() })).unwrap(); + assert!(crate::particles::DISPATCHES.load(std::sync::atomic::Ordering::Relaxed) > before, "{id}: simulated on the GPU"); + agree(&format!("{id} moving producer"), &cpu, &gpu, 1e-4, cpu.len() / 100 + 1); + } +} + +/// A checkpoint reached with one producer history is not reused for another history, even +/// when the current producer position and the system's key are unchanged. +#[test] +fn a_changed_gpu_producer_history_drops_a_stale_checkpoint() { + let Some(g) = gpu() else { return }; + let system = ParticleSystem::Engine(EngineDesc { + life: 10.0, + radius: [0.0; 3], + anim: 0, + speed: 0.0, + gravity: [0.0; 3], + axis: [0.0, -1.0, 0.0], + extra: 0.0, + cone: 0.0, + damp: 1.0, + seed: 41, + flat: true, + }); + let births_one = [0u32]; + let producers_one = [[10.0, 0.0, 0.0]]; + let first = g.simulate(&SimRequest { key: 0x1955, steps: 1, births: &births_one, producers: &producers_one, system }).unwrap(); + assert!((first[0].p[0] - 10.0).abs() < 1e-4, "{:?}", first[0].p); + + let births_two = [0u32, 1u32]; + let producers_two = [[99.0, 0.0, 0.0], [20.0, 0.0, 0.0]]; + let second = g.simulate(&SimRequest { key: 0x1955, steps: 2, births: &births_two, producers: &producers_two, system }).unwrap(); + assert!((second[0].p[0] - 99.0).abs() < 1e-4, "the old checkpoint was reused: {:?}", second[0].p); + assert!((second[1].p[0] - 20.0).abs() < 1e-4, "{:?}", second[1].p); +} + #[test] fn playground_cannon_matches_the_cpu_and_checkpoints_reuse() { let Some(g) = gpu() else { return }; diff --git a/crates/project/src/essential.rs b/crates/project/src/essential.rs index cc3b12209..ee7acaa9c 100644 --- a/crates/project/src/essential.rs +++ b/crates/project/src/essential.rs @@ -650,7 +650,7 @@ pub fn sync_project(before: &Project, after: &mut Project) { /// Keys given in comp time, in the time of a layer that starts at `start` and is stretched to /// `stretch` percent. Empty when the stretch is not a usable factor. -fn keys_in_layer_time(keys: &[Keyframe], start: Tick, stretch: f64) -> Vec { +pub fn keys_in_layer_time(keys: &[Keyframe], start: Tick, stretch: f64) -> Vec { if stretch.is_finite() && stretch > 0.0 { keys.iter().map(|k| key_in_layer_time(k, start, stretch)).collect() } else { vec![] } } diff --git a/crates/render/src/cache.rs b/crates/render/src/cache.rs index 06ed04b75..f8aba34b4 100644 --- a/crates/render/src/cache.rs +++ b/crates/render/src/cache.rs @@ -723,15 +723,22 @@ fn hash_blend_spans(h: &mut KeyHasher, ctx: &EvalCtx, layer: &Layer) { /// Feed every property of `g` that can change over time (keyframes or expression) as its value /// at the context time. The static structure is hashed separately. -/// Mix the collapsed-instance overrides that target `id` into a cache key. They replace values +/// Mix the collapsed-instance overrides that target `layer` into a cache key. They replace values /// without editing the layer, so a key without them would reuse another instance's buffer. -fn hash_overrides(h: &mut KeyHasher, ctx: &EvalCtx, id: effectcraft_project::LayerId) { - for o in ctx.property_overrides.iter().filter(|o| o.layer == id) { +fn hash_overrides(h: &mut KeyHasher, ctx: &EvalCtx, layer: &Layer) { + for o in ctx.property_overrides.iter().filter(|o| o.layer == layer.id) { o.prop.hash(h); o.font.hash(h); hash_debug(h, &o.value); + hash_debug(h, &o.keys); + // The stored value belongs to the outer context. The nested layer can be compared with + // its previous frame while that value stays fixed, so hash the effective value at the + // target layer's exact time as well. + if let Some(prop) = layer.props.find(o.prop) { + hash_debug(h, &o.value_at_layer_time(prop, layer.layer_time(ctx.time))); + } } - for m in ctx.media_overrides.iter().filter(|m| m.layer == id) { + for m in ctx.media_overrides.iter().filter(|m| m.layer == layer.id) { m.item.hash(h); } } @@ -754,8 +761,8 @@ fn hash_values(h: &mut KeyHasher, ctx: &EvalCtx, layer: &Layer, g: &PropGroup) { /// time, or `None` when the layer must not be cached (movie footage, precomps, cameras, adjustment /// layers…). pub fn layer_key(ctx: &EvalCtx, layer: &Layer, scale: f64, draft: bool, blur: bool) -> Option { - // Time effects (and CC Particle World's Birth Rate history) see property values at other - // times. Keyframes are part of the hashed structure (and the layer time is folded in), but + // Time effects (and stepped particle systems' Birth Rate and producer history) see property + // values at other times. Keyframes are part of the hashed structure (and the layer time is folded in), but // expressions may read other layers at those times, which the key cannot see: such layers // are not cached. if history_unkeyable(layer, None) { @@ -778,8 +785,8 @@ pub fn input_key(ctx: &EvalCtx, layer: &Layer, scale: f64, draft: bool, blur: bo } /// Does the layer run (among its first `effects` effects, all when `None`) an effect that reads -/// the layer at other times (Echo, Timewarp…) or its own parameters' history (CC Particle -/// World's Birth Rate, #1373)? +/// the layer at other times (Echo, Timewarp…) or its own parameters' history (stepped particle +/// systems' Birth Rate and producer position, #1373)? fn reads_other_times(layer: &Layer, effects: Option) -> bool { layer.switches.effects && layer.effects().is_some_and(|fx| { @@ -930,7 +937,7 @@ fn key_any(ctx: &EvalCtx, layer: &Layer, scale: f64, draft: bool, blur: bool, fo // Collapsed-instance overrides replace values without editing the nested layer, so mix them // into the key: a Font override, effect parameter or any other source-affecting override // must not reuse another instance's processed buffer. - hash_overrides(&mut h, ctx, layer.id); + hash_overrides(&mut h, ctx, layer); hash_debug(&mut h, &layer.source); // (Audio, Lock and Shy don't change pixels.) hash_debug(&mut h, &layer.switches.pixels()); diff --git a/crates/render/src/cache/dependencies.rs b/crates/render/src/cache/dependencies.rs index 9b9b5e79a..1aebad749 100644 --- a/crates/render/src/cache/dependencies.rs +++ b/crates/render/src/cache/dependencies.rs @@ -87,7 +87,7 @@ impl Dependencies<'_> { hash_debug(self.h, layer); // An overridden clip plays on the layer clock and a keyed one from its key: the same // selection at the same time can pose differently. - super::hash_overrides(self.h, ctx, layer.id); + super::hash_overrides(self.h, ctx, layer); hash_values(self.h, ctx, layer, &layer.props); hash_debug(self.h, &ctx.world_matrix(layer)); if let Some(item) = layer.source.item() { @@ -148,7 +148,7 @@ impl Dependencies<'_> { hash_debug(self.h, layer); // A referenced layer's static values can be overridden by the collapsed instance without // editing it (`hash_values` only sees animated ones), so the owner's key needs them too. - super::hash_overrides(self.h, ctx, layer.id); + super::hash_overrides(self.h, ctx, layer); hash_values(self.h, ctx, layer, &layer.props); hash_debug(self.h, &ctx.world_matrix(layer)); // A cached owner never runs this layer's effects, so the comp camera and lights its diff --git a/crates/render/src/eval.rs b/crates/render/src/eval.rs index a9abefb16..2906b23c4 100644 --- a/crates/render/src/eval.rs +++ b/crates/render/src/eval.rs @@ -3,8 +3,10 @@ //! Keyframe times are stored in **layer time** (they move with the layer), so evaluating a //! property at comp time `t` first maps `t` through the layer's start time and stretch. +use std::borrow::Cow; + use effectcraft_geom::{Mat3, Mat4, Vec3, vec2, vec3}; -use effectcraft_keyframe::Value; +use effectcraft_keyframe::{Value, evaluate, evaluate_orientation}; use effectcraft_project::{Comp, ItemId, Layer, LayerId, LayerSource, Project, PropGroup, Property}; use effectcraft_time::Tick; @@ -57,12 +59,21 @@ impl<'a> EvalCtx<'a> { pub fn at(&self, time: Tick) -> EvalCtx<'a> { EvalCtx { time, ..*self } } + /// The property as this context evaluates it: a collapsed Essential Property override + /// replaces its value and keyframes, while a Font override merges only the font. The + /// expression stays on the property and is not evaluated here. + pub fn effective_property<'p>(&self, layer: &Layer, prop: &'p Property) -> Cow<'p, Property> { + let Some(o) = self.property_overrides.iter().rev().find(|o| o.layer == layer.id && o.prop == prop.uid) else { + return Cow::Borrowed(prop); + }; + Cow::Owned(o.effective_property(prop)) + } /// Value of a property at the context time (keyframes, then expression). pub fn value(&self, layer: &Layer, prop: &Property) -> Value { // A collapsed precomp instance's Essential Property override replaces the base value; // its expression (if any) still runs, and sees the overrides of this context. if let Some(o) = self.property_overrides.iter().rev().find(|o| o.layer == layer.id && o.prop == prop.uid) { - let v = o.value(layer, prop, self.time); + let v = o.value_at_layer_time(prop, layer.layer_time(self.time)); if prop.has_expression() && let Some(h) = self.expr { @@ -87,7 +98,12 @@ impl<'a> EvalCtx<'a> { /// fractional stretch: a Hold key at `lt` could read its previous value). An expression /// still runs at the context time. pub fn value_at_layer_time(&self, layer: &Layer, prop: &Property, lt: Tick) -> Value { - let v = prop.value_at(lt); + let v = self + .property_overrides + .iter() + .rev() + .find(|o| o.layer == layer.id && o.prop == prop.uid) + .map_or_else(|| prop.value_at(lt), |o| o.value_at_layer_time(prop, lt)); if prop.has_expression() && let Some(h) = self.expr { @@ -283,16 +299,41 @@ impl<'a> EvalCtx<'a> { } impl crate::PropertyOverride { - pub(crate) fn value(&self, layer: &Layer, prop: &Property, time: Tick) -> Value { + /// The target property with this override applied, without evaluating its expression. + fn effective_property(&self, prop: &Property) -> Property { + let mut property = prop.clone(); if self.font { // A Font control merges only the font into the target text, as - // `essential::with_overrides` does. - let mut value = prop.value_at(layer.layer_time(time)); - effectcraft_project::essential::merge_font(&mut value, &self.value); - value + // `essential::with_overrides` does. The target's own text and keyframes stay. + effectcraft_project::essential::merge_font(&mut property.value, &self.value); + for key in &mut property.keys { + effectcraft_project::essential::merge_font(&mut key.value, &self.value); + } } else { - self.value.clone() + property.keys = self.keys.clone(); + property.value = self.value.clone(); } + property + } + /// The overridden value at the target layer's exact `layer_time`. + pub(crate) fn value_at_layer_time(&self, prop: &Property, layer_time: Tick) -> Value { + if self.font { + // A Font override leaves the target's history in place and merges its font into the + // value that history selects. The same font is merged into every key, so merging + // after evaluation is equivalent and avoids cloning all the target's keys. + let mut value = prop.value_at(layer_time); + effectcraft_project::essential::merge_font(&mut value, &self.value); + return value; + } + if self.keys.is_empty() { + return self.value.clone(); + } + // Match `Property::value_at` for the replacement history, including orientation's + // shortest-arc interpolation and spatial position paths. + if prop.match_id == "orientation" && matches!(self.value, Value::Vec3(_)) { + return evaluate_orientation(&self.keys, layer_time).unwrap_or_else(|| self.value.clone()); + } + evaluate(&self.keys, layer_time, prop.spatial).unwrap_or_else(|| self.value.clone()) } } diff --git a/crates/render/src/fx_host.rs b/crates/render/src/fx_host.rs index 6e8a0d42d..58dc72e79 100644 --- a/crates/render/src/fx_host.rs +++ b/crates/render/src/fx_host.rs @@ -139,7 +139,13 @@ impl EffectHost for FxHost<'_, '_, '_> { } fn param_is_static(&self, effect_index: usize, id: &str) -> bool { - effect_param(self.layer, effect_index, id).is_some_and(|p| p.keys.is_empty() && !p.has_expression()) + let Some(p) = effect_param(self.layer, effect_index, id) else { return false }; + let Some(o) = self.ctx.property_overrides.iter().rev().find(|o| o.layer == self.layer.id && o.prop == p.uid) else { + return p.keys.is_empty() && !p.has_expression(); + }; + // A whole-value override replaces the target property's keys. A Font override leaves them + // in place, so those keys still make the value vary over time. + o.keys.is_empty() && !p.has_expression() && (!o.font || p.keys.is_empty()) } fn comp_scene(&self) -> Option { @@ -210,10 +216,25 @@ pub fn essential_overrides(ctx: &EvalCtx, layer: &Layer) -> Vec, /// A Font control changes only the font of the target text, not its text. pub(crate) font: bool, } @@ -122,28 +124,29 @@ fn collapsed_instance(ctx: &EvalCtx, layer: &Layer, item: ItemId) -> Option<(Vec if over.is_empty() { return Some((vec![], vec![])); } - let g = essential::group(layer)?; - let eg = ctx.project.comp(item)?.essential.as_ref()?; + essential::group(layer)?; + let nc = ctx.project.comp(item)?; + let eg = nc.essential.as_ref()?; let mut property = vec![]; let mut fonts: Vec = vec![]; let mut media = vec![]; - g.walk("", &mut |_, p| { - if !over.contains(&p.uid) { - return; - } - let Some(control) = essential::control_of(&p.match_id) else { return }; - let Some(ctl) = eg.resolve(control) else { return }; - let value = ctx.value(layer, p); + for over in essential_overrides(ctx, layer) { + let Some(ctl) = eg.resolve(over.control) else { continue }; match &ctl.kind { EgKind::Property { .. } => { let font = ctl.as_type == Some(ControlType::Font); - for (layer, prop) in ctl.kind.targets() { - let o = PropertyOverride { layer, prop, value: value.clone(), font }; + for (target_layer, prop) in ctl.kind.targets() { + let keys = if font { + vec![] + } else { + nc.layer(target_layer).map(|target| essential::keys_in_layer_time(&over.keys, target.start_time, target.stretch)).unwrap_or_default() + }; + let o = PropertyOverride { layer: target_layer, prop, value: over.value.clone(), keys, font }; if font { fonts.push(o) } else { property.push(o) } } } EgKind::Media { layer: target } => { - let Value::Scalar(id) = value else { return }; + let Value::Scalar(id) = over.value else { continue }; let item = ItemId(id.max(0.0) as u64); if matches!(ctx.project.item(item).map(|i| &i.kind), Some(ItemKind::Footage(_))) { media.push(MediaOverride { layer: *target, item }); @@ -151,12 +154,17 @@ fn collapsed_instance(ctx: &EvalCtx, layer: &Layer, item: ItemId) -> Option<(Vec } _ => {} } - }); + } // A Font control merges into the text its instance shows, after a whole-value (Text) override // of the same property, as `essential::with_overrides` does: keep one entry per property. for f in fonts { match property.iter_mut().rev().find(|o| o.layer == f.layer && o.prop == f.prop) { - Some(o) => effectcraft_project::essential::merge_font(&mut o.value, &f.value), + Some(o) => { + effectcraft_project::essential::merge_font(&mut o.value, &f.value); + for key in &mut o.keys { + effectcraft_project::essential::merge_font(&mut key.value, &f.value); + } + } None => property.push(f), } } diff --git a/crates/render/src/tests/collapse.rs b/crates/render/src/tests/collapse.rs index 4104e0b38..be3fef49b 100644 --- a/crates/render/src/tests/collapse.rs +++ b/crates/render/src/tests/collapse.rs @@ -1,9 +1,9 @@ //! Collapse Transformations, Continuously Rasterize and the Quality switch. use effectcraft_color::{BlendMode, Label}; -use effectcraft_keyframe::{TextDoc, Value}; +use effectcraft_keyframe::{Keyframe, TextDoc, Value}; use effectcraft_project::build::{self, Ids}; -use effectcraft_project::{BitDepth, Comp, FrameBlend, ItemId, ItemKind, Layer, LayerSource, Project, Quality, Solid}; +use effectcraft_project::{BitDepth, Comp, FrameBlend, GroupKind, ItemId, ItemKind, Layer, LayerSource, Project, Quality, Solid}; use effectcraft_time::{FrameRate, Tick}; use crate::{EvalCtx, Image, NoFootage, RenderOpts, Renderer, render_frame}; @@ -90,6 +90,145 @@ fn collapsed_precomp_equals_manual_flattening() { assert!((half.get(x, y)[0] - (bg + (full - bg) * 0.5)).abs() < 0.03, "{:?} vs {full}", half.get(x, y)); } +/// A Particle Emitter 2D producer in a nested comp, overridden by a keyframed Essential +/// Property on the collapsed precomp instance. The particles born earlier follow the instance +/// override's history, just as they do on the flattened path. +#[test] +fn a_collapsed_particle_producer_follows_the_instance_override_history() { + use effectcraft_project::essential::{self, EgControl, EgKind, EssentialGraphics}; + + fn scene(collapse: bool) -> (Project, ItemId) { + let mut p = project(); + let mut outer = Comp::new(200, 100, FrameRate::FPS_30, Tick::from_seconds_f64(2.0)); + let mut inner = Comp::new(200, 100, FrameRate::FPS_30, Tick::from_seconds_f64(2.0)); + let mut layer = solid(&mut p, &inner, [0.0, 0.0, 0.0], (200, 100), [100.0, 50.0, 0.0]); + let spec = effectcraft_effects::find("ec.sim.ccparticlesystems2").unwrap(); + let mut next = p.next_id; + let mut effect = effectcraft_effects::instantiate(spec, &mut Ids(&mut next), spec.name, [200.0, 100.0]); + p.next_id = next; + effect.prop_mut("birthRate").unwrap().value = Value::Scalar(60.0); + effect.prop_mut("longevity").unwrap().value = Value::Scalar(5.0); + let producer = effect.sub_mut("producer").unwrap().prop_mut("position").unwrap(); + producer.value = Value::Vec2([140.0, 50.0]); + producer.keys = vec![Keyframe::new(Tick::ZERO, Value::Vec2([140.0, 50.0])), Keyframe::new(Tick::from_seconds_f64(1.0), Value::Vec2([160.0, 50.0]))]; + let producer_uid = producer.uid; + for (group, name) in [("producer", "radiusX"), ("producer", "radiusY"), ("physics", "velocity"), ("physics", "gravity")] { + effect.sub_mut(group).unwrap().prop_mut(name).unwrap().value = Value::Scalar(0.0); + } + layer.props.sub_mut("effects").unwrap().children.push(effect.into()); + let layer_id = layer.id; + inner.layers = vec![layer].into(); + let inner_id = p.add_item("Inner", Label::Sandstone, None, ItemKind::Comp(inner.into())); + p.comp_mut(inner_id).unwrap().essential = Some(EssentialGraphics { + controls: vec![EgControl { + id: 1, + name: "Producer".into(), + kind: EgKind::Property { layer: layer_id, prop: producer_uid, links: vec![] }, + as_type: None, + }], + ..Default::default() + }); + + let mut pre = build::layer(&mut p, &outer, "Inner", LayerSource::Comp { item: inner_id }, (200, 100), None); + let mut next = p.next_id; + let mut ids = Ids(&mut next); + let mut control = ids.prop(&essential::match_id(1), "Producer", Value::Vec2([20.0, 50.0])); + control.keys = vec![Keyframe::new(Tick::ZERO, Value::Vec2([20.0, 50.0])), Keyframe::new(Tick::from_seconds_f64(1.0), Value::Vec2([120.0, 50.0]))]; + let mut group = ids.group(essential::GROUP, "Essential Properties"); + group.kind = GroupKind::Essential { overridden: vec![control.uid] }; + group.children.push(control.into()); + pre.props.children.push(group.into()); + p.next_id = next; + pre.switches.collapse = collapse; + outer.layers = vec![pre].into(); + let outer_id = p.add_item("Outer", Label::Sandstone, None, ItemKind::Comp(outer.into())); + (p, outer_id) + } + + fn particle_span(img: &Image) -> (f32, f32) { + let (mut first, mut last, mut mass) = (f32::INFINITY, f32::NEG_INFINITY, 0.0); + for y in 0..img.height { + for x in 0..img.width { + let red = img.get(x as i64, y as i64)[0]; + if red > 0.001 { + first = first.min(x as f32); + last = last.max(x as f32); + mass += red; + } + } + } + assert!(mass > 1.0, "particles drawn"); + (first, last) + } + + let (p, cid) = scene(false); + let flattened = particle_span(&render_frame(&p, cid, Tick::from_seconds_f64(1.0), 1.0)); + let (p, cid) = scene(true); + let comp = p.comp(cid).unwrap(); + let ctx = EvalCtx::new(&p, cid, comp, Tick::from_seconds_f64(1.0)); + assert!(Renderer::new(&p, &NoFootage, RenderOpts::default()).collapsed(&ctx, &comp.layers[0]).is_some(), "the precomp stays collapsed"); + let collapsed = particle_span(&render_frame(&p, cid, Tick::from_seconds_f64(1.0), 1.0)); + // The override moves the producer from x=20 to x=120. The trail must reach both ends, + // independently of whether the flattened and collapsed paths agree. + assert!(collapsed.0 < 30.0 && collapsed.1 > 110.0, "collapsed producer trail {collapsed:?}"); + assert!( + (flattened.0 - collapsed.0).abs() < 2.0 && (flattened.1 - collapsed.1).abs() < 2.0, + "collapsed producer history: {collapsed:?} vs flattened {flattened:?}" + ); +} + +/// A keyframed Source Text override on a collapsed precomp changes the nested text layer at +/// its exact layer times. Its processed-layer key must change too, or the previous nested frame +/// is reused and the old text stays on screen. +#[test] +fn an_animated_collapsed_text_override_changes_the_nested_layer_cache_key() { + use effectcraft_project::essential::{self, EgControl, EgKind, EssentialGraphics}; + + fn text(value: &str) -> Value { + Value::Text(Box::new(TextDoc { text: value.into(), size: 60.0, ..Default::default() })) + } + + let mut p = project(); + let mut outer = Comp::new(200, 100, FrameRate::FPS_30, Tick::from_seconds_f64(2.0)); + let mut inner = Comp::new(200, 100, FrameRate::FPS_30, Tick::from_seconds_f64(2.0)); + let mut layer = build::layer(&mut p, &inner, "Text", LayerSource::Text, (200, 100), None); + layer.props.prop_mut("text/sourceText").unwrap().value = text("BASE"); + let layer_id = layer.id; + let source_uid = layer.props.prop("text/sourceText").unwrap().uid; + inner.layers = vec![layer].into(); + inner.essential = Some(EssentialGraphics { + controls: vec![EgControl { id: 1, name: "Text".into(), kind: EgKind::Property { layer: layer_id, prop: source_uid, links: vec![] }, as_type: None }], + ..Default::default() + }); + let inner_id = p.add_item("Inner", Label::Sandstone, None, ItemKind::Comp(inner.into())); + + let mut pre = build::layer(&mut p, &outer, "Inner", LayerSource::Comp { item: inner_id }, (200, 100), None); + let mut next = p.next_id; + let mut ids = Ids(&mut next); + let mut control = ids.prop(&essential::match_id(1), "Text", text("A")); + control.keys = vec![Keyframe::new(Tick::ZERO, text("A")), Keyframe::new(Tick::from_seconds_f64(1.0), text("B"))]; + let mut group = ids.group(essential::GROUP, "Essential Properties"); + group.kind = GroupKind::Essential { overridden: vec![control.uid] }; + group.children.push(control.into()); + pre.props.children.push(group.into()); + p.next_id = next; + pre.switches.collapse = true; + outer.layers = vec![pre].into(); + let outer_id = p.add_item("Outer", Label::Sandstone, None, ItemKind::Comp(outer.into())); + + let outer = p.comp(outer_id).unwrap(); + let pre = &outer.layers[0]; + let renderer = Renderer::new(&p, &NoFootage, RenderOpts::default()); + let ctx = EvalCtx::new(&p, outer_id, outer, Tick::from_seconds_f64(1.0)); + let collapsed = renderer.collapsed(&ctx, pre).unwrap(); + let (_, nested) = renderer.collapse_into(&ctx, pre, &collapsed, 1.0).unwrap(); + let layer = &nested.comp.layers[0]; + let before = nested.time - nested.comp.frame_rate.frame_duration(); + let now_key = crate::cache::layer_key(&nested, layer, 1.0, false, false).unwrap(); + let before_key = crate::cache::layer_key(&nested.at(before), layer, 1.0, false, false).unwrap(); + assert_ne!(now_key, before_key, "the animated Source Text override changes the nested layer's pixels"); +} + #[test] fn masks_on_a_collapsed_layer_force_a_flattened_render() { let (mut p, cid) = scene(true, false); @@ -159,8 +298,7 @@ fn referenced_layer_overrides_change_the_owner_cache_key() { let comp = p.comp(cid).unwrap(); let b = comp.layer(bid).unwrap(); let opacity = comp.layer(aid).unwrap().props.prop("transform/opacity").unwrap().uid; - let key = |value: f64| { - let overrides = [crate::PropertyOverride { layer: aid, prop: opacity, value: Value::Scalar(value), font: false }]; + let key = |overrides: &[crate::PropertyOverride]| { let ctx = EvalCtx { project: &p, comp_id: cid, @@ -168,15 +306,19 @@ fn referenced_layer_overrides_change_the_owner_cache_key() { time: Tick::ZERO, expr: None, footage: None, - property_overrides: &overrides, + property_overrides: overrides, media_overrides: &[], reads: None, }; crate::cache::layer_key(&ctx, b, 1.0, false, false) }; - let (opaque, half) = (key(100.0), key(50.0)); + let override_at = |value: f64, keys: Vec| [crate::PropertyOverride { layer: aid, prop: opacity, value: Value::Scalar(value), keys, font: false }]; + let (opaque, half) = (key(&override_at(100.0, vec![])), key(&override_at(50.0, vec![]))); assert!(opaque.is_some(), "the owner is cacheable"); assert_ne!(opaque, half, "A's static override changes B's key"); + let early = override_at(100.0, vec![Keyframe::new(Tick::ZERO, Value::Scalar(25.0))]); + let late = override_at(100.0, vec![Keyframe::new(Tick::ZERO, Value::Scalar(75.0))]); + assert_ne!(key(&early), key(&late), "A's override history changes B's key"); } #[test] diff --git a/crates/render/src/text.rs b/crates/render/src/text.rs index eef5b4067..be6f864a2 100644 --- a/crates/render/src/text.rs +++ b/crates/render/src/text.rs @@ -284,7 +284,7 @@ pub fn animator_selection_within(ctx: &EvalCtx, layer: &Layer, anim: &PropGroup, let stat = if prop.has_expression() { // The expression is not run here, but an Essential Property override still wins over the base value. match ctx.property_overrides.iter().rev().find(|o| o.layer == layer.id && o.prop == prop.uid) { - Some(o) => o.value(layer, prop, ctx.time), + Some(o) => o.value_at_layer_time(prop, layer.layer_time(ctx.time)), None => prop.value_at(layer.layer_time(ctx.time)), } } else { diff --git a/docs/architecture.md b/docs/architecture.md index 1ac306174..9955cc79e 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -481,12 +481,14 @@ Playground cannons without interacting forces evolve every particle independentl backend (reached through `EffectHost::particles` when the GPU compositor is active) simulates one particle per invocation from the CPU's birth schedule and keeps per-key state checkpoints on the GPU, like `SimCache`; the CPU simulation stays the oracle (tests compare ids and positions). -Particle Emitter 3D, Particle Emitter 2D and Liquid Particles sample their Birth Rate at every -step (`EffectHost::param_at`, #1373), so a keyed rate only decides the births of its own time; -the rate is left out of the simulation key, and a checkpoint is resumed only with the same rate history (the CPU state's `hist`, the GPU -checkpoint's births). The rate's keyframes are read at the step's exact layer time +Particle Emitter 3D, Particle Emitter 2D and Liquid Particles sample their Birth Rate and producer +position at every step (`EffectHost::param_at`, #1373), so a keyed rate only decides the births of +its own time and a particle is born where its producer was during that step. The rate and producer +are left out of the simulation key; a checkpoint is resumed only with the same rate and producer +histories (the CPU state's `hist` and `producer_hist`, the GPU checkpoint's births and producer +fingerprint). The values are read at the step's exact layer time (`EvalCtx::value_at_layer_time`; mapping it to comp time and back rounds under a fractional -stretch), a rate without keyframes or an expression isn't sampled, and a layer of one of them with +stretch), a value without keyframes or an expression isn't sampled, and a layer of one of them with expressions isn't layer cached (its key can't see what an expression returned at earlier times). `effectcraft-cli bench --gpu` reports CPU vs GPU ms/frame, speed-up, Auto's ms/frame, pixel agreement and the steady-state upload / readback MB per frame for every comp plus an From 1f51b365674f602328c34978c718b591fe91643c Mon Sep 17 00:00:00 2001 From: NullTron Date: Sat, 21 Nov 2026 18:40:51 +0530 Subject: [PATCH 384/451] fix(effects): preserve Particle Playground producer history (#1955) --- crates/effects/src/lib.rs | 2 +- crates/effects/src/psim.rs | 7 +- crates/effects/src/sim.rs | 2 +- crates/effects/src/sim3.rs | 107 ++++++++++++++++------ crates/effects/src/sim3/tests.rs | 122 +++++++++++++++++++++++++- crates/gpu/src/particles.rs | 27 +++--- crates/gpu/src/shaders/particles.wgsl | 26 +++--- crates/gpu/src/tests/particles.rs | 28 ++++++ crates/render/src/tests.rs | 28 ++++++ 9 files changed, 284 insertions(+), 65 deletions(-) diff --git a/crates/effects/src/lib.rs b/crates/effects/src/lib.rs index 8fc5bd111..3d9fbd85e 100644 --- a/crates/effects/src/lib.rs +++ b/crates/effects/src/lib.rs @@ -1527,7 +1527,7 @@ pub fn is_time_dependent(id: &str) -> bool { /// their Birth Rate and producer position at every step, #1373)? Caches keyed on the current /// values can't see what an expression returned then. pub fn reads_param_history(id: &str) -> bool { - matches!(id, "ec.sim.ccparticleworld" | "ec.sim.ccparticlesystems2" | "ec.sim.ccmrmercury") + matches!(id, "ec.sim.ccparticleworld" | "ec.sim.ccparticlesystems2" | "ec.sim.ccmrmercury" | "ec.sim.particleplayground") } /// Run an effect on a buffer. diff --git a/crates/effects/src/psim.rs b/crates/effects/src/psim.rs index 492242018..b414d4f57 100644 --- a/crates/effects/src/psim.rs +++ b/crates/effects/src/psim.rs @@ -33,7 +33,6 @@ pub struct EngineDesc { /// Particle Playground's Cannon with gravity only (see `sim3::Pg`). #[derive(Clone, Copy, Debug, PartialEq)] pub struct CannonDesc { - pub pos: [f32; 2], pub barrel_angle: f32, pub barrel_radius: f32, pub dir_spread: f32, @@ -60,9 +59,9 @@ pub struct SimRequest<'a> { pub steps: u64, /// Birth step of every particle id born before `steps` (ascending). pub births: &'a [u32], - /// Engine producer position at the start of each simulated step, in the system's own - /// coordinates: entry `i` is the position used by particles born in step `i` and by the force - /// centre during step `i`. + /// Producer position at the start of each simulated step, in the system's own coordinates: + /// entry `i` is the position used by particles born in step `i` and by the force centre + /// during step `i`. pub producers: &'a [[f32; 3]], pub system: ParticleSystem, } diff --git a/crates/effects/src/sim.rs b/crates/effects/src/sim.rs index f02f1f0aa..6f6737b18 100644 --- a/crates/effects/src/sim.rs +++ b/crates/effects/src/sim.rs @@ -31,7 +31,7 @@ pub use engine::particle_state; use engine::{MERCURY, PS2, PW, PW_EFFECT_CAMERA, Stepped, rate_history, sim_key, simulate_rates}; #[cfg(test)] pub(crate) use engine::{PState, PW_ANIMS, Phys, simulate}; -pub(crate) use engine::{SPS, steps_at}; +pub(crate) use engine::{ProducerPath, SPS, steps_at}; pub(crate) use particle_fx::particle_world_textured; pub use particle_fx::{Blob, mercury_blobs}; #[cfg(test)] diff --git a/crates/effects/src/sim3.rs b/crates/effects/src/sim3.rs index 08cf6ae6a..7fe00bbd6 100644 --- a/crates/effects/src/sim3.rs +++ b/crates/effects/src/sim3.rs @@ -27,8 +27,8 @@ use effectcraft_project::ParamUi; use effectcraft_raster::{Image, Px}; use rayon::prelude::*; -use crate::sim::{Acc, Post, SPS, Shape, Sprite, SpritePlan, Tint, combine, splat, steps_at}; -use crate::util::{SimCache, hash1, params_key, point_in_poly, unpremul}; +use crate::sim::{Acc, Post, ProducerPath, SPS, Shape, Sprite, SpritePlan, Tint, combine, splat, steps_at}; +use crate::util::{SimCache, hash1, params_key_except, point_in_poly, unpremul}; use crate::{Buf, EffectCtx, EffectSpec, col, num, p, popup, slider}; fn spec(id: &'static str, name: &'static str, params: Vec, render: crate::RenderFn) -> EffectSpec { @@ -108,6 +108,8 @@ pub struct PgState { pub parts: Vec, carry: f64, next_id: u32, + /// Fingerprint of the producer positions of the steps so far. + producer_hist: u64, } /// A map layer sampled in layer coordinates. @@ -346,7 +348,6 @@ impl Mapper { struct Pg { // Cannon cannon: bool, - pos: [f32; 2], barrel_angle: f32, barrel_radius: f32, rate: f64, @@ -380,7 +381,8 @@ struct Pg { } impl Pg { - fn spawn(&self, id: u32) -> PgParticle { + /// Spawn a cannon particle at `producer` (the cannon's position during its birth step). + fn spawn_at(&self, id: u32, producer: [f32; 2]) -> PgParticle { let s = self.seed; let h = |k: u32| hash1(id, k, s) * 2.0 - 1.0; // AE angles: 0° = up, clockwise. @@ -395,7 +397,7 @@ impl Pg { let (a, rr) = (hash1(id, 5, s) * std::f32::consts::TAU, hash1(id, 6, s).sqrt() * -r); [a.cos() * rr, a.sin() * rr] }; - let p = [self.pos[0] + off[0], self.pos[1] + off[1]]; + let p = [producer[0] + off[0], producer[1] + off[1]]; let mut q = PgParticle::new(p, [d[0] * speed, d[1] * speed], self.color, self.radius, id, SRC_CANNON); if !self.cannon_text.is_empty() { q.ch = self.cannon_text[id as usize % self.cannon_text.len()] as u32; @@ -403,6 +405,12 @@ impl Pg { q } + /// Spawn a cannon particle at the origin (the tests' reference). + #[cfg(test)] + fn spawn(&self, id: u32) -> PgParticle { + self.spawn_at(id, [0.0; 2]) + } + /// The particle as the ephemeral mapper sees it this step (unchanged without one). fn ephemeral(&self, q: &PgParticle) -> PgParticle { let mut e = *q; @@ -412,7 +420,8 @@ impl Pg { e } - fn step(&self, st: &mut PgState) { + /// Advance the simulation one step, using `producer` for particles born in that step. + fn step_at(&self, st: &mut PgState, producer: [f32; 2]) { let dt = (1.0 / SPS) as f32; let s = self.seed; // Persistent Property Mapper: the mapped values stay with the particle. @@ -534,18 +543,36 @@ impl Pg { } let id = st.next_id; st.next_id = st.next_id.wrapping_add(1); - let mut q = self.spawn(id); + let mut q = self.spawn_at(id, producer); // Sub-step birth offset keeps streams smooth. let frac = hash1(id, 9, s) * dt; q.p = [q.p[0] + q.v[0] * frac, q.p[1] + q.v[1] * frac]; st.parts.push(q); } } + st.producer_hist = crate::psim::producer_hash_step(st.producer_hist, [producer[0], producer[1], 0.0]); + } + + /// Advance one step with the origin as its producer (the tests' reference). + #[cfg(test)] + fn step(&self, st: &mut PgState) { + self.step_at(st, [0.0; 2]); } } static PG_CACHE: SimCache = SimCache::new(6); +/// The cannon's position history is sampled in layer pixels, not in the shared systems' +/// height-relative coordinates. +const PG_PRODUCER: ProducerPath = ProducerPath::Point { id: "cannon/cannonPosition", by_height: false }; + +/// The simulation key without the cannon's current position: its history is fingerprinted +/// separately, so moving the cannon does not make every simulation restart. +fn pg_key(ctx: &EffectCtx) -> u64 { + let skip = PG_PRODUCER.cache_skips(); + params_key_except(ctx, &Buf { img: Image::new(0, 0), offset: [0.0; 2], scale: 1.0 }, 0x7067, &skip) +} + fn image_key(img: &Image) -> u64 { use std::hash::{Hash, Hasher}; let mut h = std::collections::hash_map::DefaultHasher::new(); @@ -615,7 +642,6 @@ fn pg_of(ctx: &EffectCtx) -> Pg { let ephemeral = mapper_from(ctx, "ephemeralPropertyMapper", true); Pg { cannon: pr.b("cannonEnabled"), - pos: { pr.v2("cannon/cannonPosition").map(|v| v as f32) }, barrel_angle: pr.f("cannon/barrelAngle") as f32, barrel_radius: pr.f("cannon/barrelRadius") as f32, rate: pr.f("cannon/particlesPerSecond").max(0.0), @@ -665,12 +691,14 @@ impl Affects { } /// Particle Playground cannons with gravity only, simulated by the host's particle backend. -fn pg_accelerated(ctx: &EffectCtx, key: u64, pg: &Pg) -> Option> { +fn pg_accelerated(ctx: &EffectCtx, key: u64, pg: &Pg, producers: &[[f32; 3]]) -> Option> { let backend = ctx.env.host?.particles()?; let steps = steps_at(ctx.time); + if producers.len() < usize::try_from(steps).ok()? { + return None; + } let births = crate::psim::births(pg.rate, steps, 60_000)?; let desc = crate::psim::CannonDesc { - pos: pg.pos, barrel_angle: pg.barrel_angle, barrel_radius: pg.barrel_radius, dir_spread: pg.dir_spread, @@ -681,19 +709,22 @@ fn pg_accelerated(ctx: &EffectCtx, key: u64, pg: &Pg) -> Option>>()?; + Some(std::sync::Arc::new(PgState { parts, carry: 0.0, next_id: births.len() as u32, producer_hist: crate::psim::producer_hash(producers, steps) })) } /// The live particles of a Particle Playground whose cannon is the only producer and force @@ -707,8 +738,19 @@ pub fn playground_state(ctx: &EffectCtx) -> Option if !pg.cannon_only() || grid || exploder { return None; } - let key = params_key(ctx, &Buf { img: Image::new(0, 0), offset: [0.0; 2], scale: 1.0 }, 0x7067); - let st = pg_accelerated(ctx, key, &pg).unwrap_or_else(|| PG_CACHE.run(key, steps_at(ctx.time), PgState::default, |st, _| pg.step(st))); + let producers = PG_PRODUCER.history(ctx); + let producer_prefix = crate::psim::producer_prefixes(&producers); + let key = pg_key(ctx); + let producer = |i: u64| producers.get(i as usize).map(|p| [p[0], p[1]]).unwrap_or([0.0; 2]); + let st = pg_accelerated(ctx, key, &pg, &producers).unwrap_or_else(|| { + PG_CACHE.run_where( + key, + steps_at(ctx.time), + PgState::default, + |st, i| pg.step_at(st, producer(i)), + |s, st| producer_prefix.get(s as usize) == Some(&st.producer_hist), + ) + }); Some( st.parts .iter() @@ -748,7 +790,7 @@ pub fn playground_plan(ctx: &EffectCtx, b: &Buf) -> PgPlan { let ex_r = pr.f("layerExploder/radiusOfNewParticles").max(0.5) as f32; let ex_disp = pr.f("layerExploder/velocityDispersion") as f32; - let mut key = params_key(ctx, &Buf { img: Image::new(0, 0), offset: [0.0; 2], scale: 1.0 }, 0x7067); + let mut key = pg_key(ctx); for m in [&pg.persistent, &pg.ephemeral].into_iter().flatten() { key ^= image_key(&m.map.img).rotate_left(7); } @@ -819,8 +861,19 @@ pub fn playground_plan(ctx: &EffectCtx, b: &Buf) -> PgPlan { }; // A cannon with gravity only: every particle moves on its own (GPU particles). let independent = pg.cannon_only() && !(grid_on && across > 0 && down > 0) && exploder.is_none(); - let gpu = if independent { pg_accelerated(ctx, key, &pg) } else { None }; - let st = gpu.unwrap_or_else(|| PG_CACHE.run(key, steps_at(ctx.time), init, |st, _| pg.step(st))); + let producers = PG_PRODUCER.history(ctx); + let producer_prefix = crate::psim::producer_prefixes(&producers); + let producer = |i: u64| producers.get(i as usize).map(|p| [p[0], p[1]]).unwrap_or([0.0; 2]); + let gpu = if independent { pg_accelerated(ctx, key, &pg, &producers) } else { None }; + let st = gpu.unwrap_or_else(|| { + PG_CACHE.run_where( + key, + steps_at(ctx.time), + init, + |st, i| pg.step_at(st, producer(i)), + |s, st| producer_prefix.get(s as usize) == Some(&st.producer_hist), + ) + }); // Render: what the ephemeral mapper changes shows for this frame only. let parts: Vec = st.parts.iter().map(|q| pg.ephemeral(q)).collect(); let auto_orient = pr.b("options/autoOrientRotation"); diff --git a/crates/effects/src/sim3/tests.rs b/crates/effects/src/sim3/tests.rs index ffce0ae6d..8e0be1ec0 100644 --- a/crates/effects/src/sim3/tests.rs +++ b/crates/effects/src/sim3/tests.rs @@ -1,5 +1,5 @@ use super::*; -use crate::{EffectEnv, MaskShape, run_fx}; +use crate::{EffectCtx, EffectEnv, MaskShape, Params, run_fx}; fn run(vals: &[(&str, Value)], t: f64) -> Image { run_fx("ec.sim.particleplayground", vals, Image::filled(80, 60, [0.2, 0.2, 0.2, 1.0]), t, EffectEnv::default()).img @@ -27,6 +27,125 @@ fn cannon_stream_is_seek_consistent() { assert!(z.data.iter().all(|p| p[3] == 0.0)); } +/// A host whose cannon moves from `start_x` at layer time 0 to `start_x + 60 · t`. +struct MovingCannon { + index: usize, + start_x: f64, +} + +impl crate::EffectHost for MovingCannon { + fn layer(&self, _: u64, _: bool) -> Option { + None + } + fn audio(&self, _: u64, _: f64, _: usize, _: u32) -> Option> { + None + } + fn param_at(&self, effect_index: usize, id: &str, t: f64) -> Option { + (effect_index == self.index && id == "cannon/cannonPosition").then_some(Value::Vec2([self.start_x + 60.0 * t, 50.0])) + } +} + +fn pg_params(current_x: f64) -> Params { + let spec = crate::find("ec.sim.particleplayground").unwrap(); + let mut p = Params { values: spec.params.iter().map(|ps| (ps.id.to_string(), crate::default_value(ps, [80.0, 60.0]))).collect() }; + for (id, value) in [ + ("gridEnabled", Value::Bool(false)), + ("cannonEnabled", Value::Bool(true)), + ("cannon/cannonPosition", Value::Vec2([current_x, 50.0])), + ("cannon/barrelRadius", num(0.0)), + ("cannon/particlesPerSecond", num(60.0)), + ("cannon/directionRandomSpread", num(0.0)), + ("cannon/velocity", num(0.0)), + ("cannon/velocityRandomSpread", num(0.0)), + ("gravity/gravityForce", num(0.0)), + ("randomSeed", num(1.0)), + ] { + p.values.insert(id.into(), value); + } + p +} + +/// Production-shaped Particle Playground parameters, including the positional aliases that +/// [`crate::flatten_params`] adds for grouped controls. +fn pg_production_params(current_x: f64) -> Params { + use effectcraft_project::build::Ids; + let spec = crate::find("ec.sim.particleplayground").unwrap(); + let mut next = 1; + let mut group = crate::instantiate(spec, &mut Ids(&mut next), spec.name, [80.0, 60.0]); + group.sub_mut("cannon").unwrap().prop_mut("cannonPosition").unwrap().value = Value::Vec2([current_x, 50.0]); + crate::flatten_params(&group, &mut |pr| pr.value.clone()) +} + +/// #1955: a Particle Playground cannon particle is born at the cannon's position during its +/// birth step, not at the cannon's position when the frame is rendered. +#[test] +fn cannon_particles_are_born_at_their_producer_positions() { + let p = pg_params(80.0); + let host = MovingCannon { index: 0, start_x: 20.0 }; + let env = EffectEnv { host: Some(&host), effect_index: 0, ..Default::default() }; + let ctx = EffectCtx { params: &p, time: 1.0, layer_size: [80.0, 60.0], seed: 11, adjustment: false, env }; + let parts = playground_state(&ctx).unwrap(); + let births = crate::psim::births(60.0, steps_at(1.0), 60_000).unwrap(); + assert!(parts.len() > 20, "{} particles", parts.len()); + for q in parts { + let step = births[q.id as usize] as f32; + assert!((q.p[0] - (20.0 + step)).abs() < 1e-4, "particle {} at {:?}, expected {}", q.id, q.p, 20.0 + step); + } +} + +/// The current cannon position is not part of the simulation key, but an earlier one is: a +/// checkpoint reached with another producer history is not reused. +#[test] +fn a_changed_cannon_history_drops_stale_checkpoints() { + let p = pg_params(80.0); + let state = |start_x| { + let host = MovingCannon { index: 0, start_x }; + let env = EffectEnv { host: Some(&host), effect_index: 0, ..Default::default() }; + let ctx = EffectCtx { params: &p, time: 1.0, layer_size: [80.0, 60.0], seed: 12, adjustment: false, env }; + playground_state(&ctx).unwrap().into_iter().next().unwrap().p[0] + }; + assert!((state(20.0) - 20.0).abs() < 1e-4, "{}", state(20.0)); + assert!((state(60.0) - 60.0).abs() < 1e-4, "{}", state(60.0)); +} + +/// The cannon's current position is not part of the simulation key, while its other cannon +/// parameters remain part of it. +#[test] +fn the_cannon_position_is_not_part_of_the_particle_playground_key() { + let p = pg_production_params(80.0); + fn ctx(p: &Params) -> EffectCtx<'_> { + EffectCtx { params: p, time: 1.0, layer_size: [80.0, 60.0], seed: 13, adjustment: false, env: EffectEnv::default() } + } + assert!(p.values.contains_key("#2/cannonPosition"), "production parameters have the positional alias"); + let mut moved = p.clone(); + moved.values.insert("cannon/cannonPosition".into(), Value::Vec2([120.0, 50.0])); + moved.values.insert("#2/cannonPosition".into(), Value::Vec2([120.0, 50.0])); + assert_eq!(pg_key(&ctx(&p)), pg_key(&ctx(&moved))); + moved.values.insert("cannon/barrelAngle".into(), num(10.0)); + moved.values.insert("#2/barrelAngle".into(), num(10.0)); + assert_ne!(pg_key(&ctx(&p)), pg_key(&ctx(&moved))); +} + +/// Moving the cannon only changes the position of particles born after the move; particles +/// that already exist keep their world-space trajectory. +#[test] +fn moving_the_cannon_does_not_move_existing_particles() { + let pg = Pg { cannon: true, rate: 60.0, vel: 60.0, ..bare(3) }; + let mut initial = PgState::default(); + pg.step_at(&mut initial, [10.0, 10.0]); + let mut moved = initial.clone(); + let mut unchanged = initial.clone(); + pg.step_at(&mut moved, [100.0, 10.0]); + pg.step_at(&mut unchanged, [10.0, 10.0]); + assert_eq!(moved.parts.len(), 2); + assert_eq!(unchanged.parts.len(), 2); + assert_eq!(moved.parts[0].id, unchanged.parts[0].id); + assert_eq!(moved.parts[0].p, unchanged.parts[0].p); + assert_eq!(moved.parts[0].v, unchanged.parts[0].v); + assert!((moved.parts[1].p[0] - 100.0).abs() < 1e-4, "{:?}", moved.parts[1].p); + assert!((unchanged.parts[1].p[0] - 10.0).abs() < 1e-4, "{:?}", unchanged.parts[1].p); +} + #[test] fn grid_falls_with_gravity_and_bounces_off_a_wall() { let grid = |t: f64, env: EffectEnv| { @@ -136,7 +255,6 @@ fn property_mapper_and_layer_map_read_layers() { fn bare(seed: u32) -> Pg { Pg { cannon: false, - pos: [0.0; 2], barrel_angle: 0.0, barrel_radius: 0.0, rate: 0.0, diff --git a/crates/gpu/src/particles.rs b/crates/gpu/src/particles.rs index c9077a19a..07435f893 100644 --- a/crates/gpu/src/particles.rs +++ b/crates/gpu/src/particles.rs @@ -126,9 +126,9 @@ fn uniforms(req: &SimRequest, n: u32, s0: u64, prev_n: u32) -> Vec { ParticleSystem::Cannon(c) => { u[3] = 1; u2 = [0, 1, c.seed, prev_n]; - f[0] = [c.pos[0], c.pos[1], c.barrel_angle, c.barrel_radius]; - f[1] = [c.dir_spread, c.vel, c.vel_spread, c.grav_spread]; - f[2] = [c.gravity[0], c.gravity[1], dt, 0.0]; + f[0] = [c.barrel_angle, c.barrel_radius, c.dir_spread, c.vel]; + f[1] = [c.vel_spread, c.grav_spread, dt, 0.0]; + f[2] = [c.gravity[0], c.gravity[1], 0.0, 0.0]; f[3] = c.bounds; } } @@ -163,23 +163,16 @@ pub(crate) fn simulate(g: &GpuContext, req: &SimRequest) -> Option { - if req.producers.len() < steps { - return None; - } - &req.producers[..steps] - } - ParticleSystem::Cannon(_) => &[][..], - }; + if req.producers.len() < steps { + return None; + } // Check the storage-buffer size before allocating the history fingerprint or its bytes. - let producer_size = if producers.is_empty() { 16 } else { steps.checked_mul(16)? }; + let producer_size = steps.checked_mul(16)?; if u64::try_from(producer_size).ok()? > g.device.limits().max_storage_buffer_binding_size { return None; } - let producer_prefix = if producers.is_empty() { vec![0; steps.checked_add(1)?] } else { producer_prefixes(producers) }; + let producers = &req.producers[..steps]; + let producer_prefix = producer_prefixes(producers); let deferred = g.deferred.clone(); let key = deferred.as_ref().map(|_| sim_key(req)); if let (Some(d), Some(k)) = (&deferred, key) { @@ -223,7 +216,7 @@ pub(crate) fn simulate(g: &GpuContext, req: &SimRequest) -> Option = req.births.iter().flat_map(|b| b.to_le_bytes()).collect(); let births = g.buffer_init(Some("births"), &births, wgpu::BufferUsages::STORAGE); - let producer_bytes = if producers.is_empty() { packed_producers(&[[0.0; 3]]) } else { packed_producers(producers) }; + let producer_bytes = packed_producers(producers); let producers = g.buffer_init(Some("particle producers"), &producer_bytes, wgpu::BufferUsages::STORAGE); let prev = prev.unwrap_or_else(|| { d.create_buffer(&wgpu::BufferDescriptor { label: Some("particles"), size: STATE_BYTES, usage: wgpu::BufferUsages::STORAGE, mapped_at_creation: false }) diff --git a/crates/gpu/src/shaders/particles.wgsl b/crates/gpu/src/shaders/particles.wgsl index 8e0db4859..59646e761 100644 --- a/crates/gpu/src/shaders/particles.wgsl +++ b/crates/gpu/src/shaders/particles.wgsl @@ -11,8 +11,8 @@ struct PSim { u2: vec4, // Engine: f[0] = (life, speed, extra, cone), f[1] = radius, f[3] = gravity, // f[4] = axis, f[5] = (damp, dt). - // Cannon: f[0] = (pos.x, pos.y, barrel angle, barrel radius), f[1] = (dir spread, vel, - // vel spread, grav spread), f[2] = (gravity.x, gravity.y, dt), f[3] = bounds. + // Cannon: f[0] = (barrel angle, barrel radius, dir spread, vel), f[1] = (vel spread, + // grav spread, dt), f[2] = (gravity.x, gravity.y), f[3] = bounds. f: array, 6>, } @@ -183,13 +183,13 @@ fn ps_step_engine(q: Part, j: u32) -> Part { } // sim3::Pg::spawn (+ the sub-step birth offset). -fn ps_spawn_cannon(id: u32) -> Part { - let pos = S.f[0].xy; - let angle = S.f[0].z; - let r = S.f[0].w; - let spread = S.f[1].x; - let vel = S.f[1].y; - let vel_spread = S.f[1].z; +fn ps_spawn_cannon(id: u32, birth: u32) -> Part { + let pos = producers[birth].xy; + let angle = S.f[0].x; + let r = S.f[0].y; + let spread = S.f[0].z; + let vel = S.f[0].w; + let vel_spread = S.f[1].x; let a = radians(angle + ps_hs(id, 1u) * spread * 0.5); let d = vec2(sin_p(a), -cos_p(a)); let speed = max(vel + ps_hs(id, 3u) * vel_spread, 0.0); @@ -202,7 +202,7 @@ fn ps_spawn_cannon(id: u32) -> Part { off = vec2(cos_p(aa) * rr, sin_p(aa) * rr); } let v = d * speed; - let dt = S.f[2].z; + let dt = S.f[1].z; let frac = ps_h(id, 9u) * dt; let p = pos + off + v * frac; return Part(vec3(p, 0.0), vec3(v, 0.0), 0.0, 0.0, 0.0); @@ -210,8 +210,8 @@ fn ps_spawn_cannon(id: u32) -> Part { // sim3::Pg::step for one particle (gravity only); returns false when it leaves the bounds. fn ps_step_cannon(q: ptr, id: u32) -> bool { - let dt = S.f[2].z; - let spread = S.f[1].w; + let dt = S.f[1].z; + let spread = S.f[1].y; var g = 1.0; if (spread > 0.0) { g = 1.0 + (ps_h(id, 7u) * 2.0 - 1.0) * spread; @@ -247,7 +247,7 @@ fn particles(@builtin(global_invocation_id) gid: vec3) { j = s0; } else { if (cannon) { - q = ps_spawn_cannon(id); + q = ps_spawn_cannon(id, b); } else { q = ps_spawn_engine(id, b); } diff --git a/crates/gpu/src/tests/particles.rs b/crates/gpu/src/tests/particles.rs index f3f1206ec..e4ca79d69 100644 --- a/crates/gpu/src/tests/particles.rs +++ b/crates/gpu/src/tests/particles.rs @@ -51,6 +51,7 @@ impl EffectHost for MovingProducer { "producer/producerX" => Some(n(x)), "producer/producerY" => Some(n(50.0)), "producer/producerZ" => Some(n(0.0)), + "cannon/cannonPosition" => Some(Value::Vec2([x, 50.0])), _ => None, } } @@ -257,6 +258,33 @@ fn moving_producers_match_the_cpu_on_the_gpu() { assert!(crate::particles::DISPATCHES.load(std::sync::atomic::Ordering::Relaxed) > before, "{id}: simulated on the GPU"); agree(&format!("{id} moving producer"), &cpu, &gpu, 1e-4, cpu.len() / 100 + 1); } + + let p = params( + "ec.sim.particleplayground", + &[ + ("cannonEnabled", Value::Bool(true)), + ("grid/particlesAcross", n(0.0)), + ("grid/particlesDown", n(0.0)), + ("cannon/barrelRadius", n(0.0)), + ("cannon/particlesPerSecond", n(60.0)), + ("cannon/velocity", n(0.0)), + ("cannon/velocityRandomSpread", n(0.0)), + ("gravity/gravityForce", n(0.0)), + ], + ); + let cpu_host = MovingProducer { gpu: None, index: 0, start_x: 20.0 }; + let gpu_host = MovingProducer { gpu: Some(g), index: 0, start_x: 20.0 }; + let ctx = |env| EffectCtx { params: &p, time: 1.0, layer_size: [320.0, 240.0], seed: 32, adjustment: false, env }; + let cpu = effectcraft_effects::playground_state(&ctx(EffectEnv { host: Some(&cpu_host), ..Default::default() })).unwrap(); + let before = crate::particles::DISPATCHES.load(std::sync::atomic::Ordering::Relaxed); + let gpu = effectcraft_effects::playground_state(&ctx(EffectEnv { host: Some(&gpu_host), ..Default::default() })).unwrap(); + assert!(crate::particles::DISPATCHES.load(std::sync::atomic::Ordering::Relaxed) > before, "particle playground: simulated on the GPU"); + agree("particle playground moving producer", &cpu, &gpu, 1e-4, cpu.len() / 100 + 1); + let births = effectcraft_effects::psim::births(60.0, 60, 60_000).unwrap(); + for q in &gpu { + let birth = births[q.id as usize] as f32; + assert!((q.p[0] - (20.0 + birth)).abs() < 1e-4, "particle {} at {:?}, expected {}", q.id, q.p, 20.0 + birth); + } } /// A checkpoint reached with one producer history is not reused for another history, even diff --git a/crates/render/src/tests.rs b/crates/render/src/tests.rs index fd60f31a1..9a8acfb74 100644 --- a/crates/render/src/tests.rs +++ b/crates/render/src/tests.rs @@ -697,6 +697,34 @@ fn particle_systems_ii_and_mr_mercury_keep_a_burst_after_birth_rate_drops_to_zer } } +/// A Particle Playground cannon-position expression reads the cannon's position at earlier +/// times, so its layer cannot be served from a cache keyed only by the current value. +#[test] +fn particle_playground_with_a_cannon_position_expression_is_not_layer_cached() { + let (mut p, cid, comp) = setup(); + let mut l = solid(&mut p, &comp, [0.0, 0.0, 0.0], 200, 100); + add_effect( + &mut p, + &mut l, + "ec.sim.particleplayground", + [200.0, 100.0], + &[("grid/particlesAcross", Value::Scalar(0.0)), ("grid/particlesDown", Value::Scalar(0.0)), ("cannon/particlesPerSecond", Value::Scalar(60.0))], + ); + p.comp_mut(cid).unwrap().layers.push(l); + let c = p.comp(cid).unwrap(); + let key = crate::cache::layer_key(&crate::eval::EvalCtx::new(&p, cid, c, Tick::from_seconds_f64(0.9)), &c.layers[0], 1.0, false, false); + assert!(key.is_some(), "a static cannon position is cacheable"); + + let fx = p.comp_mut(cid).unwrap().layers[0].props.sub_mut("effects").unwrap().children.iter_mut().find_map(|c| match c { + effectcraft_project::Node::Group(g) => Some(g), + _ => None, + }); + fx.unwrap().prop_mut("cannon/cannonPosition").unwrap().expr = Some(effectcraft_project::Expression { text: "time * 10".into(), enabled: true }); + let c = p.comp(cid).unwrap(); + let key = crate::cache::layer_key(&crate::eval::EvalCtx::new(&p, cid, c, Tick::from_seconds_f64(0.9)), &c.layers[0], 1.0, false, false); + assert!(key.is_none(), "the cannon's parameter history is not cacheable"); +} + /// A Birth Rate expression on any of the stepped particle systems keeps the layer out of the /// layer cache (its key can't see what the expression returned at earlier times); without one /// the layer is cached. From e6c3efb3d74976d564a42a6c6424d00afa7f78d8 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sat, 21 Nov 2026 16:26:56 -0500 Subject: [PATCH 385/451] chore: sync effectcraft-psd craft-psd rev in Cargo.lock (#4070) --- Cargo.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 1b3f768a3..5a2d2bfc9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2404,7 +2404,7 @@ name = "effectcraft-psd" version = "0.24.1" dependencies = [ "craft-codepage", - "craft-psd 0.1.0 (git+https://github.com/storytold/craft-libs?rev=08da5e1486ee640de1d2cccd8fe8dd32b1d3b62c)", + "craft-psd 0.1.0 (git+https://github.com/storytold/craft-libs?rev=53198114310dbc2b41e18e4eaf2fd83e69964189)", "miniz_oxide 0.9.1", ] From 171e92b0772019357fa3bea724067a32c5875ad7 Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Sun, 22 Nov 2026 04:58:34 +0700 Subject: [PATCH 386/451] media: cover legacy Motion JPEG MOV import without FFmpeg (#4064) Co-authored-by: Codex --- crates/media/src/stream.rs | 88 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/crates/media/src/stream.rs b/crates/media/src/stream.rs index dae3c516e..d349a2c86 100644 --- a/crates/media/src/stream.rs +++ b/crates/media/src/stream.rs @@ -280,3 +280,91 @@ pub(crate) fn probe_source(path: &Path) -> Option> { pub(crate) fn probe_source(_path: &Path) -> Option> { None } + +#[cfg(all(test, any(unix, windows)))] +mod tests { + use super::*; + use craft_media::isobmff::{self, Brand, CodecConfig, Mp4Writer, SampleEntry, TrackConfig, WriteSample, WriterOptions}; + use filmcraft_frame::PixelData; + use image::ExtendedColorType; + use image::codecs::jpeg::JpegEncoder; + + type TestResult = std::result::Result>; + + const WIDTH: u16 = 16; + const HEIGHT: u16 = 16; + + fn generated_mjpeg_mov() -> TestResult> { + // Original synthetic fixture: encode two authored solid RGB tiles, not external media. + let mut writer = Mp4Writer::new(std::io::Cursor::new(Vec::new()), WriterOptions::new(Brand::Mov))?; + let video = writer.add_track(TrackConfig::new(SampleEntry::jpeg(WIDTH, HEIGHT), 1_000))?; + for rgb in [[220, 32, 24], [19, 36, 224]] { + let rgb = rgb.repeat(usize::from(WIDTH) * usize::from(HEIGHT)); + let mut jpeg = Vec::new(); + JpegEncoder::new_with_quality(&mut jpeg, 90).encode(&rgb, u32::from(WIDTH), u32::from(HEIGHT), ExtendedColorType::Rgb8)?; + writer.write_sample(video, WriteSample { data: &jpeg, duration: 40, composition_offset: 0, is_sync: true })?; + } + Ok(writer.finish()?.into_inner().into()) + } + + fn legacy_mjpeg_pixels(source: &MediaSource, time: Tick) -> TestResult>> { + let frame = match source.video_frame(time, 1.0)? { + DecodedFrame::Film(frame) => Some(frame), + DecodedFrame::Craft(_) => None, + } + .ok_or("the MJPEG baseline must use FilmCraft")?; + assert_eq!((frame.width, frame.height), (u32::from(WIDTH), u32::from(HEIGHT))); + let rgba = match &frame.data { + PixelData::Rgba8(rgba) => Some(rgba), + _ => None, + } + .ok_or("legacy MJPEG decodes to RGBA8")?; + assert_eq!(rgba.len(), usize::from(WIDTH) * usize::from(HEIGHT) * 4); + Ok(rgba.clone()) + } + + #[test] + fn generated_mjpeg_mov_preserves_legacy_probe_and_seek() -> TestResult<()> { + let bytes = generated_mjpeg_mov()?; + let mov = isobmff::open(bytes.as_ref())?; + assert!(mov.is_quicktime); + assert_eq!(mov.tracks.len(), 1); + let track = &mov.tracks[0]; + assert!(matches!(track.codec(), Some(CodecConfig::Jpeg { .. }))); + assert_eq!(track.timescale, 1_000); + assert_eq!(track.samples.len(), 2); + assert_eq!((track.samples[0].pts, track.samples[1].pts), (0, 40)); + + let dir = tempfile::tempdir()?; + let name = "generated-mjpeg.mov"; + let path = dir.path().join(name); + std::fs::write(&path, bytes.as_ref())?; + let native_probe = crate::probe(&path)?; + let memory_probe = crate::probe_bytes(name, bytes.clone())?; + let direct = filmcraft_codecs::open_bytes(name, bytes.clone())?; + let legacy_probe = crate::probe::footage_from_info(name, direct.info()); + let step = Tick::from_units(1, 25); + for probe in [native_probe, memory_probe] { + assert!(probe.has_video && !probe.has_audio); + assert_eq!((probe.width, probe.height), (u32::from(WIDTH), u32::from(HEIGHT))); + assert_eq!((probe.frame_rate.num, probe.frame_rate.den), (25, 1)); + assert_eq!(probe.duration, Tick::from_units(2, 25)); + assert_eq!(probe.codec, legacy_probe.codec); + assert_eq!(probe.color_profile, legacy_probe.color_profile); + } + + let native = open_source(&path).ok_or("native source")?.0?; + let memory = open_bytes(name, bytes)?; + assert!(matches!(&native, MediaSource::Film(_))); + assert!(matches!(&memory, MediaSource::Film(_))); + let legacy = MediaSource::Film(direct); + for (time, dominant) in [(Tick::ZERO, 0), (step, 2), (Tick::ZERO, 0)] { + let expected = legacy_mjpeg_pixels(&legacy, time)?; + // Independent colour check: a repeated first frame or blank decode cannot pass parity. + assert!(expected.as_chunks::<4>().0.iter().all(|p| p[dominant] > 180 && p[2 - dominant] < 80 && p[3] == 255)); + assert_eq!(legacy_mjpeg_pixels(&native, time)?, expected); + assert_eq!(legacy_mjpeg_pixels(&memory, time)?, expected); + } + Ok(()) + } +} From 108e6362609c05e94570d20f1e456b8fb33ad2d4 Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Sun, 22 Nov 2026 23:28:40 +0700 Subject: [PATCH 387/451] test(ui): pump and wait longer while prefetch setup fills the cache (#4096) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #4095. This is a hardening change for a FreeBSD CI flake; it may not fully fix the flake. On the scheduled FreeBSD 15 x86_64 run, ui_preview_align::playback_prefetches_past_the_cached_frames_ahead failed during setup: after requesting frames 0..120 it asserted the cache equalled [0, 1, …, 119] and got only [0]. The wait was eight seconds and did not step the harness. The same test passed on the previous day's scheduled run. This PR steps the harness while waiting, gives the workers up to 60 seconds, and reports how many frames actually landed. If workers never fill the cache under load, the test can still fail. The FreeBSD aarch64 job only cross-compiles tests; it does not run them, so a green aarch64 leg is not a test pass. --- crates/ui-egui/tests/it/ui_preview_align.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/tests/it/ui_preview_align.rs b/crates/ui-egui/tests/it/ui_preview_align.rs index afafa8a45..a41723d61 100644 --- a/crates/ui-egui/tests/it/ui_preview_align.rs +++ b/crates/ui-egui/tests/it/ui_preview_align.rs @@ -273,13 +273,16 @@ fn playback_prefetches_past_the_cached_frames_ahead() { for f in 0..120 { h.state().request_frame(cid, f, scale); } - for _ in 0..4000 { + let deadline = std::time::Instant::now() + std::time::Duration::from_secs(60); + while std::time::Instant::now() < deadline { if h.state().frames.cached_frames(&series).len() >= 120 && h.state().frames.inflight() == 0 { break; } + h.step(); std::thread::sleep(std::time::Duration::from_millis(2)); } - assert_eq!(h.state().frames.cached_frames(&series), (0..120).collect::>()); + let cached = h.state().frames.cached_frames(&series); + assert_eq!(cached, (0..120).collect::>(), "setup cached {} frames before playback: {cached:?}", cached.len()); // Rendering/instrumentation time must not move the playhead near the end of the // cached run. Exercise real prefetch workers while holding playback in its first second. h.state_mut().use_manual_clock(); From e7bc3ad808e3e6c0a5c80b542f606b04da7e617c Mon Sep 17 00:00:00 2001 From: Valentin Klein Date: Sun, 22 Nov 2026 19:56:45 +0100 Subject: [PATCH 388/451] Audio Levels in the Audio panel show the value at the current time, with keyframes and expressions (#3234) * Audio panel: Audio Levels show the value at the current time, keyframes and expressions included (#3227) The level fields read the property's static base value. They now evaluate Audio Levels the way the Timeline and Effect Controls do (EvalCtx at the current time: keyframes at layer time, the expression host), and they are hot-text fields whose edits run the Timeline's prop.set, so a keyframed property gets a key at the current time. The Timeline's Link Channels state applies (#2485). New automation ids audio.levelLeft and audio.levelRight carry the shown value; the fields are drawn only when the panel is wide enough for them. Fixes #3227 * Audio panel: a Ctrl+Alt scrub of Audio Levels is proportional, as in the Timeline (#3227) The Audio panel's prop.set now carries the proportional flag the Timeline sends for a Ctrl+Alt (Cmd+Opt) scrub, so the change spreads over the selected layers by selection order. * Audio panel: a scrub of expression-driven Audio Levels moves the keyframed value by the scrub (#3227) prop.set takes a scrub's change from the keyframed value under the expression. The Audio panel sent the shown (expression-evaluated) value moved by the scrub, so the expression's offset was added to every selected layer on every frame of the scrub. A scrub now sends the keyframed value moved by the shown change; a typed value is still set as it is. * Audio panel: narrow panels keep the level fields; typing one channel keeps the other's value under the expression (#3227) The level fields were left out below 110 px (the panel showed them down to 80 px before this PR); 80-110 px now get a compact layout with L / R labels. Typing into one channel of an expression-driven Audio Levels wrote the other channel's shown (expression-evaluated) value into the value under the expression; that channel now keeps its own. Adds tests for a linked and an Alt scrub and for typing into an expression-driven field. * Audio panel: Audio Levels evaluate with the session's footage source (#3227) The level fields built their expression context without the footage source, so an expression sampling footage with sampleImage disagreed with the render. They now use the session's source. Regression: nonzero sampled footage drives both channels. * Audio panel: each level scrub is its own undo step (#3234 review) --- crates/ui-egui/src/panels/misc.rs | 122 +++++- crates/ui-egui/tests/it/main.rs | 1 + .../ui-egui/tests/it/ui_audio_panel_levels.rs | 405 ++++++++++++++++++ 3 files changed, 507 insertions(+), 21 deletions(-) create mode 100644 crates/ui-egui/tests/it/ui_audio_panel_levels.rs diff --git a/crates/ui-egui/src/panels/misc.rs b/crates/ui-egui/src/panels/misc.rs index 0c87721db..a34e0d483 100644 --- a/crates/ui-egui/src/panels/misc.rs +++ b/crates/ui-egui/src/panels/misc.rs @@ -354,36 +354,116 @@ pub fn audio(app: &mut EffectcraftApp, ui: &mut egui::Ui, rect: Rect) { p.text(pos2(sx + 2.0, y), Align2::LEFT_CENTER, format!("{db:.1}"), Tokens::ui(10.0), t.text_faint); } p.text(pos2(sx + 30.0, top - 9.0), Align2::LEFT_CENTER, "dB", Tokens::ui(10.0), t.text_dim); - // Selected layer's Audio Levels. + // Selected layer's Audio Levels: "Left" / "Right" and the editable "-12.0 dB" fields need + // about 110 px; narrower, "L" / "R" (down to 80 px, below which the section is left out). let lx = rect.min.x + 120.0; if rect.max.x - lx < 80.0 { return; } - let sel = app.session.state.selected_layers.first().copied(); - let levels = sel.and_then(|id| { - let c = app.session.active_comp()?; - let l = c.layer(id)?; - let pr = l.props.sub("audio")?.get("levels")?; - Some((l.name.clone(), pr.value.as_vec2())) - }); - match levels { - Some((name, [a, b])) => { - p.text(pos2(lx, top - 9.0), Align2::LEFT_CENTER, &name, Tokens::ui(11.0), t.text_dim); - for (i, (k, v)) in [("Left", a), ("Right", b)].into_iter().enumerate() { - let y = top + 12.0 + i as f32 * 20.0; - p.text(pos2(lx, y), Align2::LEFT_CENTER, k, Tokens::ui(12.0), t.text_dim); - p.text(pos2(lx + 44.0, y), Align2::LEFT_CENTER, format!("{v:+.1} dB"), Tokens::ui(12.0), t.hot_text); - } - } - None => { - p.text(pos2(lx, top + 12.0), Align2::LEFT_CENTER, tr("No audio layer selected"), Tokens::ui(11.0), t.text_faint); - } - } + audio_levels(app, ui, &p, pos2(lx, top), rect.max.x - lx < 110.0); if app.meter.active() || app.audio.is_some() { ui.ctx().request_repaint(); } } +/// The Audio panel's level fields at `at` (left, top of the meters): the selected layer's Audio +/// Levels at the current time, keyframes (read at layer time) and expression included, as the +/// Timeline and Effect Controls show them (#3227). An edit runs the Timeline's `prop.set`: on a +/// keyframed property it keys the current time; a scrub is one undo step; with the Timeline's +/// Link Channels on, the other channel moves by the same dB (#2485). `compact` labels the channels +/// "L" / "R" to fit a narrow panel. +fn audio_levels(app: &mut EffectcraftApp, ui: &mut egui::Ui, p: &egui::Painter, at: egui::Pos2, compact: bool) { + let t = app.tokens; + let (lx, top) = (at.x, at.y); + let comp = app.session.active_comp_arc(); + let selected = app.session.state.selected_layers.first().copied(); + let levels = match (comp.as_deref(), app.session.active_comp_id()) { + (Some(comp), Some(cid)) => selected.and_then(|id| comp.layer(id)).and_then(|layer| { + let pr = layer.props.sub("audio")?.get("levels")?; + let project = app.session.project.clone(); + let expr = app.session.expr.clone(); + // The session's footage source, as the render and `prop.get` use it, so an expression + // that samples footage (`sampleImage`) shows what it evaluates to (#3234). + let footage = app.session.footage.clone(); + let ectx = effectcraft_engine::render::EvalCtx { + project: &project, + comp_id: cid, + comp, + time: app.session.time(), + expr: expr.as_deref(), + footage: Some(footage.as_ref()), + property_overrides: &[], + media_overrides: &[], + reads: None, + }; + // The keyframed value before the expression: what `prop.set` writes and scrubs from. + let raw = pr.value_at(layer.layer_time(ectx.time)).as_vec2(); + Some((layer.id.0, pr.uid, pr.has_expression(), layer.name.as_str(), ectx.value(layer, pr).as_vec2(), raw)) + }), + _ => None, + }; + let Some((lid, uid, driven, name, values, raw)) = levels else { + p.text(pos2(lx, top + 12.0), Align2::LEFT_CENTER, tr("No audio layer selected"), Tokens::ui(11.0), t.text_faint); + return; + }; + p.text(pos2(lx, top - 9.0), Align2::LEFT_CENTER, name, Tokens::ui(11.0), t.text_dim); + // The values themselves: red while an expression drives the property (#1306). + let vt = t.for_value(driven); + // As in the Timeline, a scrub moves every selected layer by the same change and a typed value + // sets the typed channel. + let scrub = ui.ctx().dragged_id().is_some() && ui.input(|i| i.pointer.is_decidedly_dragging()); + // Proportional Scrubbing (Ctrl+Alt / Cmd+Opt): the change spreads over the selected layers by + // selection order, as in the Timeline. + let proportional = scrub && ui.input(|i| widgets::proportional_scrub(i.modifiers)); + // Linked channels move together; Alt edits one alone (Ctrl+Alt is a proportional scrub). + let linked = app.ui.timeline.is_linked(uid, false) && !ui.input(|i| i.modifiers.alt && !widgets::proportional_scrub(i.modifiers)); + let mut actions: Vec = vec![]; + // A scrub ended this frame: the edits below still join its undo step, the next scrub starts + // another (#3234 review). + let mut released = false; + let (channels, field_x) = if compact { (["L", "R"], 14.0) } else { (["Left", "Right"], 44.0) }; + for (d, (k, v)) in channels.into_iter().zip(values).enumerate() { + let y = top + 12.0 + d as f32 * 20.0; + p.text(pos2(lx, y), Align2::LEFT_CENTER, k, Tokens::ui(12.0), t.text_dim); + let spec = widgets::HotSpec { speed: 1.0, range: (-1e9, 1e9), decimals: 1, suffix: " dB" }; + let (r, nv, done) = widgets::hot_number_at(ui, pos2(lx + field_x, y - 9.0), egui::Id::unique(("audio-level", uid, d)), v, &spec, &vt); + released |= done; + app.auto.add(if d == 0 { "audio.levelLeft" } else { "audio.levelRight" }, r, &format!("{v:.1} dB")); + if let Some(nv) = nv { + let merge = format!("audio-levels-{uid}"); + let mut params = json!({"layer": lid, "prop": uid, "merge": merge, "selected": true, "offset": scrub, "proportional": proportional, "dims": [d]}); + let value = if linked { + // The other channel follows by each layer's own change, keeping its balance. + params["follow"] = json!([usize::from(d == 0)]); + widgets::shifted(&values, d, nv) + } else { + let mut value = values.to_vec(); + if let Some(slot) = value.get_mut(d) { + *slot = nv; + } + value + }; + // The fields show the value after the expression; `prop.set` writes (and a scrub takes + // its change from) the keyframed value under it. So each channel is that value moved + // by the change the edit makes to what is shown (every selected layer then moves by + // it), except a typed channel, which is set as typed. + let value: Vec = + value.iter().zip(values.iter().zip(raw)).enumerate().map(|(e, (n, (shown, r)))| if e == d && !scrub { *n } else { r + (n - shown) }).collect(); + params["value"] = json!(value); + actions.push(params); + } + } + let ctx = ui.ctx().clone(); + for params in actions { + if let Err(e) = crate::menus::invoke(app, &ctx, "prop.set", params) { + app.ui.status = e; + } + } + if released { + app.session.history.merge_key = None; + } +} + /// The History panel: every state of the session's branching history, indented under the state it /// grew from, with the current state highlighted and future/abandoned branches dimmed. Only the /// rows in view are drawn; the current state is scrolled into view when it changes. Clicking a diff --git a/crates/ui-egui/tests/it/main.rs b/crates/ui-egui/tests/it/main.rs index f80611a9b..4444fcc5e 100644 --- a/crates/ui-egui/tests/it/main.rs +++ b/crates/ui-egui/tests/it/main.rs @@ -11,6 +11,7 @@ mod ui_accessibility_audit; mod ui_agent_audit; mod ui_alt_drag_duplicate; mod ui_angles; +mod ui_audio_panel_levels; mod ui_audio_scrub; mod ui_azerty_shortcuts; mod ui_batch_links; diff --git a/crates/ui-egui/tests/it/ui_audio_panel_levels.rs b/crates/ui-egui/tests/it/ui_audio_panel_levels.rs new file mode 100644 index 000000000..9f7121c0b --- /dev/null +++ b/crates/ui-egui/tests/it/ui_audio_panel_levels.rs @@ -0,0 +1,405 @@ +//! The Audio panel's level fields (#3227): they show the selected layer's Audio Levels at the +//! current time, keyframes and expression included, as the Timeline does; typing into one on a +//! keyframed property sets a key at the current time and leaves the static value alone, and with +//! the Timeline's Link Channels on the other channel follows (#2485). + +use effectcraft_engine::Session; +use effectcraft_engine::project::LayerId; +use effectcraft_ui_egui::EffectcraftApp; +use effectcraft_ui_egui::dock::PanelKind; +use egui::{Event, Key, Modifiers, PointerButton, Pos2, pos2, vec2}; +use egui_kittest::Harness; +use serde_json::json; + +const LEFT: &str = "audio.levelLeft"; +const RIGHT: &str = "audio.levelRight"; + +fn center(h: &Harness<'_, EffectcraftApp>, id: &str) -> Pos2 { + let e = h.state().auto.find(id).unwrap_or_else(|| panic!("the Audio panel shows no {id}")); + pos2(e.rect[0] + e.rect[2] / 2.0, e.rect[1] + e.rect[3] / 2.0) +} + +fn label(h: &Harness<'_, EffectcraftApp>, id: &str) -> String { + h.state().auto.find(id).unwrap_or_else(|| panic!("the Audio panel shows no {id}")).label.clone() +} + +fn click(h: &mut Harness<'_, EffectcraftApp>, id: &str) { + let p = center(h, id); + h.input_mut().events.push(Event::PointerMoved(p)); + h.step(); + h.input_mut().events.push(Event::PointerButton { pos: p, button: PointerButton::Primary, pressed: true, modifiers: Modifiers::NONE }); + h.step(); + h.input_mut().events.push(Event::PointerButton { pos: p, button: PointerButton::Primary, pressed: false, modifiers: Modifiers::NONE }); + h.run_steps(3); +} + +fn type_value(h: &mut Harness<'_, EffectcraftApp>, id: &str, v: &str) { + click(h, id); + h.input_mut().events.push(Event::Text(v.into())); + h.step(); + h.input_mut().events.push(Event::Key { key: Key::Enter, physical_key: None, pressed: true, repeat: false, modifiers: Modifiers::NONE }); + h.run_steps(3); +} + +/// Comps Sound and Main, and a precomp layer of Sound (which has Audio Levels) in Main at +/// `levels`; its layer id. +fn sound_layer(s: &mut Session, levels: [f64; 2]) -> u64 { + s.execute("comp.new", json!({"name": "Sound", "width": 64, "height": 36, "duration": 4})).unwrap(); + s.execute("comp.new", json!({"name": "Main", "width": 320, "height": 180, "duration": 4})).unwrap(); + let l = s.execute("layer.addItem", json!({"item": "Sound"})).unwrap()["layer"].as_u64().unwrap(); + s.execute("prop.set", json!({"layer": l, "path": "audio/levels", "value": levels})).unwrap(); + l +} + +/// The harness with layer `l` selected and the Audio panel up. +fn harness(mut s: Session, l: u64) -> Harness<'static, EffectcraftApp> { + s.execute("layer.select", json!({"layers": [l]})).unwrap(); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + h.state_mut().show_panel(PanelKind::Audio); + h.run_steps(4); + h +} + +fn levels(h: &Harness<'_, EffectcraftApp>, l: u64) -> effectcraft_engine::project::Property { + h.state().session.active_comp().unwrap().layer(LayerId(l)).unwrap().props.prop("audio/levels").unwrap().clone() +} + +/// `prop.get`'s `key` (`value`: keyframed, `evaluated`: after the expression) at the current time. +fn engine_value(h: &mut Harness<'_, EffectcraftApp>, l: u64, key: &str) -> Vec { + let r = h.state_mut().session.execute("prop.get", json!({"layer": l, "path": "audio/levels"})).unwrap(); + r[key].as_array().unwrap_or_else(|| panic!("no {key} in {r}")).iter().map(|v| v.as_f64().unwrap()).collect() +} + +fn db(v: f64) -> String { + format!("{v:.1} dB") +} + +/// Keyframed Audio Levels on a layer that starts 1 s into the comp, with the current time between +/// the keys: the panel shows the value interpolated at layer time, not the static one (nor the one +/// at comp time, past the last key); typing sets a key at the current time. +#[test] +fn keyframed_levels_show_the_value_at_the_current_time_and_typing_keys_it() { + let mut s = Session::default(); + let l = sound_layer(&mut s, [-20.0, -20.0]); + // Keys at layer time 0 s and 1 s (the layer still starts at 0 s, so comp time = layer time). + s.execute("prop.addKey", json!({"layer": l, "path": "audio/levels", "time": 0.0, "value": [-6.0, -12.0]})).unwrap(); + s.execute("prop.addKey", json!({"layer": l, "path": "audio/levels", "time": 1.0, "value": [0.0, 0.0]})).unwrap(); + // The layer moves 1 s later: its keys sit at comp 1 s and 2 s. + let cid = s.active_comp_id().unwrap(); + let one = effectcraft_engine::time::Tick::from_seconds_f64(1.0); + let layer = std::sync::Arc::make_mut(&mut s.project).comp_mut(cid).unwrap().layer_mut(LayerId(l)).unwrap(); + layer.start_time += one; + layer.in_point += one; + layer.out_point += one; + s.execute("time.set", json!({"time": 1.5})).unwrap(); + let mut h = harness(s, l); + + let now = engine_value(&mut h, l, "value"); + assert!(now[0] > -6.0 && now[0] < 0.0 && now[1] > -12.0 && now[1] < 0.0, "between the keys: {now:?}"); + assert_eq!(label(&h, LEFT), db(now[0]), "Left at the current time"); + assert_eq!(label(&h, RIGHT), db(now[1]), "Right at the current time"); + assert_ne!(label(&h, LEFT), db(-20.0), "not the static value"); + + type_value(&mut h, LEFT, "-1"); + let pr = levels(&h, l); + assert_eq!(pr.value.components(), vec![-20.0, -20.0], "the static value stays"); + let keys: Vec<(f64, Vec)> = pr.keys.iter().map(|k| (k.time.seconds(), k.value.components())).collect(); + assert_eq!(keys.len(), 3, "a key at the current time: {keys:?}"); + assert_eq!(keys[0].1, vec![-6.0, -12.0], "{keys:?}"); + let lt = h.state().session.time().seconds() - 1.0; + assert!((keys[1].0 - lt).abs() < 1e-6, "the new key is at the current layer time {lt}: {keys:?}"); + assert_eq!(keys[1].1[0], -1.0, "the typed Left: {keys:?}"); + assert!((keys[1].1[1] - now[1]).abs() < 1e-9, "Right keeps its value at that time: {keys:?}"); + assert_eq!(keys[2].1, vec![0.0, 0.0], "{keys:?}"); + assert_eq!(label(&h, LEFT), db(-1.0), "the panel shows the new key"); +} + +/// An expression drives Audio Levels: the panel shows what it evaluates to. +#[test] +fn expression_driven_levels_show_the_evaluated_value() { + let mut s = effectcraft_host::session(); + let l = sound_layer(&mut s, [-6.0, -12.0]); + s.execute("prop.setExpression", json!({"layer": l, "path": "audio/levels", "expression": "[-1, -2]"})).unwrap(); + let mut h = harness(s, l); + assert_eq!(engine_value(&mut h, l, "evaluated"), vec![-1.0, -2.0], "the expression runs"); + assert_eq!(label(&h, LEFT), db(-1.0)); + assert_eq!(label(&h, RIGHT), db(-2.0)); +} + +/// Static Audio Levels: typing sets the value and adds no key. +#[test] +fn static_levels_take_a_typed_value_without_a_key() { + let mut s = Session::default(); + let l = sound_layer(&mut s, [-6.0, -12.0]); + let mut h = harness(s, l); + assert_eq!(label(&h, LEFT), db(-6.0)); + assert_eq!(label(&h, RIGHT), db(-12.0)); + type_value(&mut h, RIGHT, "-3"); + let pr = levels(&h, l); + assert_eq!(pr.value.components(), vec![-6.0, -3.0]); + assert!(pr.keys.is_empty(), "no key on a static property"); +} + +/// With the Timeline's Link Channels on (#2485), typing into one channel moves the other by the +/// same dB, as in the Timeline. +#[test] +fn linked_levels_move_both_channels_by_the_same_db() { + let mut s = Session::default(); + let l = sound_layer(&mut s, [-6.0, -12.0]); + let mut h = harness(s, l); + let uid = levels(&h, l).uid; + h.state_mut().ui.timeline.toggle_link(uid, false); + h.run_steps(2); + assert!(h.state().ui.timeline.is_linked(uid, false)); + type_value(&mut h, LEFT, "-3"); + assert_eq!(levels(&h, l).value.components(), vec![-3.0, -9.0], "both rise 3 dB and keep their 6 dB balance"); + h.state_mut().session.execute("edit.undo", json!({})).unwrap(); + h.run_steps(2); + assert_eq!(levels(&h, l).value.components(), vec![-6.0, -12.0], "one Undo takes back both channels"); +} + +/// Proportional Scrubbing (After Effects 26.2): with three layers selected, a Ctrl+Alt scrub of +/// Left in the Audio panel (which shows the first selected layer) leaves that layer as it is, +/// moves the last selected by the whole change and the middle one by half, as in the Timeline. +#[test] +fn ctrl_alt_scrub_is_proportional_over_the_selected_layers() { + let mut s = Session::default(); + let first = sound_layer(&mut s, [-20.0, -20.0]); + let mut ids = vec![first]; + for _ in 0..2 { + let l = s.execute("layer.addItem", json!({"item": "Sound"})).unwrap()["layer"].as_u64().unwrap(); + s.execute("prop.set", json!({"layer": l, "path": "audio/levels", "value": [-20.0, -20.0]})).unwrap(); + ids.push(l); + } + // Selection order: the first created (the one the panel shows), then the second, then the third. + let mut h = harness(s, first); + for l in &ids[1..] { + h.state_mut().session.execute("layer.select", json!({"layers": [l], "add": true})).unwrap(); + } + h.run_steps(2); + assert_eq!(h.state().session.state.selected_layers.first().map(|l| l.0), Some(first), "the panel shows the first selected layer"); + let from = center(&h, LEFT); + let ctrl_alt = Modifiers { alt: true, ctrl: true, command: true, ..Default::default() }; + h.input_mut().events.push(Event::PointerMoved(from)); + h.step(); + h.input_mut().events.push(Event::ModifiersChanged(ctrl_alt)); + h.input_mut().events.push(Event::PointerButton { pos: from, button: PointerButton::Primary, pressed: true, modifiers: ctrl_alt }); + h.step(); + let to = from + vec2(40.0, 0.0); + for k in 1..=24 { + h.input_mut().events.push(Event::PointerMoved(from + (to - from) * (k as f32 / 24.0))); + h.step(); + } + h.input_mut().events.push(Event::PointerButton { pos: to, button: PointerButton::Primary, pressed: false, modifiers: ctrl_alt }); + h.step(); + h.input_mut().events.push(Event::ModifiersChanged(Modifiers::NONE)); + h.run_steps(2); + let moved: Vec = ids.iter().map(|l| levels(&h, *l).value.components()[0] + 20.0).collect(); + assert!(moved[2] > 1.0, "the last selected layer moved: {moved:?}"); + assert!(moved[0].abs() < 1e-9, "the first selected layer stays: {moved:?}"); + assert!((moved[1] - moved[2] / 2.0).abs() < 1e-6, "the middle one moves by half: {moved:?}"); +} + +/// Scrub Left in the Audio panel 40 px to the right with `modifiers`. +fn scrub_left(h: &mut Harness<'_, EffectcraftApp>, modifiers: Modifiers) { + let from = center(h, LEFT); + let to = from + vec2(40.0, 0.0); + h.input_mut().events.push(Event::PointerMoved(from)); + h.step(); + h.input_mut().events.push(Event::ModifiersChanged(modifiers)); + h.input_mut().events.push(Event::PointerButton { pos: from, button: PointerButton::Primary, pressed: true, modifiers }); + h.step(); + for k in 1..=24 { + h.input_mut().events.push(Event::PointerMoved(from + (to - from) * (k as f32 / 24.0))); + h.step(); + } + h.input_mut().events.push(Event::PointerButton { pos: to, button: PointerButton::Primary, pressed: false, modifiers }); + h.step(); + h.input_mut().events.push(Event::ModifiersChanged(Modifiers::NONE)); + h.run_steps(2); +} + +/// An expression shifts the shown levels: a scrub moves the keyframed value under it (of the +/// shown layer and of every other selected layer) by the scrub's change, the same as without the +/// expression, not by the change plus the expression's offset; Ctrl+Alt spreads that change. +#[test] +fn a_scrub_of_expression_driven_levels_moves_every_selected_layer_by_the_scrub() { + let mut s = effectcraft_host::session(); + let first = sound_layer(&mut s, [-20.0, -20.0]); + let mut ids = vec![first]; + for _ in 0..2 { + let l = s.execute("layer.addItem", json!({"item": "Sound"})).unwrap()["layer"].as_u64().unwrap(); + s.execute("prop.set", json!({"layer": l, "path": "audio/levels", "value": [-30.0, -30.0]})).unwrap(); + ids.push(l); + } + let mut h = harness(s, first); + for l in &ids[1..] { + h.state_mut().session.execute("layer.select", json!({"layers": [l], "add": true})).unwrap(); + } + h.run_steps(2); + let left = |h: &Harness<'_, EffectcraftApp>| -> Vec { ids.iter().map(|l| levels(h, *l).value.components()[0]).collect() }; + let undo = |h: &mut Harness<'_, EffectcraftApp>| { + h.state_mut().session.execute("edit.undo", json!({})).unwrap(); + h.run_steps(2); + }; + let before = left(&h); + // Without an expression: the change a 40 px scrub makes. + scrub_left(&mut h, Modifiers::NONE); + let change = left(&h)[0] - before[0]; + assert!(change > 1.0, "the scrub raised Left: {before:?} -> {:?}", left(&h)); + undo(&mut h); + assert_eq!(left(&h), before); + + for l in &ids { + h.state_mut().session.execute("prop.setExpression", json!({"layer": l, "path": "audio/levels", "expression": "value + [10, 10]"})).unwrap(); + } + h.run_steps(2); + assert_eq!(label(&h, LEFT), db(-10.0), "the panel shows the expression's value"); + scrub_left(&mut h, Modifiers::NONE); + let after = left(&h); + for (i, (a, b)) in after.iter().zip(&before).enumerate() { + assert!((a - b - change).abs() < 1e-6, "layer {i} moved by the scrub ({change}), not by the expression's offset too: {before:?} -> {after:?}"); + } + assert_eq!(label(&h, LEFT), db(after[0] + 10.0), "the panel shows the moved value through the expression"); + undo(&mut h); + + // Proportional: the first selected stays, the middle takes half, the last all of it. + let ctrl_alt = Modifiers { alt: true, ctrl: true, command: true, ..Default::default() }; + scrub_left(&mut h, ctrl_alt); + let moved: Vec = left(&h).iter().zip(&before).map(|(a, b)| a - b).collect(); + assert!(moved[0].abs() < 1e-9, "the first selected layer stays: {moved:?}"); + assert!((moved[2] - change).abs() < 1e-6, "the last selected moves by the scrub's change ({change}): {moved:?}"); + assert!((moved[1] - change / 2.0).abs() < 1e-6, "the middle one moves by half: {moved:?}"); +} + +/// #3234 review: each scrub is its own undo step. A second scrub with nothing between it and +/// the first must not fold into it (one Undo would take both back). +#[test] +fn two_scrubs_are_two_undo_steps() { + let mut s = effectcraft_host::session(); + let l = sound_layer(&mut s, [-20.0, -20.0]); + let mut h = harness(s, l); + let left = |h: &Harness<'_, EffectcraftApp>| levels(h, l).value.components()[0]; + let start = left(&h); + scrub_left(&mut h, Modifiers::NONE); + let first = left(&h); + assert!(first > start + 1.0, "the first scrub raised Left: {start} -> {first}"); + scrub_left(&mut h, Modifiers::NONE); + let second = left(&h); + assert!(second > first + 1.0, "the second scrub raised it again: {first} -> {second}"); + h.state_mut().session.execute("edit.undo", json!({})).unwrap(); + h.run_steps(2); + assert!((left(&h) - first).abs() < 1e-9, "one Undo takes back the second scrub only: {start} / {first} / {second} -> {}", left(&h)); +} + +/// With Link Channels on, a scrub of Left moves Right by the same dB; Alt scrubs Left alone. +#[test] +fn a_linked_scrub_moves_both_channels_and_alt_moves_one() { + let mut s = Session::default(); + let l = sound_layer(&mut s, [-6.0, -12.0]); + let mut h = harness(s, l); + let uid = levels(&h, l).uid; + h.state_mut().ui.timeline.toggle_link(uid, false); + h.run_steps(2); + scrub_left(&mut h, Modifiers::NONE); + let c = levels(&h, l).value.components(); + assert!(c[0] > -6.0, "the scrub raised Left: {c:?}"); + assert!((c[0] - c[1] - 6.0).abs() < 1e-9, "Right moved by the same dB: {c:?}"); + h.state_mut().session.execute("edit.undo", json!({})).unwrap(); + h.run_steps(2); + assert_eq!(levels(&h, l).value.components(), vec![-6.0, -12.0], "one Undo takes back the scrub"); + scrub_left(&mut h, Modifiers { alt: true, ..Default::default() }); + let c = levels(&h, l).value.components(); + assert!(c[0] > -6.0, "the Alt scrub raised Left: {c:?}"); + assert_eq!(c[1], -12.0, "Alt leaves Right alone: {c:?}"); +} + +/// Typed into an expression-driven field, the value is the keyframed value under the expression +/// (what the expression reads as `value`), as in the Timeline. +#[test] +fn typing_into_expression_driven_levels_sets_the_value_under_the_expression() { + let mut s = effectcraft_host::session(); + let l = sound_layer(&mut s, [-6.0, -12.0]); + s.execute("prop.setExpression", json!({"layer": l, "path": "audio/levels", "expression": "value + [10, 10]"})).unwrap(); + let mut h = harness(s, l); + assert_eq!(label(&h, LEFT), db(4.0)); + type_value(&mut h, LEFT, "-5"); + assert_eq!(levels(&h, l).value.components(), vec![-5.0, -12.0], "Left as typed, Right's own value under the expression kept"); + assert_eq!(label(&h, LEFT), db(5.0), "shown through the expression"); + assert_eq!(label(&h, RIGHT), db(-2.0)); +} + +/// A narrow Audio panel (200-230 px) still shows the level fields, labelled "L" / "R", and keeps +/// them inside the panel. +#[test] +fn a_narrow_audio_panel_keeps_the_level_fields_inside_it() { + for width in [200.0, 215.0, 230.0, 320.0] { + let mut s = Session::default(); + let l = sound_layer(&mut s, [-20.0, -20.0]); + s.execute("layer.select", json!({"layers": [l]})).unwrap(); + let panel = egui::Rect::from_min_size(pos2(0.0, 0.0), vec2(width, 400.0)); + let mut h = Harness::builder().with_size(vec2(width + 100.0, 400.0)).build_ui_state( + move |ui, app: &mut EffectcraftApp| { + app.auto.begin_frame(); + effectcraft_ui_egui::panels::misc::audio(app, ui, panel); + }, + EffectcraftApp::new(s), + ); + h.run_steps(3); + for id in [LEFT, RIGHT] { + let e = h.state().auto.find(id).unwrap_or_else(|| panic!("{width} px: the Audio panel shows no {id}")).clone(); + assert!(e.rect[0] + e.rect[2] <= width, "{width} px: {id} ends at {} px, past the panel", e.rect[0] + e.rect[2]); + assert_eq!(e.label, db(-20.0), "{width} px"); + } + } +} + +/// Stands in for `sampleImage()` on footage (this harness has no expression language): both +/// channels come from the first frame's pixel through the context's footage source, red and green +/// as minus dB x 100. Fails without the source, as the real one samples transparent. +struct SampleFootage; + +impl effectcraft_engine::render::ExprHost for SampleFootage { + fn eval( + &self, + ctx: &effectcraft_engine::render::EvalCtx, + _: &effectcraft_engine::project::Layer, + _: &effectcraft_engine::project::Property, + _: &effectcraft_engine::keyframe::Value, + ) -> Result { + let src = ctx.footage.ok_or("sampleImage: no footage source")?; + let item = effectcraft_engine::project::ItemId(0); + let img = src.frame(item, &effectcraft_engine::project::Footage::default(), ctx.time).ok_or("no frame")?; + let px = img.get(0, 0); + Ok(effectcraft_engine::keyframe::Value::Vec2([-f64::from(px[0]) * 100.0, -f64::from(px[1]) * 100.0])) + } +} + +/// One frame of nonzero footage for every request. +struct Grey; + +impl effectcraft_engine::render::FootageSource for Grey { + fn frame( + &self, + _: effectcraft_engine::project::ItemId, + _: &effectcraft_engine::project::Footage, + _: effectcraft_engine::time::Tick, + ) -> Option> { + Some(std::sync::Arc::new(effectcraft_engine::raster::Image::filled(4, 4, [0.25, 0.5, 0.0, 1.0]))) + } +} + +/// Audio Levels driven by an expression that samples footage pixels (#3234): the panel evaluates +/// with the session's footage source, as the render does, so it shows the sampled +/// values (-25 dB, -50 dB) rather than a failed evaluation's keyframed ones. +#[test] +fn levels_driven_by_footage_sampling_show_the_sampled_value() { + let mut s = Session::default(); + let l = sound_layer(&mut s, [-6.0, -12.0]); + s.expr = Some(std::sync::Arc::new(SampleFootage)); + s.footage = std::sync::Arc::new(Grey); + s.execute("prop.setExpression", json!({"layer": l, "path": "audio/levels", "expression": "sampleImage([0, 0])"})).unwrap(); + let h = harness(s, l); + assert_eq!(label(&h, LEFT), db(-25.0)); + assert_eq!(label(&h, RIGHT), db(-50.0)); +} From 525dcfc0d815e6a0d36ae2e7deb7ee5afbf53491 Mon Sep 17 00:00:00 2001 From: Valentin Klein Date: Sun, 22 Nov 2026 19:58:56 +0100 Subject: [PATCH 389/451] =?UTF-8?q?Browse=E2=80=A6=20buttons=20in=20a=20sc?= =?UTF-8?q?ript's=20own=20dialogs=20and=20panels=20open=20the=20file=20dia?= =?UTF-8?q?log=20instead=20of=20doing=20nothing=20(#3253)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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) --- apps/effectcraft/src/file_dialogs.rs | 154 ++++++++++++++++++- crates/automation/src/confine.rs | 2 + crates/automation/src/tests.rs | 1 + crates/engine/src/cmd/scripts.rs | 22 ++- crates/engine/src/scriptui.rs | 104 +++++++++++++ crates/script/src/prelude.js | 24 ++- crates/script/src/runtime.rs | 3 +- crates/script/src/tests/startup.rs | 15 ++ crates/script/src/tests/ui.rs | 122 +++++++++++++++ crates/script/src/ui.rs | 168 ++++++++++++++++++--- crates/ui-egui/src/app.rs | 4 +- crates/ui-egui/src/app/frame.rs | 12 ++ crates/ui-egui/src/app/gpu.rs | 10 ++ crates/ui-egui/src/hooks.rs | 17 +++ crates/ui-egui/src/lib.rs | 5 + crates/ui-egui/src/lifecycle_tests.rs | 33 ++++ crates/ui-egui/src/panels/scriptui_view.rs | 109 +++++++++++++ crates/ui-egui/tests/it/ui_scriptui.rs | 162 ++++++++++++++++++++ docs/agents.md | 10 +- docs/scripting-parity.md | 2 +- 20 files changed, 945 insertions(+), 34 deletions(-) diff --git a/apps/effectcraft/src/file_dialogs.rs b/apps/effectcraft/src/file_dialogs.rs index 9f3114367..c8cf5181a 100644 --- a/apps/effectcraft/src/file_dialogs.rs +++ b/apps/effectcraft/src/file_dialogs.rs @@ -111,7 +111,9 @@ pub fn install_pickers(app: &mut EffectcraftApp, ctx: &egui::Context) -> Receive let tx = Errors { tx, ctx: ctx.clone() }; let errors = tx.clone(); app.hooks.pick_files = Some(Box::new(move |exts: &[&str]| { - blocking(&errors, "Open", || rfd::FileDialog::new().add_filter("Media", exts).pick_files()).unwrap_or_default().into_iter().map(path_string).collect() + // No extensions (a script's File.openDialog without a filter): every file. + let dialog = || if exts.is_empty() { rfd::FileDialog::new() } else { rfd::FileDialog::new().add_filter("Media", exts) }; + blocking(&errors, "Open", || dialog().pick_files()).unwrap_or_default().into_iter().map(path_string).collect() })); let errors = tx.clone(); app.hooks.pick_save = Some(Box::new(move |name: &str| { @@ -123,6 +125,12 @@ pub fn install_pickers(app: &mut EffectcraftApp, ctx: &egui::Context) -> Receive })); let errors = tx.clone(); app.hooks.pick_folder = Some(Box::new(move || blocking(&errors, "Choose Folder", || rfd::FileDialog::new().pick_folder()).map(path_string))); + let errors = tx.clone(); + // Scripts' file dialogs where they block (Windows; see `install_file_dialogs` in main.rs). + app.hooks.pick_file_dialog = Some(Box::new(move |dialog: FileDialog| { + let what = title(&dialog); + blocking(&errors, what, || Some(pick_blocking(dialog))).unwrap_or_default() + })); let errors = tx; app.hooks.pick_save_file = Some(Box::new(move |name: &str, ext: &str| { blocking(&errors, "Save", || { @@ -170,9 +178,9 @@ pub fn show_asked(asked: &Receiver, frame: &eframe::Frame, ctx: &egui::Co /// The dialog's title, for errors. fn title(dialog: &FileDialog) -> &'static str { match dialog { - FileDialog::Open { .. } | FileDialog::OpenProject => "Open", - FileDialog::Folder => "Choose Folder", - FileDialog::Save { .. } => "Save", + FileDialog::Open { .. } | FileDialog::OpenProject | FileDialog::Script { .. } => "Open", + FileDialog::Folder | FileDialog::ScriptFolder { .. } => "Choose Folder", + FileDialog::Save { .. } | FileDialog::ScriptSave { .. } => "Save", } } @@ -231,6 +239,101 @@ fn path(file: Option) -> Vec { paths(file.map(|f| vec![f])) } +/// The filters of a script's file dialog (#2778): its own, under the script's name for it (else +/// "Files"), then "All Files" when the script's filter offers every file. Without extensions, no +/// filter: every file. macOS takes all the filters' extensions together as the allowed types, so a +/// dialog that also offers every file gets no filter there. +macro_rules! script_filters { + ($dialog:expr, $label:expr, $exts:expr, $any:expr) => {{ + let (d, label, exts, any): (_, &str, &[String], bool) = ($dialog, $label, $exts, $any); + if exts.is_empty() || (any && cfg!(target_os = "macos")) { + d + } else { + let d = d.add_filter(if label.is_empty() { "Files" } else { label }, exts); + if any { d.add_filter("All Files", &["*"]) } else { d } + } + }}; +} + +/// The folder a script's dialog starts in: its `start` when that is a folder, else the folder +/// the file `start` names lives in; `None` when neither exists (the system's choice). +fn start_dir(start: &str) -> Option { + if start.is_empty() { + return None; + } + let at = std::path::Path::new(start); + if at.is_dir() { Some(at.to_path_buf()) } else { at.parent().filter(|d| d.is_dir()).map(std::path::Path::to_path_buf) } +} + +/// The filters of a script's save dialog: the script's own ([`script_filters!`]), else the +/// extension of the default name. +fn save_exts(exts: &[String], default: &str) -> Vec { + if exts.is_empty() { std::path::Path::new(default).extension().map(|e| vec![e.to_string_lossy().to_string()]).unwrap_or_default() } else { exts.to_vec() } +} + +/// A script's file dialog, blocking until it closes (`Hooks::pick_file_dialog`, Windows): its +/// paths, empty when cancelled. Runs inside [`guarded`] (see [`install_pickers`]). +fn pick_blocking(dialog: FileDialog) -> Vec { + let all = + |files: Option>| -> Vec { files.unwrap_or_default().into_iter().map(|p| p.to_string_lossy().to_string()).collect() }; + let one = |file: Option| all(file.map(|f| vec![f])); + match dialog { + FileDialog::Script { label, exts, any, many, prompt, start } => { + let mut d = script_filters!(rfd::FileDialog::new(), &label, &exts, any); + if !prompt.is_empty() { + d = d.set_title(&prompt); + } + if let Some(dir) = start_dir(&start) { + d = d.set_directory(dir); + } + if many { all(d.pick_files()) } else { one(d.pick_file()) } + } + FileDialog::ScriptFolder { prompt, start } => { + let mut d = rfd::FileDialog::new(); + if !prompt.is_empty() { + d = d.set_title(&prompt); + } + if let Some(dir) = start_dir(&start) { + d = d.set_directory(dir); + } + one(d.pick_folder()) + } + FileDialog::ScriptSave { default, prompt, label, exts, any } => { + let at = std::path::Path::new(&default); + let name = at.file_name().map(|n| n.to_string_lossy().to_string()).unwrap_or_default(); + let mut d = script_filters!(rfd::FileDialog::new(), &label, &save_exts(&exts, &default), any); + if !prompt.is_empty() { + d = d.set_title(&prompt); + } + if let Some(dir) = start_dir(&default) { + d = d.set_directory(dir); + } + one(d.set_file_name(name).save_file()) + } + FileDialog::Open { exts, many } => { + let d = if exts.is_empty() { rfd::FileDialog::new() } else { rfd::FileDialog::new().add_filter("Media", &exts) }; + if many { all(d.pick_files()) } else { one(d.pick_file()) } + } + FileDialog::OpenProject => one(rfd::FileDialog::new().add_filter("EffectCraft Project", &["ecproj", "ecprojx"]).pick_file()), + FileDialog::Folder => one(rfd::FileDialog::new().pick_folder()), + FileDialog::Save { default, ext, project } => { + let at = std::path::Path::new(&default); + let name = at.file_name().map(|n| n.to_string_lossy().to_string()).unwrap_or_default(); + let mut d = if project { + rfd::FileDialog::new().add_filter("EffectCraft Project", &["ecproj"]) + } else if ext.is_empty() { + rfd::FileDialog::new() + } else { + rfd::FileDialog::new().add_filter(&ext, &[ext.as_str()]) + }; + if let Some(dir) = at.parent().filter(|d| d.is_dir()) { + d = d.set_directory(dir); + } + one(d.set_file_name(name).save_file()) + } + } +} + /// The dialog, as the blocking hooks show it. On macOS rfd makes the panel here, before the /// future is returned, so a panel AppKit can't make panics here, inside [`guarded`]. /// @@ -242,7 +345,8 @@ fn path(file: Option) -> Vec { fn open(dialog: FileDialog, frame: &eframe::Frame) -> Answer { match dialog { FileDialog::Open { exts, many } => { - let d = parented(frame).add_filter("Media", &exts); + // No extensions (a script's File.openDialog without a filter): every file. + let d = if exts.is_empty() { parented(frame) } else { parented(frame).add_filter("Media", &exts) }; if many { let f = d.pick_files(); Box::pin(async move { paths(f.await) }) @@ -251,6 +355,46 @@ fn open(dialog: FileDialog, frame: &eframe::Frame) -> Answer { Box::pin(async move { path(f.await) }) } } + FileDialog::Script { label, exts, any, many, prompt, start } => { + let mut d = script_filters!(parented(frame), &label, &exts, any); + if !prompt.is_empty() { + d = d.set_title(&prompt); + } + if let Some(dir) = start_dir(&start) { + d = d.set_directory(dir); + } + if many { + let f = d.pick_files(); + Box::pin(async move { paths(f.await) }) + } else { + let f = d.pick_file(); + Box::pin(async move { path(f.await) }) + } + } + FileDialog::ScriptFolder { prompt, start } => { + let mut d = parented(frame); + if !prompt.is_empty() { + d = d.set_title(&prompt); + } + if let Some(dir) = start_dir(&start) { + d = d.set_directory(dir); + } + let f = d.pick_folder(); + Box::pin(async move { path(f.await) }) + } + FileDialog::ScriptSave { default, prompt, label, exts, any } => { + let at = std::path::Path::new(&default); + let name = at.file_name().map(|n| n.to_string_lossy().to_string()).unwrap_or_default(); + let mut d = script_filters!(parented(frame), &label, &save_exts(&exts, &default), any); + if !prompt.is_empty() { + d = d.set_title(&prompt); + } + if let Some(dir) = start_dir(&default) { + d = d.set_directory(dir); + } + let f = d.set_file_name(name).save_file(); + Box::pin(async move { path(f.await) }) + } FileDialog::OpenProject => { let f = parented(frame).add_filter("EffectCraft Project", &["ecproj", "ecprojx"]).pick_file(); Box::pin(async move { path(f.await) }) diff --git a/crates/automation/src/confine.rs b/crates/automation/src/confine.rs index 70586b798..803317795 100644 --- a/crates/automation/src/confine.rs +++ b/crates/automation/src/confine.rs @@ -59,6 +59,8 @@ const REFUSED: &[&str] = &[ "scriptui.set", "scriptui.mouse", "scriptui.close", + // Hands a script the file it waits on, so its code goes on. + "scriptui.fileDialog", "file.executeFile", "effect.helpers.scan", "effect.helpers.load", diff --git a/crates/automation/src/tests.rs b/crates/automation/src/tests.rs index afee15936..a21248cb5 100644 --- a/crates/automation/src/tests.rs +++ b/crates/automation/src/tests.rs @@ -1587,6 +1587,7 @@ fn automation_roots_refuse_running_script_code() { ("scriptui.set", json!({"window": 1, "widget": 2, "value": 1})), ("scriptui.mouse", json!({"window": 1, "widget": 2, "type": "click"})), ("scriptui.close", json!({"window": 1})), + ("scriptui.fileDialog", json!({"host": 1, "paths": null})), ] { let msg = refused(&mut s, "execute_command", json!({"command": command, "params": params})); assert!(msg.contains("not available while file access is confined"), "`{command}`: {msg}"); diff --git a/crates/engine/src/cmd/scripts.rs b/crates/engine/src/cmd/scripts.rs index 8c14e03ec..510efd12c 100644 --- a/crates/engine/src/cmd/scripts.rs +++ b/crates/engine/src/cmd/scripts.rs @@ -430,7 +430,12 @@ fn run_startup(s: &mut Session, _: &Value) -> Result { /// (frontends call it as the app quits, after the unsaved-changes prompt). fn run_shutdown(s: &mut Session, _: &Value) -> Result { s.replace_project(effectcraft_project::Project::default(), None); - Ok(run_folder(s, SHUTDOWN_DIR, true)) + // The app is quitting: nothing would show a Shutdown script's file dialog (File.saveDialog…), + // so it gets null at once instead of waiting. + let answers = std::mem::replace(&mut s.script_ui.answers_file_dialogs, false); + let r = run_folder(s, SHUTDOWN_DIR, true); + s.script_ui.answers_file_dialogs = answers; + Ok(r) } /// Window ▸ ``: run the panel script (or bring its panel forward). @@ -599,6 +604,21 @@ pub fn specs() -> Vec { always, scriptui::close ), + crate::query!( + "scriptui.fileDialogs", + "Script File Dialogs", + "{} → [{id, host, kind: open|save|folder, prompt, exts, label, any, many, start, shown}]: the file dialogs scripts wait on (File.openDialog, File.saveDialog, Folder.selectDialog…)", + scriptui::file_dialogs + ), + cmd!( + "scriptui.fileDialog", + "Answer Script File Dialog", + [], + None, + "{id? (from scriptui.fileDialogs; default the only one), host?, paths: [path…] | null (cancelled)} → the waiting script goes on with the picked files", + always, + scriptui::file_dialog + ), ] } diff --git a/crates/engine/src/scriptui.rs b/crates/engine/src/scriptui.rs index 69e572ec2..250ca86bc 100644 --- a/crates/engine/src/scriptui.rs +++ b/crates/engine/src/scriptui.rs @@ -436,6 +436,50 @@ pub struct ScriptUiEvent { /// The ScriptUI mouse events scripts can listen for (`addEventListener`). pub const MOUSE_EVENTS: [&str; 6] = ["mousedown", "mouseup", "mousemove", "mouseover", "mouseout", "click"]; +/// The [`ScriptUiEvent::kind`] that answers a script's file dialog ([`ScriptFileDialog`]); its +/// value is `{host, paths: [path…] | null}` and it goes to the script context `host`, not to a +/// window. +pub const FILE_DIALOG_EVENT: &str = "fileDialog"; + +/// What a script's file dialog picks. +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] +#[serde(rename_all = "lowercase")] +pub enum FileDialogKind { + /// A file (or several) to open: `File.openDialog`, `file.openDlg`. + #[default] + Open, + /// Where to save: `File.saveDialog`, `file.saveDlg`. + Save, + /// A folder: `Folder.selectDialog`, `folder.selectDlg`. + Folder, +} + +/// A file dialog a script asked for and waits on (#2778). The frontend shows it and answers with +/// `scriptui.fileDialog`; agents can answer it the same way. +#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] +#[serde(default, rename_all = "camelCase")] +pub struct ScriptFileDialog { + /// Unique in the process: an answer goes to this dialog only. + pub id: u32, + /// The script context waiting for the answer. + pub host: u32, + pub kind: FileDialogKind, + /// The script's prompt. + pub prompt: String, + /// The extensions the script's filter names, lower case (empty: any file). + pub exts: Vec, + /// The filter's name (`"Audio"` in `"Audio:*.mp3;*.wav"`; empty: none given). + pub label: String, + /// The filter also offers every file (`*.*`). + pub any: bool, + /// `multiSelect`: several files may be picked. + pub many: bool, + /// The file or folder the dialog starts from (`file.saveDlg`: the default name). + pub start: String, + /// A frontend has shown it (it is not shown again). + pub shown: bool, +} + /// Hands an event to the script that owns the window; returns what the handler reported /// (`{ok, output, error}`) and updates [`Session::script_ui`]. pub type ScriptUiDispatch = fn(&mut Session, &ScriptUiEvent) -> std::result::Result; @@ -491,6 +535,13 @@ pub struct ScriptUi { /// replaced, until EffectCraft quits. #[serde(skip)] pub startup_hosts: Vec, + /// The file dialogs scripts wait on, until `scriptui.fileDialog` answers them. + pub file_dialogs: Vec, + /// A frontend shows the scripts' file dialogs (the egui UI sets it). Without one, as in + /// headless runs, `File.openDialog` and the like return `null` at once, so a script never + /// waits on a dialog nobody shows. + #[serde(skip)] + pub answers_file_dialogs: bool, } impl ScriptUi { @@ -859,10 +910,63 @@ pub(crate) fn resize(s: &mut Session, p: &Value) -> Result { dispatch(s, ScriptUiEvent { window, widget: 0, kind: "resize".into(), value: json!([w, h]) }) } +/// `scriptui.fileDialogs`: the file dialogs scripts wait on. +pub(crate) fn file_dialogs(s: &mut Session, _: &Value) -> Result { + Ok(serde_json::to_value(&s.script_ui.file_dialogs).unwrap_or(Value::Null)) +} + +/// `scriptui.fileDialog`: answer a script's file dialog with the picked `paths` (`null` or +/// empty: cancelled); the script goes on with them. The dialog stays pending until its script +/// has the answer, so a refused answer leaves it to be answered again. +pub(crate) fn file_dialog(s: &mut Session, p: &Value) -> Result { + let c = "scriptui.fileDialog"; + // A script answering a dialog (its own or another script's) would only be refused when the + // answer is handed over: scripts can't drive script windows. + if s.running_for_script() { + return Err(crate::commands::bad(c, "scripts can't answer file dialogs")); + } + let num = |k: &str| p.get(k).map(|v| v.as_u64().and_then(|n| u32::try_from(n).ok())); + let pending = &s.script_ui.file_dialogs; + let asked = match (num("id"), num("host")) { + (Some(id), _) => id.and_then(|id| pending.iter().find(|d| d.id == id)), + (None, Some(host)) => host.and_then(|h| pending.iter().find(|d| d.host == h)), + (None, None) if pending.len() == 1 => pending.first(), + (None, None) => None, + }; + let asked = asked.cloned().ok_or_else(|| crate::commands::bad(c, "no such file dialog (give `id` from scriptui.fileDialogs)"))?; + let mut paths: Vec = match p.get("paths").or_else(|| p.get("path")) { + None | Some(Value::Null) => vec![], + Some(Value::String(one)) => vec![one.clone()], + Some(Value::Array(a)) => { + a.iter().map(|v| v.as_str().map(str::to_string)).collect::>>().ok_or_else(|| crate::commands::bad(c, "`paths` must be strings"))? + } + Some(other) => return Err(crate::commands::bad(c, format!("`paths` must be a list of paths or null, not {other}"))), + }; + paths.retain(|p| !p.is_empty()); + if !asked.many { + paths.truncate(1); + } + let paths = if paths.is_empty() { Value::Null } else { json!(paths) }; + // The scripting engine takes the dialog off the list when its script has the answer. + let value = json!({"id": asked.id, "host": asked.host, "paths": paths}); + dispatch(s, ScriptUiEvent { window: 0, widget: 0, kind: FILE_DIALOG_EVENT.into(), value }) +} + /// `scriptui.close`: close a window (a dialog's `show()` returns `result`, default 2 = Cancel). pub(crate) fn close(s: &mut Session, p: &Value) -> Result { let window = window_p(s, p, "scriptui.close")?; let result = p.get("result").cloned().unwrap_or(json!(2)); + // A script waiting on its file dialog (one whose answer never came) can still be closed: + // the file dialog counts as cancelled first. If that is refused, the close is tried all the + // same (and refused with its own reason). + let host = s.script_ui.window(window).map(|w| w.host); + let asked = host.and_then(|h| s.script_ui.file_dialogs.iter().find(|d| d.host == h)).map(|d| d.id); + if let Some(id) = asked + && let Ok(cancelled) = file_dialog(s, &json!({"id": id, "paths": null})) + && s.script_ui.window(window).is_none() + { + return Ok(cancelled); + } dispatch(s, ScriptUiEvent { window, widget: 0, kind: "close".into(), value: result }) } diff --git a/crates/script/src/prelude.js b/crates/script/src/prelude.js index f33da7091..6f31ec37c 100644 --- a/crates/script/src/prelude.js +++ b/crates/script/src/prelude.js @@ -287,11 +287,23 @@ File.prototype = { copy: function (to) { return JSON.parse(__file("copy", this.__path, __str(to))); }, rename: function () { throw __err("File.rename is not supported"); }, execute: function () { return JSON.parse(__file("execute", this.__path)); }, - openDlg: function () { return null; }, - saveDlg: function () { return null; }, + openDlg: function (prompt, filter, multiSelect) { return __pickFile("open", prompt, filter, multiSelect, this.__path); }, + saveDlg: function (prompt, filter) { return __pickFile("save", prompt, filter, false, this.__path); }, }; -File.openDialog = function () { return null; }; -File.saveDialog = function () { return null; }; +// The app's file dialog (#2778): a File (an array of them with multiSelect), a Folder for +// "folder", or null when cancelled, and where no dialog can be shown (the Script Console, the +// web, headless runs). Filters are strings ("*.jsx", "Audio:*.mp3;*.wav"); a function (macOS) +// offers every file. +function __pickFile(kind, prompt, filter, multiSelect, start) { + var opt = function (v) { return v === undefined || v === null ? null : __str(v); }; + var r = JSON.parse(__fileDialog(kind, opt(prompt), typeof filter === "string" ? filter : null, !!multiSelect, opt(start))); + if (!r || !r.length) return null; + if (kind === "folder") return new Folder(r[0]); + if (kind === "open" && multiSelect) return r.map(function (p) { return new File(p); }); + return new File(r[0]); +} +File.openDialog = function (prompt, filter, multiSelect) { return __pickFile("open", prompt, filter, multiSelect); }; +File.saveDialog = function (prompt, filter) { return __pickFile("save", prompt, filter, false); }; File.decode = function (s) { return decodeURIComponent(s); }; File.encode = function (s) { return encodeURIComponent(s); }; File.fs = "EffectCraft"; @@ -354,9 +366,9 @@ Folder.prototype = { } return out; }, - selectDlg: function () { return null; }, + selectDlg: function (prompt) { return __pickFile("folder", prompt, null, false, this.__path); }, }; -Folder.selectDialog = function () { return null; }; +Folder.selectDialog = function (prompt) { return __pickFile("folder", prompt, null, false); }; Object.defineProperty(Folder, "current", { get: function () { var d = __get("app").projectDir; return d ? new Folder(d) : null; } }); Object.defineProperty(Folder, "temp", { get: function () { return null; } }); Object.defineProperty(Folder, "desktop", { get: function () { return null; } }); diff --git a/crates/script/src/runtime.rs b/crates/script/src/runtime.rs index 28e490158..ab7e511e5 100644 --- a/crates/script/src/runtime.rs +++ b/crates/script/src/runtime.rs @@ -562,7 +562,7 @@ pub(crate) fn new_context() -> Result { let limits = ctx.runtime_limits_mut(); limits.set_loop_iteration_limit(200_000_000); limits.set_recursion_limit(2000); - let natives: [(JsString, usize, fn(&JsValue, &[JsValue], &mut Context) -> JsResult); 11] = [ + let natives: [(JsString, usize, fn(&JsValue, &[JsValue], &mut Context) -> JsResult); 12] = [ (js_string!("__exec"), 2, native_exec), (js_string!("__query"), 2, native_query), (js_string!("__print"), 1, native_print), @@ -574,6 +574,7 @@ pub(crate) fn new_context() -> Result { (js_string!("__uiNewId"), 0, crate::ui::native_new_id), (js_string!("__uiModal"), 1, crate::ui::native_modal), (js_string!("__uiLayoutNative"), 1, crate::ui::native_layout), + (js_string!("__fileDialog"), 5, crate::ui::native_file_dialog), ]; for (name, len, f) in natives { ctx.register_global_callable(name, len, NativeFunction::from_fn_ptr(f)).map_err(|e| e.to_string())?; diff --git a/crates/script/src/tests/startup.rs b/crates/script/src/tests/startup.rs index 67da833c5..079bed416 100644 --- a/crates/script/src/tests/startup.rs +++ b/crates/script/src/tests/startup.rs @@ -288,3 +288,18 @@ fn empty_or_missing_folders_run_nothing() { crate::install(&mut s); assert_eq!(s.execute("file.runShutdownScripts", json!({})).unwrap(), none); } + +/// #2778: the app is quitting, so nothing would show a Shutdown script's file dialog: it gets null +/// at once instead of waiting for good. +#[test] +fn a_shutdown_script_file_dialog_does_not_wait() { + let store = Arc::new(MemoryConfig::default()); + let probe = r#"var f = File.saveDialog("Save the log", "*.txt"); app.settings.saveSetting("Startup Test", "log", f === null ? "none" : "asked");"#; + store.write(&format!("{SHUTDOWN_DIR}/Save Log.jsx"), probe).unwrap(); + let mut s = session(&store); + s.script_ui.answers_file_dialogs = true; + let r = s.execute("file.runShutdownScripts", json!({})).unwrap(); + assert_eq!(r, json!({"ran": ["Save Log.jsx"], "waiting": [], "failed": []})); + assert_eq!(setting(&mut s, "log"), "none"); + assert!(s.script_ui.file_dialogs.is_empty()); +} diff --git a/crates/script/src/tests/ui.rs b/crates/script/src/tests/ui.rs index 460376ac5..52bc0b922 100644 --- a/crates/script/src/tests/ui.rs +++ b/crates/script/src/tests/ui.rs @@ -297,3 +297,125 @@ fn sample_scripts_and_installing() { let _ = std::fs::remove_dir_all(&dir); let _: Value = json!(null); } + +const PICK_AUDIO: &str = r#" +var d = new Window("dialog", "Pick Audio"); +var song = d.add("edittext", undefined, "", { name: "song" }); +var browse = d.add("button", undefined, "Browse...", { name: "browse" }); +browse.onClick = function () { + var f = File.openDialog("Select a song", "Audio:*.MP3;*.wav,All files:*.*"); + song.text = f ? f.fsName : "(cancelled)"; +}; +var where = d.add("button", undefined, "Folder...", { name: "where" }); +where.onClick = function () { + var f = Folder.selectDialog("Output folder"); + song.text = f instanceof Folder ? "folder " + f.fsName : "(cancelled)"; +}; +d.add("button", undefined, "OK", { name: "ok" }); +var r = d.show(); +r + " " + song.text +"#; + +/// #2778: File.openDialog, Folder.selectDialog… in a dialog's Browse… handler. With a frontend +/// that shows scripts' file dialogs, the script waits for `scriptui.fileDialog`'s answer (the +/// picked files, or null when cancelled); headless runs get null at once. +#[test] +fn file_dialogs_wait_for_their_answer() { + let mut s = session(); + // Headless: nothing shows a dialog, so the script never waits on one. + let o = run_code(&mut s, r#"var f = File.openDialog("Pick"); f === null ? "none" : "picked""#, "headless.jsx"); + assert!(!o.waiting && o.error.is_none(), "{o:?}"); + assert_eq!(o.result, json!("none")); + assert!(s.script_ui.file_dialogs.is_empty()); + + s.script_ui.answers_file_dialogs = true; + // At the top of a script, with multiSelect: an array of Files. + let o = run_code(&mut s, r#"var fs = File.openDialog("Pick scripts", "*.jsx", true); fs ? fs.length + " " + fs[1].name : "none""#, "top.jsx"); + assert!(o.waiting, "{o:?}"); + let asked = s.execute("scriptui.fileDialogs", json!({})).unwrap(); + assert_eq!(asked[0]["kind"], "open", "{asked}"); + assert_eq!((asked[0]["prompt"].clone(), asked[0]["exts"].clone(), asked[0]["many"].clone()), (json!("Pick scripts"), json!(["jsx"]), json!(true))); + let r = s.execute("scriptui.fileDialog", json!({"paths": ["/a/x.jsx", "/b/y.jsx"]})).unwrap(); + assert_eq!(r["result"], "2 y.jsx", "{r}"); + assert!(s.script_ui.file_dialogs.is_empty()); + + // In a modal dialog's Browse… handler. + let o = run_code(&mut s, PICK_AUDIO, "pick.jsx"); + assert!(o.waiting, "{o:?}"); + let r = s.execute("scriptui.click", json!({"widget": "browse"})).unwrap(); + assert_eq!(r["waiting"], true, "{r}"); + let asked = s.script_ui.file_dialogs.clone(); + assert_eq!(asked.len(), 1); + assert_eq!(asked[0].exts, ["mp3", "wav"], "the filter's extensions, `*.*` adds none"); + assert_eq!((asked[0].label.as_str(), asked[0].any, asked[0].many), ("Audio", true, false)); + // An answer for another dialog (a stale one) is refused; this one still waits. + let e = s.execute("scriptui.fileDialog", json!({"id": asked[0].id + 1000, "paths": null})).unwrap_err().to_string(); + assert!(e.contains("no such file dialog"), "{e}"); + assert_eq!(s.script_ui.file_dialogs.len(), 1); + // The dialog's controls wait for the answer. + let e = s.execute("scriptui.click", json!({"widget": "ok"})).unwrap_err().to_string(); + assert!(e.contains("waiting for its file dialog"), "{e}"); + // Cancelled: null. + s.execute("scriptui.fileDialog", json!({"paths": null})).unwrap(); + let song = |s: &Session| s.script_ui.windows[0].root.lookup(&json!("song")).map(|w| w.text.clone()).unwrap_or_default(); + assert_eq!(song(&s), "(cancelled)"); + s.execute("scriptui.click", json!({"widget": "browse"})).unwrap(); + // Only one file without multiSelect. + s.execute("scriptui.fileDialog", json!({"paths": ["/media/song.wav", "/media/other.wav"]})).unwrap(); + assert_eq!(song(&s), "/media/song.wav"); + s.execute("scriptui.click", json!({"widget": "where"})).unwrap(); + assert_eq!(s.script_ui.file_dialogs[0].kind, effectcraft_engine::scriptui::FileDialogKind::Folder); + s.execute("scriptui.fileDialog", json!({"paths": ["/media/out"]})).unwrap(); + assert_eq!(song(&s), "folder /media/out"); + let r = s.execute("scriptui.click", json!({"widget": "ok"})).unwrap(); + assert_eq!(r["result"], "1 folder /media/out", "{r}"); + // Nothing waits any more. + assert!(s.execute("scriptui.fileDialog", json!({"paths": null})).is_err()); + + // A file dialog whose answer never comes doesn't trap its script window: closing it cancels + // the file dialog, then closes the window. + let o = run_code(&mut s, PICK_AUDIO, "pick.jsx"); + assert!(o.waiting, "{o:?}"); + s.execute("scriptui.click", json!({"widget": "browse"})).unwrap(); + assert_eq!(s.script_ui.file_dialogs.len(), 1); + let r = s.execute("scriptui.close", json!({})).unwrap(); + assert_eq!(r["result"], "2 (cancelled)", "{r}"); + assert!(s.script_ui.windows.is_empty() && s.script_ui.file_dialogs.is_empty()); +} + +/// A script can't answer or close another script's waiting file dialog (it would take the dialog +/// off the list and leave its script waiting for good): refused, and the window still closes. +#[test] +fn scripts_cannot_strand_a_waiting_file_dialog() { + let mut s = session(); + s.script_ui.answers_file_dialogs = true; + let o = run_code(&mut s, PICK_AUDIO, "pick.jsx"); + assert!(o.waiting, "{o:?}"); + s.execute("scriptui.click", json!({"widget": "browse"})).unwrap(); + let (window, id) = (s.script_ui.windows[0].id, s.script_ui.file_dialogs[0].id); + // From the Script Console. + for (command, params) in [("scriptui.close", json!({"window": window})), ("scriptui.fileDialog", json!({"id": id, "paths": ["/x.wav"]}))] { + let code = format!("try {{ __exec({command:?}, {:?}); \"ran\" }} catch (e) {{ \"refused\" }}", params.to_string()); + let o = crate::run(&mut s, &effectcraft_engine::ScriptRequest { code: &code, name: "console", console: true }); + assert_eq!(o.result, json!("refused"), "{command}: {o:?}"); + assert_eq!(s.script_ui.file_dialogs.len(), 1, "{command}: the dialog still waits"); + } + let r = s.execute("scriptui.close", json!({"window": window})).unwrap(); + assert_eq!(r["result"], "2 (cancelled)", "{r}"); + assert!(s.script_ui.windows.is_empty() && s.script_ui.file_dialogs.is_empty()); +} + +#[test] +fn file_dialog_filters_name_their_extensions() { + use crate::ui::filter_exts; + assert_eq!(filter_exts("*.jsx"), ["jsx"]); + assert_eq!(filter_exts("Audio:*.MP3;*.wav,All files:*.*"), ["mp3", "wav"]); + assert_eq!(filter_exts("Images (*.png, *.jpg)|*.png;*.jpg"), ["png", "jpg"]); + assert!(filter_exts("*.*").is_empty() && filter_exts("").is_empty() && filter_exts("*.").is_empty()); + use crate::ui::{filter_any, filter_label}; + assert_eq!(filter_label("Audio:*.mp3;*.wav,All files:*.*"), "Audio"); + assert_eq!(filter_label("Images (*.png, *.jpg)|*.png;*.jpg"), "Images"); + assert_eq!(filter_label("*.jsx"), ""); + assert!(filter_any("Audio:*.mp3,All files:*.*") && filter_any("Any|*")); + assert!(!filter_any("*.jsx") && !filter_any("")); +} diff --git a/crates/script/src/ui.rs b/crates/script/src/ui.rs index ecf4cd28b..6030ae71e 100644 --- a/crates/script/src/ui.rs +++ b/crates/script/src/ui.rs @@ -18,7 +18,7 @@ use std::sync::atomic::{AtomicU32, Ordering}; use boa_engine::{Context, JsResult, JsValue, js_string}; use effectcraft_engine::Session; -use effectcraft_engine::scriptui::{ScriptUiEvent, ScriptWindow, layout}; +use effectcraft_engine::scriptui::{FILE_DIALOG_EVENT, FileDialogKind, ScriptFileDialog, ScriptUiEvent, ScriptWindow, layout}; use serde_json::{Value as J, json}; use web_time::Instant; @@ -126,6 +126,116 @@ pub(crate) fn native_modal(_: &JsValue, args: &[JsValue], ctx: &mut Context) -> } } +/// The extensions a ScriptUI file filter names, lower case: `"*.wav"`, `"Audio:*.mp3;*.wav,All +/// files:*.*"` (Windows), `"Audio (*.mp3, *.wav)|*.mp3;*.wav"`… Wildcard-only patterns (`*.*`) +/// name none; a filter without extensions (or a macOS filter function) offers every file. +pub(crate) fn filter_exts(filter: &str) -> Vec { + const MAX_EXTS: usize = 64; + const MAX_LEN: usize = 16; + let mut out: Vec = vec![]; + for part in filter.split("*.").skip(1) { + let ext: String = part.chars().take_while(char::is_ascii_alphanumeric).collect(); + if ext.is_empty() || ext.len() > MAX_LEN { + continue; + } + let ext = ext.to_ascii_lowercase(); + if !out.contains(&ext) { + out.push(ext); + } + if out.len() >= MAX_EXTS { + break; + } + } + out +} + +/// The name a ScriptUI file filter gives its first entry (`"Audio"` in `"Audio:*.mp3;*.wav"`, +/// `"Audio (*.mp3)|*.mp3"`); empty when it gives none. +pub(crate) fn filter_label(filter: &str) -> String { + const MAX_LEN: usize = 64; + let Some(end) = filter.find([':', '|']) else { return String::new() }; + // "Audio (*.mp3, *.wav)": the name without its list of patterns. + let label = filter.get(..end).unwrap_or_default(); + let label = label.split('(').next().unwrap_or_default().trim(); + if label.contains('*') { String::new() } else { label.chars().take(MAX_LEN).collect() } +} + +/// Whether a ScriptUI file filter also offers every file (`*.*`, or a bare `*` pattern). +pub(crate) fn filter_any(filter: &str) -> bool { + filter.contains("*.*") || filter.split([':', '|', ';', ',']).any(|p| p.trim() == "*") +} + +static NEXT_FILE_DIALOG: AtomicU32 = AtomicU32::new(1); + +/// Argument `i` as text; empty when null or missing. +fn text_arg(args: &[JsValue], i: usize, ctx: &mut Context) -> JsResult { + match args.get(i) { + None => Ok(String::new()), + Some(v) if v.is_null() || v.is_undefined() => Ok(String::new()), + Some(v) => Ok(v.to_string(ctx)?.to_std_string_escaped()), + } +} + +/// `__fileDialog(kind, prompt, filter, multiSelect, start)` → `[path…]` JSON or `null`: +/// `File.openDialog`, `File.saveDialog`, `Folder.selectDialog` and the instance `openDlg` / +/// `saveDlg` / `selectDlg` (#2778). On a script-host thread, with a frontend that shows the +/// scripts' file dialogs ([`effectcraft_engine::scriptui::ScriptUi::answers_file_dialogs`]), it +/// asks for the dialog ([`ScriptFileDialog`]), hands the session back to the caller like a modal +/// dialog does and waits for `scriptui.fileDialog`'s answer. Elsewhere (the Script Console, the +/// web, headless runs) there is no dialog to wait on: `null`, as a cancelled dialog. +pub(crate) fn native_file_dialog(_: &JsValue, args: &[JsValue], ctx: &mut Context) -> JsResult { + let kind = match arg_string(args, 0, ctx)?.as_str() { + "save" => FileDialogKind::Save, + "folder" => FileDialogKind::Folder, + _ => FileDialogKind::Open, + }; + let prompt = text_arg(args, 1, ctx)?; + let filter = text_arg(args, 2, ctx)?; + let start = text_arg(args, 4, ctx)?; + let many = kind == FileDialogKind::Open && args.get(3).is_some_and(JsValue::to_boolean); + let id = NEXT_FILE_DIALOG.fetch_add(1, Ordering::Relaxed); + let asked = with_active(|a| { + if a.link.is_none() || !a.session.script_ui.answers_file_dialogs { + return Ok(false); + } + // One dialog at a time per script. + a.session.script_ui.file_dialogs.retain(|d| d.host != a.host); + let folder = kind == FileDialogKind::Folder; + let (exts, label, any) = if folder { (vec![], String::new(), false) } else { (filter_exts(&filter), filter_label(&filter), filter_any(&filter)) }; + a.session.script_ui.file_dialogs.push(ScriptFileDialog { id, host: a.host, kind, prompt, exts, label, any, many, start, shown: false }); + Ok(true) + }) + .unwrap_or(false); + if !asked { + return Ok(JsValue::null()); + } + let forget = || { + let _ = with_active(|a| { + a.session.script_ui.file_dialogs.retain(|d| d.id != id); + Ok(()) + }); + }; + loop { + let windows = snapshot(ctx); + let out = crate::Outcome { output: settle(), waiting: true, ..Default::default() }; + // The caller went away: as cancelled. + let Some(ev) = yield_wait(out, windows, false) else { return Ok(JsValue::null()) }; + if ev.kind == FILE_DIALOG_EVENT { + // An answer to an earlier dialog of this script is not this one's. + if ev.value.get("id").and_then(J::as_u64) == Some(u64::from(id)) { + forget(); + let paths = ev.value.get("paths").cloned().unwrap_or(J::Null); + return Ok(js_str(&paths.to_string())); + } + } else if ev.kind == "close" { + // `dispatch_ui` refuses the script's window events while it waits; a close that got + // here all the same ends the wait as cancelled, so the window can be closed. + forget(); + return Ok(JsValue::null()); + } + } +} + // ---------------------------------------------------------------- script-host threads pub(crate) enum ToHost { @@ -320,8 +430,7 @@ fn receive(session: &mut Session, host: u32, end: HostEnd) -> crate::Outcome { } publish(session, host, &name, windows); if done { - session.script_ui.windows.retain(|w| w.host != host); - session.script_ui.revision += 1; + forget_host(session, host); } else if let Ok(mut h) = hosts().lock() { h.insert(host, HostEnd { next_due, epoch: session.script_ui.project_epoch, ..end }); } @@ -331,6 +440,13 @@ fn receive(session: &mut Session, host: u32, end: HostEnd) -> crate::Outcome { } } +/// A script host has ended: its windows close and nothing waits on its file dialogs. +fn forget_host(session: &mut Session, host: u32) { + session.script_ui.windows.retain(|w| w.host != host); + session.script_ui.file_dialogs.retain(|d| d.host != host); + session.script_ui.revision += 1; +} + /// Run a script file on a new script-host thread (see the module docs). Not on the web, where /// scripts run inline. #[cfg(not(target_arch = "wasm32"))] @@ -434,22 +550,33 @@ pub fn dispatch_ui(session: &mut Session, ev: &ScriptUiEvent) -> Result bool { - !session.script_ui.windows.iter().any(|w| w.host == host) && !session.script_ui.startup_hosts.contains(&host) + // A script waiting on its file dialog goes on when it is answered. + !session.script_ui.windows.iter().any(|w| w.host == host) + && !session.script_ui.startup_hosts.contains(&host) + && !session.script_ui.file_dialogs.iter().any(|d| d.host == host) } /// Run the due tasks of the script-host threads; hosts without windows whose project was closed @@ -501,13 +631,16 @@ pub(crate) fn tick_threaded(session: &mut Session, now: Instant, report: &mut cr let Some(end) = h.get(&host) else { continue }; if end.epoch != epoch && ends_with_project(session, host) { // Dropping its end lets the host thread finish. - stale.extend(h.remove(&host)); + stale.extend(h.remove(&host).map(|end| (host, end))); } else if end.next_due.is_some_and(|d| d <= now) { due.push(host); } } } - drop(stale); + for end in stale { + forget_host(session, end.0); + drop(end.1); + } for host in due { if session.script_ui.render_host.is_some() { break; @@ -515,8 +648,7 @@ pub(crate) fn tick_threaded(session: &mut Session, now: Instant, report: &mut cr let Some(end) = hosts().lock().ok().and_then(|mut h| h.remove(&host)) else { continue }; if let Err(std::sync::mpsc::SendError(msg)) = end.tx.send(ToHost::Tick(std::mem::take(session), now)) { *session = msg.into_session(); - session.script_ui.windows.retain(|w| w.host != host); - session.script_ui.revision += 1; + forget_host(session, host); continue; } report.add(receive(session, host, end)); diff --git a/crates/ui-egui/src/app.rs b/crates/ui-egui/src/app.rs index f1373607d..ae0fbf38d 100644 --- a/crates/ui-egui/src/app.rs +++ b/crates/ui-egui/src/app.rs @@ -31,7 +31,9 @@ impl EffectcraftApp { /// Loads and applies the workspaces saved in the session's config directory (a failed load is reported in /// `ui.status`), initializes the default UI, playback and render state, and registers the frontend's commands as /// shortcutable `UiCommand`s on the session. - pub fn new(session: Session) -> Self { + pub fn new(mut session: Session) -> Self { + // Scripts' file dialogs (File.openDialog…) show here ([`panels::scriptui_view::serve_file_dialogs`]). + session.script_ui.answers_file_dialogs = true; let mut ui = UiState::default(); let workspace_store = workspace_state::WorkspaceStore::load(session.config.as_deref(), &mut ui); EffectcraftApp { diff --git a/crates/ui-egui/src/app/frame.rs b/crates/ui-egui/src/app/frame.rs index 8eef34d4b..59c12267c 100644 --- a/crates/ui-egui/src/app/frame.rs +++ b/crates/ui-egui/src/app/frame.rs @@ -326,12 +326,21 @@ impl EffectcraftApp { || !self.synthetic.is_empty() || !self.input_waiters.is_empty() || self.pending_screenshots.iter().any(|s| s.slot.is_none()) + || self.script_file_dialog_waits() || (self.playback.playing && child_viewports); if paint { self.request_hidden_paint(ctx); } } + /// A script waits for a file dialog nobody has shown yet: dialogs are served in a UI pass + /// (`serve_file_dialogs`), so a minimized window must paint for it (#3253 review). Not while + /// a non-blocking dialog is up: the next one waits for it. + fn script_file_dialog_waits(&self) -> bool { + let one_at_a_time = self.hooks.file_dialog_async.is_some() && self.file_dialogs.any(); + !one_at_a_time && self.session.script_ui.file_dialogs.iter().any(|d| !d.shown) + } + /// Ask the host for a UI pass even when the window is minimized or occluded. /// /// Native eframe honours `RequestPaintWhileHidden`; the shared web backend does not carry it @@ -529,6 +538,9 @@ impl EffectcraftApp { updates_ui::show(self, &ctx); panels::scriptui_view::sync_panels(self); panels::scriptui_view::show_windows(self, &ctx); + // After the windows' events and the menus' commands: a script that asked for a file + // dialog in this pass gets it now. + panels::scriptui_view::serve_file_dialogs(self); panels::learn::coach(self, &ctx); let lift = panels::media_panels::import_card(self, ui, full); self.draw_toast(ui, full, lift); diff --git a/crates/ui-egui/src/app/gpu.rs b/crates/ui-egui/src/app/gpu.rs index 92ea7665c..96a24c5e0 100644 --- a/crates/ui-egui/src/app/gpu.rs +++ b/crates/ui-egui/src/app/gpu.rs @@ -144,6 +144,16 @@ impl EffectcraftApp { pub(crate) fn run_dialog_answers(&mut self) { while let Ok(answer) = self.dialog_answers.1.try_recv() { self.file_dialogs.answered(); + // A script's file dialog: answered even when cancelled (the script waits on it). + if answer.command == panels::scriptui_view::FILE_DIALOG_COMMAND { + // A dialog that couldn't open says why in the status line and counts as cancelled. + let paths = answer.paths.unwrap_or_else(|e| { + self.ui.status = e; + Vec::new() + }); + panels::scriptui_view::answer_file_dialog(self, &answer.params, paths); + continue; + } menus::dialog_answered(self, answer); } } diff --git a/crates/ui-egui/src/hooks.rs b/crates/ui-egui/src/hooks.rs index 7a87eeb6c..177084a46 100644 --- a/crates/ui-egui/src/hooks.rs +++ b/crates/ui-egui/src/hooks.rs @@ -13,6 +13,19 @@ pub enum FileDialog { OpenProject, /// A folder. Folder, + /// A file (several when `many`) a script asks for (`File.openDialog`, #2778): the script's + /// filter named `label` with these extensions (none: every file), and `any`: every file + /// besides (the filter's `*.*`). + /// `prompt` is the dialog's title (empty: the system's) and `start` the file or folder it + /// opens at (empty: the system's). + Script { label: String, exts: Vec, any: bool, many: bool, prompt: String, start: String }, + /// A folder a script asks for (`Folder.selectDialog`, `folder.selectDlg`) with its `prompt` + /// (the dialog's title) and the folder it starts in (`start`); both empty when not given. + ScriptFolder { prompt: String, start: String }, + /// Where a script wants to save (`File.saveDialog`, `file.saveDlg`): `default` (a file name + /// or path) with the script's filter (`label`, `exts`, `any` as in [`FileDialog::Script`]; no + /// extensions: the default's extension) and the script's `prompt` as the title. + ScriptSave { default: String, prompt: String, label: String, exts: Vec, any: bool }, /// Where to save `default` (a file name or path) with extension `ext` (empty: no filter); /// `project`: the project save dialog, given the file name. Save { default: String, ext: String, project: bool }, @@ -62,6 +75,10 @@ pub struct Hooks { /// a drag over the window (#511), and on Linux a blocking desktop-portal dialog never pumps /// events, so the compositor marks the window as not responding (#1275). pub file_dialog_async: Option>, + /// Shows a [`FileDialog`] and blocks until it closes: the picked paths (empty: cancelled). + /// Scripts' file dialogs use it where [`Hooks::file_dialog_async`] isn't set (Windows); without + /// it they fall back to the pickers above. + pub pick_file_dialog: Option Vec>>, /// Tells the user the graphics device was lost and the window is closing, once. `saved` is /// the auto-save of unsaved changes (`None`: nothing was unsaved), its path or why it failed. pub device_lost: Option>)>>, diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 5d49d397b..1d39857df 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -538,6 +538,11 @@ impl FileDialogsUp { self.count = self.count.saturating_add(1); } + /// Whether one is up. + pub(crate) fn any(&self) -> bool { + self.count > 0 + } + pub(crate) fn answered(&mut self) { self.count = self.count.saturating_sub(1); } diff --git a/crates/ui-egui/src/lifecycle_tests.rs b/crates/ui-egui/src/lifecycle_tests.rs index 5b97b1961..fe9041987 100644 --- a/crates/ui-egui/src/lifecycle_tests.rs +++ b/crates/ui-egui/src/lifecycle_tests.rs @@ -356,6 +356,39 @@ fn image(width: usize, height: usize) -> Arc { Arc::new(egui::ColorImage::new([width, height], vec![egui::Color32::from_rgb(10, 20, 30); width.checked_mul(height).unwrap()])) } +/// #3253 review: a script waits on a file dialog while the window is hidden. File dialogs are +/// served in a UI pass, so the app asks for one until the dialog is shown; a hidden window with +/// nothing waiting stays quiet. +#[test] +fn a_script_file_dialog_asks_for_a_pass_while_the_window_is_hidden() { + use effectcraft_engine::scriptui::{FileDialogKind, ScriptFileDialog}; + let ctx = egui::Context::default(); + let frame = eframe::Frame::_new_kittest(); + let mut app = app_with_comp(); + ready(&mut app, &ctx, &frame); + let asks = + |out: &egui::LogicOutput| out.viewport_commands.values().flatten().filter(|c| matches!(c, egui::ViewportCommand::RequestPaintWhileHidden)).count(); + let size = egui::vec2(800.0, 480.0); + assert_eq!(asks(&tick_with(&mut app, &ctx, &frame, &raw(size))), 0, "nothing waits: a hidden window stays quiet"); + app.session.script_ui.file_dialogs.push(ScriptFileDialog { + id: 1, + host: 1, + kind: FileDialogKind::Open, + prompt: String::new(), + exts: vec![], + label: String::new(), + any: true, + many: false, + start: String::new(), + shown: false, + }); + assert_eq!(asks(&tick_with(&mut app, &ctx, &frame, &raw(size))), 1, "a script waits for its dialog: the hidden window paints"); + if let Some(d) = app.session.script_ui.file_dialogs.first_mut() { + d.shown = true; + } + assert_eq!(asks(&tick_with(&mut app, &ctx, &frame, &raw(size))), 0, "the dialog is shown: no more passes asked for"); +} + #[test] fn a_screenshot_is_issued_only_after_settled_passes_and_writes_from_the_tick() { let ctx = egui::Context::default(); diff --git a/crates/ui-egui/src/panels/scriptui_view.rs b/crates/ui-egui/src/panels/scriptui_view.rs index 2e34757bf..4b365afdf 100644 --- a/crates/ui-egui/src/panels/scriptui_view.rs +++ b/crates/ui-egui/src/panels/scriptui_view.rs @@ -540,6 +540,115 @@ fn perform(app: &mut EffectcraftApp, ctx: &egui::Context, acts: Vec) { } } +/// The command that answers a script's file dialog. +pub(crate) const FILE_DIALOG_COMMAND: &str = "scriptui.fileDialog"; + +/// The answer to a script's file dialog shown without blocking. Dropped unanswered (a dialog that +/// ended without its completion handler, a dialog thread that didn't start) it answers +/// "cancelled", so the script never waits for an answer that can't come. +struct PendingAnswer { + tx: std::sync::mpsc::Sender, + answer: Option, +} + +impl PendingAnswer { + fn send(mut self, paths: Result, String>) { + if let Some(a) = self.answer.take() { + let _ = self.tx.send(crate::DialogAnswer { paths, ..a }); + } + } +} + +impl Drop for PendingAnswer { + fn drop(&mut self) { + if let Some(a) = self.answer.take() { + let _ = self.tx.send(a); + } + } +} + +/// Show the file dialog a script waits on (`File.openDialog`, `File.saveDialog`, +/// `Folder.selectDialog`… from a ScriptUI Browse… button, #2778) and hand the answer back +/// through `scriptui.fileDialog`. Where blocking the frame is unsafe the dialog shows without +/// blocking ([`crate::Hooks::file_dialog_async`]), one at a time, and answers when it closes; a +/// host without a dialog answers "cancelled" at once, so the script never waits for nothing. +pub fn serve_file_dialogs(app: &mut EffectcraftApp) { + use effectcraft_engine::scriptui::FileDialogKind; + let spawn = app.hooks.file_dialog_async.is_some(); + // A non-blocking dialog already up: the next one shows after it. + if spawn && app.file_dialogs.any() { + return; + } + let Some(asked) = app.session.script_ui.file_dialogs.iter_mut().find(|d| !d.shown) else { return }; + asked.shown = true; + let asked = asked.clone(); + let params = json!({"id": asked.id}); + // The save dialog's default: the script's file, else a name with the filter's extension. + let default = match (asked.start.is_empty(), asked.exts.first()) { + (false, _) => asked.start.clone(), + (true, Some(ext)) => format!("Untitled.{ext}"), + (true, None) => "Untitled".to_string(), + }; + let request = match asked.kind { + FileDialogKind::Open => crate::FileDialog::Script { + label: asked.label.clone(), + exts: asked.exts.clone(), + any: asked.any, + many: asked.many, + prompt: asked.prompt.clone(), + start: asked.start.clone(), + }, + FileDialogKind::Save => crate::FileDialog::ScriptSave { + default: default.clone(), + prompt: asked.prompt.clone(), + label: asked.label.clone(), + exts: asked.exts.clone(), + any: asked.any, + }, + FileDialogKind::Folder => crate::FileDialog::ScriptFolder { prompt: asked.prompt.clone(), start: asked.start.clone() }, + }; + if let Some(spawn) = app.hooks.file_dialog_async.as_ref() { + let answer = crate::DialogAnswer { command: FILE_DIALOG_COMMAND.to_string(), key: "paths", params, paths: Ok(Vec::new()) }; + let pending = PendingAnswer { tx: app.dialog_answers.0.clone(), answer: Some(answer) }; + app.file_dialogs.opened(); + spawn(request, Box::new(move |paths| pending.send(paths))); + return; + } + let paths: Vec = match (&app.hooks.pick_file_dialog, asked.kind) { + (Some(pick), _) => pick(request), + (_, FileDialogKind::Open) => { + let exts: Vec<&str> = asked.exts.iter().map(String::as_str).collect(); + app.hooks.pick_files.as_ref().map(|pick| pick(&exts)).unwrap_or_default() + } + (_, FileDialogKind::Save) => app.hooks.save_dialog(&default).flatten().into_iter().collect(), + (_, FileDialogKind::Folder) => app.hooks.pick_folder.as_ref().and_then(|pick| pick()).into_iter().collect(), + }; + let paths = if asked.many { paths } else { paths.into_iter().take(1).collect() }; + answer_file_dialog(app, ¶ms, paths); +} + +/// Answer a script's file dialog (`params`: `{id}`) with the picked `paths` (empty: cancelled); +/// what the script then reports shows as [`perform`] shows a handler's. An answer that comes +/// after the dialog was dropped (its script window closed meanwhile) is let go. +pub(crate) fn answer_file_dialog(app: &mut EffectcraftApp, params: &Value, paths: Vec) { + let id = params.get("id").and_then(Value::as_u64); + if !app.session.script_ui.file_dialogs.iter().any(|d| Some(u64::from(d.id)) == id) { + return; + } + let paths = if paths.is_empty() { Value::Null } else { json!(paths) }; + match app.session.execute(FILE_DIALOG_COMMAND, json!({"id": id, "paths": paths})) { + Ok(r) => { + if let Some(e) = r.get("error").filter(|e| !e.is_null()) { + let msg = e["message"].as_str().unwrap_or("script error").to_string(); + app.toast = Some((msg, app.now())); + } else if let Some(o) = r["output"].as_str().filter(|o| !o.is_empty()) { + app.ui.status = o.lines().last().unwrap_or_default().to_string(); + } + } + Err(e) => app.ui.status = e.to_string(), + } +} + /// The floating script windows (dialogs, palettes, windows), drawn over the app. pub fn show_windows(app: &mut EffectcraftApp, ctx: &egui::Context) { let windows: Vec = app.session.script_ui.windows.iter().filter(|w| w.kind != WindowKind::Panel).cloned().collect(); diff --git a/crates/ui-egui/tests/it/ui_scriptui.rs b/crates/ui-egui/tests/it/ui_scriptui.rs index a905ebc5a..6c46e71cf 100644 --- a/crates/ui-egui/tests/it/ui_scriptui.rs +++ b/crates/ui-egui/tests/it/ui_scriptui.rs @@ -398,3 +398,165 @@ fn scheduled_import_reveals_its_composition_without_manual_clicks() { assert!(!h.state().ui.start_screen, "Home must not hide a composition opened by the scheduled import"); h.state_mut().session.execute("scriptui.close", json!({"window":"Automatic import"})).unwrap(); } + +/// #2778: a script dialog's Browse… button calls `File.openDialog` / `Folder.selectDialog`; the +/// app shows its file dialog (with the script's filter) and the script goes on with the picked +/// file, or with null when cancelled. Blocking dialogs (Windows) answer in the same pass; the +/// non-blocking ones (macOS, Linux) when they close. +#[test] +fn script_browse_buttons_open_the_file_dialog() { + use std::sync::{Arc, Mutex}; + let mut h = harness(); + let picked = std::env::temp_dir().join("Song.wav").to_string_lossy().to_string(); + let asked: Arc>>> = Arc::default(); + let (log, file) = (asked.clone(), picked.clone()); + h.state_mut().hooks.pick_files = Some(Box::new(move |exts: &[&str]| { + log.lock().unwrap().push(exts.iter().map(|e| e.to_string()).collect()); + vec![file.clone()] + })); + // Cancelled. + h.state_mut().hooks.pick_folder = Some(Box::new(|| None::)); + let code = r#" + var d = new Window("dialog", "Pick Audio"); + var row = d.add("group"); + var song = row.add("edittext", undefined, "", { name: "song" }); + song.characters = 30; + var browse = row.add("button", undefined, "Browse...", { name: "browse" }); + browse.onClick = function () { + var f = File.openDialog("Select a song", "Audio:*.mp3;*.wav,All files:*.*"); + song.text = f ? f.fsName : "(cancelled)"; + }; + var out = d.add("edittext", undefined, "", { name: "out" }); + var where = d.add("button", undefined, "Folder...", { name: "where" }); + where.onClick = function () { + var f = Folder.selectDialog("Output folder"); + out.text = f ? f.fsName : "(cancelled)"; + }; + d.add("button", undefined, "OK", { name: "ok" }); + if (d.show() === 1) app.project.activeItem.layers.addNull().name = song.text + " | " + out.text; + "#; + let r = h.state_mut().session.execute("script.run", json!({"code": code, "name": "pick.jsx"})).unwrap(); + assert_eq!(r["waiting"], true, "{r}"); + h.run_steps(3); + let d = h.state().session.script_ui.windows.iter().find(|w| w.modal).unwrap().id; + let text = |h: &Harness<'_, EffectcraftApp>, name: &str| { + h.state().session.script_ui.window(d).and_then(|w| w.root.lookup(&json!(name))).map(|w| w.text.clone()).unwrap_or_default() + }; + click(&mut h, &format!("scriptui.{d}.browse")); + assert_eq!(*asked.lock().unwrap(), [vec!["mp3".to_string(), "wav".to_string()]], "Browse… opens the file dialog with the script's filter"); + assert_eq!(text(&h, "song"), picked, "the script gets the picked file"); + click(&mut h, &format!("scriptui.{d}.where")); + assert_eq!(text(&h, "out"), "(cancelled)", "a cancelled dialog gives the script null"); + + // A dialog that doesn't block the frame answers when it closes. + let done: Arc>> = Arc::default(); + let queue = done.clone(); + h.state_mut().hooks.file_dialog_async = Some(Box::new(move |dialog, answer| queue.lock().unwrap().push((dialog, answer)))); + click(&mut h, &format!("scriptui.{d}.where")); + let (dialog, answer) = done.lock().unwrap().pop().expect("the folder dialog is asked for"); + assert_eq!(dialog, effectcraft_ui_egui::FileDialog::ScriptFolder { prompt: "Output folder".into(), start: String::new() }); + let folder = std::env::temp_dir().to_string_lossy().to_string(); + answer(Ok(vec![folder.clone()])); + h.run_steps(3); + assert_eq!(text(&h, "out"), folder); + // A dialog that ends without answering (its completion handler never runs) counts as + // cancelled: the script doesn't wait for good. + h.state_mut().hooks.file_dialog_async = Some(Box::new(|_: effectcraft_ui_egui::FileDialog, answer: effectcraft_ui_egui::DialogDone| drop(answer))); + click(&mut h, &format!("scriptui.{d}.where")); + h.run_steps(3); + assert_eq!(text(&h, "out"), "(cancelled)"); + // The dialog still works: OK closes it and the script runs on. + click(&mut h, &format!("scriptui.{d}.ok")); + assert_eq!(layer_names(&h), [format!("{picked} | (cancelled)")]); + assert!(h.state().session.script_ui.windows.is_empty()); +} + +/// #2778 review: the prompt, the start location and the full filter of a script's instance +/// `openDlg` / `saveDlg` / `selectDlg` reach the host's dialog, not just the filter's extensions. +#[test] +fn script_file_dialog_options_reach_the_host_dialog() { + use effectcraft_ui_egui::FileDialog; + use std::sync::{Arc, Mutex}; + let mut h = harness(); + let asked: Arc>> = Arc::default(); + let log = asked.clone(); + h.state_mut().hooks.pick_file_dialog = Some(Box::new(move |dialog| { + log.lock().unwrap().push(dialog); + Vec::new() + })); + let dir = std::env::temp_dir().to_string_lossy().to_string(); + let code = format!( + r#" + var d = new Window("dialog", "Options"); + d.add("button", undefined, "Open", {{ name: "open" }}).onClick = function () {{ new File({dir:?}).openDlg("Pick a song", "Audio:*.mp3;*.wav,All files:*.*", false); }}; + d.add("button", undefined, "Save", {{ name: "save" }}).onClick = function () {{ new File({dir:?} + "/Mix.wav").saveDlg("Save the mix", "Audio:*.wav;*.aif"); }}; + d.add("button", undefined, "Folder", {{ name: "folder" }}).onClick = function () {{ new Folder({dir:?}).selectDlg("Output folder"); }}; + d.add("button", undefined, "OK", {{ name: "ok" }}); + d.show(); + "# + ); + let r = h.state_mut().session.execute("script.run", json!({"code": code, "name": "opts.jsx"})).unwrap(); + assert_eq!(r["waiting"], true, "{r}"); + h.run_steps(3); + let d = h.state().session.script_ui.windows.iter().find(|w| w.modal).unwrap().id; + for name in ["open", "save", "folder"] { + click(&mut h, &format!("scriptui.{d}.{name}")); + } + let got = asked.lock().unwrap().clone(); + let exts = |e: &[&str]| e.iter().map(|e| e.to_string()).collect::>(); + assert_eq!( + got, + [ + FileDialog::Script { label: "Audio".into(), exts: exts(&["mp3", "wav"]), any: true, many: false, prompt: "Pick a song".into(), start: dir.clone() }, + FileDialog::ScriptSave { + default: format!("{dir}/Mix.wav"), + prompt: "Save the mix".into(), + label: "Audio".into(), + exts: exts(&["wav", "aif"]), + any: false + }, + FileDialog::ScriptFolder { prompt: "Output folder".into(), start: dir.clone() }, + ], + "the dialogs carry the script's prompt, start location and whole filter" + ); +} + +/// #2894: the same from a dockable ScriptUI panel (Window ▸ ): its button's +/// `File.openDialog` opens the file dialog and the panel's handler goes on with the file. +#[test] +fn a_docked_panel_button_opens_the_file_dialog() { + use effectcraft_engine::config::{ConfigStore, MemoryConfig}; + use std::sync::{Arc, Mutex}; + let store = Arc::new(MemoryConfig::default()); + let panel = r#" + var p = this; + var status = p.add("statictext", undefined, "No file selected", { name: "status" }); + status.characters = 40; + var pick = p.add("button", undefined, "Select SRT File", { name: "pick" }); + pick.onClick = function () { + var f = File.openDialog("Select an SRT file", "Subtitles:*.srt;All Files:*.*"); + status.text = f ? f.name : "No file selected"; + }; + p.layout.layout(true); + "#; + store.write("Scripts/ScriptUI Panels/Subtitles Panel.jsx", panel).unwrap(); + let mut s = effectcraft_host::session(); + s.config = Some(store.clone()); + let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).build_eframe(|_| EffectcraftApp::new(s)); + h.run_steps(3); + let asked: Arc>>> = Arc::default(); + let log = asked.clone(); + let file = std::env::temp_dir().join("Episode 1.srt").to_string_lossy().to_string(); + h.state_mut().hooks.pick_files = Some(Box::new(move |exts: &[&str]| { + log.lock().unwrap().push(exts.iter().map(|e| e.to_string()).collect()); + vec![file.clone()] + })); + h.state_mut().session.execute("window.scriptPanel", json!({"name": "Subtitles Panel.jsx"})).unwrap(); + h.run_steps(3); + let panel = h.state().session.script_ui.windows.iter().find(|w| w.script == "Subtitles Panel.jsx").expect("the panel's window").id; + assert!(h.state().ui.dock.is_docked(PanelKind::ScriptPanel(panel)), "the panel docks"); + click(&mut h, &format!("scriptui.{panel}.pick")); + assert_eq!(*asked.lock().unwrap(), [vec!["srt".to_string()]], "the panel's button opens the file dialog"); + let status = h.state().session.script_ui.window(panel).and_then(|w| w.root.lookup(&json!("status"))).map(|w| w.text.clone()).unwrap_or_default(); + assert_eq!(status, "Episode 1.srt"); +} diff --git a/docs/agents.md b/docs/agents.md index a83432f04..e09a94957 100644 --- a/docs/agents.md +++ b/docs/agents.md @@ -688,7 +688,15 @@ Scripts that build ScriptUI windows publish them to the session; agents drive th A dialog's `show()` waits for the user: the `script.run` / `file.runScript` reply carries `"waiting": true`, and the script continues (its final output arrives in the reply of the click -that closes the dialog). File ▸ Scripts: `file.scripts.list`, `file.runScript {"name": …}`, +that closes the dialog). A script's file dialog (`File.openDialog`, `File.saveDialog`, +`Folder.selectDialog`, `openDlg` / `saveDlg` / `selectDlg`, as a Browse… button calls them) waits +the same way in the app, which shows it. `scriptui.fileDialogs` lists the dialogs scripts wait on +(`{id, host, kind: open|save|folder, prompt, exts, label, any, many, start, shown}`; `shown`: the +app has shown it) and `scriptui.fileDialog {"id": …, "paths": […]}` (or `null`: cancelled) answers +one. On Windows the system dialog blocks the app's window until a person closes it, so an agent +can't answer it there; on macOS and Linux it doesn't block. The script's windows refuse events +meanwhile, except `scriptui.close`, which cancels the file dialog first. Without the app (headless +runs), in the Script Console and in Shutdown scripts these return `null` at once. File ▸ Scripts: `file.scripts.list`, `file.runScript {"name": …}`, `file.installScript` / `file.installScriptUIPanel {"path": …}`, `window.scriptPanel {"name": …}`, `window.restoreScriptPanels` (the panels open when the app last quit), `file.runStartupScripts` and `file.runShutdownScripts` (the scripts in `Scripts/Startup` and `Scripts/Shutdown`; the second closes diff --git a/docs/scripting-parity.md b/docs/scripting-parity.md index 9aa6ca626..662472c96 100644 --- a/docs/scripting-parity.md +++ b/docs/scripting-parity.md @@ -20,7 +20,7 @@ our own scripts; no real-world script library has been run against both apps. | Expression performance | Cached, multi-frame | Per-thread boa contexts | unknown | No benchmark | | Scripting object model | `app`, `Project`, items, layers, properties, keys, eases, render queue, `TextDocument`, `Shape`, markers, `File`/`Folder`, `Socket`, `app.settings` | Same classes, edits run through undoable engine commands; match names table, the properties of Offset Paths and Zig Zag included; layers, groups and properties are callable (`layer("Effects")(1)` is `.property(...)`) | good | `crates/script` tests (≈ 10 test files) | | `$.evalFile`, `BridgeTalk` | Evaluate another script file; identify the host application and message other Adobe applications | `$.evalFile` evaluates a file relative to the calling file (nested at most 32 deep, under the scripts' file gate) and returns its last value; `BridgeTalk` names the host honestly (`appName` `effectcraft`, its version); messaging other applications throws "not supported" | partial | `tests_evalfile.rs` (#760); no inter-application messaging | -| ScriptUI | Dialogs, palettes, dockable panels, resource strings, `onDraw` / ScriptUIGraphics, mouse events | Same, dockable panels reopen at launch; a docked panel gets its dock's size and `onResize` (`scriptui.resize`, #2585); a drag keeps reaching the control it started on past the window edge, and `MouseEvent.buttons` reports the held buttons (#2584) | good | `ui_scriptui`, `tests_ui*` | +| ScriptUI | Dialogs, palettes, dockable panels, resource strings, `onDraw` / ScriptUIGraphics, mouse events | Same, dockable panels reopen at launch; a docked panel gets its dock's size and `onResize` (`scriptui.resize`, #2585); a drag keeps reaching the control it started on past the window edge, and `MouseEvent.buttons` reports the held buttons (#2584); `File.openDialog`, `File.saveDialog` and `Folder.selectDialog` (a Browse… button) show the app's file dialog and the script waits for it (#2778) | good | `ui_scriptui`, `tests_ui*` | | `app.scheduleTask` / `cancelTask` | One-shot and repeating tasks (polling, panel refresh) until `cancelTask` | Same: repeating tasks run every `delay` ms (at least 50 ms, at most 64 pending per script) until `cancelTask`, until they throw (reported once, then cancelled), or until their owner goes: a script's last window closing, or the project closing for scripts without windows (a Startup script's tasks go on until EffectCraft quits); frontends tick them every frame, agents with `script.runTasks` | good | `tests_tasks.rs` (#773); one-shot tasks of a script file still run right after it, not after their delay | | Scripts menu, ScriptUI Panels folder | yes | yes; a subfolder (one level) of either folder is a submenu named after it | same | [plugins.md](plugins.md) | | Startup / Shutdown folders | yes | `Scripts/Startup` runs at launch and `Scripts/Shutdown` runs as the desktop app quits, after the project is closed, each in alphabetical order | partial | `crates/script/src/tests/startup.rs`; each script has its own global scope, so a Startup script's variables and functions are not available to later scripts ([plugins.md](plugins.md)) | From 29d116c6f706171e49dab902e1186249e00bb1ce Mon Sep 17 00:00:00 2001 From: Valentin Klein Date: Sun, 22 Nov 2026 20:31:15 +0100 Subject: [PATCH 390/451] Convert To Bezier Path works on a selected shape layer or group, for example right after drawing a rectangle (#3220) * #3057: Convert To Bezier Path converts a selected shape layer's or group's parametric paths Right after drawing with the Rectangle, Ellipse or Polygon tool only the layer is selected, and Convert To Bezier Path fell through to the mask branch and reported "no masks". It only converted when the parametric path row itself (Rectangle Path 1) was selected. - A selected shape group converts the parametric paths inside it, nested groups included. - With only layers selected, a shape layer converts its parametric paths, as a selected layer's masks are targeted. Locked layers are skipped; animated parametric paths are left alone and reported (skippedAnimated), and selecting the path still converts it. - Masks win only when targeted (mask param, selected mask, mask vertices) or when one uses RotoBezier: plain masks no longer turn the command into a silent no-op. - An explicit layer/layers limits selected shape items to those layers; an unmatched mask param is an error instead of converting every path. - Errors say what to select instead of asking for masks. A PSD shape layer importing as a layer with a mask matches After Effects; no change there. Fixes #3057 * #3057: Convert To Bezier Path converts a layer named twice once A layer given twice in `layers` (by id and by name) was widened twice: its parametric paths were queued twice, and the second replacement found no such item, so the whole command failed. The layer list is deduplicated before the widening, which also keeps skippedAnimated from counting a path twice. * #3057: Convert To Bezier Path leaves locked layers and a group's animated paths alone Shape items given as `items` or selected on a locked layer converted anyway (only the layer-wide conversion checked locks); they now go through unlocked(), an error when every one is locked. A selected group skips its keyframed or expression-driven parametric paths and reports them in skippedAnimated, as converting a whole layer does; a path selected itself still converts at the current time. * Doc comments for the functions this PR touches * #3057: Convert To Bezier Path gives an explicit mask priority over shape items With a `mask` given, a selected parametric path (or `items`) was converted instead of the mask, an unmatched `mask` converted the shape rather than reporting the miss, and a locked shape-item layer could reject the call before the mask was looked at. Shape items are now ignored when `mask` is present. * #3057: Convert To Bezier Path converts a selected mask with the selected shape paths With a mask and a parametric path both selected, only the path converted and the mask kept its RotoBezier tangents. Masks the selection targets (a selected mask or its property, mask vertices, on unlocked layers in scope) now convert in the same undo step, the result reports them as masks, and they stay selected with the new paths. An explicit `mask` keeps its priority. * #3057: Convert To Bezier Path keeps mask conversion to an explicit layer With `{"layer": A}` and a RotoBezier mask selected on layer B, the mask branch converted B's mask and left A unchanged. The resolved masks are now scoped to the explicit layer/layers (falling back to those layers' own masks), the priority check only counts selected masks and vertices in scope, and the scoped targets are edited directly instead of being resolved again. * #3057: Convert To Bezier Path leaves masks on locked layers alone A scoped or selected RotoBezier mask on a locked layer was converted through the mask branch. Masks on locked layers are now dropped after the scope and its fallback are resolved, so a locked selected mask does not hand the conversion to other masks; when every targeted mask is locked, the command reports the lock, as it does for shape items. * #3057: Convert To Bezier Path converts in the composition `comp` names With `comp` naming a composition that is not active, an explicit `mask` was resolved there but filtered against the active composition ("no mask matches"), and explicit `items` were looked up in the active composition. convert_to_bezier now works in the composition comp_id resolves, and selected_shape_items returns the composition layer_p resolved for explicit items (also used by Group and Ungroup Shapes); a selection made in another composition does not apply. * Convert To Bezier Path: explicit items add no selected masks With explicit `items`, only those shape paths convert. A RotoBezier mask selected on the same layer no longer loses its RotoBezier flag as a side effect. Regression test added. * Convert To Bezier Path: explicit items without a parametric path convert no mask * Convert To Bezier Path: items count as given only as a list --------- Co-authored-by: FredApps <153173854+FredApps@users.noreply.github.com> --- crates/engine/src/cmd/paths.rs | 290 ++++++++++++++++++--- crates/engine/src/tests/stubs.rs | 426 +++++++++++++++++++++++++++++++ 2 files changed, 681 insertions(+), 35 deletions(-) diff --git a/crates/engine/src/cmd/paths.rs b/crates/engine/src/cmd/paths.rs index 2f1e1051b..00c38c502 100644 --- a/crates/engine/src/cmd/paths.rs +++ b/crates/engine/src/cmd/paths.rs @@ -9,7 +9,7 @@ use effectcraft_render::EvalCtx; use serde_json::{Value, json}; use super::layer_menu::target_masks; -use super::{CommandSpec, b_p, bad, f_p, has_comp, has_layers, layer_mut, layer_p, merge_p, str_p}; +use super::{CommandSpec, b_p, bad, comp_id, f_p, has_comp, has_layers, layer_mut, layer_p, layers_p, merge_p, str_p, unlocked}; use crate::{EngineError, Result, Session, VertexRef, cmd}; mod closed; @@ -153,26 +153,223 @@ fn parametric_path(ctx: &EvalCtx, layer: &effectcraft_project::Layer, g: &PropGr effectcraft_path::from_kurbo(&path).into_iter().next() } +/// How deep [`parametric_in`] looks into nested shape groups; deeper ones are left alone. +const MAX_SHAPE_DEPTH: usize = 64; + +/// The parametric paths in `g` (itself, if it is one), in drawing order. +fn parametric_in(g: &PropGroup, lid: LayerId, depth: usize, out: &mut Vec<(LayerId, Uid)>) { + if PARAMETRIC.contains(&g.match_id.as_str()) { + out.push((lid, g.uid)); + return; + } + if depth >= MAX_SHAPE_DEPTH { + return; + } + for c in g.groups() { + parametric_in(c, lid, depth + 1, out); + } +} + +/// Converts masks and the selected parametric shape paths (Rectangle, Ellipse, Polystar) to editable Bezier paths of the same geometry at the current time. +/// Items on locked layers are skipped, and it errors when nothing is left to convert. fn convert_to_bezier(s: &mut Session, p: &Value) -> Result { // On a shape layer this replaces a Rectangle, Ellipse or Polystar path with an editable // Path 1 of the same geometry, as After Effects does (#932). The parametric properties are // read at the current time and the path that comes out is static: a size or roundness // animation cannot survive the conversion, in After Effects either. - let (cid, items) = selected_shape_items(s, p)?; + const LABEL: &str = "Convert To Bezier Path"; + // An explicit `mask` is what converts: selected shape items (or `items`) don't take its place, + // and a `mask` that matches nothing is reported below rather than converting a shape. + // The composition is the one `comp` names (else the active one), as the mask and layer + // resolvers use; a selection made in another composition doesn't apply to it. + let cid = comp_id(s, p)?; + let mut items = if p.get("mask").is_some() { + Vec::new() + } else { + let (items_cid, items) = selected_shape_items(s, p, "path.convertToBezier")?; + if items_cid == cid { items } else { Vec::new() } + }; + // `items` count as given only as a list, as `selected_shape_items` reads them; a null or other + // value leaves the selection in charge. + let explicit_items = matches!(p.get("items"), Some(Value::Array(_))); + // An explicit `layer` / `layers` limits the selected shape items to those layers. + let explicit_layers = p.get("layer").is_some_and(|v| !v.is_null()) || p.get("layers").is_some(); + if explicit_layers && !explicit_items { + let (_, layers) = layers_p(s, p)?; + items.retain(|(l, _)| layers.contains(l)); + } + // Items on a locked layer are left alone (an error when they all are), whether they come from + // the selection or from `items`. + if !items.is_empty() { + let mut item_layers: Vec = items.iter().map(|(l, _)| *l).collect(); + item_layers.sort(); + item_layers.dedup(); + let open = unlocked(s, cid, item_layers, "path.convertToBezier")?; + items.retain(|(l, _)| open.contains(l)); + } let comp = s.project.comp(cid).ok_or(EngineError::NoComp)?; - let shapes: Vec<(LayerId, Uid)> = items - .into_iter() - .filter(|(l, u)| { - comp.layer(*l).and_then(|l| l.props.sub("contents")).and_then(|c| c.find_group(*u)).is_some_and(|g| PARAMETRIC.contains(&g.match_id.as_str())) - }) - .collect(); - if shapes.is_empty() { - return edit_mask_groups(s, p, "Convert To Bezier Path", |g| { - if let GroupKind::Mask { roto_bezier, .. } = &mut g.kind { - *roto_bezier = false; + // A selected parametric path converts itself, animated or not (After Effects keeps the shape + // at the current time). A selected shape group converts the parametric paths inside it + // (#3057: selecting Rectangle 1 rather than its Rectangle Path 1 reported "no masks"), but + // leaves the animated ones alone, as converting a whole layer does. + let mut shapes: Vec<(LayerId, Uid)> = Vec::new(); + let mut skipped: Vec<(LayerId, Uid)> = Vec::new(); + for (lid, uid) in &items { + let Some(g) = comp.layer(*lid).and_then(|l| l.props.sub("contents")).and_then(|c| c.find_group(*uid)) else { continue }; + if PARAMETRIC.contains(&g.match_id.as_str()) { + shapes.push((*lid, *uid)); + continue; + } + let mut found = Vec::new(); + parametric_in(g, *lid, 0, &mut found); + for (fl, fu) in found { + if g.find_group(fu).is_some_and(PropGroup::any_animated) { + skipped.push((fl, fu)); + } else { + shapes.push((fl, fu)); } - Ok(()) - }); + } + } + shapes.sort(); + shapes.dedup(); + // A path both selected itself and inside a selected group converts; it is not skipped. + skipped.sort(); + skipped.dedup(); + skipped.retain(|x| !shapes.contains(x)); + let mut skipped_animated = skipped.len(); + // Masks the selection targets too (a selected mask or one of its properties, mask vertices) + // convert with the shape paths in the same step, as the command acts on every selected path: + // selecting a mask and a Rectangle path must not convert only the rectangle. + // Explicit `items` name exactly what converts: the selection adds no masks to them. + let mut sel_masks: Vec<(LayerId, Uid)> = Vec::new(); + if !shapes.is_empty() && !explicit_items { + let masks_of = |l: LayerId| comp.layer(l).filter(|ly| !ly.switches.locked).and_then(|ly| ly.masks()); + for (l, u) in &s.state.selected_props { + let Some(m) = masks_of(*l) else { continue }; + sel_masks.extend(m.groups().filter(|g| g.uid == *u || g.find(*u).is_some()).map(|g| (*l, g.uid))); + } + for v in &s.state.selected_vertices { + if masks_of(v.layer).is_some_and(|m| m.groups().any(|g| g.uid == v.mask)) { + sel_masks.push((v.layer, v.mask)); + } + } + if explicit_layers { + let (_, layers) = layers_p(s, p)?; + sel_masks.retain(|(l, _)| layers.contains(l)); + } + sel_masks.sort(); + sel_masks.dedup(); + } + if shapes.is_empty() { + // Explicit `items` with nothing parametric in them (a Fill, a path that is already Bezier) + // convert nothing: they don't hand the conversion to a selected mask or the layer's masks. + if explicit_items && p.get("mask").is_none() { + let why = if skipped_animated > 0 { + "the parametric paths are animated: name the path itself in `items` to convert it at the current time (its animation is lost)" + } else { + "nothing to convert: the given items have no Rectangle, Ellipse or Polystar path" + }; + return Err(bad(LABEL, why)); + } + let (_, mut masks) = masks_for(s, p)?; + let mask_of = |l: LayerId, u: Uid| comp.layer(l).and_then(|l| l.masks()).and_then(|m| m.groups().find(|g| g.uid == u)); + masks.retain(|(l, u)| mask_of(*l, *u).is_some()); + // An explicit `layer` / `layers` is the scope: a mask selected on another layer is not + // converted in its place. With none of the selected masks in scope, the scoped layers' + // own masks are the targets, as for a selected layer. + let scope = if explicit_layers { Some(layers_p(s, p)?.1) } else { None }; + let in_scope = |l: &LayerId| scope.as_ref().is_none_or(|v| v.contains(l)); + if let Some(layers) = &scope { + masks.retain(|(l, _)| layers.contains(l)); + if masks.is_empty() && p.get("mask").is_none() { + for l in layers { + if let Some(m) = comp.layer(*l).and_then(|ly| ly.masks()) { + masks.extend(m.groups().map(|g| (*l, g.uid))); + } + } + } + } + masks.sort(); + masks.dedup(); + // Masks on a locked layer are left alone, as shape items are. This comes after the scope + // and its fallback, so a locked selected mask doesn't hand the conversion to other masks. + let mut mask_layers: Vec = masks.iter().map(|(l, _)| *l).collect(); + mask_layers.dedup(); + masks.retain(|(l, _)| comp.layer(*l).is_some_and(|ly| !ly.switches.locked)); + // Masks take priority when they are targeted (a `mask`, a selected mask or mask vertices) + // or when one of them has RotoBezier tangents to turn off. A selected layer's plain masks + // are already Bezier paths: converting them would do nothing and hide the layer's + // parametric shapes (#3057). + let mask_targeted = p.get("mask").is_some() + || (p.get("layer").is_none() && s.state.selected_vertices.iter().any(|v| in_scope(&v.layer))) + || s.state + .selected_props + .iter() + .any(|(l, u)| in_scope(l) && comp.layer(*l).and_then(|l| l.masks()).is_some_and(|m| m.uid != *u && m.find_group(*u).is_some())); + let any_roto = masks.iter().any(|(l, u)| mask_of(*l, *u).is_some_and(is_roto)); + // Every targeted mask is on a locked layer: say so rather than convert anything else. + if mask_targeted && masks.is_empty() && !mask_layers.is_empty() { + unlocked(s, cid, mask_layers, "path.convertToBezier")?; + return Err(bad(LABEL, "the masks are on locked layers")); + } + // A selected group whose paths were all skipped as animated reports that, rather than + // turning to the layer's masks. + if !masks.is_empty() && (mask_targeted || (any_roto && skipped_animated == 0)) { + // The scoped targets are edited as resolved here, not looked up again. + let n = masks.len(); + s.edit(LABEL, None, |proj, _| { + for (lid, uid) in &masks { + let l = layer_mut(proj, cid, *lid)?; + if let Some(g) = l.props.sub_mut("masks").and_then(|m| m.find_group_mut(*uid)) + && let GroupKind::Mask { roto_bezier, .. } = &mut g.kind + { + *roto_bezier = false; + } + } + Ok(()) + })?; + return Ok(json!({"masks": n})); + } + if p.get("mask").is_some() { + return Err(bad(LABEL, "no mask matches `mask`")); + } + // Only layers selected (#3057): a shape layer drawn with the Rectangle, Ellipse or Polygon + // tool converts its parametric paths, as the masks of a selected layer do. A selected + // shape item with nothing parametric in it (a Fill, a Bezier path) is not widened to the + // whole layer, and an animated parametric path is left alone here: converting keeps only + // the shape at the current time, so that takes selecting the path itself. + if items.is_empty() { + let (lcid, mut layers) = layers_p(s, p)?; + // A layer named twice (`layers: [1, "Shape 1"]`) converts once: its paths would + // otherwise be replaced twice, and the second replacement finds no such item. + layers.sort(); + layers.dedup(); + if lcid == cid { + for lid in unlocked(s, cid, layers, "path.convertToBezier")? { + let Some(l) = comp.layer(lid).filter(|l| matches!(l.source, LayerSource::Shape)) else { continue }; + let Some(contents) = l.props.sub("contents") else { continue }; + let mut found = Vec::new(); + parametric_in(contents, lid, 0, &mut found); + for (fl, fu) in found { + if contents.find_group(fu).is_some_and(PropGroup::any_animated) { + skipped_animated += 1; + } else { + shapes.push((fl, fu)); + } + } + } + } + } + if shapes.is_empty() { + let why = if skipped_animated > 0 { + "the parametric paths are animated: select one in the Timeline to convert it at the current time (its animation is lost)" + } else if !masks.is_empty() { + "nothing to convert: the masks are already Bezier paths" + } else { + "nothing to convert: select a Rectangle, Ellipse or Polystar path, a shape layer with one, or a layer with masks" + }; + return Err(bad(LABEL, why)); + } } let t = s.time(); let n = shapes.len(); @@ -210,13 +407,22 @@ fn convert_to_bezier(s: &mut Session, p: &Value) -> Result { made.push((lid, new_uid)); } proj.next_id = next; - // The new paths are what is selected, so the vertices can be edited straight away. + for (lid, uid) in &sel_masks { + let l = layer_mut(proj, cid, *lid)?; + if let Some(g) = l.props.sub_mut("masks").and_then(|m| m.find_group_mut(*uid)) + && let GroupKind::Mask { roto_bezier, .. } = &mut g.kind + { + *roto_bezier = false; + } + } + // The new paths are what is selected, so the vertices can be edited straight away; the + // converted masks stay selected with them. if !made.is_empty() { - st.selected_props = made.clone(); + st.selected_props = made.iter().chain(&sel_masks).copied().collect(); } Ok(made) })?; - Ok(json!({"paths": made.len(), "of": n})) + Ok(json!({"paths": made.len(), "of": n, "masks": sel_masks.len(), "skippedAnimated": skipped_animated})) } // ---------------------------------------------------------------- mask options @@ -389,24 +595,25 @@ const SHAPE_ITEMS: &[&str] = &[ "wiggle", "wiggler", "merge", "front", "bevel", "side", "back", ]; -/// Selected shape items (contents entries) of shape layers: (layer, uid). -fn selected_shape_items(s: &Session, p: &Value) -> Result<(ItemId, Vec<(LayerId, Uid)>)> { +/// Selected shape items (contents entries) of shape layers: (layer, uid), with their composition. +/// Explicit `items` are on the layer `layer_p` resolves, in the composition it resolves (`comp`, +/// else the active one); selected items are the active composition's. +fn selected_shape_items(s: &Session, p: &Value, cmd: &str) -> Result<(ItemId, Vec<(LayerId, Uid)>)> { + if let Some(Value::Array(a)) = p.get("items") { + let (cid, lid) = layer_p(s, p, cmd)?; + return Ok((cid, a.iter().filter_map(Value::as_u64).map(|u| (lid, u)).collect())); + } let cid = s.active_comp_id().ok_or(EngineError::NoComp)?; let comp = s.project.comp(cid).ok_or(EngineError::NoComp)?; let mut out = vec![]; - if let Some(Value::Array(a)) = p.get("items") { - let (_, lid) = layer_p(s, p, "path.groupShapes")?; - out.extend(a.iter().filter_map(Value::as_u64).map(|u| (lid, u))); - } else { - for (lid, uid) in &s.state.selected_props { - let Some(l) = comp.layer(*lid).filter(|l| matches!(l.source, LayerSource::Shape)) else { continue }; - if l.props - .sub("contents") - .and_then(|c| c.find_group(*uid)) - .is_some_and(|g| g.uid != l.props.sub("contents").map(|c| c.uid).unwrap_or(0) && SHAPE_ITEMS.contains(&g.match_id.as_str())) - { - out.push((*lid, *uid)); - } + for (lid, uid) in &s.state.selected_props { + let Some(l) = comp.layer(*lid).filter(|l| matches!(l.source, LayerSource::Shape)) else { continue }; + if l.props + .sub("contents") + .and_then(|c| c.find_group(*uid)) + .is_some_and(|g| g.uid != l.props.sub("contents").map(|c| c.uid).unwrap_or(0) && SHAPE_ITEMS.contains(&g.match_id.as_str())) + { + out.push((*lid, *uid)); } } Ok((cid, out)) @@ -421,8 +628,10 @@ fn has_shape_items(s: &Session) -> std::result::Result<(), String> { if ok { Ok(()) } else { Err("select shape items (Contents ▸ …) in the timeline".into()) } } +/// Wraps the selected shape items of one layer in a new group placed where the first of them was. +/// Errors when no shape items are selected or they do not share one parent group. fn group_shapes(s: &mut Session, p: &Value) -> Result { - let (cid, items) = selected_shape_items(s, p)?; + let (cid, items) = selected_shape_items(s, p, "path.groupShapes")?; let Some(lid) = items.first().map(|x| x.0) else { return Err(bad("path.groupShapes", "select shape items to group")) }; let uids: Vec = items.iter().filter(|(l, _)| *l == lid).map(|(_, u)| *u).collect(); let g = s.edit("Group Shapes", None, |proj, st| { @@ -496,8 +705,10 @@ fn offset_items(g: &mut PropGroup, d: [f64; 2]) { } } +/// Replaces each selected shape group with its children, baking the group's position offset into them. +/// Errors when no group is selected or a group has a scale, rotation, skew, opacity or animated transform. fn ungroup_shapes(s: &mut Session, p: &Value) -> Result { - let (cid, items) = selected_shape_items(s, p)?; + let (cid, items) = selected_shape_items(s, p, "path.ungroupShapes")?; let comp = s.project.comp(cid).ok_or(EngineError::NoComp)?; let groups: Vec<(LayerId, Uid)> = items .into_iter() @@ -548,11 +759,20 @@ fn ungroup_shapes(s: &mut Session, p: &Value) -> Result { Ok(json!({"ungrouped": n})) } +/// The command specs for the path commands: RotoBezier, Convert To Bezier Path, Group Shapes, Ungroup Shapes and the rest of this module. pub fn specs() -> Vec { vec![ cmd!("path.toggleClosed", "Closed", ["Layer", "Mask and Shape Path"], None, "{}", closed::has_paths, closed::toggle_closed), cmd!("path.rotoBezier", "RotoBezier", ["Layer", "Mask and Shape Path"], None, "{layer?, mask?, value?}", has_layers, roto_bezier), - cmd!("path.convertToBezier", "Convert To Bezier Path", ["Layer", "Mask and Shape Path"], None, "{layer?, mask?}", has_layers, convert_to_bezier), + cmd!( + "path.convertToBezier", + "Convert To Bezier Path", + ["Layer", "Mask and Shape Path"], + None, + "{layer?, layers?, mask?, items?: [uid]}", + has_layers, + convert_to_bezier + ), cmd!("path.groupShapes", "Group Shapes", ["Layer"], Some("Cmd+G"), "{layer?, items?: [uid]}", has_shape_items, group_shapes), cmd!("path.ungroupShapes", "Ungroup Shapes", ["Layer"], Some("Cmd+Shift+G"), "{layer?, items?: [group uid]}", has_shape_items, ungroup_shapes), cmd!( diff --git a/crates/engine/src/tests/stubs.rs b/crates/engine/src/tests/stubs.rs index 6f89f4f62..58fb21777 100644 --- a/crates/engine/src/tests/stubs.rs +++ b/crates/engine/src/tests/stubs.rs @@ -649,6 +649,432 @@ fn convert_to_bezier_evaluates_corner_expressions() { assert_eq!(path, expected, "the expression-evaluated corner is converted"); } +/// The uid of the first shape item with `match_id` in a shape layer's Contents. +fn shape_item(s: &Session, l: u64, match_id: &str) -> u64 { + /// Depth-first search of a property group tree for the uid of the first group with the given match id. + fn walk(g: &effectcraft_project::PropGroup, id: &str) -> Option { + if g.match_id == id { + return Some(g.uid); + } + g.groups().find_map(|c| walk(c, id)) + } + let ly = layer(s, l); + let contents = ly.props.sub("contents").unwrap(); + contents.groups().find_map(|c| walk(c, match_id)).unwrap() +} + +/// #3057: right after drawing with the Rectangle, Ellipse or Polygon tool only the layer is +/// selected; Convert To Bezier Path then converted nothing and reported "no masks". The selected +/// shape layer's parametric paths convert, as the masks of a selected layer do, and so do those in +/// a selected shape group (Rectangle 1 rather than its Rectangle Path 1). +#[test] +fn convert_to_bezier_on_a_selected_shape_layer_or_group() { + for kind in ["rect", "ellipse", "polygon"] { + let mut s = comp(); + let l = s.execute("layer.newShape", json!({"kind": kind, "size": [120, 80]})).unwrap()["layer"].as_u64().unwrap(); + assert_eq!(s.state.selected_layers, vec![LayerId(l)], "the new layer is selected"); + assert!(s.state.selected_props.is_empty(), "and no shape item"); + let out = s.execute("path.convertToBezier", json!({})).unwrap(); + assert_eq!(out["paths"].as_u64(), Some(1), "{kind}: {out}"); + let (new_uid, now) = first_shape(&s, l); + assert_eq!(now, "path", "{kind}: the layer's parametric path is a bezier path now"); + assert_eq!(s.state.selected_props, vec![(LayerId(l), new_uid)], "{kind}: and selected, to edit its vertices"); + } + + // A selected shape group converts the parametric path inside it. + let mut s = comp(); + let l = s.execute("layer.newShape", json!({"kind": "rect", "size": [120, 80]})).unwrap()["layer"].as_u64().unwrap(); + let group = shape_item(&s, l, "group"); + s.state.selected_props = vec![(LayerId(l), group)]; + let out = s.execute("path.convertToBezier", json!({})).unwrap(); + assert_eq!(out["paths"].as_u64(), Some(1), "{out}"); + assert_eq!(first_shape(&s, l).1, "path"); + + // Nothing parametric left: the error says what to select instead of asking for masks. + s.execute("layer.select", json!({"layers": [l]})).unwrap(); + let err = s.execute("path.convertToBezier", json!({})).unwrap_err().to_string(); + assert!(err.contains("Rectangle, Ellipse or Polystar"), "{err}"); +} + +/// #3057: a selected shape item with nothing parametric in it (a Fill) does not widen the +/// conversion to the rest of the layer. A guard for the fix (it passes on the old code too). +#[test] +fn convert_to_bezier_does_not_widen_a_selected_fill() { + let mut s = comp(); + let l = s.execute("layer.newShape", json!({"kind": "rect", "size": [120, 80], "fill": "#ff0000"})).unwrap()["layer"].as_u64().unwrap(); + let fill = shape_item(&s, l, "fill"); + s.state.selected_props = vec![(LayerId(l), fill)]; + assert!(s.execute("path.convertToBezier", json!({})).is_err()); + assert_eq!(first_shape(&s, l).1, "rect", "the rectangle stays parametric"); +} + +/// #3057: a selected shape layer's plain masks are already Bezier paths, so they don't hide its +/// rectangle: the rectangle converts. A RotoBezier mask still converts first. +#[test] +fn convert_to_bezier_on_a_shape_layer_with_a_plain_mask() { + let mut s = comp(); + let l = s.execute("layer.newShape", json!({"kind": "rect", "size": [120, 80]})).unwrap()["layer"].as_u64().unwrap(); + s.execute("mask.new", json!({"layer": l, "vertices": [[0, 0], [50, 0], [50, 50], [0, 50]], "closed": true})).unwrap(); + s.execute("layer.select", json!({"layers": [l]})).unwrap(); + s.state.selected_vertices.clear(); + let out = s.execute("path.convertToBezier", json!({})).unwrap(); + assert_eq!(out["paths"].as_u64(), Some(1), "{out}"); + assert_eq!(first_shape(&s, l).1, "path"); + + // Nothing parametric left and the mask is plain: say so rather than succeed doing nothing. + s.execute("layer.select", json!({"layers": [l]})).unwrap(); + s.state.selected_vertices.clear(); + let err = s.execute("path.convertToBezier", json!({})).unwrap_err().to_string(); + assert!(err.contains("already Bezier"), "{err}"); +} + +/// #3057: an explicit `mask` that matches no mask converts nothing, rather than every parametric +/// path of the layer. +#[test] +fn convert_to_bezier_with_an_unmatched_mask_converts_nothing() { + let mut s = comp(); + let l = s.execute("layer.newShape", json!({"kind": "rect", "size": [120, 80]})).unwrap()["layer"].as_u64().unwrap(); + assert!(s.execute("path.convertToBezier", json!({"layer": l, "mask": "No Such Mask"})).is_err()); + assert_eq!(first_shape(&s, l).1, "rect", "the rectangle stays parametric"); +} + +/// #3057: an explicit `layer` is the layer converted, even with a path selected on another one. +#[test] +fn convert_to_bezier_follows_an_explicit_layer() { + let mut s = comp(); + let a = s.execute("layer.newShape", json!({"kind": "rect", "size": [120, 80]})).unwrap()["layer"].as_u64().unwrap(); + let b = s.execute("layer.newShape", json!({"kind": "ellipse", "size": [120, 80]})).unwrap()["layer"].as_u64().unwrap(); + let (a_rect, _) = first_shape(&s, a); + s.state.selected_props = vec![(LayerId(a), a_rect)]; + let out = s.execute("path.convertToBezier", json!({"layer": b})).unwrap(); + assert_eq!(out["paths"].as_u64(), Some(1), "{out}"); + assert_eq!(first_shape(&s, b).1, "path", "the given layer converts"); + assert_eq!(first_shape(&s, a).1, "rect", "the selection on another layer does not"); +} + +/// #3057: converting a selected layer leaves an animated parametric path alone (its animation +/// would be lost) and reports it; selecting that path converts it at the current time, as After +/// Effects does. +#[test] +fn convert_to_bezier_skips_animated_paths_of_a_selected_layer() { + let mut s = comp(); + let l = s.execute("layer.newShape", json!({"kind": "rect", "size": [120, 80]})).unwrap()["layer"].as_u64().unwrap(); + let (rect, _) = first_shape(&s, l); + let size = layer(&s, l).props.sub("contents").unwrap().find_group(rect).unwrap().get("size").unwrap().uid; + for (t, v) in [(0.0, [120.0, 80.0]), (1.0, [200.0, 100.0])] { + s.execute("prop.addKey", json!({"layer": l, "path": format!("@{size}"), "time": t, "value": v})).unwrap(); + } + s.execute("layer.select", json!({"layers": [l]})).unwrap(); + let err = s.execute("path.convertToBezier", json!({})).unwrap_err().to_string(); + assert!(err.contains("animated"), "{err}"); + assert_eq!(first_shape(&s, l).1, "rect", "the animated rectangle stays parametric"); + + s.state.selected_props = vec![(LayerId(l), rect)]; + let out = s.execute("path.convertToBezier", json!({})).unwrap(); + assert_eq!(out["paths"].as_u64(), Some(1), "{out}"); + assert_eq!(first_shape(&s, l).1, "path", "the selected path converts"); +} + +/// #3057 review: a layer named twice in `layers` (by id and by name) converts once, and its +/// animated paths are counted once. +#[test] +fn convert_to_bezier_with_a_layer_named_twice() { + let mut s = comp(); + let l = s.execute("layer.newShape", json!({"kind": "rect", "size": [120, 80]})).unwrap()["layer"].as_u64().unwrap(); + let name = layer(&s, l).name; + let out = s.execute("path.convertToBezier", json!({"layers": [l, name, l]})).unwrap(); + assert_eq!(out["paths"].as_u64(), Some(1), "{out}"); + assert_eq!(out["of"].as_u64(), Some(1), "{out}"); + assert_eq!(first_shape(&s, l).1, "path"); + + let mut s = comp(); + let a = s.execute("layer.newShape", json!({"kind": "rect", "size": [120, 80]})).unwrap()["layer"].as_u64().unwrap(); + let b = s.execute("layer.newShape", json!({"kind": "ellipse", "size": [120, 80]})).unwrap()["layer"].as_u64().unwrap(); + let (rect, _) = first_shape(&s, a); + let size = layer(&s, a).props.sub("contents").unwrap().find_group(rect).unwrap().get("size").unwrap().uid; + for (t, v) in [(0.0, [120.0, 80.0]), (1.0, [200.0, 100.0])] { + s.execute("prop.addKey", json!({"layer": a, "path": format!("@{size}"), "time": t, "value": v})).unwrap(); + } + s.execute("layer.select", json!({"layers": [b]})).unwrap(); + let out = s.execute("path.convertToBezier", json!({"layers": [a, a, b]})).unwrap(); + assert_eq!(out["paths"].as_u64(), Some(1), "{out}"); + assert_eq!(out["skippedAnimated"].as_u64(), Some(1), "{out}"); +} + +/// #3057 review: shape items on a locked layer don't convert, whether given as `items` or +/// selected; unlocked, they do. +#[test] +fn convert_to_bezier_leaves_a_locked_layer_alone() { + for explicit in [true, false] { + let mut s = comp(); + let l = s.execute("layer.newShape", json!({"kind": "rect", "size": [120, 80]})).unwrap()["layer"].as_u64().unwrap(); + let (rect, _) = first_shape(&s, l); + let lock = |s: &mut Session, v: bool| { + s.execute("layer.setSwitch", json!({"layers": [l], "switch": "locked", "value": v})).unwrap(); + }; + let run = |s: &mut Session| { + if explicit { + s.execute("path.convertToBezier", json!({"layer": l, "items": [rect]})) + } else { + s.state.selected_props = vec![(LayerId(l), rect)]; + s.execute("path.convertToBezier", json!({})) + } + }; + lock(&mut s, true); + let err = run(&mut s).unwrap_err().to_string(); + assert!(err.contains("locked"), "explicit {explicit}: {err}"); + assert_eq!(first_shape(&s, l).1, "rect", "explicit {explicit}: the locked rectangle stays parametric"); + lock(&mut s, false); + let out = run(&mut s).unwrap(); + assert_eq!(out["paths"].as_u64(), Some(1), "explicit {explicit}: {out}"); + assert_eq!(first_shape(&s, l).1, "path"); + } +} + +/// #3057 review: a selected group leaves its animated paths alone and reports them, as +/// converting a whole layer does; the path itself, selected, still converts. +#[test] +fn convert_to_bezier_skips_animated_paths_of_a_selected_group() { + let mut s = comp(); + let l = s.execute("layer.newShape", json!({"kind": "rect", "size": [120, 80]})).unwrap()["layer"].as_u64().unwrap(); + let (rect, _) = first_shape(&s, l); + let group = shape_item(&s, l, "group"); + let size = layer(&s, l).props.sub("contents").unwrap().find_group(rect).unwrap().get("size").unwrap().uid; + s.execute("prop.setExpression", json!({"layer": l, "path": format!("@{size}"), "expression": "[100, 100]"})).unwrap(); + + s.state.selected_props = vec![(LayerId(l), group)]; + let err = s.execute("path.convertToBezier", json!({})).unwrap_err().to_string(); + assert!(err.contains("animated"), "{err}"); + assert_eq!(first_shape(&s, l).1, "rect", "the expression-driven rectangle stays parametric"); + + // The group and its path both selected: the path is converted, not skipped. + s.state.selected_props = vec![(LayerId(l), group), (LayerId(l), rect)]; + let out = s.execute("path.convertToBezier", json!({})).unwrap(); + assert_eq!(out["paths"].as_u64(), Some(1), "{out}"); + assert_eq!(out["skippedAnimated"].as_u64(), Some(0), "{out}"); + assert_eq!(first_shape(&s, l).1, "path"); +} + +/// #3057 review: an explicit `mask` is what converts, even with a parametric path selected or +/// `items` given; a `mask` that matches nothing is an error and converts no shape. +#[test] +fn convert_to_bezier_gives_an_explicit_mask_priority() { + // A shape layer with a rectangle and a RotoBezier mask; the rectangle's path is selected. + let setup = || { + let mut s = comp(); + let l = s.execute("layer.newShape", json!({"kind": "rect", "size": [120, 80]})).unwrap()["layer"].as_u64().unwrap(); + s.execute("mask.new", json!({"layer": l, "vertices": [[0, 0], [50, 0], [50, 50], [0, 50]], "closed": true})).unwrap(); + let m = layer(&s, l).masks().unwrap().groups().next().unwrap().uid; + s.execute("path.rotoBezier", json!({"layer": l, "mask": m, "value": true})).unwrap(); + let (rect, _) = first_shape(&s, l); + s.state.selected_props = vec![(LayerId(l), rect)]; + (s, l, m, rect) + }; + + // A matching mask converts, not the selected rectangle. + let (mut s, l, m, _) = setup(); + s.execute("path.convertToBezier", json!({"layer": l, "mask": m})).unwrap(); + assert!(matches!(mask_kind(&s, l), GroupKind::Mask { roto_bezier: false, .. }), "the mask converts"); + assert_eq!(first_shape(&s, l).1, "rect", "the selected rectangle stays parametric"); + + // An unmatched mask is an error, and the selected rectangle is not converted in its place. + let (mut s, l, _, _) = setup(); + let err = s.execute("path.convertToBezier", json!({"layer": l, "mask": "No Such Mask"})).unwrap_err().to_string(); + assert!(err.contains("mask"), "{err}"); + assert_eq!(first_shape(&s, l).1, "rect"); + assert!(matches!(mask_kind(&s, l), GroupKind::Mask { roto_bezier: true, .. })); + + // `mask` and `items` together: the mask converts, the items don't. + let (mut s, l, m, rect) = setup(); + s.state.selected_props.clear(); + s.execute("path.convertToBezier", json!({"layer": l, "mask": m, "items": [rect]})).unwrap(); + assert!(matches!(mask_kind(&s, l), GroupKind::Mask { roto_bezier: false, .. }), "the mask converts"); + assert_eq!(first_shape(&s, l).1, "rect", "the listed rectangle stays parametric"); +} + +/// #3057 review: a selected mask and a selected parametric path both convert, in one undo step; +/// neither is dropped for the other. +#[test] +fn convert_to_bezier_converts_a_selected_mask_and_path_together() { + let mut s = comp(); + let l = s.execute("layer.newShape", json!({"kind": "rect", "size": [120, 80]})).unwrap()["layer"].as_u64().unwrap(); + s.execute("mask.new", json!({"layer": l, "vertices": [[0, 0], [50, 0], [50, 50], [0, 50]], "closed": true})).unwrap(); + let m = layer(&s, l).masks().unwrap().groups().next().unwrap().uid; + s.execute("path.rotoBezier", json!({"layer": l, "mask": m, "value": true})).unwrap(); + let (rect, _) = first_shape(&s, l); + s.state.selected_vertices.clear(); + s.state.selected_props = vec![(LayerId(l), m), (LayerId(l), rect)]; + + let out = s.execute("path.convertToBezier", json!({})).unwrap(); + assert_eq!(out["paths"].as_u64(), Some(1), "{out}"); + assert_eq!(out["masks"].as_u64(), Some(1), "{out}"); + assert_eq!(first_shape(&s, l).1, "path", "the rectangle converts"); + assert!(matches!(mask_kind(&s, l), GroupKind::Mask { roto_bezier: false, .. }), "and so does the mask"); + + s.execute("edit.undo", json!({})).unwrap(); + assert_eq!(first_shape(&s, l).1, "rect", "one undo restores the rectangle"); + assert!(matches!(mask_kind(&s, l), GroupKind::Mask { roto_bezier: true, .. }), "and the mask"); +} + +/// #3057 review: explicit `items` convert only those shape paths; a RotoBezier mask that happens to +/// be selected on the same layer is not converted along with them. +#[test] +fn convert_to_bezier_with_explicit_items_leaves_a_selected_mask_alone() { + let mut s = comp(); + let l = s.execute("layer.newShape", json!({"kind": "rect", "size": [120, 80]})).unwrap()["layer"].as_u64().unwrap(); + s.execute("mask.new", json!({"layer": l, "vertices": [[0, 0], [50, 0], [50, 50], [0, 50]], "closed": true})).unwrap(); + let m = layer(&s, l).masks().unwrap().groups().next().unwrap().uid; + s.execute("path.rotoBezier", json!({"layer": l, "mask": m, "value": true})).unwrap(); + let (rect, _) = first_shape(&s, l); + s.state.selected_vertices.clear(); + s.state.selected_props = vec![(LayerId(l), m)]; + let out = s.execute("path.convertToBezier", json!({"layer": l, "items": [rect]})).unwrap(); + assert_eq!(out["paths"].as_u64(), Some(1), "{out}"); + assert!(out.get("masks").is_none_or(|v| v.as_u64().unwrap_or(0) == 0), "{out}"); + assert_eq!(first_shape(&s, l).1, "path", "the listed rectangle converts"); + assert!(matches!(mask_kind(&s, l), GroupKind::Mask { roto_bezier: true, .. }), "the selected mask is unchanged"); +} + +/// #3057 review: explicit `items` with nothing parametric in them (a Fill, a path that is already +/// Bezier) are an error and change nothing: neither a selected RotoBezier mask nor, with no mask +/// selected, the layer's own RotoBezier masks are converted in their place. +#[test] +fn convert_to_bezier_with_explicit_non_parametric_items_converts_no_mask() { + for item in ["fill", "path"] { + for mask_selected in [true, false] { + let mut s = comp(); + let l = s.execute("layer.newShape", json!({"kind": "rect", "size": [120, 80], "fill": "#ff0000"})).unwrap()["layer"].as_u64().unwrap(); + s.execute("mask.new", json!({"layer": l, "vertices": [[0, 0], [50, 0], [50, 50], [0, 50]], "closed": true})).unwrap(); + let m = layer(&s, l).masks().unwrap().groups().next().unwrap().uid; + s.execute("path.rotoBezier", json!({"layer": l, "mask": m, "value": true})).unwrap(); + let (rect, _) = first_shape(&s, l); + s.state.selected_vertices.clear(); + s.state.selected_props.clear(); + // An already-Bezier path: the rectangle converted first, the mask left as it is. + if item == "path" { + s.execute("path.convertToBezier", json!({"layer": l, "items": [rect]})).unwrap(); + assert!(matches!(mask_kind(&s, l), GroupKind::Mask { roto_bezier: true, .. })); + } + let uid = shape_item(&s, l, item); + s.state.selected_vertices.clear(); + s.state.selected_props = if mask_selected { vec![(LayerId(l), m)] } else { Vec::new() }; + let before = layer(&s, l).props; + + let err = s.execute("path.convertToBezier", json!({"layer": l, "items": [uid]})).unwrap_err().to_string(); + assert!(err.contains("Rectangle, Ellipse or Polystar"), "{item}, mask selected {mask_selected}: {err}"); + assert!(matches!(mask_kind(&s, l), GroupKind::Mask { roto_bezier: true, .. }), "{item}, mask selected {mask_selected}: the mask is unchanged"); + assert!(layer(&s, l).props == before, "{item}, mask selected {mask_selected}: no shape or mask changed"); + } + } +} + +/// #3057 review: an explicit `layer` scopes the mask conversion too: a RotoBezier mask selected +/// on another layer is left alone, and the given layer's masks convert. +#[test] +fn convert_to_bezier_keeps_masks_to_an_explicit_layer() { + let mut s = comp(); + let (a, _) = masked(&mut s); + let (b, mb) = masked(&mut s); + for l in [a, b] { + s.state.selected_props.clear(); + s.state.selected_vertices.clear(); + s.execute("path.rotoBezier", json!({"layer": l, "value": true})).unwrap(); + } + assert!(matches!(mask_kind(&s, a), GroupKind::Mask { roto_bezier: true, .. })); + assert!(matches!(mask_kind(&s, b), GroupKind::Mask { roto_bezier: true, .. })); + s.state.selected_vertices.clear(); + s.state.selected_props = vec![(LayerId(b), mb)]; + + let out = s.execute("path.convertToBezier", json!({"layer": a})).unwrap(); + assert_eq!(out["masks"].as_u64(), Some(1), "{out}"); + assert!(matches!(mask_kind(&s, a), GroupKind::Mask { roto_bezier: false, .. }), "the given layer's mask converts"); + assert!(matches!(mask_kind(&s, b), GroupKind::Mask { roto_bezier: true, .. }), "the mask selected on another layer does not"); +} + +/// #3057 review: a RotoBezier mask on a locked layer stays as it is, given as the layer or +/// selected, and removing it as a target does not hand the conversion to another layer's mask. +#[test] +fn convert_to_bezier_leaves_a_locked_layers_masks_alone() { + let mut s = comp(); + let (a, ma) = masked(&mut s); + let (b, _) = masked(&mut s); + for l in [a, b] { + s.state.selected_props.clear(); + s.state.selected_vertices.clear(); + s.execute("path.rotoBezier", json!({"layer": l, "value": true})).unwrap(); + } + s.execute("layer.setSwitch", json!({"layers": [a], "switch": "locked", "value": true})).unwrap(); + let roto = |s: &Session, l: u64| matches!(mask_kind(s, l), GroupKind::Mask { roto_bezier: true, .. }); + + // The locked layer given explicitly. + s.state.selected_props.clear(); + s.state.selected_vertices.clear(); + let err = s.execute("path.convertToBezier", json!({"layer": a})).unwrap_err().to_string(); + assert!(err.contains("locked"), "{err}"); + assert!(roto(&s, a), "the locked layer's mask stays RotoBezier"); + + // Its mask selected, with the unlocked layer in scope too: B's mask is not converted instead. + s.state.selected_props = vec![(LayerId(a), ma)]; + let err = s.execute("path.convertToBezier", json!({"layers": [a, b]})).unwrap_err().to_string(); + assert!(err.contains("locked"), "{err}"); + assert!(roto(&s, a) && roto(&s, b), "neither mask converts"); +} + +/// #3057 review: an explicit `comp` that is not the active composition is where `items` and +/// `mask` are looked up and converted. +#[test] +fn convert_to_bezier_in_a_composition_that_is_not_active() { + let mut s = comp(); + let main = s.active_comp_id().unwrap(); + let l = s.execute("layer.newShape", json!({"kind": "rect", "size": [120, 80]})).unwrap()["layer"].as_u64().unwrap(); + let (rect, _) = first_shape(&s, l); + let (solid, m) = masked(&mut s); + s.state.selected_props.clear(); + s.state.selected_vertices.clear(); + s.execute("path.rotoBezier", json!({"layer": solid, "value": true})).unwrap(); + s.execute("comp.new", json!({"name": "Other", "width": 400, "height": 300, "frameRate": 30, "duration": 4})).unwrap(); + assert_ne!(s.active_comp_id(), Some(main), "another composition is active"); + let in_main = |s: &Session| s.project.comp(main).unwrap().clone(); + let main_mask_roto = |s: &Session| { + let c = in_main(s); + matches!(c.layer(LayerId(solid)).unwrap().masks().unwrap().find_group(m).unwrap().kind, GroupKind::Mask { roto_bezier: true, .. }) + }; + + // Explicit shape items. + let out = s.execute("path.convertToBezier", json!({"comp": main.0, "layer": l, "items": [rect]})).unwrap(); + assert_eq!(out["paths"].as_u64(), Some(1), "{out}"); + let c = in_main(&s); + let contents = c.layer(LayerId(l)).unwrap().props.sub("contents").unwrap(); + assert!(contents.find_group(rect).is_none(), "the rectangle is replaced in that composition"); + + // An explicit mask. + assert!(main_mask_roto(&s)); + s.execute("path.convertToBezier", json!({"comp": main.0, "layer": solid, "mask": m})).unwrap(); + assert!(!main_mask_roto(&s), "the mask converts in that composition"); +} + +/// #3057: parametric paths in nested groups convert from the layer and from the outer group. +#[test] +fn convert_to_bezier_finds_paths_in_nested_groups() { + for select_outer in [false, true] { + let mut s = comp(); + let l = s.execute("layer.newShape", json!({"kind": "star", "size": [120, 120]})).unwrap()["layer"].as_u64().unwrap(); + let inner = shape_item(&s, l, "group"); + s.state.selected_props = vec![(LayerId(l), inner)]; + s.execute("path.groupShapes", json!({})).unwrap(); + let outer = shape_item(&s, l, "group"); + assert_ne!(outer, inner, "the shape is nested one group deeper"); + if select_outer { + s.state.selected_props = vec![(LayerId(l), outer)]; + } else { + s.execute("layer.select", json!({"layers": [l]})).unwrap(); + } + let out = s.execute("path.convertToBezier", json!({})).unwrap(); + assert_eq!(out["paths"].as_u64(), Some(1), "{out}"); + assert_eq!(first_shape(&s, l).1, "path"); + } +} + /// #2201: a viewer drag on the free-transform box sends one `path.freeTransform` per frame with a /// shared merge key; one undo must revert the whole drag, not the last frame. #[test] From 268b982ade27845dadf717a533c54e5f48130702 Mon Sep 17 00:00:00 2001 From: Terra854 Date: Mon, 23 Nov 2026 04:36:11 +0800 Subject: [PATCH 391/451] media: honor delayed PCM starts in shared AVI (#4071) --- crates/media/src/craft_source.rs | 43 +++++++++-- .../media/src/craft_source/raw_avi_tests.rs | 74 +++++++++++++++++++ 2 files changed, 111 insertions(+), 6 deletions(-) diff --git a/crates/media/src/craft_source.rs b/crates/media/src/craft_source.rs index 8a1363194..fe4063b46 100644 --- a/crates/media/src/craft_source.rs +++ b/crates/media/src/craft_source.rs @@ -599,7 +599,7 @@ fn compute_audio_starts(container: &ContainerFile, track_idx: usize, codec: Code let den = i128::from(s.rate.max(1)); let scale = i128::from(s.scale.max(1)); if s.sample_size > 0 { - let mut acc = 0i64; + let mut acc = delayed_avi_pcm_start(s).map_or(0, |(start, _)| start); return AudioStarts::complete( s.chunks .iter() @@ -1390,6 +1390,33 @@ fn default_video_info(width: u32, height: u32, frame_rate: FrameRate, codec: &Co } } +/// A byte-timed PCM stream uses one indexed unit per interleaved sample frame. +/// Convert its stream-clock start to native samples before counting those units. +fn delayed_avi_pcm_start(stream: &avi::Stream) -> Option<(i64, u32)> { + if stream.start == 0 || stream.scale == 0 || stream.rate == 0 { + return None; + } + let wave = stream.audio.as_ref()?; + if !matches!((wave.format_tag, wave.bits_per_sample), (1, 8 | 16 | 24 | 32) | (3, 32 | 64)) { + return None; + } + let (sample_rate, channels) = filmcraft_media::bounded_audio_dimensions(wave.sample_rate, u32::from(wave.channels)).ok()?; + let packed = u32::from(wave.bits_per_sample.div_ceil(8)) * channels; + // The shared decoder consumes packed PCM. Keep the prior route when the + // indexed sample size or block padding implies a different packet clock. + if stream.sample_size != packed || u32::from(wave.block_align) > packed { + return None; + } + let start = i128::from(stream.start) * i128::from(stream.scale) * i128::from(sample_rate) / i128::from(stream.rate); + Some((i64::try_from(start).ok()?, sample_rate)) +} + +fn delayed_avi_pcm_end(stream: &avi::Stream) -> Option { + let (start, sample_rate) = delayed_avi_pcm_start(stream)?; + let end = stream.chunks.iter().fold(start, |frames, chunk| frames.saturating_add(i64::from(chunk.size / stream.sample_size))); + Some(Tick::from_units(end, i64::from(sample_rate))) +} + fn open_avi(name: &str, source: SharedBytes) -> Option> { let file = avi::open(&*source).ok()?; let video_idx = file.streams.iter().position(|s| s.kind == avi::StreamKind::Video && !s.chunks.is_empty() && s.rate > 0 && s.scale > 0); @@ -1404,22 +1431,25 @@ fn open_avi(name: &str, source: SharedBytes) -> Option> { if video_idx.is_none() && audio_candidates.is_empty() { return None; } + let delayed_audio_end = audio_candidates.iter().filter_map(|&(idx, _, _, _)| delayed_avi_pcm_end(&file.streams[idx])).max().unwrap_or(Tick::ZERO); if let Some(idx) = video_idx && let Some(raw) = RawAvi::new(&file.streams[idx]) { - // Shared AVI audio positions are relative to the first chunk. Keep the - // legacy path for a track with a separate stream start. - if audio_candidates.iter().any(|&(audio, _, _, _)| file.streams[audio].start != 0) { + if audio_candidates.iter().any(|&(audio, _, _, _)| { + let stream = &file.streams[audio]; + stream.start != 0 && delayed_avi_pcm_start(stream).is_none() + }) { return None; } let duration = audio_candidates .iter() + .filter(|&&(audio, _, _, _)| file.streams[audio].start == 0) .map(|&(audio, _, _, _)| { let s = &file.streams[audio]; Tick::from_units(i64::from(s.length).saturating_mul(i64::from(s.scale.max(1))), i64::from(s.rate.max(1))) }) - .fold(raw.duration(file.streams[idx].chunks.len()), Tick::max); + .fold(raw.duration(file.streams[idx].chunks.len()).max(delayed_audio_end), Tick::max); let video = ContainerVideoPart { track_idx: idx, info: raw.info(&file.streams[idx]), state: Mutex::new(VideoState::RawAvi(raw)) }; return finish_container_source(name, "avi", source, ContainerFile::Avi(Box::new(file)), Some(video), duration, audio_candidates); } @@ -1453,6 +1483,7 @@ fn open_avi(name: &str, source: SharedBytes) -> Option> { } else { let duration = audio_candidates .iter() + .filter(|&&(idx, _, _, _)| delayed_avi_pcm_start(&file.streams[idx]).is_none()) .map(|(idx, _, params, _)| { let s = &file.streams[*idx]; let units = if params.codec == CodecId::Pcm && s.sample_size > 0 { @@ -1468,7 +1499,7 @@ fn open_avi(name: &str, source: SharedBytes) -> Option> { (None, duration) }; - finish_container_source(name, "avi", source, ContainerFile::Avi(Box::new(file)), video, duration, audio_candidates) + finish_container_source(name, "avi", source, ContainerFile::Avi(Box::new(file)), video, duration.max(delayed_audio_end), audio_candidates) } fn estimate_mpeg_frame_rate_pts(pts: impl IntoIterator) -> FrameRate { diff --git a/crates/media/src/craft_source/raw_avi_tests.rs b/crates/media/src/craft_source/raw_avi_tests.rs index 96ce62454..1dc67aead 100644 --- a/crates/media/src/craft_source/raw_avi_tests.rs +++ b/crates/media/src/craft_source/raw_avi_tests.rs @@ -97,3 +97,77 @@ fn raw_rgb_avi_with_dropped_slot_keeps_legacy_playback() -> Result<(), Box Result { + bytes.windows(12).position(|window| &window[..4] == b"strh" && &window[8..] == b"auds").map(|offset| offset + 8).ok_or("AVI audio stream header") +} + +#[test] +fn delayed_avi_pcm_keeps_raw_rgb_and_reports_the_later_audio_end() -> Result<(), Box> { + let mut bytes = fixture(24, true, false)?; + let at = audio_header(&bytes)?; + let delay = AUDIO_PER_FRAME as u32 + 13; + bytes[at + 28..at + 32].copy_from_slice(&delay.to_le_bytes()); // dwStart + bytes[at + 32..at + 36].copy_from_slice(&1u32.to_le_bytes()); // stale dwLength + + let bytes: Arc<[u8]> = bytes.into(); + let dir = tempfile::tempdir()?; + let path = dir.path().join("delayed-rgb.avi"); + std::fs::write(&path, &bytes)?; + let end = Tick::from_units(i64::from(delay) + 3 * AUDIO_PER_FRAME as i64, i64::from(AUDIO_RATE)); + for info in [crate::probe::probe(&path)?, crate::probe::probe_bytes("delayed-rgb.avi", bytes.clone())?] { + assert_eq!(info.duration.0, end.0); + assert!(info.has_audio && info.has_video); + } + let disk = stream::open_source(&path).ok_or("unrecognized AVI")?.0?; + let memory = stream::open_bytes("delayed-rgb.avi", bytes)?; + for opened in [disk, memory] { + let MediaSource::Craft(source) = opened else { panic!("delayed fixed-size PCM should stay on the shared RGB route") }; + let frame = source.video_frame(FrameRequest { time: Tick::from_units(1, i64::from(FPS)), scale: 1.0 })?; + let PixelData::Rgba8(pixels) = &frame.data else { panic!("expected RGBA picture") }; + assert_eq!(&pixels[..4], &rgba(1, 0, 0)); + + let delay = i64::from(delay); + let after = source.audio(delay + AUDIO_PER_FRAME as i64, 2, AUDIO_RATE)?; + assert_eq!(after.channels[0], [2000.0 / 32768.0; 2]); + let first = source.audio(delay - 2, 4, AUDIO_RATE)?; + assert_eq!(first.channels[0], [0.0, 0.0, 1000.0 / 32768.0, 1000.0 / 32768.0]); + } + Ok(()) +} + +#[test] +fn delayed_avi_pcm_audio_only_uses_the_stream_clock_and_indexed_samples() -> Result<(), Box> { + let audio = avi::StreamSpec::Audio(avi::AudioSpec::pcm(AUDIO_RATE, 1, 16)); + let mut writer = avi::AviWriter::new(Cursor::new(Vec::new()), vec![audio], avi::MuxOptions::default())?; + writer.write_chunk(0, &8192i16.to_le_bytes().repeat(5), true)?; + writer.write_chunk(0, &16384i16.to_le_bytes().repeat(9), true)?; + let mut bytes = writer.finish()?.into_inner(); + let at = audio_header(&bytes)?; + // This stream clock places dwStart at 4.8 native samples, truncated to 4. + bytes[at + 20..at + 24].copy_from_slice(&1u32.to_le_bytes()); + bytes[at + 24..at + 28].copy_from_slice(&5000u32.to_le_bytes()); + bytes[at + 28..at + 32].copy_from_slice(&3u32.to_le_bytes()); + bytes[at + 32..at + 36].copy_from_slice(&200u32.to_le_bytes()); + + let bytes: Arc<[u8]> = bytes.into(); + let opened = stream::open_bytes("delayed-pcm.avi", bytes.clone())?; + let MediaSource::Craft(source) = opened else { panic!("expected shared PCM reader") }; + assert_eq!(source.audio(0, 6, AUDIO_RATE)?.channels[0], [0.0, 0.0, 0.0, 0.0, 0.25, 0.25]); + assert_eq!(source.audio(17, 2, AUDIO_RATE)?.channels[0], [0.5, 0.0]); + let info = crate::probe::probe_bytes("delayed-pcm.avi", bytes)?; + assert_eq!(info.duration.0, Tick::from_units(18, i64::from(AUDIO_RATE)).0); + Ok(()) +} + +#[test] +fn delayed_avi_pcm_with_conflicting_block_size_keeps_legacy_rgb_route() -> Result<(), Box> { + let mut bytes = fixture(24, true, false)?; + let at = audio_header(&bytes)?; + bytes[at + 28..at + 32].copy_from_slice(&16u32.to_le_bytes()); + bytes[at + 44..at + 48].copy_from_slice(&1u32.to_le_bytes()); // dwSampleSize + let opened = stream::open_bytes("delayed-pcm-block.avi", bytes.into())?; + let MediaSource::Film(source) = opened else { panic!("expected legacy PCM block alignment") }; + assert_eq!(source.audio(15, 2, AUDIO_RATE)?.channels[0], [0.0, 1000.0 / 32768.0]); + Ok(()) +} From 7e2d0256209974ffb92a29d8bdb6f2a49078f51f Mon Sep 17 00:00:00 2001 From: Terra854 Date: Mon, 23 Nov 2026 04:58:13 +0800 Subject: [PATCH 392/451] media: cover generated Motion JPEG AVI and PCM (#4069) Co-authored-by: FredApps <153173854+FredApps@users.noreply.github.com> --- crates/media/tests/it/avi_mjpeg.rs | 67 ++++++++++++++++++++++++++++++ crates/media/tests/it/main.rs | 1 + 2 files changed, 68 insertions(+) create mode 100644 crates/media/tests/it/avi_mjpeg.rs diff --git a/crates/media/tests/it/avi_mjpeg.rs b/crates/media/tests/it/avi_mjpeg.rs new file mode 100644 index 000000000..aa25fa454 --- /dev/null +++ b/crates/media/tests/it/avi_mjpeg.rs @@ -0,0 +1,67 @@ +use std::io::Cursor; +use std::sync::Arc; + +use craft_media::avi::{AudioSpec, AviWriter, MuxOptions, StreamSpec, VideoSpec}; +use effectcraft_media::{MediaPool, probe, probe_bytes}; +use effectcraft_project::FootageKind; +use effectcraft_time::{FrameRate, Tick}; +use image::{ExtendedColorType, codecs::jpeg::JpegEncoder}; + +const SIDE: u32 = 16; +const FPS: u32 = 25; +const SAMPLE_RATE: u32 = 48_000; + +fn mjpeg_with_pcm() -> Arc<[u8]> { + let video = StreamSpec::Video(VideoSpec::new(*b"MJPG", SIDE, SIDE, FPS, 1)); + let audio = StreamSpec::Audio(AudioSpec::pcm(SAMPLE_RATE, 1, 16)); + let mut writer = AviWriter::new(Cursor::new(Vec::new()), vec![video, audio], MuxOptions::default()).expect("AVI writer"); + let samples_per_frame = (SAMPLE_RATE / FPS) as usize; + for (color, sample) in [([220_u8, 40, 30], 8_192_i16), ([30, 40, 220], -8_192)] { + let pixels = color.repeat((SIDE * SIDE) as usize); + let mut jpeg = Vec::new(); + JpegEncoder::new_with_quality(&mut jpeg, 90).encode(&pixels, SIDE, SIDE, ExtendedColorType::Rgb8).expect("JPEG picture"); + writer.write_chunk(0, &jpeg, true).expect("video chunk"); + + let pcm = sample.to_le_bytes().repeat(samples_per_frame); + writer.write_chunk(1, &pcm, true).expect("matching audio chunk"); + } + writer.finish().expect("finish AVI").into_inner().into() +} + +#[test] +fn generated_mjpeg_avi_preserves_video_seek_and_pcm_alignment() { + let bytes = mjpeg_with_pcm(); + let directory = tempfile::tempdir().expect("temporary directory"); + let path = directory.path().join("native-mjpeg.avi"); + std::fs::write(&path, &bytes).expect("write AVI"); + let native = probe(&path).expect("native AVI probe"); + let name = "in-memory-mjpeg.avi"; + let memory = probe_bytes(name, bytes.clone()).expect("in-memory AVI probe"); + + for footage in [&native, &memory] { + assert_eq!(footage.kind, FootageKind::Video); + assert_eq!((footage.width, footage.height), (SIDE, SIDE)); + assert_eq!(footage.frame_rate, FrameRate::FPS_25); + assert_eq!(footage.duration, Tick::from_units(2, i64::from(FPS))); + assert_eq!(footage.codec, "Motion JPEG"); + assert!(footage.has_video && footage.has_audio); + } + + let native_pool = MediaPool::new(); + let memory_pool = MediaPool::new(); + memory_pool.add_bytes(name, bytes); + for (frame, dominant, other, sign) in [(0, 0, 2, 1.0), (1, 2, 0, -1.0), (0, 0, 2, 1.0)] { + let at = Tick::from_units(frame, i64::from(FPS)); + let native_frame = native_pool.frame_at(&native, at).expect("native picture"); + let memory_frame = memory_pool.frame_at(&memory, at).expect("in-memory picture"); + let pixel = native_frame.get(i64::from(SIDE / 2), i64::from(SIDE / 2)); + assert_eq!(pixel, memory_frame.get(i64::from(SIDE / 2), i64::from(SIDE / 2))); + assert!(pixel[dominant] > pixel[other] + 0.4, "picture at frame {frame}: {pixel:?}"); + + let native_pcm = native_pool.audio_samples(&native, at, 16, SAMPLE_RATE); + let memory_pcm = memory_pool.audio_samples(&memory, at, 16, SAMPLE_RATE); + assert_eq!(native_pcm, memory_pcm); + assert_eq!(native_pcm.len(), 32); + assert!(native_pcm.iter().all(|sample| sign * sample > 0.05), "PCM at frame {frame}: {native_pcm:?}"); + } +} diff --git a/crates/media/tests/it/main.rs b/crates/media/tests/it/main.rs index efa69b5a6..afeda890e 100644 --- a/crates/media/tests/it/main.rs +++ b/crates/media/tests/it/main.rs @@ -1,6 +1,7 @@ //! The crate's integration tests, one binary (each module is a former `tests/.rs`). mod aac_layout; +mod avi_mjpeg; mod downmix; mod exif_orientation; mod exr_golden; From 9bea8f827423ed2461d8da229e48ea0ed9dce90b Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Mon, 23 Nov 2026 06:35:24 +0700 Subject: [PATCH 393/451] chore(deps): move EffectCraft's media pins to craft-libs 33be3562 and FilmCraft e7345f6e --- Cargo.lock | 224 +++++++++++++++++++++-------------------------------- Cargo.toml | 30 +++---- 2 files changed, 105 insertions(+), 149 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5a2d2bfc9..874327c70 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1182,11 +1182,11 @@ dependencies = [ [[package]] name = "craft-aaf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17#dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ - "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", + "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", "craft-cfb", - "craft-timeline 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", + "craft-timeline 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", "thiserror 2.0.21", ] @@ -1207,21 +1207,10 @@ dependencies = [ [[package]] name = "craft-audio" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6#6a061a30bdd4a6cc24329334d5e44241896edba6" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6)", - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6)", - "log", - "thiserror 2.0.21", -] - -[[package]] -name = "craft-audio" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17#dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17" -dependencies = [ - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", + "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", "log", "rayon", "symphonia 0.6.1", @@ -1231,7 +1220,7 @@ dependencies = [ [[package]] name = "craft-cfb" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17#dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" [[package]] name = "craft-cms" @@ -1250,7 +1239,7 @@ source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c [[package]] name = "craft-color" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6#6a061a30bdd4a6cc24329334d5e44241896edba6" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ "serde", ] @@ -1277,7 +1266,7 @@ source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c [[package]] name = "craft-dpx" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ "thiserror 2.0.21", ] @@ -1285,7 +1274,7 @@ dependencies = [ [[package]] name = "craft-dpx" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17#dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17" +source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" dependencies = [ "thiserror 2.0.21", ] @@ -1305,6 +1294,15 @@ name = "craft-eps" version = "0.1.0" source = "git+https://github.com/storytold/craft-libs?rev=068e079c7be4b100a8a6b305b31ac881e069727e#068e079c7be4b100a8a6b305b31ac881e069727e" +[[package]] +name = "craft-exr" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" +dependencies = [ + "flate2", + "serde_json", +] + [[package]] name = "craft-exr" version = "0.1.0" @@ -1317,15 +1315,6 @@ dependencies = [ "thiserror 2.0.21", ] -[[package]] -name = "craft-exr" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8b40f1a4b0718916e7c136c1b91b38a5c7531a0e#8b40f1a4b0718916e7c136c1b91b38a5c7531a0e" -dependencies = [ - "flate2", - "serde_json", -] - [[package]] name = "craft-fonts-build" version = "0.1.0" @@ -1334,10 +1323,10 @@ source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c [[package]] name = "craft-frame" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6#6a061a30bdd4a6cc24329334d5e44241896edba6" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ "craft-color", - "craft-time 0.1.0 (git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6)", + "craft-time 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", "rayon", "serde", ] @@ -1354,7 +1343,7 @@ dependencies = [ [[package]] name = "craft-hdr" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17#dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ "thiserror 2.0.21", ] @@ -1385,7 +1374,7 @@ dependencies = [ [[package]] name = "craft-jpeg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17#dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ "thiserror 2.0.21", ] @@ -1416,16 +1405,7 @@ source = "git+https://github.com/storytold/craft-libs?rev=30596f73c5ef851ba3dad9 [[package]] name = "craft-media" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6#6a061a30bdd4a6cc24329334d5e44241896edba6" -dependencies = [ - "chrono", - "thiserror 2.0.21", -] - -[[package]] -name = "craft-media" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17#dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ "chrono", "thiserror 2.0.21", @@ -1434,13 +1414,13 @@ dependencies = [ [[package]] name = "craft-media-source" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6#6a061a30bdd4a6cc24329334d5e44241896edba6" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ - "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6)", + "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", "craft-color", "craft-frame", - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6)", - "craft-time 0.1.0 (git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6)", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", + "craft-time 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", "serde", "thiserror 2.0.21", ] @@ -1500,7 +1480,7 @@ dependencies = [ [[package]] name = "craft-psd" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=53198114310dbc2b41e18e4eaf2fd83e69964189#53198114310dbc2b41e18e4eaf2fd83e69964189" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ "encoding_rs", "flate2", @@ -1511,7 +1491,7 @@ dependencies = [ [[package]] name = "craft-psd" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17#dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17" +source = "git+https://github.com/storytold/craft-libs?rev=53198114310dbc2b41e18e4eaf2fd83e69964189#53198114310dbc2b41e18e4eaf2fd83e69964189" dependencies = [ "encoding_rs", "flate2", @@ -1533,7 +1513,7 @@ dependencies = [ [[package]] name = "craft-raw" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17#dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ "craft-tiff", "miniz_oxide 0.9.1", @@ -1544,6 +1524,11 @@ dependencies = [ "zune-jpeg", ] +[[package]] +name = "craft-sniff" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" + [[package]] name = "craft-svg" version = "0.1.0" @@ -1562,7 +1547,7 @@ dependencies = [ [[package]] name = "craft-tga" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17#dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ "thiserror 2.0.21", ] @@ -1570,7 +1555,7 @@ dependencies = [ [[package]] name = "craft-tiff" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17#dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ "serde", "thiserror 2.0.21", @@ -1588,16 +1573,7 @@ dependencies = [ [[package]] name = "craft-time" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6#6a061a30bdd4a6cc24329334d5e44241896edba6" -dependencies = [ - "serde", - "thiserror 2.0.21", -] - -[[package]] -name = "craft-time" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17#dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ "serde", "thiserror 2.0.21", @@ -1614,10 +1590,10 @@ dependencies = [ [[package]] name = "craft-timeline" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17#dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ - "craft-time 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", + "craft-time 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", + "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", "serde", "serde_json", ] @@ -1684,20 +1660,9 @@ dependencies = [ [[package]] name = "craft-video" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6#6a061a30bdd4a6cc24329334d5e44241896edba6" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6)", - "rav1e", - "rayon", - "thiserror 2.0.21", -] - -[[package]] -name = "craft-video" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17#dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17" -dependencies = [ - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", "rav1e", "rayon", "thiserror 2.0.21", @@ -1712,6 +1677,16 @@ dependencies = [ "thiserror 2.0.21", ] +[[package]] +name = "craft-xml" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" +dependencies = [ + "quick-xml 0.41.0", + "serde", + "thiserror 2.0.21", +] + [[package]] name = "craft-xml" version = "0.1.0" @@ -1722,30 +1697,10 @@ dependencies = [ "thiserror 2.0.21", ] -[[package]] -name = "craft-xml" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6#6a061a30bdd4a6cc24329334d5e44241896edba6" -dependencies = [ - "quick-xml 0.41.0", - "serde", - "thiserror 2.0.21", -] - -[[package]] -name = "craft-xml" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17#dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17" -dependencies = [ - "quick-xml 0.41.0", - "serde", - "thiserror 2.0.21", -] - [[package]] name = "craft-y4m" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17#dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ "thiserror 2.0.21", ] @@ -2123,11 +2078,11 @@ dependencies = [ name = "effectcraft-export" version = "0.24.1" dependencies = [ - "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6)", + "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", "craft-exr 0.1.0 (git+https://github.com/storytold/craft-libs?rev=3b8e426a260695af840a2cd79a064d40778f939e)", "craft-gif", - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6)", - "craft-video 0.1.0 (git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6)", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", + "craft-video", "effectcraft-color", "effectcraft-effects", "effectcraft-keyframe", @@ -2289,17 +2244,17 @@ name = "effectcraft-media" version = "0.24.1" dependencies = [ "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=30596f73c5ef851ba3dad9cf145669f391e2eb0d)", - "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6)", + "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", "craft-color", "craft-docpath", "craft-dpx 0.1.0 (git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87)", "craft-exr 0.1.0 (git+https://github.com/storytold/craft-libs?rev=3b8e426a260695af840a2cd79a064d40778f939e)", "craft-frame", "craft-gif", - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6)", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", "craft-media-source", - "craft-time 0.1.0 (git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6)", - "craft-video 0.1.0 (git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6)", + "craft-time 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", + "craft-video", "craft-webp", "effectcraft-color", "effectcraft-effects", @@ -2998,15 +2953,15 @@ dependencies = [ [[package]] name = "filmcraft-bitstream" version = "0.20.1" -source = "git+https://github.com/storytold/filmcraft?rev=d6cc257f55e83b16af4be6bf9c371e6798f00af6#d6cc257f55e83b16af4be6bf9c371e6798f00af6" +source = "git+https://github.com/storytold/filmcraft?rev=e7345f6e04a9bb921c2613a6aa92d162edf39b3b#e7345f6e04a9bb921c2613a6aa92d162edf39b3b" dependencies = [ - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", ] [[package]] name = "filmcraft-cfb" version = "0.20.1" -source = "git+https://github.com/storytold/filmcraft?rev=d6cc257f55e83b16af4be6bf9c371e6798f00af6#d6cc257f55e83b16af4be6bf9c371e6798f00af6" +source = "git+https://github.com/storytold/filmcraft?rev=e7345f6e04a9bb921c2613a6aa92d162edf39b3b#e7345f6e04a9bb921c2613a6aa92d162edf39b3b" dependencies = [ "craft-cfb", ] @@ -3014,12 +2969,12 @@ dependencies = [ [[package]] name = "filmcraft-codecs" version = "0.20.1" -source = "git+https://github.com/storytold/filmcraft?rev=d6cc257f55e83b16af4be6bf9c371e6798f00af6#d6cc257f55e83b16af4be6bf9c371e6798f00af6" +source = "git+https://github.com/storytold/filmcraft?rev=e7345f6e04a9bb921c2613a6aa92d162edf39b3b#e7345f6e04a9bb921c2613a6aa92d162edf39b3b" dependencies = [ - "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", + "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", "craft-jpeg", - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", - "craft-video 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", + "craft-video", "craft-y4m", "filmcraft-bitstream", "filmcraft-color", @@ -3038,7 +2993,7 @@ dependencies = [ [[package]] name = "filmcraft-color" version = "0.20.1" -source = "git+https://github.com/storytold/filmcraft?rev=d6cc257f55e83b16af4be6bf9c371e6798f00af6#d6cc257f55e83b16af4be6bf9c371e6798f00af6" +source = "git+https://github.com/storytold/filmcraft?rev=e7345f6e04a9bb921c2613a6aa92d162edf39b3b#e7345f6e04a9bb921c2613a6aa92d162edf39b3b" dependencies = [ "serde", ] @@ -3046,7 +3001,7 @@ dependencies = [ [[package]] name = "filmcraft-dng" version = "0.20.1" -source = "git+https://github.com/storytold/filmcraft?rev=d6cc257f55e83b16af4be6bf9c371e6798f00af6#d6cc257f55e83b16af4be6bf9c371e6798f00af6" +source = "git+https://github.com/storytold/filmcraft?rev=e7345f6e04a9bb921c2613a6aa92d162edf39b3b#e7345f6e04a9bb921c2613a6aa92d162edf39b3b" dependencies = [ "craft-raw", "craft-tiff", @@ -3058,7 +3013,7 @@ dependencies = [ [[package]] name = "filmcraft-frame" version = "0.20.1" -source = "git+https://github.com/storytold/filmcraft?rev=d6cc257f55e83b16af4be6bf9c371e6798f00af6#d6cc257f55e83b16af4be6bf9c371e6798f00af6" +source = "git+https://github.com/storytold/filmcraft?rev=e7345f6e04a9bb921c2613a6aa92d162edf39b3b#e7345f6e04a9bb921c2613a6aa92d162edf39b3b" dependencies = [ "filmcraft-color", "filmcraft-time", @@ -3069,7 +3024,7 @@ dependencies = [ [[package]] name = "filmcraft-geom" version = "0.20.1" -source = "git+https://github.com/storytold/filmcraft?rev=d6cc257f55e83b16af4be6bf9c371e6798f00af6#d6cc257f55e83b16af4be6bf9c371e6798f00af6" +source = "git+https://github.com/storytold/filmcraft?rev=e7345f6e04a9bb921c2613a6aa92d162edf39b3b#e7345f6e04a9bb921c2613a6aa92d162edf39b3b" dependencies = [ "serde", ] @@ -3077,11 +3032,11 @@ dependencies = [ [[package]] name = "filmcraft-interchange" version = "0.20.1" -source = "git+https://github.com/storytold/filmcraft?rev=d6cc257f55e83b16af4be6bf9c371e6798f00af6#d6cc257f55e83b16af4be6bf9c371e6798f00af6" +source = "git+https://github.com/storytold/filmcraft?rev=e7345f6e04a9bb921c2613a6aa92d162edf39b3b#e7345f6e04a9bb921c2613a6aa92d162edf39b3b" dependencies = [ "craft-aaf", - "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", - "craft-timeline 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", + "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", + "craft-timeline 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", "filmcraft-cfb", "filmcraft-color", "filmcraft-geom", @@ -3097,31 +3052,32 @@ dependencies = [ [[package]] name = "filmcraft-isobmff" version = "0.20.1" -source = "git+https://github.com/storytold/filmcraft?rev=d6cc257f55e83b16af4be6bf9c371e6798f00af6#d6cc257f55e83b16af4be6bf9c371e6798f00af6" +source = "git+https://github.com/storytold/filmcraft?rev=e7345f6e04a9bb921c2613a6aa92d162edf39b3b#e7345f6e04a9bb921c2613a6aa92d162edf39b3b" dependencies = [ - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", ] [[package]] name = "filmcraft-matroska" version = "0.20.1" -source = "git+https://github.com/storytold/filmcraft?rev=d6cc257f55e83b16af4be6bf9c371e6798f00af6#d6cc257f55e83b16af4be6bf9c371e6798f00af6" +source = "git+https://github.com/storytold/filmcraft?rev=e7345f6e04a9bb921c2613a6aa92d162edf39b3b#e7345f6e04a9bb921c2613a6aa92d162edf39b3b" dependencies = [ - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", ] [[package]] name = "filmcraft-media" version = "0.20.1" -source = "git+https://github.com/storytold/filmcraft?rev=d6cc257f55e83b16af4be6bf9c371e6798f00af6#d6cc257f55e83b16af4be6bf9c371e6798f00af6" +source = "git+https://github.com/storytold/filmcraft?rev=e7345f6e04a9bb921c2613a6aa92d162edf39b3b#e7345f6e04a9bb921c2613a6aa92d162edf39b3b" dependencies = [ - "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", - "craft-dpx 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", - "craft-exr 0.1.0 (git+https://github.com/storytold/craft-libs?rev=8b40f1a4b0718916e7c136c1b91b38a5c7531a0e)", + "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", + "craft-dpx 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", + "craft-exr 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", "craft-hdr", - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", "craft-media-source", - "craft-psd 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", + "craft-psd 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", + "craft-sniff", "craft-tga", "craft-tiff", "filmcraft-color", @@ -3137,7 +3093,7 @@ dependencies = [ [[package]] name = "filmcraft-project" version = "0.20.1" -source = "git+https://github.com/storytold/filmcraft?rev=d6cc257f55e83b16af4be6bf9c371e6798f00af6#d6cc257f55e83b16af4be6bf9c371e6798f00af6" +source = "git+https://github.com/storytold/filmcraft?rev=e7345f6e04a9bb921c2613a6aa92d162edf39b3b#e7345f6e04a9bb921c2613a6aa92d162edf39b3b" dependencies = [ "filmcraft-color", "filmcraft-geom", @@ -3152,9 +3108,9 @@ dependencies = [ [[package]] name = "filmcraft-time" version = "0.20.1" -source = "git+https://github.com/storytold/filmcraft?rev=d6cc257f55e83b16af4be6bf9c371e6798f00af6#d6cc257f55e83b16af4be6bf9c371e6798f00af6" +source = "git+https://github.com/storytold/filmcraft?rev=e7345f6e04a9bb921c2613a6aa92d162edf39b3b#e7345f6e04a9bb921c2613a6aa92d162edf39b3b" dependencies = [ - "craft-timeline 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", + "craft-timeline 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 1dbbffffd..627ea1365 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -97,25 +97,25 @@ same-file = "1.0" tempfile = "3.27" # codecs + containers shared by the Craft apps (crates/media, crates/export); keep all in sync. -craft-media = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "6a061a30bdd4a6cc24329334d5e44241896edba6", default-features = false, features = ["isobmff", "matroska"] } -craft-media-source = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "6a061a30bdd4a6cc24329334d5e44241896edba6" } -craft-frame = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "6a061a30bdd4a6cc24329334d5e44241896edba6" } -craft-color = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "6a061a30bdd4a6cc24329334d5e44241896edba6" } -craft-time = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "6a061a30bdd4a6cc24329334d5e44241896edba6" } -craft-audio = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "6a061a30bdd4a6cc24329334d5e44241896edba6", default-features = false, features = ["aac-decode", "aac-encode", "alac-decode", "opus-decode", "opus-encode", "ac3-decode", "mp3-decode", "mpa-decode"] } -craft-video = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "6a061a30bdd4a6cc24329334d5e44241896edba6", features = ["h264-decode", "h264-encode", "prores", "hevc-encode", "vp9-encode", "av1", "threads"] } +craft-media = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "33be35625e252cc4f06aa375b3b428521faea37d", default-features = false, features = ["isobmff", "matroska"] } +craft-media-source = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "33be35625e252cc4f06aa375b3b428521faea37d" } +craft-frame = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "33be35625e252cc4f06aa375b3b428521faea37d" } +craft-color = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "33be35625e252cc4f06aa375b3b428521faea37d" } +craft-time = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "33be35625e252cc4f06aa375b3b428521faea37d" } +craft-audio = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "33be35625e252cc4f06aa375b3b428521faea37d", default-features = false, features = ["aac-decode", "aac-encode", "alac-decode", "opus-decode", "opus-encode", "ac3-decode", "mp3-decode", "mpa-decode"] } +craft-video = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "33be35625e252cc4f06aa375b3b428521faea37d", features = ["h264-decode", "h264-encode", "prores", "hevc-encode", "vp9-encode", "av1", "threads"] } # footage decoding: FilmCraft's pure-Rust crates, pinned to a revision (plan/adr/0001). # Only `crates/media`, `crates/export` and `crates/interchange` may depend on these. -filmcraft-codecs = { git = "https://github.com/storytold/filmcraft", rev = "d6cc257f55e83b16af4be6bf9c371e6798f00af6" } -filmcraft-media = { git = "https://github.com/storytold/filmcraft", rev = "d6cc257f55e83b16af4be6bf9c371e6798f00af6" } -filmcraft-frame = { git = "https://github.com/storytold/filmcraft", rev = "d6cc257f55e83b16af4be6bf9c371e6798f00af6" } -filmcraft-color = { git = "https://github.com/storytold/filmcraft", rev = "d6cc257f55e83b16af4be6bf9c371e6798f00af6" } -filmcraft-time = { git = "https://github.com/storytold/filmcraft", rev = "d6cc257f55e83b16af4be6bf9c371e6798f00af6" } +filmcraft-codecs = { git = "https://github.com/storytold/filmcraft", rev = "e7345f6e04a9bb921c2613a6aa92d162edf39b3b" } +filmcraft-media = { git = "https://github.com/storytold/filmcraft", rev = "e7345f6e04a9bb921c2613a6aa92d162edf39b3b" } +filmcraft-frame = { git = "https://github.com/storytold/filmcraft", rev = "e7345f6e04a9bb921c2613a6aa92d162edf39b3b" } +filmcraft-color = { git = "https://github.com/storytold/filmcraft", rev = "e7345f6e04a9bb921c2613a6aa92d162edf39b3b" } +filmcraft-time = { git = "https://github.com/storytold/filmcraft", rev = "e7345f6e04a9bb921c2613a6aa92d162edf39b3b" } # timeline interchange (EDL, FCP7 XML, FCPXML, OTIO) for Premiere Pro interop (crates/interchange only) -filmcraft-interchange = { git = "https://github.com/storytold/filmcraft", rev = "d6cc257f55e83b16af4be6bf9c371e6798f00af6" } -filmcraft-project = { git = "https://github.com/storytold/filmcraft", rev = "d6cc257f55e83b16af4be6bf9c371e6798f00af6" } -filmcraft-geom = { git = "https://github.com/storytold/filmcraft", rev = "d6cc257f55e83b16af4be6bf9c371e6798f00af6" } +filmcraft-interchange = { git = "https://github.com/storytold/filmcraft", rev = "e7345f6e04a9bb921c2613a6aa92d162edf39b3b" } +filmcraft-project = { git = "https://github.com/storytold/filmcraft", rev = "e7345f6e04a9bb921c2613a6aa92d162edf39b3b" } +filmcraft-geom = { git = "https://github.com/storytold/filmcraft", rev = "e7345f6e04a9bb921c2613a6aa92d162edf39b3b" } # gpu (the same wgpu eframe / egui-wgpu use) wgpu = { version = "30.0.1", features = ["fragile-send-sync-non-atomic-wasm"] } From 38624ac67e646102a8cba66d45c06f058da71626 Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Mon, 23 Nov 2026 06:38:10 +0700 Subject: [PATCH 394/451] export: write Targa sequences through craft-tga (craft-libs#778) Use craft_tga::write_top_left_raw from craft-libs#3076, which shares the footerless, uncompressed top-left stream this export wrote with the image crate's encoder. --- Cargo.lock | 1 + Cargo.toml | 1 + crates/export/Cargo.toml | 1 + crates/export/src/lib.rs | 13 ++++++++++--- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 874327c70..e87881ec5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2082,6 +2082,7 @@ dependencies = [ "craft-exr 0.1.0 (git+https://github.com/storytold/craft-libs?rev=3b8e426a260695af840a2cd79a064d40778f939e)", "craft-gif", "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", + "craft-tga", "craft-video", "effectcraft-color", "effectcraft-effects", diff --git a/Cargo.toml b/Cargo.toml index 627ea1365..376772e5b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,6 +22,7 @@ craft-dpx = { version = "0.1.0", git = "https://github.com/storytold/craft-libs" craft-ps = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "068e079c7be4b100a8a6b305b31ac881e069727e", default-features = false, features = ["read"] } craft-exr = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "3b8e426a260695af840a2cd79a064d40778f939e" } craft-gif = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "ba25ccd233934d1b2f74e3c0f235168bf5f13ef3" } +craft-tga = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "33be35625e252cc4f06aa375b3b428521faea37d" } craft-psd = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "53198114310dbc2b41e18e4eaf2fd83e69964189" } craft-codepage = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" } craft-svg = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "3dff4793f1a5bd1f99a4fe3280d48f515158dff3" } diff --git a/crates/export/Cargo.toml b/crates/export/Cargo.toml index 6b93a8a7c..a810d21c2 100644 --- a/crates/export/Cargo.toml +++ b/crates/export/Cargo.toml @@ -18,6 +18,7 @@ craft-video = { workspace = true } craft-audio = { workspace = true } craft-media = { workspace = true } craft-gif = { workspace = true } +craft-tga = { workspace = true } craft-exr = { workspace = true, features = ["decode"] } image = { workspace = true, features = ["png", "jpeg", "tiff", "exr", "tga"] } rayon = { workspace = true } diff --git a/crates/export/src/lib.rs b/crates/export/src/lib.rs index 16d65fabe..b89acbbab 100644 --- a/crates/export/src/lib.rs +++ b/crates/export/src/lib.rs @@ -413,9 +413,16 @@ fn write_still(cx: &Cx, file: &mut W, img: &I }; match fmt { OutputFormat::PngSequence => image::codecs::png::PngEncoder::new(file).write_image(&data, w, h, ct), - // Uncompressed (the encoder's run-length compression is off), top-left origin, the - // alpha bits in the image descriptor: 8 for RGB + Alpha, 0 otherwise. - OutputFormat::TargaSequence => image::codecs::tga::TgaEncoder::new(file).disable_rle().write_image(&data, w, h, ct), + // The shared footerless writer: uncompressed, top-left origin, the alpha bits in the + // image descriptor: 8 for RGB + Alpha, 0 otherwise. + OutputFormat::TargaSequence => { + let layout = match channels { + Channels::Rgba => craft_tga::Layout::Rgba, + Channels::Alpha => craft_tga::Layout::Gray, + Channels::Rgb => craft_tga::Layout::Rgb, + }; + return craft_tga::write_top_left_raw(file, w, h, layout, &data).map_err(|e| ExportError::Encode(e.to_string())); + } // (the TIFF encoder needs Seek) _ => image::codecs::tiff::TiffEncoder::new(file).write_image(&data, w, h, ct), } From 0ab43ebd680e75500555ae36f0ceaa1905c26729 Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Mon, 23 Nov 2026 06:40:23 +0700 Subject: [PATCH 395/451] media: open YUV4MPEG2 through the shared craft-media-source reader --- Cargo.lock | 1 + crates/media/Cargo.toml | 2 +- crates/media/src/craft_source.rs | 146 ++++++++++++++++++++++++------- crates/media/src/stream.rs | 2 +- 4 files changed, 119 insertions(+), 32 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 874327c70..e3dc8cbb2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1421,6 +1421,7 @@ dependencies = [ "craft-frame", "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", "craft-time 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", + "craft-y4m", "serde", "thiserror 2.0.21", ] diff --git a/crates/media/Cargo.toml b/crates/media/Cargo.toml index 6a2ddcfdd..c23ceeb05 100644 --- a/crates/media/Cargo.toml +++ b/crates/media/Cargo.toml @@ -31,7 +31,7 @@ craft-audio = { workspace = true, features = ["decode-native", "aac-decode", "al craft-color = { workspace = true } craft-frame = { workspace = true } craft-media = { workspace = true, features = ["mpegts", "avi", "mxf"] } -craft-media-source = { workspace = true } +craft-media-source = { workspace = true, features = ["y4m"] } craft-time = { workspace = true } craft-video = { workspace = true, features = ["h264-decode", "hevc-decode", "vp9-decode", "vp8-decode", "av1-decode", "prores", "dnx", "mpeg2-decode", "ffv1", "apv-decode", "threads"] } filmcraft-frame = { workspace = true } diff --git a/crates/media/src/craft_source.rs b/crates/media/src/craft_source.rs index fe4063b46..4459ac129 100644 --- a/crates/media/src/craft_source.rs +++ b/crates/media/src/craft_source.rs @@ -1,39 +1,33 @@ -//! ISO-BMFF (MP4/MOV/M4A) and Matroska/WebM (MKV/MKA/WebM) media-reader routes backed by -//! `craft-media`, `craft-video`, `craft-audio`, and `craft-media-source`. +//! ISO-BMFF (MP4/MOV/M4A), Matroska/WebM (MKV/MKA/WebM), MXF, AVI, MPEG-TS/PS, YUV4MPEG2 and +//! standalone audio media-reader routes backed by `craft-media`, `craft-video`, `craft-audio`, and +//! `craft-media-source`. //! //! Preserves sync-sample backward seek, B-frame reordering, cooperative cancellation, VUI + //! container colour resolution, draft mode for reduced-resolution playback, and bounded worker //! threads, while falling back to `filmcraft-codecs` for unsupported codecs or audio streams. //! //! ## Route Matrix (`crates/media`) -//! - **ISO-BMFF (`MP4`/`MOV`/`M4A`, video+audio & audio-only)**: -//! - Shared (`craft-media::isobmff` + `craft-video` + `craft-audio`): `H264`, `Hevc`, `Av1`, -//! `Vp9`, `Vp8`, `ProRes` (coded alpha via `craft_video::prores::probe`, #3999), `Dnxhd`, -//! `Mpeg2Video`, and strictly admitted video-only `Apv` MP4; -//! audio `Aac`, `Alac`, `Flac`, `Opus`, `Ac3`, `Mp3`/`Mp2`/`Mp1`. -//! - Fallback (`filmcraft-codecs`): `Mjpeg`, `Mpeg4Video`, `Ffv1`, other `Apv`, or unsupported audio. -//! - **Matroska / WebM (`MKV`/`MKA`/`WebM`, video+audio & audio-only)**: -//! - Shared (`craft-media::matroska` + `craft-video` + `craft-audio`): `H264`, `Hevc`, `Av1`, -//! `Vp9`, `Vp8`, `ProRes`, `Dnxhd`, `Mpeg2Video`; audio `Aac`, `Alac`, `Flac`, `Opus`, `Ac3`, -//! `Mp3`/`Mp2`/`Mp1` (with `CodecDelay` + `SeekPreRoll` timing). -//! - Fallback (`filmcraft-codecs`): `alpha_mode == 1` (`BlockAdditional` alpha), unreadable/zlib -//! encodings, `Mjpeg`/`Ffv1`/`Theora`/`Apv`, or unsupported audio (`Vorbis`/`Pcm`). -//! - **MXF (`MXF`, video+audio & audio-only OP1a/OP-Atom)**: -//! - Shared (`craft-media::mxf` + `craft-video` + `MxfFile::read_pcm`): `H264`, `Hevc`, `Av1`, -//! `Vp9`, `Vp8`, `ProRes`, `Dnxhd`, `Mpeg2Video`; sound `Pcm` and `Aes3` (D-10). -//! - Fallback (`filmcraft-codecs`): compressed MXF sound or unsupported video codecs. -//! - **AVI / MPEG-TS / MPEG-PS**: -//! - Shared (`craft-media::avi`, `craft-media::mpegts` + `craft-video` + `craft-audio`): -//! `H264`, `Hevc`, `Mpeg2Video`, `Av1`, `Vp9`, `Vp8`, `ProRes`, `Dnxhd`; audio `Aac`, -//! `Ac3`/`Eac3`, `Mp3`/`Mp2`/`Mp1`, `Pcm`. AVI also accepts complete 24/32-bit `BI_RGB` streams. -//! - Fallback (`filmcraft-codecs`): unsupported codecs (`Mjpeg`, `Mpeg4Video`, `Ffv1`, `Theora`, -//! `Apv`, other raw AVI layouts) or unsupported audio. -//! - **Other containers & standalone audio**: -//! - Shared (`craft_audio::Decoder` with `decode-native`): standalone `WAV`, `AIFF`, `MP3`/`MP2`/`MP1`, -//! `AAC` (ADTS), `AC-3`, and `Ogg` (`Opus`). Bounded standalone FLAC uses the shared native -//! FLAC decoder and the same resampling policy. -//! - Fallback (`filmcraft-codecs`): `Ogg Vorbis`, `CAF`, or FLAC and WAV/AIFF input the shared -//! readers decline. +//! Video codecs admitted by [`supports_video_codec`] in every container: `H264`, `Hevc`, `Av1`, +//! `Vp9`, `Vp8`, `ProRes`, `Dnxhd`, `Mpeg2Video` and `Ffv1`. Audio goes through +//! `craft_audio::TrackDecoder` whenever it accepts the track (including `Pcm`); a track it declines +//! sends the whole file to `filmcraft-codecs`. +//! - **ISO-BMFF (`MP4`/`MOV`/`M4A`)**: shared, plus strictly admitted video-only `Apv` MP4. +//! Fallback: `Mjpeg`, `Mpeg4Video`, other `Apv`, or declined audio. +//! - **Matroska / WebM (`MKV`/`MKA`/`WebM`)**: shared, with `CodecDelay` + `SeekPreRoll` timing. +//! Fallback: `alpha_mode == 1` (`BlockAdditional` alpha), unreadable or compressed frame +//! encodings, `V_FFV1` without `CodecPrivate`, `Mjpeg`/`Theora`/`Apv`, or declined audio +//! (for example `Vorbis`). +//! - **MXF (OP1a/OP-Atom)**: shared, with sound `Pcm` and `Aes3` (D-10) read by +//! `MxfFile::read_pcm`. Fallback: compressed sound, video that needs reordering, or other codecs. +//! - **AVI / MPEG-TS / MPEG-PS**: shared; AVI also accepts complete 24/32-bit `BI_RGB` streams. +//! Fallback: other codecs (`Mjpeg`, `Mpeg4Video`, `Theora`, `Apv`), other raw AVI layouts, or +//! declined audio. +//! - **YUV4MPEG2 (`Y4M`)**: `craft_media_source::y4m`. Fallback: files it reports as unsupported +//! (for example a frame above the shared media buffer limit). +//! - **Standalone audio**: `craft_audio::Decoder` with `decode-native` for `WAV`, `AIFF`, +//! `MP3`/`MP2`/`MP1`, `AAC` (ADTS), `AC-3` and `Ogg` (`Opus`); bounded FLAC uses the shared +//! native FLAC decoder. Fallback: `Ogg Vorbis`, `CAF`, or FLAC and WAV/AIFF input the shared +//! readers decline. use std::sync::{Arc, Mutex}; @@ -138,6 +132,9 @@ pub(crate) fn open_reader(name: &str, head: &[u8], reader: &SharedBytes) -> Opti if let Some(fmt) = mpegts::sniff(usual_head) { return open_mpeg(name, fmt, reader.clone()); } + if craft_media_source::y4m::sniff(usual_head) { + return open_y4m(name, reader.clone()); + } if let Some(source) = standalone_flac::open_reader(name, usual_head, reader) { return Some(Ok(source)); } @@ -161,6 +158,9 @@ pub(crate) fn open_bytes(name: &str, bytes: Arc<[u8]>) -> Option) -> Option Option> { + match craft_media_source::y4m::Y4mSource::open(name, source) { + Ok(y4m) => Some(Ok(Arc::new(y4m))), + Err(MediaError::Unsupported(_)) => None, + Err(e) => Some(Err(e)), + } +} + enum ContainerFile { Isobmff(Mp4File), Matroska(Box), @@ -3086,6 +3096,82 @@ mod tests { } } + /// Two distinct self-generated pictures of `colour` (`W4 H2`), 16-bit little-endian above 8 bits. + fn generated_y4m(colour: &str, bits: u8, planes: usize, chroma_len: usize) -> Arc<[u8]> { + let mut out = format!("YUV4MPEG2 W4 H2 F25:1 Ip A2:1 C{colour} XCOLORRANGE=FULL\n").into_bytes(); + for frame in 0..2u16 { + out.extend_from_slice(b"FRAME\n"); + for plane in 0..planes { + let len = if plane == 0 || plane == 3 { 8 } else { chroma_len }; + for i in 0..len as u16 { + let v = (frame * 97 + plane as u16 * 31 + i * 13) % (1 << bits.min(10)); + if bits > 8 { + out.extend_from_slice(&v.to_le_bytes()); + } else { + out.push(v as u8); + } + } + } + } + out.into() + } + + #[test] + fn y4m_import_uses_the_shared_source_with_film_parity() { + use crate::stream::{DecodedFrame, MediaSource as Opened}; + + fn planes(frame: DecodedFrame) -> (Vec>, Option>, u32) { + let wide = |p: &[u8]| p.iter().map(|&v| u16::from(v)).collect::>(); + match frame { + DecodedFrame::Craft(f) => match &f.data { + PixelData::Yuv8 { planes, alpha, .. } => (planes.iter().map(|p| wide(p)).collect(), alpha.as_ref().map(|a| wide(a)), 8u32), + PixelData::Yuv16 { planes, alpha, bits, .. } => (planes.iter().map(|p| p.to_vec()).collect(), alpha.as_ref().map(|a| a.to_vec()), *bits), + _ => panic!("shared Y4M frame is planar YUV"), + }, + DecodedFrame::Film(f) => match &f.data { + filmcraft_frame::PixelData::Yuv8 { planes, alpha, .. } => (planes.iter().map(|p| wide(p)).collect(), alpha.as_ref().map(|a| wide(a)), 8u32), + filmcraft_frame::PixelData::Yuv16 { planes, alpha, bits, .. } => { + (planes.iter().map(|p| p.to_vec()).collect(), alpha.as_ref().map(|a| a.to_vec()), *bits) + } + _ => panic!("legacy Y4M frame is planar YUV"), + }, + } + } + + let step = craft_time::TICKS_PER_SECOND / 25; + for (colour, bits, plane_count, chroma_len) in + [("420jpeg", 8, 3, 2), ("444alpha", 8, 4, 8), ("mono", 8, 1, 0), ("420p10", 10, 3, 2), ("422p12", 12, 3, 4)] + { + let bytes = generated_y4m(colour, bits, plane_count, chroma_len); + let path = "generated.y4m"; + let shared = crate::stream::open_bytes(path, bytes.clone()).unwrap(); + assert!(matches!(shared, Opened::Craft(_)), "{colour}: Y4M must use the shared source"); + let direct = filmcraft_codecs::open_bytes(path, bytes.clone()).unwrap(); + let old = crate::probe::footage_from_info(path, direct.info()); + let film = Opened::Film(direct); + let footage = crate::probe_bytes(path, bytes.clone()).unwrap(); + assert_eq!((footage.width, footage.height), (4, 2), "{colour}"); + assert_eq!(footage.frame_rate, old.frame_rate, "{colour}"); + assert_eq!(footage.duration, old.duration, "{colour}"); + assert_eq!(footage.duration.0, step * 2, "{colour}"); + assert_eq!(footage.pixel_aspect, old.pixel_aspect, "{colour}"); + assert_eq!(footage.alpha, old.alpha, "{colour}"); + assert_eq!(footage.color_profile, old.color_profile, "{colour}"); + assert_eq!(footage.codec, old.codec, "{colour}"); + let mut seen = Vec::new(); + for at in [step, 0, step - 1, step, 0] { + let time = effectcraft_time::Tick(at); + let new = planes(shared.video_frame(time, 1.0).unwrap()); + let legacy = planes(film.video_frame(time, 1.0).unwrap()); + assert_eq!(new, legacy, "{colour} at {at}"); + assert_eq!(new.2, u32::from(bits), "{colour}"); + assert_eq!(new.1.is_some(), colour == "444alpha", "{colour}"); + seen.push(new.0); + } + assert_ne!(seen[0], seen[1], "{colour}: the two pictures differ"); + } + } + #[test] fn simple_apv_mp4_import_preserves_film_color_alpha_and_backward_seek() { use crate::stream::MediaSource as Opened; diff --git a/crates/media/src/stream.rs b/crates/media/src/stream.rs index d349a2c86..0de9b427b 100644 --- a/crates/media/src/stream.rs +++ b/crates/media/src/stream.rs @@ -38,7 +38,7 @@ impl DecodedFrame { } /// An opened movie/audio source, routed through `craft-media-source` for migrated formats -/// (ISO-BMFF and Matroska/WebM with supported codecs) and `filmcraft-media` for remaining formats. +/// (the route matrix in `craft_source`) and `filmcraft-media` for remaining formats. #[derive(Clone)] pub(crate) enum MediaSource { Craft(craft_media_source::SharedSource), From d7c7d0d737527c35e1b41378ab37641217729e87 Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Mon, 23 Nov 2026 10:48:11 +0700 Subject: [PATCH 396/451] chore(deps): move EffectCraft's media pins to craft-libs 33be3562 and FilmCraft e7345f6e (#4104) --- Cargo.lock | 224 +++++++++++++++++++++-------------------------------- Cargo.toml | 30 +++---- 2 files changed, 105 insertions(+), 149 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5a2d2bfc9..874327c70 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1182,11 +1182,11 @@ dependencies = [ [[package]] name = "craft-aaf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17#dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ - "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", + "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", "craft-cfb", - "craft-timeline 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", + "craft-timeline 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", "thiserror 2.0.21", ] @@ -1207,21 +1207,10 @@ dependencies = [ [[package]] name = "craft-audio" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6#6a061a30bdd4a6cc24329334d5e44241896edba6" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6)", - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6)", - "log", - "thiserror 2.0.21", -] - -[[package]] -name = "craft-audio" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17#dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17" -dependencies = [ - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", + "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", "log", "rayon", "symphonia 0.6.1", @@ -1231,7 +1220,7 @@ dependencies = [ [[package]] name = "craft-cfb" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17#dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" [[package]] name = "craft-cms" @@ -1250,7 +1239,7 @@ source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c [[package]] name = "craft-color" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6#6a061a30bdd4a6cc24329334d5e44241896edba6" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ "serde", ] @@ -1277,7 +1266,7 @@ source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c [[package]] name = "craft-dpx" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ "thiserror 2.0.21", ] @@ -1285,7 +1274,7 @@ dependencies = [ [[package]] name = "craft-dpx" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17#dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17" +source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" dependencies = [ "thiserror 2.0.21", ] @@ -1305,6 +1294,15 @@ name = "craft-eps" version = "0.1.0" source = "git+https://github.com/storytold/craft-libs?rev=068e079c7be4b100a8a6b305b31ac881e069727e#068e079c7be4b100a8a6b305b31ac881e069727e" +[[package]] +name = "craft-exr" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" +dependencies = [ + "flate2", + "serde_json", +] + [[package]] name = "craft-exr" version = "0.1.0" @@ -1317,15 +1315,6 @@ dependencies = [ "thiserror 2.0.21", ] -[[package]] -name = "craft-exr" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8b40f1a4b0718916e7c136c1b91b38a5c7531a0e#8b40f1a4b0718916e7c136c1b91b38a5c7531a0e" -dependencies = [ - "flate2", - "serde_json", -] - [[package]] name = "craft-fonts-build" version = "0.1.0" @@ -1334,10 +1323,10 @@ source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c [[package]] name = "craft-frame" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6#6a061a30bdd4a6cc24329334d5e44241896edba6" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ "craft-color", - "craft-time 0.1.0 (git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6)", + "craft-time 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", "rayon", "serde", ] @@ -1354,7 +1343,7 @@ dependencies = [ [[package]] name = "craft-hdr" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17#dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ "thiserror 2.0.21", ] @@ -1385,7 +1374,7 @@ dependencies = [ [[package]] name = "craft-jpeg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17#dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ "thiserror 2.0.21", ] @@ -1416,16 +1405,7 @@ source = "git+https://github.com/storytold/craft-libs?rev=30596f73c5ef851ba3dad9 [[package]] name = "craft-media" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6#6a061a30bdd4a6cc24329334d5e44241896edba6" -dependencies = [ - "chrono", - "thiserror 2.0.21", -] - -[[package]] -name = "craft-media" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17#dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ "chrono", "thiserror 2.0.21", @@ -1434,13 +1414,13 @@ dependencies = [ [[package]] name = "craft-media-source" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6#6a061a30bdd4a6cc24329334d5e44241896edba6" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ - "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6)", + "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", "craft-color", "craft-frame", - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6)", - "craft-time 0.1.0 (git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6)", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", + "craft-time 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", "serde", "thiserror 2.0.21", ] @@ -1500,7 +1480,7 @@ dependencies = [ [[package]] name = "craft-psd" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=53198114310dbc2b41e18e4eaf2fd83e69964189#53198114310dbc2b41e18e4eaf2fd83e69964189" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ "encoding_rs", "flate2", @@ -1511,7 +1491,7 @@ dependencies = [ [[package]] name = "craft-psd" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17#dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17" +source = "git+https://github.com/storytold/craft-libs?rev=53198114310dbc2b41e18e4eaf2fd83e69964189#53198114310dbc2b41e18e4eaf2fd83e69964189" dependencies = [ "encoding_rs", "flate2", @@ -1533,7 +1513,7 @@ dependencies = [ [[package]] name = "craft-raw" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17#dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ "craft-tiff", "miniz_oxide 0.9.1", @@ -1544,6 +1524,11 @@ dependencies = [ "zune-jpeg", ] +[[package]] +name = "craft-sniff" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" + [[package]] name = "craft-svg" version = "0.1.0" @@ -1562,7 +1547,7 @@ dependencies = [ [[package]] name = "craft-tga" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17#dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ "thiserror 2.0.21", ] @@ -1570,7 +1555,7 @@ dependencies = [ [[package]] name = "craft-tiff" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17#dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ "serde", "thiserror 2.0.21", @@ -1588,16 +1573,7 @@ dependencies = [ [[package]] name = "craft-time" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6#6a061a30bdd4a6cc24329334d5e44241896edba6" -dependencies = [ - "serde", - "thiserror 2.0.21", -] - -[[package]] -name = "craft-time" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17#dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ "serde", "thiserror 2.0.21", @@ -1614,10 +1590,10 @@ dependencies = [ [[package]] name = "craft-timeline" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17#dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ - "craft-time 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", + "craft-time 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", + "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", "serde", "serde_json", ] @@ -1684,20 +1660,9 @@ dependencies = [ [[package]] name = "craft-video" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6#6a061a30bdd4a6cc24329334d5e44241896edba6" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6)", - "rav1e", - "rayon", - "thiserror 2.0.21", -] - -[[package]] -name = "craft-video" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17#dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17" -dependencies = [ - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", "rav1e", "rayon", "thiserror 2.0.21", @@ -1712,6 +1677,16 @@ dependencies = [ "thiserror 2.0.21", ] +[[package]] +name = "craft-xml" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" +dependencies = [ + "quick-xml 0.41.0", + "serde", + "thiserror 2.0.21", +] + [[package]] name = "craft-xml" version = "0.1.0" @@ -1722,30 +1697,10 @@ dependencies = [ "thiserror 2.0.21", ] -[[package]] -name = "craft-xml" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6#6a061a30bdd4a6cc24329334d5e44241896edba6" -dependencies = [ - "quick-xml 0.41.0", - "serde", - "thiserror 2.0.21", -] - -[[package]] -name = "craft-xml" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17#dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17" -dependencies = [ - "quick-xml 0.41.0", - "serde", - "thiserror 2.0.21", -] - [[package]] name = "craft-y4m" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17#dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ "thiserror 2.0.21", ] @@ -2123,11 +2078,11 @@ dependencies = [ name = "effectcraft-export" version = "0.24.1" dependencies = [ - "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6)", + "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", "craft-exr 0.1.0 (git+https://github.com/storytold/craft-libs?rev=3b8e426a260695af840a2cd79a064d40778f939e)", "craft-gif", - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6)", - "craft-video 0.1.0 (git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6)", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", + "craft-video", "effectcraft-color", "effectcraft-effects", "effectcraft-keyframe", @@ -2289,17 +2244,17 @@ name = "effectcraft-media" version = "0.24.1" dependencies = [ "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=30596f73c5ef851ba3dad9cf145669f391e2eb0d)", - "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6)", + "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", "craft-color", "craft-docpath", "craft-dpx 0.1.0 (git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87)", "craft-exr 0.1.0 (git+https://github.com/storytold/craft-libs?rev=3b8e426a260695af840a2cd79a064d40778f939e)", "craft-frame", "craft-gif", - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6)", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", "craft-media-source", - "craft-time 0.1.0 (git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6)", - "craft-video 0.1.0 (git+https://github.com/storytold/craft-libs?rev=6a061a30bdd4a6cc24329334d5e44241896edba6)", + "craft-time 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", + "craft-video", "craft-webp", "effectcraft-color", "effectcraft-effects", @@ -2998,15 +2953,15 @@ dependencies = [ [[package]] name = "filmcraft-bitstream" version = "0.20.1" -source = "git+https://github.com/storytold/filmcraft?rev=d6cc257f55e83b16af4be6bf9c371e6798f00af6#d6cc257f55e83b16af4be6bf9c371e6798f00af6" +source = "git+https://github.com/storytold/filmcraft?rev=e7345f6e04a9bb921c2613a6aa92d162edf39b3b#e7345f6e04a9bb921c2613a6aa92d162edf39b3b" dependencies = [ - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", ] [[package]] name = "filmcraft-cfb" version = "0.20.1" -source = "git+https://github.com/storytold/filmcraft?rev=d6cc257f55e83b16af4be6bf9c371e6798f00af6#d6cc257f55e83b16af4be6bf9c371e6798f00af6" +source = "git+https://github.com/storytold/filmcraft?rev=e7345f6e04a9bb921c2613a6aa92d162edf39b3b#e7345f6e04a9bb921c2613a6aa92d162edf39b3b" dependencies = [ "craft-cfb", ] @@ -3014,12 +2969,12 @@ dependencies = [ [[package]] name = "filmcraft-codecs" version = "0.20.1" -source = "git+https://github.com/storytold/filmcraft?rev=d6cc257f55e83b16af4be6bf9c371e6798f00af6#d6cc257f55e83b16af4be6bf9c371e6798f00af6" +source = "git+https://github.com/storytold/filmcraft?rev=e7345f6e04a9bb921c2613a6aa92d162edf39b3b#e7345f6e04a9bb921c2613a6aa92d162edf39b3b" dependencies = [ - "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", + "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", "craft-jpeg", - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", - "craft-video 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", + "craft-video", "craft-y4m", "filmcraft-bitstream", "filmcraft-color", @@ -3038,7 +2993,7 @@ dependencies = [ [[package]] name = "filmcraft-color" version = "0.20.1" -source = "git+https://github.com/storytold/filmcraft?rev=d6cc257f55e83b16af4be6bf9c371e6798f00af6#d6cc257f55e83b16af4be6bf9c371e6798f00af6" +source = "git+https://github.com/storytold/filmcraft?rev=e7345f6e04a9bb921c2613a6aa92d162edf39b3b#e7345f6e04a9bb921c2613a6aa92d162edf39b3b" dependencies = [ "serde", ] @@ -3046,7 +3001,7 @@ dependencies = [ [[package]] name = "filmcraft-dng" version = "0.20.1" -source = "git+https://github.com/storytold/filmcraft?rev=d6cc257f55e83b16af4be6bf9c371e6798f00af6#d6cc257f55e83b16af4be6bf9c371e6798f00af6" +source = "git+https://github.com/storytold/filmcraft?rev=e7345f6e04a9bb921c2613a6aa92d162edf39b3b#e7345f6e04a9bb921c2613a6aa92d162edf39b3b" dependencies = [ "craft-raw", "craft-tiff", @@ -3058,7 +3013,7 @@ dependencies = [ [[package]] name = "filmcraft-frame" version = "0.20.1" -source = "git+https://github.com/storytold/filmcraft?rev=d6cc257f55e83b16af4be6bf9c371e6798f00af6#d6cc257f55e83b16af4be6bf9c371e6798f00af6" +source = "git+https://github.com/storytold/filmcraft?rev=e7345f6e04a9bb921c2613a6aa92d162edf39b3b#e7345f6e04a9bb921c2613a6aa92d162edf39b3b" dependencies = [ "filmcraft-color", "filmcraft-time", @@ -3069,7 +3024,7 @@ dependencies = [ [[package]] name = "filmcraft-geom" version = "0.20.1" -source = "git+https://github.com/storytold/filmcraft?rev=d6cc257f55e83b16af4be6bf9c371e6798f00af6#d6cc257f55e83b16af4be6bf9c371e6798f00af6" +source = "git+https://github.com/storytold/filmcraft?rev=e7345f6e04a9bb921c2613a6aa92d162edf39b3b#e7345f6e04a9bb921c2613a6aa92d162edf39b3b" dependencies = [ "serde", ] @@ -3077,11 +3032,11 @@ dependencies = [ [[package]] name = "filmcraft-interchange" version = "0.20.1" -source = "git+https://github.com/storytold/filmcraft?rev=d6cc257f55e83b16af4be6bf9c371e6798f00af6#d6cc257f55e83b16af4be6bf9c371e6798f00af6" +source = "git+https://github.com/storytold/filmcraft?rev=e7345f6e04a9bb921c2613a6aa92d162edf39b3b#e7345f6e04a9bb921c2613a6aa92d162edf39b3b" dependencies = [ "craft-aaf", - "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", - "craft-timeline 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", + "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", + "craft-timeline 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", "filmcraft-cfb", "filmcraft-color", "filmcraft-geom", @@ -3097,31 +3052,32 @@ dependencies = [ [[package]] name = "filmcraft-isobmff" version = "0.20.1" -source = "git+https://github.com/storytold/filmcraft?rev=d6cc257f55e83b16af4be6bf9c371e6798f00af6#d6cc257f55e83b16af4be6bf9c371e6798f00af6" +source = "git+https://github.com/storytold/filmcraft?rev=e7345f6e04a9bb921c2613a6aa92d162edf39b3b#e7345f6e04a9bb921c2613a6aa92d162edf39b3b" dependencies = [ - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", ] [[package]] name = "filmcraft-matroska" version = "0.20.1" -source = "git+https://github.com/storytold/filmcraft?rev=d6cc257f55e83b16af4be6bf9c371e6798f00af6#d6cc257f55e83b16af4be6bf9c371e6798f00af6" +source = "git+https://github.com/storytold/filmcraft?rev=e7345f6e04a9bb921c2613a6aa92d162edf39b3b#e7345f6e04a9bb921c2613a6aa92d162edf39b3b" dependencies = [ - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", ] [[package]] name = "filmcraft-media" version = "0.20.1" -source = "git+https://github.com/storytold/filmcraft?rev=d6cc257f55e83b16af4be6bf9c371e6798f00af6#d6cc257f55e83b16af4be6bf9c371e6798f00af6" +source = "git+https://github.com/storytold/filmcraft?rev=e7345f6e04a9bb921c2613a6aa92d162edf39b3b#e7345f6e04a9bb921c2613a6aa92d162edf39b3b" dependencies = [ - "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", - "craft-dpx 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", - "craft-exr 0.1.0 (git+https://github.com/storytold/craft-libs?rev=8b40f1a4b0718916e7c136c1b91b38a5c7531a0e)", + "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", + "craft-dpx 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", + "craft-exr 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", "craft-hdr", - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", "craft-media-source", - "craft-psd 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", + "craft-psd 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", + "craft-sniff", "craft-tga", "craft-tiff", "filmcraft-color", @@ -3137,7 +3093,7 @@ dependencies = [ [[package]] name = "filmcraft-project" version = "0.20.1" -source = "git+https://github.com/storytold/filmcraft?rev=d6cc257f55e83b16af4be6bf9c371e6798f00af6#d6cc257f55e83b16af4be6bf9c371e6798f00af6" +source = "git+https://github.com/storytold/filmcraft?rev=e7345f6e04a9bb921c2613a6aa92d162edf39b3b#e7345f6e04a9bb921c2613a6aa92d162edf39b3b" dependencies = [ "filmcraft-color", "filmcraft-geom", @@ -3152,9 +3108,9 @@ dependencies = [ [[package]] name = "filmcraft-time" version = "0.20.1" -source = "git+https://github.com/storytold/filmcraft?rev=d6cc257f55e83b16af4be6bf9c371e6798f00af6#d6cc257f55e83b16af4be6bf9c371e6798f00af6" +source = "git+https://github.com/storytold/filmcraft?rev=e7345f6e04a9bb921c2613a6aa92d162edf39b3b#e7345f6e04a9bb921c2613a6aa92d162edf39b3b" dependencies = [ - "craft-timeline 0.1.0 (git+https://github.com/storytold/craft-libs?rev=dc6adc3fbd9cf39e4a8210f94106a5b0c3e26e17)", + "craft-timeline 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 1dbbffffd..627ea1365 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -97,25 +97,25 @@ same-file = "1.0" tempfile = "3.27" # codecs + containers shared by the Craft apps (crates/media, crates/export); keep all in sync. -craft-media = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "6a061a30bdd4a6cc24329334d5e44241896edba6", default-features = false, features = ["isobmff", "matroska"] } -craft-media-source = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "6a061a30bdd4a6cc24329334d5e44241896edba6" } -craft-frame = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "6a061a30bdd4a6cc24329334d5e44241896edba6" } -craft-color = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "6a061a30bdd4a6cc24329334d5e44241896edba6" } -craft-time = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "6a061a30bdd4a6cc24329334d5e44241896edba6" } -craft-audio = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "6a061a30bdd4a6cc24329334d5e44241896edba6", default-features = false, features = ["aac-decode", "aac-encode", "alac-decode", "opus-decode", "opus-encode", "ac3-decode", "mp3-decode", "mpa-decode"] } -craft-video = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "6a061a30bdd4a6cc24329334d5e44241896edba6", features = ["h264-decode", "h264-encode", "prores", "hevc-encode", "vp9-encode", "av1", "threads"] } +craft-media = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "33be35625e252cc4f06aa375b3b428521faea37d", default-features = false, features = ["isobmff", "matroska"] } +craft-media-source = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "33be35625e252cc4f06aa375b3b428521faea37d" } +craft-frame = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "33be35625e252cc4f06aa375b3b428521faea37d" } +craft-color = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "33be35625e252cc4f06aa375b3b428521faea37d" } +craft-time = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "33be35625e252cc4f06aa375b3b428521faea37d" } +craft-audio = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "33be35625e252cc4f06aa375b3b428521faea37d", default-features = false, features = ["aac-decode", "aac-encode", "alac-decode", "opus-decode", "opus-encode", "ac3-decode", "mp3-decode", "mpa-decode"] } +craft-video = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "33be35625e252cc4f06aa375b3b428521faea37d", features = ["h264-decode", "h264-encode", "prores", "hevc-encode", "vp9-encode", "av1", "threads"] } # footage decoding: FilmCraft's pure-Rust crates, pinned to a revision (plan/adr/0001). # Only `crates/media`, `crates/export` and `crates/interchange` may depend on these. -filmcraft-codecs = { git = "https://github.com/storytold/filmcraft", rev = "d6cc257f55e83b16af4be6bf9c371e6798f00af6" } -filmcraft-media = { git = "https://github.com/storytold/filmcraft", rev = "d6cc257f55e83b16af4be6bf9c371e6798f00af6" } -filmcraft-frame = { git = "https://github.com/storytold/filmcraft", rev = "d6cc257f55e83b16af4be6bf9c371e6798f00af6" } -filmcraft-color = { git = "https://github.com/storytold/filmcraft", rev = "d6cc257f55e83b16af4be6bf9c371e6798f00af6" } -filmcraft-time = { git = "https://github.com/storytold/filmcraft", rev = "d6cc257f55e83b16af4be6bf9c371e6798f00af6" } +filmcraft-codecs = { git = "https://github.com/storytold/filmcraft", rev = "e7345f6e04a9bb921c2613a6aa92d162edf39b3b" } +filmcraft-media = { git = "https://github.com/storytold/filmcraft", rev = "e7345f6e04a9bb921c2613a6aa92d162edf39b3b" } +filmcraft-frame = { git = "https://github.com/storytold/filmcraft", rev = "e7345f6e04a9bb921c2613a6aa92d162edf39b3b" } +filmcraft-color = { git = "https://github.com/storytold/filmcraft", rev = "e7345f6e04a9bb921c2613a6aa92d162edf39b3b" } +filmcraft-time = { git = "https://github.com/storytold/filmcraft", rev = "e7345f6e04a9bb921c2613a6aa92d162edf39b3b" } # timeline interchange (EDL, FCP7 XML, FCPXML, OTIO) for Premiere Pro interop (crates/interchange only) -filmcraft-interchange = { git = "https://github.com/storytold/filmcraft", rev = "d6cc257f55e83b16af4be6bf9c371e6798f00af6" } -filmcraft-project = { git = "https://github.com/storytold/filmcraft", rev = "d6cc257f55e83b16af4be6bf9c371e6798f00af6" } -filmcraft-geom = { git = "https://github.com/storytold/filmcraft", rev = "d6cc257f55e83b16af4be6bf9c371e6798f00af6" } +filmcraft-interchange = { git = "https://github.com/storytold/filmcraft", rev = "e7345f6e04a9bb921c2613a6aa92d162edf39b3b" } +filmcraft-project = { git = "https://github.com/storytold/filmcraft", rev = "e7345f6e04a9bb921c2613a6aa92d162edf39b3b" } +filmcraft-geom = { git = "https://github.com/storytold/filmcraft", rev = "e7345f6e04a9bb921c2613a6aa92d162edf39b3b" } # gpu (the same wgpu eframe / egui-wgpu use) wgpu = { version = "30.0.1", features = ["fragile-send-sync-non-atomic-wasm"] } From 47391863accb86a7556bac0b61b70711bda3209c Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Mon, 23 Nov 2026 09:33:40 -0500 Subject: [PATCH 397/451] ci(release): forward ARTCRAFT_SERVICES_DISPATCH_TOKEN secret (#4112) --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ffbe49afb..b38c3d2b8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -54,3 +54,4 @@ jobs: AZURE_SIGNING_ACCOUNT: ${{ secrets.AZURE_SIGNING_ACCOUNT }} AZURE_CERT_PROFILE: ${{ secrets.AZURE_CERT_PROFILE }} LINUX_SIGNING_KEY: ${{ secrets.LINUX_SIGNING_KEY }} + ARTCRAFT_SERVICES_DISPATCH_TOKEN: ${{ secrets.ARTCRAFT_SERVICES_DISPATCH_TOKEN }} From 54bc1ba26f17c33f4f346a4fe2a944fd68b36071 Mon Sep 17 00:00:00 2001 From: skylartaylor Date: Sun, 22 Nov 2026 21:56:30 +0100 Subject: [PATCH 398/451] fix(media): retain unsupported shared video error semantics --- crates/media/src/craft_source.rs | 14 ++++++++++---- crates/media/src/pool.rs | 26 +++++++++++++++++++++++--- 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/crates/media/src/craft_source.rs b/crates/media/src/craft_source.rs index 4459ac129..1bf733128 100644 --- a/crates/media/src/craft_source.rs +++ b/crates/media/src/craft_source.rs @@ -1674,6 +1674,13 @@ fn decode_track_packet( Ok(vec![frame]) } +fn video_decode_error(error: VideoError) -> MediaError { + match error { + VideoError::Unsupported(detail) => MediaError::Unsupported(detail), + other => MediaError::Decode(other.to_string()), + } +} + struct AudioTrackState { decoder: AudioTrackDecoder, audio_starts: AudioStarts, @@ -1842,7 +1849,7 @@ impl MediaSource for CraftMediaSource { // Backward seek, jump to a later GOP, or draft/full-quality mode switch: reset decoder to // the target sync sample so full-quality frames never reuse draft-decoded references. if draft_changed || target_idx < state.next_decode_idx || sync_idx > state.gop_start_idx { - state.decoder.reset().map_err(|e| MediaError::Decode(e.to_string()))?; + state.decoder.reset().map_err(video_decode_error)?; state.decoded.clear(); state.next_decode_idx = sync_idx; state.gop_start_idx = sync_idx; @@ -1859,12 +1866,11 @@ impl MediaSource for CraftMediaSource { let idx = state.next_decode_idx; let pts = self.file.sample_pts(video_idx, idx); let pkt = self.file.read_sample(&*self.source, video_idx, idx)?; - let frames = - decode_track_packet(&mut state.decoder, is_isobmff, &pkt, pts, prores::decode_frame_with).map_err(|e| MediaError::Decode(e.to_string()))?; + let frames = decode_track_packet(&mut state.decoder, is_isobmff, &pkt, pts, prores::decode_frame_with).map_err(video_decode_error)?; state.next_decode_idx = idx + 1; push_decoded(&mut state.decoded, frames, want_draft, self.presentation, &self.file, video_idx)?; } else if !state.flushed { - let frames = state.decoder.flush().map_err(|e| MediaError::Decode(e.to_string()))?; + let frames = state.decoder.flush().map_err(video_decode_error)?; state.flushed = true; push_decoded(&mut state.decoded, frames, want_draft, self.presentation, &self.file, video_idx)?; break; diff --git a/crates/media/src/pool.rs b/crates/media/src/pool.rs index 041b235db..92c7031f5 100644 --- a/crates/media/src/pool.rs +++ b/crates/media/src/pool.rs @@ -2029,10 +2029,30 @@ fn describe_problem(codec: &str, e: &MediaError) -> String { MediaError::Cancelled => "the decode was called off", }; let mut unsupported = matches!(e, MediaError::Unsupported(_)); - while let Some(rest) = ["decode error: ", "unsupported media: ", "unsupported: ", "I/O error: "].iter().find_map(|p| detail.strip_prefix(p)) { - unsupported |= detail.starts_with("unsupported"); - detail = rest; + loop { + if let Some(rest) = ["decode error: ", "unsupported media: ", "unsupported video: ", "malformed video: ", "unsupported: ", "I/O error: "] + .iter() + .find_map(|p| detail.strip_prefix(p)) + { + unsupported |= detail.starts_with("unsupported"); + detail = rest; + } else if !codec.is_empty() + && let Some(rest) = detail.strip_prefix(codec).and_then(|s| s.strip_prefix(": ")) + { + detail = rest; + } else { + break; + } } + // Present the stream's chroma sampling, not the shared decoder's H.264 syntax-field number. + let detail = if codec == "H.264" { + [("chroma_format_idc 0 ", "monochrome "), ("chroma_format_idc 2 ", "4:2:2 chroma "), ("chroma_format_idc 3 ", "4:4:4 chroma ")] + .into_iter() + .find_map(|(syntax, label)| detail.strip_prefix(syntax).map(|rest| format!("{label}{rest}"))) + .unwrap_or_else(|| detail.to_owned()) + } else { + detail.to_owned() + }; let what = if codec.is_empty() { "This video" } else { codec }; if unsupported { format!("{what} isn't supported by the built-in decoder: {detail}") } else { format!("{what} can't be decoded: {detail}") } } From e17252b8a3ec6c34cffa494b96801e3978d39fc9 Mon Sep 17 00:00:00 2001 From: skylar taylor-barrick Date: Mon, 23 Nov 2026 10:12:34 -0600 Subject: [PATCH 399/451] fix(gpu): bring the colour kernel's cold compile time back to release level (#4111) The fixed 32-step searches from 3678cc9be and f0a5783a8 were unrolled at every inlined call, so software Vulkan drivers took long enough compiling fxl_point to miss the 10 s readback deadline. Each search now has one call site and runs a host-computed trip count that is the same for every invocation: still bounded, non-divergent and without dynamic lane writes. --- crates/gpu/src/fx_lut.rs | 64 ++++++++++++++++++++++++++++-- crates/gpu/src/shaders/fx_lut.wgsl | 45 ++++++++++++++------- 2 files changed, 91 insertions(+), 18 deletions(-) diff --git a/crates/gpu/src/fx_lut.rs b/crates/gpu/src/fx_lut.rs index cf8df08d6..532679c0e 100644 --- a/crates/gpu/src/fx_lut.rs +++ b/crates/gpu/src/fx_lut.rs @@ -37,16 +37,29 @@ pub(crate) const IDS: &[&str] = &[ /// Largest LUT the kernels take (floats in the storage buffer); bigger ones render on the CPU. const MAX_FLOATS: usize = 1 << 24; +/// Most halvings the kernel's partition searches run (`fxl_search_steps` caps the count there). +const SHADER_MAX_STEPS: u32 = 32; + +/// Halvings a partition search over `n` entries runs: `n`'s bit length, which every search +/// finishes within, plus one to spare. +const fn search_steps(n: usize) -> u32 { + usize::BITS - n.leading_zeros() + 1 +} + +// A program's tables fit in MAX_FLOATS floats, so none needs more halvings than the kernel runs. +const _: () = assert!(search_steps(MAX_FLOATS) <= SHADER_MAX_STEPS); + /// Run effect `id` (one of [`IDS`]); `None` = this parameter combination runs on the CPU. pub(crate) fn apply(e: &mut Enc, id: &str, ctx: &EffectCtx, b: GBuf) -> Option { let (ops, straight) = effectcraft_effects::color_program(id, ctx)?; if ops.is_empty() { return Some(b); } - let data = encode(&ops)?; + let (data, steps) = encode(&ops)?; let buf = e.data(&data); let mut p = Params::default(); p.u[0][0] = (straight == Straight::Divide) as u32; + p.u[0][1] = steps; let out = e.scratch(b.img.width, b.img.height); e.pixels("fxl_point", &p, &b.img, None, &out, Some(&buf)); Some(GBuf { img: out, ..b }) @@ -79,11 +92,13 @@ pub(crate) fn push_lut(d: &mut Vec, lut: &Lut) -> f32 { at } -/// Program layout: a stream of (opcode, arguments…) ending in 0, followed by LUT data. -fn encode(ops: &[ColorOp]) -> Option> { +/// Program layout: a stream of (opcode, arguments…) ending in 0, followed by LUT data; and the +/// halvings the kernel's partition searches need for this program's tables. +fn encode(ops: &[ColorOp]) -> Option<(Vec, u32)> { if ops.len() > MAX_OPS { return None; } + let mut steps = 0; let mut prog: Vec = vec![]; let mut tables: Vec> = vec![]; // LUT offsets are patched once the program's length is known. @@ -142,6 +157,13 @@ fn encode(ops: &[ColorOp]) -> Option> { prog.extend(lo.iter().chain(hi)); } ColorOp::Lut { lut, shaper, interp, inverse } => { + // The kernel searches an inverted 1D table and every shaper channel. + if *inverse && lut.n3 == 0 { + steps = steps.max(search_steps(lut.n1)); + } + for channel in shaper.iter().flat_map(|s| s.iter()) { + steps = steps.max(search_steps(channel.len())); + } prog.extend([8.0, 0.0, *interp as f32, *inverse as u32 as f32, -1.0]); let mut t = vec![]; push_lut(&mut t, lut); @@ -179,5 +201,39 @@ fn encode(ops: &[ColorOp]) -> Option> { for t in tables { prog.extend(t); } - Some(prog) + Some((prog, steps)) +} + +#[cfg(test)] +mod tests { + use super::*; + + /// The kernel's partition search (fxl_shape, fxl_inv_1d) run for `steps` halvings over the + /// sorted table 0, 1, …, n - 1: the index of the first entry not below `x`. + fn search(n: usize, steps: u32, x: f64) -> usize { + let (mut lo, mut hi) = (0, n); + for _ in 0..steps { + if lo < hi { + let mid = lo + (hi - lo) / 2; + if (mid as f64) < x { + lo = mid + 1; + } else { + hi = mid; + } + } + } + lo + } + + #[test] + fn search_steps_finish_every_partition_search() { + for n in [1, 2, 3, 4, 5, 255, 256, 257, 1 << 16, (1 << 16) + 1, MAX_FLOATS / 3, MAX_FLOATS] { + let steps = search_steps(n); + assert!(steps <= SHADER_MAX_STEPS, "{n} entries need more halvings than the kernel runs"); + for x in [-1.0, 0.0, 0.5, n as f64 / 3.0 + 0.5, n as f64 - 1.5, n as f64 - 0.5, n as f64 + 1.0] { + let want = (x.ceil().max(0.0) as usize).min(n); + assert_eq!(search(n, steps, x), want, "{n} entries, target {x}"); + } + } + } } diff --git a/crates/gpu/src/shaders/fx_lut.wgsl b/crates/gpu/src/shaders/fx_lut.wgsl index f9081f834..b4d51a0ad 100644 --- a/crates/gpu/src/shaders/fx_lut.wgsl +++ b/crates/gpu/src/shaders/fx_lut.wgsl @@ -120,6 +120,14 @@ fn mix_exact(a: vec3, b: vec3, t: f32) -> vec3 { return a + (b - a) * t; } +// Halvings for the partition searches (fxl_shape, fxl_inv_1d): written per dispatch by fx_lut.rs +// (enough for the largest table the program searches) and capped here. Every invocation runs the +// same count, so the loops stay bounded and non-divergent, but because the count isn't known when +// the shader is compiled, a software driver doesn't unroll every search into the kernel. +fn fxl_search_steps() -> u32 { + return min(P.u[0].y, 32u); +} + // ocio::shape over `n` (x, y) points at `at` (`flip`: the curve with x and y swapped). fn fxl_shape(at: u32, n: u32, x: f32, flip: bool) -> f32 { if (n < 2u) { @@ -130,8 +138,8 @@ fn fxl_shape(at: u32, n: u32, x: f32, flip: bool) -> f32 { // partition_point(|p| p.x < x). var lo = 0u; var hi = n; - // Bound the partition search as for inverse 1D LUTs below. - for (var step = 0u; step < 32u; step++) { + // Bounded as for inverse 1D LUTs below. + for (var step = 0u; step < fxl_search_steps(); step++) { if (lo < hi) { let mid = lo + (hi - lo) / 2u; if (data[at + mid * 2u + kx] < x) { @@ -161,14 +169,17 @@ fn fxl_shaper_at(s: u32, k: u32) -> vec2 { // Evaluate independent shaper channels without dynamically writing vector lanes. fn fxl_shaper_apply(sh: u32, c: vec3, flip: bool) -> vec3 { - let r = fxl_shaper_at(sh, 0u); - let g = fxl_shaper_at(sh, 1u); - let b = fxl_shaper_at(sh, 2u); - return vec3( - fxl_shape(r.x, r.y, c.x, flip), - fxl_shape(g.x, g.y, c.y, flip), - fxl_shape(b.x, b.y, c.z, flip) - ); + // One search per kernel instead of three: a software driver unrolls each fixed-length + // search, so every extra call multiplies compile time. Lanes are read and written with + // select(), never by a dynamic index. + var r = c; + for (var k = 0u; k < 3u; k++) { + let lane = vec3(k == 0u, k == 1u, k == 2u); + let a = fxl_shaper_at(sh, k); + let v = fxl_shape(a.x, a.y, select(select(c.z, c.y, k == 1u), c.x, k == 0u), flip); + r = select(r, vec3(v), lane); + } + return r; } fn fxl_file_fwd(o: u32, sh: i32, c0: vec3, interp: u32) -> vec3 { @@ -188,9 +199,10 @@ fn fxl_inv_1d(o: u32, i: u32, y: f32) -> f32 { // partition_point over the table's values. var lo = 0u; var hi = n; - // A u32 interval needs at most 32 halvings. A fixed trip count avoids - // a divergent data-dependent loop on software Vulkan without changing lookup. - for (var step = 0u; step < 32u; step++) { + // fxl_search_steps() halvings cover every table this program searches. A trip count shared + // by every invocation avoids a divergent data-dependent loop on software Vulkan without + // changing lookup. + for (var step = 0u; step < fxl_search_steps(); step++) { if (lo < hi) { let mid = lo + (hi - lo) / 2u; if (data[b1 + mid * 3u + i] < y) { @@ -218,7 +230,12 @@ fn fxl_file(o: u32, sh: i32, c: vec3, interp: u32, inverse: bool) -> vec3 1u) { - x = vec3(fxl_inv_1d(o, 0u, c.x), fxl_inv_1d(o, 1u, c.y), fxl_inv_1d(o, 2u, c.z)); + // One search call for all three channels, as in fxl_shaper_apply. + for (var k = 0u; k < 3u; k++) { + let lane = vec3(k == 0u, k == 1u, k == 2u); + let v = fxl_inv_1d(o, k, select(select(c.z, c.y, k == 1u), c.x, k == 0u)); + x = select(x, vec3(v), lane); + } } if (sh >= 0) { x = fxl_shaper_apply(u32(sh), x, true); From 53f1312448b9d87ddf9d4ec7ce62112a02da6fa9 Mon Sep 17 00:00:00 2001 From: skylar taylor-barrick Date: Mon, 23 Nov 2026 11:07:49 -0600 Subject: [PATCH 400/451] fix(media): queue source decode roots before entering Rayon (#4074) (#4110) --- crates/media/src/pool.rs | 163 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 153 insertions(+), 10 deletions(-) diff --git a/crates/media/src/pool.rs b/crates/media/src/pool.rs index 041b235db..f8c596189 100644 --- a/crates/media/src/pool.rs +++ b/crates/media/src/pool.rs @@ -554,7 +554,68 @@ impl Sources { /// A movie/audio source by path ([`Opened`]), opened by the first caller while the others wait /// for it (`None`: failed to open; not retried until `forget`), with the file's identity as /// opened. -type SourceSlot = Arc, ReadFile)>>; +type SourceSlot = Arc; + +#[derive(Default)] +struct Source { + opened: OnceLock<(Option, ReadFile)>, + #[cfg(not(target_arch = "wasm32"))] + dispatch: Mutex, +} + +#[cfg(not(target_arch = "wasm32"))] +type DecodeJob = Box; + +#[cfg(not(target_arch = "wasm32"))] +#[derive(Default)] +struct Dispatch { + active: bool, + pending: VecDeque, +} + +#[cfg(not(target_arch = "wasm32"))] +impl Source { + fn enqueue(self: &Arc, workers: &'static rayon::ThreadPool, job: DecodeJob) { + let mut dispatch = lock(&self.dispatch); + if dispatch.active { + dispatch.pending.push_back(job); + return; + } + dispatch.active = true; + drop(dispatch); + self.start(workers, job); + } + + fn start(self: &Arc, workers: &'static rayon::ThreadPool, job: DecodeJob) { + let source = self.clone(); + workers.spawn_fifo(move || { + // Release on errors and unwinding too. Never hold the dispatch lock during a decode. + let _permit = DecodePermit { source, workers }; + job(); + }); + } +} + +#[cfg(not(target_arch = "wasm32"))] +struct DecodePermit { + source: SourceSlot, + workers: &'static rayon::ThreadPool, +} + +#[cfg(not(target_arch = "wasm32"))] +impl Drop for DecodePermit { + fn drop(&mut self) { + let mut dispatch = lock(&self.source.dispatch); + let next = dispatch.pending.pop_front(); + if next.is_none() { + dispatch.active = false; + } + drop(dispatch); + if let Some(job) = next { + self.source.start(self.workers, job); + } + } +} /// An opened movie/audio source, the turn its picture is shown with and the order its decoded /// audio channels arrive in. @@ -1198,7 +1259,11 @@ impl Inner { /// Each call notes the file as read (see [`crate::reads`]), with its identity as opened. fn opened(&self, path: &Arc) -> Option { let slot = lock(&self.sources).slot(path); - let (opened, file) = slot.get_or_init(|| self.open(path)); + self.opened_in(path, &slot) + } + + fn opened_in(&self, path: &Arc, slot: &SourceSlot) -> Option { + let (opened, file) = slot.opened.get_or_init(|| self.open(path)); reads::note(file.clone()); opened.clone() } @@ -1634,6 +1699,10 @@ impl Inner { /// (wasm32) or this is one of them. With the files the decode read (see [`crate::reads`]): /// collected on the thread that decodes, not noted anywhere (the caller notes them). fn run_decode(self: &Arc, loc: &Loc, footage: &Footage) -> (Result, ReadFiles) { + // A codec can yield to Rayon while holding its source's decoder mutex. Keep later + // roots for that source OUT of the work-stealing pool until this root finishes (#4074). + // Carry the slot too: forget/reopen must not pair an old permit with a new decoder. + let source = loc.media_t.map(|_| lock(&self.sources).slot(&loc.key.path)); #[cfg(not(target_arch = "wasm32"))] if let Some(threads) = decode_threads() && threads.current_thread_index().is_none() @@ -1642,14 +1711,20 @@ impl Inner { let (me, at, f) = (self.clone(), loc.clone(), footage.clone()); // The request's cancel flag and decoding hints go with it (#329). let hints = filmcraft_media::cancel::Context::current(); - threads.spawn(move || { + let slot = source.clone(); + let job = Box::new(move || { #[cfg(not(test))] - let decoded = reads::captured(|| hints.run(|| me.decode_source(&at, &f))); + let decoded = reads::captured(|| hints.run(|| me.decode_source(&at, &f, slot.as_ref()))); // (the decodes counted on that thread are this thread's) #[cfg(test)] - let decoded = crate::exr_channels::counting(|| reads::captured(|| hints.run(|| me.decode_source(&at, &f)))); + let decoded = crate::exr_channels::counting(|| reads::captured(|| hints.run(|| me.decode_source(&at, &f, slot.as_ref())))); let _ = tx.send(decoded); }); + if let Some(source) = &source { + source.enqueue(threads, job); + } else { + threads.spawn(job); + } // A plain block: this thread runs nothing else meanwhile. return match rx.recv() { #[cfg(not(test))] @@ -1668,11 +1743,14 @@ impl Inner { }; } let _decoding = Decoding::new(); - reads::captured(|| self.decode_source(loc, footage)) + reads::captured(|| self.decode_source(loc, footage, source.as_ref())) } /// Decode the picture `loc` names: a still whole, a movie frame at its size. - fn decode_source(&self, loc: &Loc, footage: &Footage) -> Result { + fn decode_source(&self, loc: &Loc, footage: &Footage, source: Option<&SourceSlot>) -> Result { + if filmcraft_media::cancel::cancelled() { + return Err(MediaError::Cancelled); + } self.decodes.fetch_add(1, Ordering::Relaxed); #[cfg(test)] { @@ -1684,7 +1762,7 @@ impl Inner { } match loc.media_t { None => self.decode_still(loc, footage).map(|img| Pixels::F32(Arc::new(img))), - Some(_) => self.decode_media(loc, footage), + Some(_) => self.decode_media(loc, footage, source), } } @@ -1748,7 +1826,7 @@ impl Inner { } } - fn decode_media(&self, loc: &Loc, footage: &Footage) -> Result { + fn decode_media(&self, loc: &Loc, footage: &Footage, source: Option<&SourceSlot>) -> Result { let op = AlphaOp::of(footage, loc.float); let path = &loc.key.path; let f32 = |img| Pixels::F32(Arc::new(img)); @@ -1760,7 +1838,8 @@ impl Inner { Ok(f32(dynamic_to_image(frame, op))) } Some(mt) => { - let Opened { src, turn, .. } = self.opened(path).ok_or_else(|| MediaError::Io(format!("{path}: cannot open")))?; + let opened = source.map_or_else(|| self.opened(path), |slot| self.opened_in(path, slot)); + let Opened { src, turn, .. } = opened.ok_or_else(|| MediaError::Io(format!("{path}: cannot open")))?; // A movie shown turned a quarter (a phone held upright): the footage's size and // the render's are the turned picture's, the decoded frame's are the file's. let side = |(w, h): (u32, u32)| if crate::probe::swaps_sides(turn) { (h, w) } else { (w, h) }; @@ -2489,6 +2568,70 @@ mod tests { .collect() } + /// #4074: nested codec work may steal another root. A queued same-source root must not + /// re-enter its locked decoder, and an independent source must still make progress. + #[cfg(not(target_arch = "wasm32"))] + #[test] + fn movie_dispatch_does_not_reenter_a_locked_source() { + let workers: &'static _ = Box::leak(Box::new(rayon::ThreadPoolBuilder::new().num_threads(1).build().unwrap())); + let codec = Arc::new(rayon::ThreadPoolBuilder::new().num_threads(1).build().unwrap()); + let source = SourceSlot::default(); + let decoder = Arc::new(Mutex::new(())); + let (entered_tx, entered_rx) = std::sync::mpsc::channel(); + let (release_tx, release_rx) = std::sync::mpsc::channel(); + let (done_tx, done_rx) = std::sync::mpsc::channel(); + let first_decoder = decoder.clone(); + source.enqueue( + workers, + Box::new(move || { + let _decoder = lock(&first_decoder); + codec.install(move || { + entered_tx.send(()).unwrap(); + release_rx.recv().unwrap(); + }); + }), + ); + entered_rx.recv_timeout(std::time::Duration::from_secs(20)).unwrap(); + source.enqueue( + workers, + Box::new(move || { + let _decoder = lock(&decoder); + done_tx.send(()).unwrap(); + }), + ); + let other = SourceSlot::default(); + let (other_tx, other_rx) = std::sync::mpsc::channel(); + other.enqueue(workers, Box::new(move || other_tx.send(()).unwrap())); + let independent = other_rx.recv_timeout(std::time::Duration::from_secs(2)); + // Always release the codec, including on regression failure. The timeout bounds a + // deadlock; no decode duration or throughput is being asserted. + release_tx.send(()).unwrap(); + assert!(independent.is_ok(), "another source must finish while this codec is parked"); + done_rx.recv_timeout(std::time::Duration::from_secs(20)).unwrap(); + } + + #[cfg(not(target_arch = "wasm32"))] + #[test] + fn movie_dispatch_releases_queued_work_after_a_panic() { + let workers: &'static _ = Box::leak(Box::new(rayon::ThreadPoolBuilder::new().num_threads(1).panic_handler(|_| {}).build().unwrap())); + let source = SourceSlot::default(); + let (entered_tx, entered_rx) = std::sync::mpsc::channel(); + let (release_tx, release_rx) = std::sync::mpsc::channel(); + source.enqueue( + workers, + Box::new(move || { + entered_tx.send(()).unwrap(); + release_rx.recv().unwrap(); + panic!("a codec failed"); + }), + ); + entered_rx.recv_timeout(std::time::Duration::from_secs(20)).unwrap(); + let (done_tx, done_rx) = std::sync::mpsc::channel(); + source.enqueue(workers, Box::new(move || done_tx.send(()).unwrap())); + release_tx.send(()).unwrap(); + done_rx.recv_timeout(std::time::Duration::from_secs(20)).unwrap(); + } + /// #3269: requests for a frame being decoded wait for that decode and take its picture, also /// on rayon workers (the viewer's frame workers), which each decoded a private copy before. #[test] From 6c90f7ce0e3d69b7c7db8fcd016a0c1db5492733 Mon Sep 17 00:00:00 2001 From: skylartaylor Date: Mon, 23 Nov 2026 18:54:58 +0100 Subject: [PATCH 401/451] test(media): cover the shared decoder error mapping --- crates/media/src/craft_source.rs | 9 +++++++++ crates/media/src/pool.rs | 28 ++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/crates/media/src/craft_source.rs b/crates/media/src/craft_source.rs index 1bf733128..7518b13b4 100644 --- a/crates/media/src/craft_source.rs +++ b/crates/media/src/craft_source.rs @@ -2870,6 +2870,15 @@ mod raw_avi_tests; mod tests { use super::*; + /// A decoder's "unsupported" stays unsupported; anything else is a decode failure. + #[test] + fn video_decode_errors_keep_unsupported_apart() { + assert!(matches!(video_decode_error(VideoError::Unsupported("H.264: 4:2:2".into())), MediaError::Unsupported(s) if s == "H.264: 4:2:2")); + assert!( + matches!(video_decode_error(VideoError::Malformed("VP9: bad header".into())), MediaError::Decode(s) if s == "malformed video: VP9: bad header") + ); + } + // One 20 ms mono packet from craft-audio's generated tone.opus test fixture. // Re-mux it into ordinary small audio-only files without an external encoder. const OPUS_TONE: &[u8] = b"\x78\x82\x01\xB7\x6C\x7E\x40\xE6\x00\x00\x0A\xBE\x9A\xA7\xBE\xFF\xB6\x85\xD7\x0A\x71\xE0\xDD\ diff --git a/crates/media/src/pool.rs b/crates/media/src/pool.rs index 92c7031f5..14bca26bf 100644 --- a/crates/media/src/pool.rs +++ b/crates/media/src/pool.rs @@ -2343,6 +2343,34 @@ mod tests { assert_eq!(c.bytes, (16 * 16 * 16 + 64) + (16 * 16 * 4 + 64)); } + /// The shared decoder's real messages read without their wrappers or the H.264 syntax-field + /// number, and stay "unsupported" or "can't be decoded" as the decoder said. + #[test] + fn describe_problem_unwraps_shared_decoder_errors() { + let unsupported = |s: &str| MediaError::Unsupported(s.into()); + assert_eq!( + describe_problem("H.264", &unsupported("H.264: unsupported: chroma_format_idc 2 (only 4:2:0 is implemented)")), + "H.264 isn't supported by the built-in decoder: 4:2:2 chroma (only 4:2:0 is implemented)" + ); + assert_eq!( + describe_problem("H.264", &unsupported("H.264: chroma_format_idc 0 stream")), + "H.264 isn't supported by the built-in decoder: monochrome stream" + ); + assert_eq!(describe_problem("H.264", &unsupported("chroma_format_idc 3 stream")), "H.264 isn't supported by the built-in decoder: 4:4:4 chroma stream"); + // The relabel is H.264's own field: another codec keeps the text. + assert_eq!( + describe_problem("HEVC", &unsupported("chroma_format_idc 2 stream")), + "HEVC isn't supported by the built-in decoder: chroma_format_idc 2 stream" + ); + // A wrapped "unsupported" inside a decode error still counts as unsupported. + assert_eq!( + describe_problem("VP9", &MediaError::Decode("decode error: unsupported video: VP9: profile 3".into())), + "VP9 isn't supported by the built-in decoder: profile 3" + ); + assert_eq!(describe_problem("VP9", &MediaError::Decode("malformed video: VP9: bad frame header".into())), "VP9 can't be decoded: bad frame header"); + assert_eq!(describe_problem("", &MediaError::Decode("malformed video: truncated".into())), "This video can't be decoded: truncated"); + } + /// #482: an OpenEXR file with HTJ2K compression (which the decoder lacks) says so on import /// and when its frame is read, instead of "no non-deep rgb channels" or a transparent frame. #[test] From 5e578049a55aef4e057e775c6cda1f56fdfad859 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Mon, 23 Nov 2026 13:16:54 -0500 Subject: [PATCH 402/451] ci(release): publish scheduled nightly prereleases (#4128) --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b38c3d2b8..b8b4b2a0f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,7 +33,7 @@ jobs: # Intentionally tracked at @main (not SHA-pinned) so org-wide CI improvements, security fixes, and build optimizations propagate without PR churn across all craftapp repos. uses: storytold/craft-common-actions/.github/workflows/release.yml@main with: - dry-run: ${{ github.event_name == 'schedule' }} + nightly: ${{ github.event_name == 'schedule' }} app-name: effectcraft app-title: EffectCraft version: ${{ inputs.version }} From 73bc1a99e475d07d1decb7e8653c48cb74bacad1 Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Mon, 23 Nov 2026 20:12:36 +0100 Subject: [PATCH 403/451] Release: bump effectcraft to v0.25.1 (#3985) Co-authored-by: FredApps --- Cargo.lock | 70 +++++++++++++++++++++++++++--------------------------- Cargo.toml | 2 +- 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dcdb4f274..b967eb41d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1929,7 +1929,7 @@ dependencies = [ [[package]] name = "effectcraft" -version = "0.24.1" +version = "0.25.1" dependencies = [ "chrono", "cpal", @@ -1958,7 +1958,7 @@ dependencies = [ [[package]] name = "effectcraft-aep" -version = "0.24.1" +version = "0.25.1" dependencies = [ "craft-aep", "craft-mime", @@ -1975,7 +1975,7 @@ dependencies = [ [[package]] name = "effectcraft-automation" -version = "0.24.1" +version = "0.25.1" dependencies = [ "craft-jsonrpc", "craft-mime", @@ -1991,7 +1991,7 @@ dependencies = [ [[package]] name = "effectcraft-cli" -version = "0.24.1" +version = "0.25.1" dependencies = [ "cpu-time", "effectcraft-automation", @@ -2010,7 +2010,7 @@ dependencies = [ [[package]] name = "effectcraft-color" -version = "0.24.1" +version = "0.25.1" dependencies = [ "proptest", "serde", @@ -2018,7 +2018,7 @@ dependencies = [ [[package]] name = "effectcraft-effects" -version = "0.24.1" +version = "0.25.1" dependencies = [ "chrono", "craft-cms", @@ -2037,7 +2037,7 @@ dependencies = [ [[package]] name = "effectcraft-engine" -version = "0.24.1" +version = "0.25.1" dependencies = [ "chrono", "craft-docpath", @@ -2077,7 +2077,7 @@ dependencies = [ [[package]] name = "effectcraft-export" -version = "0.24.1" +version = "0.25.1" dependencies = [ "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", "craft-exr 0.1.0 (git+https://github.com/storytold/craft-libs?rev=3b8e426a260695af840a2cd79a064d40778f939e)", @@ -2105,7 +2105,7 @@ dependencies = [ [[package]] name = "effectcraft-expr" -version = "0.24.1" +version = "0.25.1" dependencies = [ "boa_engine", "effectcraft-color", @@ -2122,7 +2122,7 @@ dependencies = [ [[package]] name = "effectcraft-geom" -version = "0.24.1" +version = "0.25.1" dependencies = [ "proptest", "serde", @@ -2130,7 +2130,7 @@ dependencies = [ [[package]] name = "effectcraft-gpu" -version = "0.24.1" +version = "0.25.1" dependencies = [ "bytemuck", "effectcraft-color", @@ -2153,7 +2153,7 @@ dependencies = [ [[package]] name = "effectcraft-helper-host" -version = "0.24.1" +version = "0.25.1" dependencies = [ "bytemuck", "effectcraft-effects", @@ -2164,7 +2164,7 @@ dependencies = [ [[package]] name = "effectcraft-host" -version = "0.24.1" +version = "0.25.1" dependencies = [ "craft-vectorcraft-format", "effectcraft-engine", @@ -2192,7 +2192,7 @@ dependencies = [ [[package]] name = "effectcraft-interchange" -version = "0.24.1" +version = "0.25.1" dependencies = [ "craft-timeline 0.1.0 (git+https://github.com/storytold/craft-libs?rev=0d6dd8bed815b8366869a800d2bf22588ca62dcb)", "effectcraft-color", @@ -2212,7 +2212,7 @@ dependencies = [ [[package]] name = "effectcraft-keyframe" -version = "0.24.1" +version = "0.25.1" dependencies = [ "effectcraft-color", "effectcraft-geom", @@ -2224,7 +2224,7 @@ dependencies = [ [[package]] name = "effectcraft-lottie" -version = "0.24.1" +version = "0.25.1" dependencies = [ "craft-docpath", "craft-lottie", @@ -2243,7 +2243,7 @@ dependencies = [ [[package]] name = "effectcraft-media" -version = "0.24.1" +version = "0.25.1" dependencies = [ "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=30596f73c5ef851ba3dad9cf145669f391e2eb0d)", "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", @@ -2286,7 +2286,7 @@ dependencies = [ [[package]] name = "effectcraft-model" -version = "0.24.1" +version = "0.25.1" dependencies = [ "craft-mesh", "effectcraft-geom", @@ -2298,7 +2298,7 @@ dependencies = [ [[package]] name = "effectcraft-path" -version = "0.24.1" +version = "0.25.1" dependencies = [ "effectcraft-geom", "effectcraft-keyframe", @@ -2311,7 +2311,7 @@ dependencies = [ [[package]] name = "effectcraft-pdf" -version = "0.24.1" +version = "0.25.1" dependencies = [ "craft-doc", "craft-pdf", @@ -2332,7 +2332,7 @@ dependencies = [ [[package]] name = "effectcraft-plugin" -version = "0.24.1" +version = "0.25.1" dependencies = [ "effectcraft-effects", "effectcraft-keyframe", @@ -2344,7 +2344,7 @@ dependencies = [ [[package]] name = "effectcraft-project" -version = "0.24.1" +version = "0.25.1" dependencies = [ "craft-ecproj-format", "effectcraft-color", @@ -2358,7 +2358,7 @@ dependencies = [ [[package]] name = "effectcraft-psd" -version = "0.24.1" +version = "0.25.1" dependencies = [ "craft-codepage", "craft-psd 0.1.0 (git+https://github.com/storytold/craft-libs?rev=53198114310dbc2b41e18e4eaf2fd83e69964189)", @@ -2367,7 +2367,7 @@ dependencies = [ [[package]] name = "effectcraft-raster" -version = "0.24.1" +version = "0.25.1" dependencies = [ "craft-exr 0.1.0 (git+https://github.com/storytold/craft-libs?rev=3b8e426a260695af840a2cd79a064d40778f939e)", "effectcraft-color", @@ -2378,7 +2378,7 @@ dependencies = [ [[package]] name = "effectcraft-render" -version = "0.24.1" +version = "0.25.1" dependencies = [ "effectcraft-color", "effectcraft-effects", @@ -2402,7 +2402,7 @@ dependencies = [ [[package]] name = "effectcraft-sam2" -version = "0.24.1" +version = "0.25.1" dependencies = [ "bytemuck", "candle-core", @@ -2417,7 +2417,7 @@ dependencies = [ [[package]] name = "effectcraft-script" -version = "0.24.1" +version = "0.25.1" dependencies = [ "boa_engine", "effectcraft-engine", @@ -2435,7 +2435,7 @@ dependencies = [ [[package]] name = "effectcraft-segment" -version = "0.24.1" +version = "0.25.1" dependencies = [ "miniz_oxide 0.9.1", "ndarray", @@ -2444,7 +2444,7 @@ dependencies = [ [[package]] name = "effectcraft-svg" -version = "0.24.1" +version = "0.25.1" dependencies = [ "craft-svg", "effectcraft-geom", @@ -2458,7 +2458,7 @@ dependencies = [ [[package]] name = "effectcraft-text" -version = "0.24.1" +version = "0.25.1" dependencies = [ "effectcraft-keyframe", "harfrust", @@ -2470,7 +2470,7 @@ dependencies = [ [[package]] name = "effectcraft-time" -version = "0.24.1" +version = "0.25.1" dependencies = [ "proptest", "serde", @@ -2478,7 +2478,7 @@ dependencies = [ [[package]] name = "effectcraft-track" -version = "0.24.1" +version = "0.25.1" dependencies = [ "craft-mime", "effectcraft-raster", @@ -2491,7 +2491,7 @@ dependencies = [ [[package]] name = "effectcraft-ui-egui" -version = "0.24.1" +version = "0.25.1" dependencies = [ "bytemuck", "chrono", @@ -2534,7 +2534,7 @@ dependencies = [ [[package]] name = "effectcraft-web" -version = "0.24.1" +version = "0.25.1" dependencies = [ "effectcraft-engine", "effectcraft-export", @@ -8642,7 +8642,7 @@ checksum = "e450f9b2ed1dff33c94c12589a87338689467b9c4f5d8a5710bd09a847d2c8a7" [[package]] name = "xtask" -version = "0.24.1" +version = "0.25.1" dependencies = [ "chrono", "pkg-config", diff --git a/Cargo.toml b/Cargo.toml index 376772e5b..8a9a9d097 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ members = ["crates/*", "apps/*", "xtask"] default-members = ["crates/*", "apps/*"] [workspace.package] -version = "0.24.1" +version = "0.25.1" edition = "2024" license = "MIT OR Apache-2.0" rust-version = "1.95" From 86af5cba7f6976fe2b4561df4e8021ba807591f5 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Mon, 23 Nov 2026 14:45:01 -0500 Subject: [PATCH 404/451] revert: restore scheduled release.yml dry-run on main (#4131) --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b8b4b2a0f..b38c3d2b8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,7 +33,7 @@ jobs: # Intentionally tracked at @main (not SHA-pinned) so org-wide CI improvements, security fixes, and build optimizations propagate without PR churn across all craftapp repos. uses: storytold/craft-common-actions/.github/workflows/release.yml@main with: - nightly: ${{ github.event_name == 'schedule' }} + dry-run: ${{ github.event_name == 'schedule' }} app-name: effectcraft app-title: EffectCraft version: ${{ inputs.version }} From 88abc334d207c97e46ab526d35d265f0f870031d Mon Sep 17 00:00:00 2001 From: aiongg Date: Tue, 24 Nov 2026 16:45:28 +0000 Subject: [PATCH 405/451] minimal-port repin: 49 edits (revs 45, features 4) --- Cargo.toml | 86 +++++++++++++++++++-------------------- crates/effects/Cargo.toml | 2 +- crates/media/Cargo.toml | 2 +- crates/ui-egui/Cargo.toml | 4 +- 4 files changed, 47 insertions(+), 47 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 8a9a9d097..c1f909485 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,29 +11,29 @@ rust-version = "1.95" repository = "https://github.com/storytold/effectcraft" [workspace.dependencies] -craft-timeline = { git = "https://github.com/storytold/craft-libs", rev = "0d6dd8bed815b8366869a800d2bf22588ca62dcb", default-features = false } -craft-mime = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" } -craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "068e079c7be4b100a8a6b305b31ac881e069727e", version = "=0.1.0", default-features = false, features = ["read"] } -craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" } -craft-jsonrpc = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "bc186ca719958fcce3b6ee24794277eabed14609" } -craft-quit = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" } -craft-ecproj-format = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" } -craft-dpx = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" } -craft-ps = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "068e079c7be4b100a8a6b305b31ac881e069727e", default-features = false, features = ["read"] } -craft-exr = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "3b8e426a260695af840a2cd79a064d40778f939e" } -craft-gif = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "ba25ccd233934d1b2f74e3c0f235168bf5f13ef3" } -craft-tga = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "33be35625e252cc4f06aa375b3b428521faea37d" } -craft-psd = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "53198114310dbc2b41e18e4eaf2fd83e69964189" } -craft-codepage = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" } -craft-svg = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "3dff4793f1a5bd1f99a4fe3280d48f515158dff3" } -craft-webp = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" } -craft-lottie = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" } -craft-mesh = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87", default-features = false, features = ["stl", "obj", "gltf", "fbx"] } -craft-aep = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" } -craft-doc = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" } -craft-vectorcraft-format = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" } +craft-timeline = { git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1", default-features = false } +craft-mime = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } +craft-pdf = { git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1", version = "=0.1.0", default-features = false, features = ["read"] } +craft-docpath = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } +craft-jsonrpc = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } +craft-quit = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } +craft-ecproj-format = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } +craft-dpx = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } +craft-ps = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1", default-features = false, features = ["read"] } +craft-exr = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } +craft-gif = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } +craft-tga = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } +craft-psd = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } +craft-codepage = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } +craft-svg = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } +craft-webp = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } +craft-lottie = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } +craft-mesh = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1", default-features = false, features = ["stl", "obj", "gltf", "fbx"] } +craft-aep = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } +craft-doc = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } +craft-vectorcraft-format = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } # craft-update: app-specific pretend versions apply to startup and manual checks. -craft-update = { git = "https://github.com/storytold/craft-libs", version = "=0.1.0", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87", features = ["egui"] } +craft-update = { git = "https://github.com/aiongg/craft-libs", version = "=0.1.0", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1", features = ["ui"] } # internal effectcraft-time = { path = "crates/time" } effectcraft-geom = { path = "crates/geom" } @@ -98,13 +98,13 @@ same-file = "1.0" tempfile = "3.27" # codecs + containers shared by the Craft apps (crates/media, crates/export); keep all in sync. -craft-media = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "33be35625e252cc4f06aa375b3b428521faea37d", default-features = false, features = ["isobmff", "matroska"] } -craft-media-source = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "33be35625e252cc4f06aa375b3b428521faea37d" } -craft-frame = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "33be35625e252cc4f06aa375b3b428521faea37d" } -craft-color = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "33be35625e252cc4f06aa375b3b428521faea37d" } -craft-time = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "33be35625e252cc4f06aa375b3b428521faea37d" } -craft-audio = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "33be35625e252cc4f06aa375b3b428521faea37d", default-features = false, features = ["aac-decode", "aac-encode", "alac-decode", "opus-decode", "opus-encode", "ac3-decode", "mp3-decode", "mpa-decode"] } -craft-video = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "33be35625e252cc4f06aa375b3b428521faea37d", features = ["h264-decode", "h264-encode", "prores", "hevc-encode", "vp9-encode", "av1", "threads"] } +craft-media = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1", default-features = false, features = ["isobmff", "matroska"] } +craft-media-source = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } +craft-frame = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } +craft-color = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } +craft-time = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } +craft-audio = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1", default-features = false, features = ["aac-decode", "aac-encode", "alac-decode", "opus-decode", "opus-encode", "ac3-decode", "mp3-decode", "mpa-decode"] } +craft-video = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1", features = ["h264-decode", "h264-encode", "prores", "hevc-encode", "vp9-encode", "av1", "threads"] } # footage decoding: FilmCraft's pure-Rust crates, pinned to a revision (plan/adr/0001). # Only `crates/media`, `crates/export` and `crates/interchange` may depend on these. @@ -127,7 +127,7 @@ half = "2.7" # ui # Shared frontend components; keep this dependency above the engine boundary. # Shared UI and the complete egui family select reviewed immutable commits below. -craft-ui = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87", features = ["serde"] } +craft-ui = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } # `default_fonts` and `monochrome_emoji_fonts` are explicit: the app's `FontDefinitions::default()` # and its `✔`/`▣` chrome glyphs need both, and kittest's own dev-dependencies do not propagate. egui = { version = "0.37", default-features = false, features = ["default_fonts", "monochrome_emoji_fonts"] } @@ -232,19 +232,19 @@ lto = "thin" codegen-units = 1 [patch.crates-io] -hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "068e079c7be4b100a8a6b305b31ac881e069727e", version = "=0.7.2" } -hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "068e079c7be4b100a8a6b305b31ac881e069727e", version = "=0.3.0" } -ecolor = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" } -emath = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" } -epaint = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" } -epaint_default_fonts = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" } -egui = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" } -egui-winit = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" } -egui-wgpu = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" } -egui_glow = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" } -egui_extras = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" } -egui_kittest = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" } -eframe = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" } +hayro-syntax = { git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1", version = "=0.7.2" } +hayro-jbig2 = { git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1", version = "=0.3.0" } +ecolor = { git = "https://github.com/storytold/egui.git", rev = "f5025284445ea19c35f746d96fc0b75468b3f560" } +emath = { git = "https://github.com/storytold/egui.git", rev = "f5025284445ea19c35f746d96fc0b75468b3f560" } +epaint = { git = "https://github.com/storytold/egui.git", rev = "f5025284445ea19c35f746d96fc0b75468b3f560" } +epaint_default_fonts = { git = "https://github.com/storytold/egui.git", rev = "f5025284445ea19c35f746d96fc0b75468b3f560" } +egui = { git = "https://github.com/storytold/egui.git", rev = "f5025284445ea19c35f746d96fc0b75468b3f560" } +egui-winit = { git = "https://github.com/storytold/egui.git", rev = "f5025284445ea19c35f746d96fc0b75468b3f560" } +egui-wgpu = { git = "https://github.com/storytold/egui.git", rev = "f5025284445ea19c35f746d96fc0b75468b3f560" } +egui_glow = { git = "https://github.com/storytold/egui.git", rev = "f5025284445ea19c35f746d96fc0b75468b3f560" } +egui_extras = { git = "https://github.com/storytold/egui.git", rev = "f5025284445ea19c35f746d96fc0b75468b3f560" } +egui_kittest = { git = "https://github.com/storytold/egui.git", rev = "f5025284445ea19c35f746d96fc0b75468b3f560" } +eframe = { git = "https://github.com/storytold/egui.git", rev = "f5025284445ea19c35f746d96fc0b75468b3f560" } # Patch a crate only together with the dependency that needs it: an unused patch makes the Nix # build, which uses vendored sources, fail (`cargo xtask lock-patches`). winit = { git = "https://github.com/storytold/winit.git", rev = "a517b3846ee8457d84ee4975110bfda6797c44dc" } diff --git a/crates/effects/Cargo.toml b/crates/effects/Cargo.toml index f3b85c98a..1c4ea0b7a 100644 --- a/crates/effects/Cargo.toml +++ b/crates/effects/Cargo.toml @@ -10,7 +10,7 @@ rust-version.workspace = true workspace = true [dependencies] -craft-cms = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "58964adec11197594d9b6b79a94ae6232221211a" } +craft-cms = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } effectcraft-geom = { workspace = true } effectcraft-color = { workspace = true } effectcraft-keyframe = { workspace = true } diff --git a/crates/media/Cargo.toml b/crates/media/Cargo.toml index c23ceeb05..6d8c08790 100644 --- a/crates/media/Cargo.toml +++ b/crates/media/Cargo.toml @@ -10,7 +10,7 @@ rust-version.workspace = true workspace = true [dependencies] -craft-audio-markers = { package = "craft-audio", version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "30596f73c5ef851ba3dad9cf145669f391e2eb0d", default-features = false } +craft-audio-markers = { package = "craft-audio", version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1", default-features = false } craft-docpath = { workspace = true } effectcraft-time = { workspace = true } effectcraft-color = { workspace = true } diff --git a/crates/ui-egui/Cargo.toml b/crates/ui-egui/Cargo.toml index 81f2023c4..028344276 100644 --- a/crates/ui-egui/Cargo.toml +++ b/crates/ui-egui/Cargo.toml @@ -12,7 +12,7 @@ workspace = true [dependencies] craft-mime = { workspace = true } craft-ui = { workspace = true } -craft-quit = { workspace = true, features = ["egui"] } +craft-quit = { workspace = true, features = ["ui"] } effectcraft-time = { workspace = true } effectcraft-geom = { workspace = true } effectcraft-color = { workspace = true } @@ -40,7 +40,7 @@ bytemuck = { workspace = true } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] # Floating panels open in OS windows of their own on desktop; the web keeps them in the page. -craft-ui = { workspace = true, features = ["native-windows"] } +craft-ui = { workspace = true } craft-update = { workspace = true } # Waits for the display pass's error scopes (immediately ready on native wgpu). pollster = { workspace = true } From fd665b636071ce0e8a4f510e3b2b9975c01a927e Mon Sep 17 00:00:00 2001 From: aiongg Date: Tue, 24 Nov 2026 16:46:22 +0000 Subject: [PATCH 406/451] minimal-port rewrite: 102 edits (dock 50, combo 31, dock rename 9, split rename 7, split 3, deps 2) --- Cargo.toml | 1 + crates/ui-egui/Cargo.toml | 1 + crates/ui-egui/src/app/window.rs | 8 +++--- crates/ui-egui/src/credits.rs | 2 +- crates/ui-egui/src/dock.rs | 28 ++++++++++--------- crates/ui-egui/src/dock_ui.rs | 7 ++--- crates/ui-egui/src/menus/invoke.rs | 6 ++-- crates/ui-egui/src/menus/tests.rs | 12 ++++---- crates/ui-egui/src/panels.rs | 4 +-- crates/ui-egui/src/panels/comp_settings.rs | 10 +++---- crates/ui-egui/src/panels/dialogs.rs | 2 +- crates/ui-egui/src/panels/dialogs_3d.rs | 8 +++--- crates/ui-egui/src/panels/essential.rs | 10 +++---- crates/ui-egui/src/panels/forms.rs | 2 +- crates/ui-egui/src/panels/key_dialogs.rs | 2 +- .../ui-egui/src/panels/layer_styles_dialog.rs | 2 +- crates/ui-egui/src/panels/markers_ui.rs | 2 +- crates/ui-egui/src/panels/primitive_dialog.rs | 2 +- crates/ui-egui/src/panels/rq_templates.rs | 4 +-- crates/ui-egui/src/panels/scriptui_view.rs | 2 +- crates/ui-egui/src/panels/settings.rs | 6 ++-- crates/ui-egui/src/panels/shortcut_editor.rs | 2 +- crates/ui-egui/src/panels/tracker.rs | 6 ++-- .../ui-egui/src/panels/viewer_text/tests.rs | 8 +++--- crates/ui-egui/src/panels/viewers.rs | 2 +- crates/ui-egui/src/workspace_state/legacy.rs | 13 +++++---- .../src/workspace_state/legacy/tests.rs | 2 +- crates/ui-egui/src/workspace_state/tests.rs | 11 ++++---- crates/ui-egui/tests/it/shared_docking_ui.rs | 13 +++++---- crates/ui-egui/tests/it/ui_effect_controls.rs | 8 +++--- crates/ui-egui/tests/it/ui_panel_windows.rs | 4 +-- crates/ui-egui/tests/it/ui_scrolling.rs | 2 +- crates/ui-egui/tests/it/ui_viewers.rs | 12 ++++---- crates/ui-egui/tests/it/ui_workspace_focus.rs | 2 +- 34 files changed, 106 insertions(+), 100 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c1f909485..ff30114bb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -128,6 +128,7 @@ half = "2.7" # Shared frontend components; keep this dependency above the engine boundary. # Shared UI and the complete egui family select reviewed immutable commits below. craft-ui = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } +craft-behavior = { git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } # `default_fonts` and `monochrome_emoji_fonts` are explicit: the app's `FontDefinitions::default()` # and its `✔`/`▣` chrome glyphs need both, and kittest's own dev-dependencies do not propagate. egui = { version = "0.37", default-features = false, features = ["default_fonts", "monochrome_emoji_fonts"] } diff --git a/crates/ui-egui/Cargo.toml b/crates/ui-egui/Cargo.toml index 028344276..c7957f79a 100644 --- a/crates/ui-egui/Cargo.toml +++ b/crates/ui-egui/Cargo.toml @@ -12,6 +12,7 @@ workspace = true [dependencies] craft-mime = { workspace = true } craft-ui = { workspace = true } +craft-behavior = { workspace = true } craft-quit = { workspace = true, features = ["ui"] } effectcraft-time = { workspace = true } effectcraft-geom = { workspace = true } diff --git a/crates/ui-egui/src/app/window.rs b/crates/ui-egui/src/app/window.rs index 7326b9f32..e741932f4 100644 --- a/crates/ui-egui/src/app/window.rs +++ b/crates/ui-egui/src/app/window.rs @@ -105,10 +105,10 @@ impl EffectcraftApp { let opened = if p == PanelKind::Composition && near.is_none() && !known && self.ui.dock.is_docked(PanelKind::Timeline) { workspace .apply( - craft_ui::docking::Action::OpenAt { + craft_behavior::dock::Action::OpenAt { panel: p, anchor: PanelKind::Timeline, - placement: craft_ui::docking::Placement::Split(craft_ui::docking::Zone::Top), + placement: craft_behavior::dock::DockPlacement::Split(craft_ui::docking::Zone::Top), }, dock::permissions, ) @@ -116,7 +116,7 @@ impl EffectcraftApp { } else if known { workspace.set_visible(p, true, near, dock::permissions) } else { - workspace.apply(craft_ui::docking::Action::Open { panel: p, anchor: near }, dock::permissions).map(|_| ()) + workspace.apply(craft_behavior::dock::Action::Open { panel: p, anchor: near }, dock::permissions).map(|_| ()) }; match opened { Ok(()) => self.ui.dock = workspace, @@ -126,7 +126,7 @@ impl EffectcraftApp { } } } - let _ = self.ui.dock.apply(craft_ui::docking::Action::Activate { panel: p }, dock::permissions); + let _ = self.ui.dock.apply(craft_behavior::dock::Action::Activate { panel: p }, dock::permissions); if self.ui.dock.is_floating(p) { self.pending_panel_raise = Some(p); } diff --git a/crates/ui-egui/src/credits.rs b/crates/ui-egui/src/credits.rs index 381131fc5..213a08740 100644 --- a/crates/ui-egui/src/credits.rs +++ b/crates/ui-egui/src/credits.rs @@ -253,7 +253,7 @@ pub fn contributors_ui(ui: &mut egui::Ui, auto: &mut Registry) { } ui.separator(); ui.label(tr("Sort")); - let combo = craft_ui::ComboBox::from_id_salt("credits_sort").selected_text(tr(v.key.label().0)).show_ui(ui, |ui| { + let combo = egui::ComboBox::from_id_salt("credits_sort").selected_text(tr(v.key.label().0)).show_ui(ui, |ui| { for k in SortKey::ALL { let r = ui.selectable_label(v.key == k, tr(k.label().0)); auto.add(&format!("about.credits.sort.{}", k.id()), r.rect, k.label().0); diff --git a/crates/ui-egui/src/dock.rs b/crates/ui-egui/src/dock.rs index e19763f90..b08d06349 100644 --- a/crates/ui-egui/src/dock.rs +++ b/crates/ui-egui/src/dock.rs @@ -7,8 +7,9 @@ use egui::{Align2, Rect, Sense, Stroke, pos2, vec2}; use serde::{Deserialize, Serialize}; -pub use craft_ui::docking::{Floating, Node, PanelState, Permissions, StackEntry}; -pub use craft_ui::layout::{SplitAxis, SplitSize}; +pub use craft_behavior::dock::{Floating, Node, PanelState, Permissions, StackEntry}; +pub use craft_behavior::flow::Axis; +pub use craft_behavior::dock::SplitSize; use crate::icons::{self, Icon}; use crate::theme::Tokens; @@ -172,9 +173,9 @@ impl PanelKind { } /// The docked tree plus floating windows. -pub type Layout = craft_ui::docking::Layout; +pub type Layout = craft_behavior::dock::Layout; /// What a workspace saves: the layout, closed panels with where each goes back, and the lock. -pub type Workspace = craft_ui::docking::Workspace; +pub type Workspace = craft_behavior::dock::Workspace; /// What may happen to a panel. Every panel moves, floats and closes, as in After Effects /// (the Composition panel too: Window ▸ Composition reopens it); the last docked group staying @@ -194,11 +195,11 @@ pub fn stack(e: &[(PanelKind, bool, Option)]) -> Node { } /// Two frames side by side. pub fn hsplit(size: SplitSize, a: Node, b: Node) -> Node { - Node::Split { axis: SplitAxis::Horizontal, size, first: Box::new(a), second: Box::new(b) } + Node::Split { axis: Axis::X, size, first: Box::new(a), second: Box::new(b) } } /// Two frames one above the other. pub fn vsplit(size: SplitSize, a: Node, b: Node) -> Node { - Node::Split { axis: SplitAxis::Vertical, size, first: Box::new(a), second: Box::new(b) } + Node::Split { axis: Axis::Y, size, first: Box::new(a), second: Box::new(b) } } /// A workspace of just `root`, with no floating windows. @@ -491,7 +492,7 @@ pub fn referenced_panels(workspace: &Workspace) -> Vec { /// stack's split path (`a`/`b` per level) and the entry's index. pub fn stack_gutter_id(layout: &Layout, p: PanelKind) -> Option { fn rec(node: &Node, p: PanelKind, path: &mut String, depth: usize) -> Option { - if depth > craft_ui::docking::MAX_DEPTH { + if depth > craft_behavior::dock::MAX_DEPTH { return None; } match node { @@ -703,7 +704,8 @@ pub fn placeholder(ui: &mut egui::Ui, rect: Rect, t: &Tokens, text: &str) { mod tests { use super::*; use PanelKind::*; - use craft_ui::docking::{Action, Placement, Zone}; + use craft_behavior::dock::{Action, DockPlacement}; + use craft_ui::docking::Zone; fn apply(w: &mut Workspace, action: Action) { w.apply(action, permissions).unwrap(); @@ -751,7 +753,7 @@ mod tests { fn default_right_column_is_a_short_preview_frame_over_the_properties_frame() { let default = workspace("Default"); let Some(Node::Split { second, size: SplitSize::FixedSecond(300.0), .. }) = &default.root else { panic!("{default:?}") }; - let Node::Split { axis: SplitAxis::Vertical, size: SplitSize::FixedFirst(PREVIEW_FRAME), first, second } = second.as_ref() else { + let Node::Split { axis: Axis::Y, size: SplitSize::FixedFirst(PREVIEW_FRAME), first, second } = second.as_ref() else { panic!("{second:?}") }; assert_eq!(**first, tabs(&[Preview], 0)); @@ -759,7 +761,7 @@ mod tests { let mut w = Workspace::new(default); assert!(w.is_visible(Preview) && w.is_visible(Properties) && !w.is_visible(Align)); // The Properties frame takes tabs; the Preview frame stays a frame of its own. - apply(&mut w, Action::Move { panel: Project, anchor: Properties, placement: Placement::Tab { before: None } }); + apply(&mut w, Action::Move { panel: Project, anchor: Properties, placement: DockPlacement::Tab { before: None } }); assert_eq!(w.group_of(Project), vec![Properties, Align, Audio, EffectsPresets, Project]); assert_eq!(w.group_of(Preview), vec![Preview]); } @@ -767,15 +769,15 @@ mod tests { #[test] fn panels_split_off_and_join_tab_groups() { let mut w = docked(hsplit(SplitSize::FixedFirst(300.0), tabs(&[Project, EffectControls], 0), tabs(&[Composition, Layer], 0))); - apply(&mut w, Action::Move { panel: EffectControls, anchor: Composition, placement: Placement::Split(Zone::Right) }); + apply(&mut w, Action::Move { panel: EffectControls, anchor: Composition, placement: DockPlacement::Split(Zone::Right) }); assert_eq!(w.group_of(EffectControls), vec![EffectControls]); assert_eq!(w.group_of(Project), vec![Project]); - apply(&mut w, Action::Move { panel: EffectControls, anchor: Composition, placement: Placement::Tab { before: Some(Layer) } }); + apply(&mut w, Action::Move { panel: EffectControls, anchor: Composition, placement: DockPlacement::Tab { before: Some(Layer) } }); assert_eq!(w.group_of(Composition), vec![Composition, EffectControls, Layer]); assert!(w.is_visible(EffectControls)); // A rejected move (onto itself, onto a closed panel) changes nothing. let before = w.clone(); - assert!(w.apply(Action::Move { panel: Project, anchor: Info, placement: Placement::Split(Zone::Left) }, permissions).is_err()); + assert!(w.apply(Action::Move { panel: Project, anchor: Info, placement: DockPlacement::Split(Zone::Left) }, permissions).is_err()); assert_eq!(w, before); } diff --git a/crates/ui-egui/src/dock_ui.rs b/crates/ui-egui/src/dock_ui.rs index 1fbaa6f83..6e98e11ee 100644 --- a/crates/ui-egui/src/dock_ui.rs +++ b/crates/ui-egui/src/dock_ui.rs @@ -7,9 +7,8 @@ //! share one route. use crate::state::UiState; -use craft_ui::docking::{ - Action, Divider, DockArea, DockCommand, DockContent, DockError, DockEvent, DockStyle, FloatSpace, Floating, Hit, Node, ResizeEdge, UiDock, -}; +use craft_behavior::dock::{Action, DockError, Floating, Node}; +use craft_ui::docking::{Divider, DockArea, DockCommand, DockContent, DockEvent, DockStyle, FloatSpace, Hit, ResizeEdge, UiDock}; use egui::{Rect, Sense, Stroke, StrokeKind, pos2, vec2}; use serde_json::{Value, json}; @@ -286,7 +285,7 @@ impl EffectcraftApp { panels.into_iter().find(|panel| *panel != p) }); let actions = match anchor { - Some(anchor) => vec![Action::Move { panel: p, anchor, placement: craft_ui::docking::Placement::Tab { before: None } }], + Some(anchor) => vec![Action::Move { panel: p, anchor, placement: craft_behavior::dock::DockPlacement::Tab { before: None } }], // Nothing is docked: the panel becomes the docked layout. None => vec![Action::Close { panel: p }, Action::Open { panel: p, anchor: None }], }; diff --git a/crates/ui-egui/src/menus/invoke.rs b/crates/ui-egui/src/menus/invoke.rs index bdd614e74..4bb7fae7c 100644 --- a/crates/ui-egui/src/menus/invoke.rs +++ b/crates/ui-egui/src/menus/invoke.rs @@ -243,7 +243,7 @@ pub fn invoke(app: &mut EffectcraftApp, ctx: &egui::Context, id: &str, params: V // Close follows panel focus too: with the Render Queue active, Cmd+W closes that panel and // leaves the active composition open (it used to close the composition next to it). if id == "file.close" && no_params(¶ms) && app.ui.focused == PanelKind::RenderQueue { - app.apply_dock(craft_ui::docking::Action::Close { panel: PanelKind::RenderQueue })?; + app.apply_dock(craft_behavior::dock::Action::Close { panel: PanelKind::RenderQueue })?; // The focus goes to a panel that is still there, so the next Close acts on the composition // instead of on the queue that is gone. let next = [PanelKind::Timeline, PanelKind::Composition, PanelKind::Project].into_iter().find(|p| panel_shown(app, *p)).unwrap_or(PanelKind::Project); @@ -443,7 +443,7 @@ pub fn invoke(app: &mut EffectcraftApp, ctx: &egui::Context, id: &str, params: V "closePanel" => { let p = panel_of("panel").ok_or("closePanel: need `panel`")??; if app.ui.dock.is_open(p) { - app.apply_dock(craft_ui::docking::Action::Close { panel: p })?; + app.apply_dock(craft_behavior::dock::Action::Close { panel: p })?; } return Ok(Value::Null); } @@ -453,7 +453,7 @@ pub fn invoke(app: &mut EffectcraftApp, ctx: &egui::Context, id: &str, params: V Some(value) => serde_json::from_value::<[f32; 4]>(value.clone()).map_err(|_| "rect must contain four finite numbers")?, None => crate::dock_ui::default_float_rect(ctx.content_rect()), }; - app.apply_dock(craft_ui::docking::Action::Float { panel: p, rect: r }).map_err(|e| format!("can't undock {}: {e}", p.title()))?; + app.apply_dock(craft_behavior::dock::Action::Float { panel: p, rect: r }).map_err(|e| format!("can't undock {}: {e}", p.title()))?; return Ok(Value::Null); } _ => { diff --git a/crates/ui-egui/src/menus/tests.rs b/crates/ui-egui/src/menus/tests.rs index f261d1057..101c23956 100644 --- a/crates/ui-egui/src/menus/tests.rs +++ b/crates/ui-egui/src/menus/tests.rs @@ -680,7 +680,7 @@ fn closing_the_render_queue_reveals_the_panel_receiving_focus() { assert!(!app.ui.dock.is_visible(PanelKind::Project)); app.show_panel(PanelKind::RenderQueue); if maximized { - app.apply_dock(craft_ui::docking::Action::Float { panel: PanelKind::RenderQueue, rect: [50.0, 60.0, 400.0, 200.0] }).unwrap(); + app.apply_dock(craft_behavior::dock::Action::Float { panel: PanelKind::RenderQueue, rect: [50.0, 60.0, 400.0, 200.0] }).unwrap(); app.toggle_maximize(PanelKind::EffectControls); app.ui.focused = PanelKind::RenderQueue; assert!(app.ui.dock.is_floating(PanelKind::RenderQueue)); @@ -703,7 +703,7 @@ fn closing_a_floating_queue_preserves_the_maximized_composition() { let app = h.state_mut(); app.show_panel(PanelKind::Composition); app.show_panel(PanelKind::RenderQueue); - app.apply_dock(craft_ui::docking::Action::Float { panel: PanelKind::RenderQueue, rect: [50.0, 60.0, 400.0, 200.0] }).unwrap(); + app.apply_dock(craft_behavior::dock::Action::Float { panel: PanelKind::RenderQueue, rect: [50.0, 60.0, 400.0, 200.0] }).unwrap(); app.toggle_maximize(PanelKind::Composition); app.ui.focused = PanelKind::RenderQueue; assert!(app.ui.dock.is_visible(PanelKind::Timeline), "the hidden underlying tab triggers the regression"); @@ -747,10 +747,10 @@ fn queue_close_preserves_viewer_command_target() { app.ui.viewers.insert(0, Some(a)); app.ui.viewers.insert(1, Some(b)); app.ui.active_viewer = 1; - app.apply_dock(craft_ui::docking::Action::Move { + app.apply_dock(craft_behavior::dock::Action::Move { panel: PanelKind::Timeline, anchor: PanelKind::Composition, - placement: craft_ui::docking::Placement::Tab { before: None }, + placement: craft_behavior::dock::DockPlacement::Tab { before: None }, }) .unwrap(); app.close_panel(PanelKind::Timeline); @@ -779,10 +779,10 @@ fn queue_close_keeps_passive_viewer_focus_across_frames() { app.ui.viewers.insert(0, Some(a)); app.ui.viewers.insert(1, Some(b)); app.ui.active_viewer = 1; - app.apply_dock(craft_ui::docking::Action::Move { + app.apply_dock(craft_behavior::dock::Action::Move { panel: PanelKind::Timeline, anchor: PanelKind::Composition, - placement: craft_ui::docking::Placement::Tab { before: None }, + placement: craft_behavior::dock::DockPlacement::Tab { before: None }, }) .unwrap(); app.close_panel(PanelKind::Timeline); diff --git a/crates/ui-egui/src/panels.rs b/crates/ui-egui/src/panels.rs index 8feb8c8c5..e0be9a80d 100644 --- a/crates/ui-egui/src/panels.rs +++ b/crates/ui-egui/src/panels.rs @@ -344,13 +344,13 @@ pub(crate) fn panel_menu_area(app: &mut EffectcraftApp, ui: &mut egui::Ui) { // only ever narrows what the area measured: the separator fills whatever width it is given ui.set_max_width(ui.max_rect().width().min(width)); if ui.button(tr("Close Panel")).clicked() { - let _ = app.dock_command(ui.ctx(), craft_ui::docking::Action::Close { panel }); + let _ = app.dock_command(ui.ctx(), craft_behavior::dock::Action::Close { panel }); close = true; } let floating = crate::dock::WorkspaceExt::is_floating(&app.ui.dock, panel); if !floating && ui.button(tr("Undock Panel")).clicked() { let r = crate::dock_ui::default_float_rect(ui.ctx().content_rect()); - let _ = app.dock_command(ui.ctx(), craft_ui::docking::Action::Float { panel, rect: r }); + let _ = app.dock_command(ui.ctx(), craft_behavior::dock::Action::Float { panel, rect: r }); close = true; } // Multiple monitors: an OS window of its own, which can go on another screen. Where diff --git a/crates/ui-egui/src/panels/comp_settings.rs b/crates/ui-egui/src/panels/comp_settings.rs index b778a3999..e1c160975 100644 --- a/crates/ui-egui/src/panels/comp_settings.rs +++ b/crates/ui-egui/src/panels/comp_settings.rs @@ -268,7 +268,7 @@ fn tab_body( .or_else(|| PRESETS.iter().find(|(_, w, h, par, f)| matches(d, *w, *h, *par, *f)).map(|p| p.0)) .unwrap_or("Custom"); ui.horizontal(|ui| { - let r = craft_ui::ComboBox::from_id_salt("comp-preset").width(300.0).selected_text(current).show_ui(ui, |ui| { + let r = egui::ComboBox::from_id_salt("comp-preset").width(300.0).selected_text(current).show_ui(ui, |ui| { // Your own presets first, then the built-in ones. for q in custom { if ui.selectable_label(q.name == current, &q.name).clicked() { @@ -332,7 +332,7 @@ fn tab_body( .find(|(_, v)| (v - d.pixel_aspect).abs() < 1e-3) .map(|p| tr(p.0).to_string()) .unwrap_or_else(|| format!("{:.2}", d.pixel_aspect)); - let r = craft_ui::ComboBox::from_id_salt("comp-par").width(220.0).selected_text(cur).show_ui(ui, |ui| { + let r = egui::ComboBox::from_id_salt("comp-par").width(220.0).selected_text(cur).show_ui(ui, |ui| { for (name, v) in PIXEL_ASPECTS { if ui.selectable_label((v - d.pixel_aspect).abs() < 1e-3, tr(name)).clicked() { d.pixel_aspect = *v; @@ -351,7 +351,7 @@ fn tab_body( // Any rate can be typed; the list holds the common ones. let r = ui.add(crate::widgets::drag_value(egui::DragValue::new(&mut d.fps).range(1.0..=999.0).speed(0.01).max_decimals(3))); auto.add("dialog.comp.frameRate", r.rect, "Frame Rate"); - let r = craft_ui::ComboBox::from_id_salt("comp-fps").width(18.0).selected_text("").show_ui(ui, |ui| { + let r = egui::ComboBox::from_id_salt("comp-fps").width(18.0).selected_text("").show_ui(ui, |ui| { for f in FRAME_RATES { if ui.selectable_label((d.fps - f).abs() < 1e-3, format!("{f}")).clicked() { d.fps = *f; @@ -369,7 +369,7 @@ fn tab_body( // the frame it renders beside it. ui.label(tr("Resolution:")); ui.horizontal(|ui| { - let r = craft_ui::ComboBox::from_id_salt("comp-resolution").width(90.0).selected_text(tr(d.resolution.label())).show_ui(ui, |ui| { + let r = egui::ComboBox::from_id_salt("comp-resolution").width(90.0).selected_text(tr(d.resolution.label())).show_ui(ui, |ui| { for res in Resolution::ALL { ui.selectable_value(&mut d.resolution, res, tr(res.label())); } @@ -456,7 +456,7 @@ fn tab_body( Tab::Renderer => { ui.horizontal(|ui| { ui.label(tr("Renderer:")); - let r = craft_ui::ComboBox::from_id_salt("comp-renderer").selected_text(tr(if d.advanced_3d { "Advanced 3D" } else { "Classic 3D" })).show_ui( + let r = egui::ComboBox::from_id_salt("comp-renderer").selected_text(tr(if d.advanced_3d { "Advanced 3D" } else { "Classic 3D" })).show_ui( ui, |ui| { ui.selectable_value(&mut d.advanced_3d, false, tr("Classic 3D")); diff --git a/crates/ui-egui/src/panels/dialogs.rs b/crates/ui-egui/src/panels/dialogs.rs index 458ce60a9..f4033808b 100644 --- a/crates/ui-egui/src/panels/dialogs.rs +++ b/crates/ui-egui/src/panels/dialogs.rs @@ -623,7 +623,7 @@ fn solid(app: &mut EffectcraftApp, ctx: &egui::Context, t: &Tokens) { .find(|(_, v)| (v - par).abs() < 1e-3) .map(|p| p.0.to_string()) .unwrap_or_else(|| format!("{par:.2}")); - let r = craft_ui::ComboBox::from_id_salt("solid-par").width(240.0).selected_text(cur).show_ui(ui, |ui| { + let r = egui::ComboBox::from_id_salt("solid-par").width(240.0).selected_text(cur).show_ui(ui, |ui| { for (label, v) in super::comp_settings::PIXEL_ASPECTS { if ui.selectable_label((v - par).abs() < 1e-3, *label).clicked() { par = *v; diff --git a/crates/ui-egui/src/panels/dialogs_3d.rs b/crates/ui-egui/src/panels/dialogs_3d.rs index 16137b599..6a77af92b 100644 --- a/crates/ui-egui/src/panels/dialogs_3d.rs +++ b/crates/ui-egui/src/panels/dialogs_3d.rs @@ -197,7 +197,7 @@ pub fn camera(app: &mut EffectcraftApp, ctx: &egui::Context, t: &Tokens) { super::dialogs::modal_placed(ctx, "Camera Settings", vec2(520.0, 420.0), t, place, |ui| { egui::Grid::new("cam-grid").num_columns(2).spacing([14.0, 9.0]).show(ui, |ui| { ui.label(tr("Type")); - craft_ui::ComboBox::from_id_salt("cam-type").selected_text(if d.two_node { "Two-Node Camera" } else { "One-Node Camera" }).show_ui(ui, |ui| { + egui::ComboBox::from_id_salt("cam-type").selected_text(if d.two_node { "Two-Node Camera" } else { "One-Node Camera" }).show_ui(ui, |ui| { ui.selectable_value(&mut d.two_node, true, tr("Two-Node Camera")); ui.selectable_value(&mut d.two_node, false, tr("One-Node Camera")); }); @@ -209,7 +209,7 @@ pub fn camera(app: &mut EffectcraftApp, ctx: &egui::Context, t: &Tokens) { ui.label(tr("Preset")); let focal = focal_for_zoom(w, d.zoom); let cur = PRESETS.iter().find(|(_, f)| (f - focal).abs() < 1e-6).map(|(n, _)| *n).unwrap_or("Custom"); - craft_ui::ComboBox::from_id_salt("cam-preset").selected_text(cur).show_ui(ui, |ui| { + egui::ComboBox::from_id_salt("cam-preset").selected_text(cur).show_ui(ui, |ui| { for (n, f) in PRESETS { if ui.selectable_label(cur == n, n).clicked() { d.zoom = zoom_for_focal(w, f); @@ -313,7 +313,7 @@ pub fn light(app: &mut EffectcraftApp, ctx: &egui::Context, t: &Tokens) { crate::widgets::focus_on_open(ui.ctx(), &r, &d.name); ui.end_row(); ui.label(tr("Light Type")); - let combo = craft_ui::ComboBox::from_id_salt("light-type").selected_text(tr(d.kind.label())).show_ui(ui, |ui| { + let combo = egui::ComboBox::from_id_salt("light-type").selected_text(tr(d.kind.label())).show_ui(ui, |ui| { for (i, k) in LightKind::ALL.into_iter().enumerate() { let item = ui.selectable_value(&mut d.kind, k, tr(k.label())); app.auto.add(&format!("dialog.light.typeItem.{i}"), item.rect, k.label()); @@ -337,7 +337,7 @@ pub fn light(app: &mut EffectcraftApp, ctx: &egui::Context, t: &Tokens) { } if falls_off(d.kind) { ui.label(tr("Falloff")); - craft_ui::ComboBox::from_id_salt("light-falloff").selected_text(FALLOFFS[d.falloff.min(2)]).show_ui(ui, |ui| { + egui::ComboBox::from_id_salt("light-falloff").selected_text(FALLOFFS[d.falloff.min(2)]).show_ui(ui, |ui| { for (i, f) in FALLOFFS.iter().enumerate() { ui.selectable_value(&mut d.falloff, i, *f); } diff --git a/crates/ui-egui/src/panels/essential.rs b/crates/ui-egui/src/panels/essential.rs index 5df6f6b8c..a95d0f4b5 100644 --- a/crates/ui-egui/src/panels/essential.rs +++ b/crates/ui-egui/src/panels/essential.rs @@ -76,7 +76,7 @@ fn body(app: &mut EffectcraftApp, ui: &mut egui::Ui) -> (Actions, Actions) { // ---- Primary + Solo. ui.horizontal(|ui| { ui.label(RichText::new(tr("Primary:")).color(t.text_dim)); - let r = craft_ui::ComboBox::from_id_salt("eg-primary").selected_text(&comp_name).width(150.0).show_ui(ui, |ui| { + let r = egui::ComboBox::from_id_salt("eg-primary").selected_text(&comp_name).width(150.0).show_ui(ui, |ui| { for (id, _) in project.comps() { let name = project.item(*id).map(|i| i.name.clone()).unwrap_or_default(); if ui.selectable_label(*id == cid, name).clicked() { @@ -374,7 +374,7 @@ fn value_widget(app: &mut EffectcraftApp, ui: &mut egui::Ui, auto: &str, ty: Opt _ => vec![], }; let cur = v.as_enum() as usize; - let r = craft_ui::ComboBox::from_id_salt(("eg-dd", auto)).selected_text(opts.get(cur).cloned().unwrap_or_default()).show_ui(ui, |ui| { + let r = egui::ComboBox::from_id_salt(("eg-dd", auto)).selected_text(opts.get(cur).cloned().unwrap_or_default()).show_ui(ui, |ui| { for (i, o) in opts.iter().enumerate() { if ui.selectable_label(i == cur, o).clicked() { out = Some(json!(i)); @@ -443,7 +443,7 @@ fn value_widget(app: &mut EffectcraftApp, ui: &mut egui::Ui, auto: &str, ty: Opt let fams = effectcraft_engine::text::fonts::families(); let mut d = (**doc).clone(); let mut changed = false; - let r1 = craft_ui::ComboBox::from_id_salt(("eg-font", auto)).selected_text(&d.font).width(110.0).show_ui(ui, |ui| { + let r1 = egui::ComboBox::from_id_salt(("eg-font", auto)).selected_text(&d.font).width(110.0).show_ui(ui, |ui| { for (f, _) in &fams { if ui.selectable_label(*f == d.font, f).clicked() { d.font = f.clone(); @@ -452,7 +452,7 @@ fn value_widget(app: &mut EffectcraftApp, ui: &mut egui::Ui, auto: &str, ty: Opt } }); let styles: Vec = fams.iter().find(|(f, _)| *f == d.font).map(|(_, st)| st.clone()).unwrap_or_default(); - let r2 = craft_ui::ComboBox::from_id_salt(("eg-style", auto)).selected_text(&d.style).width(70.0).show_ui(ui, |ui| { + let r2 = egui::ComboBox::from_id_salt(("eg-style", auto)).selected_text(&d.style).width(70.0).show_ui(ui, |ui| { for st in &styles { if ui.selectable_label(*st == d.style, st).clicked() { d.style = st.clone(); @@ -538,7 +538,7 @@ fn instance(app: &mut EffectcraftApp, ui: &mut egui::Ui, actions: &mut Actions) .filter(|i| matches!(&i.kind, ItemKind::Footage(f) if f.has_video)) .map(|i| (i.id, i.name.clone())) .collect(); - let r = craft_ui::ComboBox::from_id_salt(("eg-media", layer.id.0, c.id)).selected_text(cur_name).show_ui(ui, |ui| { + let r = egui::ComboBox::from_id_salt(("eg-media", layer.id.0, c.id)).selected_text(cur_name).show_ui(ui, |ui| { for (id, name) in &items { if ui.selectable_label(*id == cur, name).clicked() { actions.push(("essential.set".into(), json!({"layer": layer.id.0, "control": c.id, "item": id.0}))); diff --git a/crates/ui-egui/src/panels/forms.rs b/crates/ui-egui/src/panels/forms.rs index 08aa9337b..4fa92bab6 100644 --- a/crates/ui-egui/src/panels/forms.rs +++ b/crates/ui-egui/src/panels/forms.rs @@ -905,7 +905,7 @@ fn form_grid(ui: &mut egui::Ui, f: &mut Form, regs: &mut Vec<(String, egui::Rect let cur = options.get(*sel).map(|o| o.0.clone()).unwrap_or_default(); // The column keeps its width: a long choice (a GPU adapter's name) ends in an // ellipsis instead of widening the form past the dialog (#978). - craft_ui::ComboBox::from_id_salt(("form", fl.key.as_str())) + egui::ComboBox::from_id_salt(("form", fl.key.as_str())) .selected_text(tr(&cur)) .width(240.0) .truncate() diff --git a/crates/ui-egui/src/panels/key_dialogs.rs b/crates/ui-egui/src/panels/key_dialogs.rs index db3144ffd..f264cd1b0 100644 --- a/crates/ui-egui/src/panels/key_dialogs.rs +++ b/crates/ui-egui/src/panels/key_dialogs.rs @@ -199,7 +199,7 @@ pub fn velocity(app: &mut EffectcraftApp, ctx: &egui::Context, t: &Tokens) { fn combo(ui: &mut egui::Ui, app: &mut EffectcraftApp, id: &str, sel: &mut usize, opts: &[&str], enabled: bool) { ui.add_enabled_ui(enabled, |ui| { // The options are the English source strings; the automation id and label stay English. - let r = craft_ui::ComboBox::from_id_salt(id).width(200.0).selected_text(tr(opts[*sel])).show_ui(ui, |ui| { + let r = egui::ComboBox::from_id_salt(id).width(200.0).selected_text(tr(opts[*sel])).show_ui(ui, |ui| { for (i, o) in opts.iter().enumerate() { ui.selectable_value(sel, i, tr(o)); } diff --git a/crates/ui-egui/src/panels/layer_styles_dialog.rs b/crates/ui-egui/src/panels/layer_styles_dialog.rs index 09b775e30..6afe614b5 100644 --- a/crates/ui-egui/src/panels/layer_styles_dialog.rs +++ b/crates/ui-egui/src/panels/layer_styles_dialog.rs @@ -96,7 +96,7 @@ fn control(ui: &mut egui::Ui, p: &Property, v: &KV) -> Option { } (KV::Enum(i), ParamUi::Popup { options }) => { let mut sel = *i as usize; - craft_ui::ComboBox::from_id_salt(("ls-popup", p.uid)).selected_text(options.get(sel).cloned().unwrap_or_default()).show_ui(ui, |ui| { + egui::ComboBox::from_id_salt(("ls-popup", p.uid)).selected_text(options.get(sel).cloned().unwrap_or_default()).show_ui(ui, |ui| { for (k, o) in options.iter().enumerate() { ui.selectable_value(&mut sel, k, o); } diff --git a/crates/ui-egui/src/panels/markers_ui.rs b/crates/ui-egui/src/panels/markers_ui.rs index ee33fc9de..26cfffc33 100644 --- a/crates/ui-egui/src/panels/markers_ui.rs +++ b/crates/ui-egui/src/panels/markers_ui.rs @@ -197,7 +197,7 @@ pub fn dialog(app: &mut EffectcraftApp, ctx: &egui::Context, t: &Tokens) { ui.label(tr("Label:")); let labels = effectcraft_engine::color::Label::ALL; let cur = labels.get(d.label).copied().unwrap_or_default(); - let r = craft_ui::ComboBox::from_id_salt("dialog.marker.label").selected_text(app.session.prefs.label_name(cur)).show_ui(ui, |ui| { + let r = egui::ComboBox::from_id_salt("dialog.marker.label").selected_text(app.session.prefs.label_name(cur)).show_ui(ui, |ui| { for (i, l) in labels.into_iter().enumerate() { if crate::widgets::label_entry(ui, l, &app.session.prefs.label_name(l), d.label == i, &app.tokens).clicked() { d.label = i; diff --git a/crates/ui-egui/src/panels/primitive_dialog.rs b/crates/ui-egui/src/panels/primitive_dialog.rs index 3711c6a80..a3483a976 100644 --- a/crates/ui-egui/src/panels/primitive_dialog.rs +++ b/crates/ui-egui/src/panels/primitive_dialog.rs @@ -58,7 +58,7 @@ pub fn dialog(app: &mut EffectcraftApp, ctx: &egui::Context, t: &Tokens) { super::dialogs::modal(ctx, "New 3D Primitive", vec2(420.0, 300.0), t, |ui| { egui::Grid::new("primitive-grid").num_columns(2).spacing([14.0, 9.0]).show(ui, |ui| { ui.label(tr("Type")); - let combo = craft_ui::ComboBox::from_id_salt("primitive-type").selected_text(tr(d.kind.label())).show_ui(ui, |ui| { + let combo = egui::ComboBox::from_id_salt("primitive-type").selected_text(tr(d.kind.label())).show_ui(ui, |ui| { for (i, k) in PrimitiveKind::ALL.into_iter().enumerate() { let item = ui.selectable_value(&mut d.kind, k, tr(k.label())); app.auto.add(&format!("dialog.primitive.typeItem.{i}"), item.rect, k.label()); diff --git a/crates/ui-egui/src/panels/rq_templates.rs b/crates/ui-egui/src/panels/rq_templates.rs index 93a458aae..31f221c8c 100644 --- a/crates/ui-egui/src/panels/rq_templates.rs +++ b/crates/ui-egui/src/panels/rq_templates.rs @@ -61,7 +61,7 @@ pub fn show(app: &mut EffectcraftApp, ctx: &egui::Context, t: &Tokens) { ui.label(slot.label()); let cur = templates.default_name(k, slot); let mut pick = cur.clone(); - let r = craft_ui::ComboBox::from_id_salt(("tpl-def", slot.label())).selected_text(&cur).width(300.0).show_ui(ui, |ui| { + let r = egui::ComboBox::from_id_salt(("tpl-def", slot.label())).selected_text(&cur).width(300.0).show_ui(ui, |ui| { for n in &list { ui.selectable_value(&mut pick, n.clone(), n); } @@ -79,7 +79,7 @@ pub fn show(app: &mut EffectcraftApp, ctx: &egui::Context, t: &Tokens) { ui.label(egui::RichText::new(tr("Settings")).font(Tokens::semibold(12.5)).color(t.text)); ui.horizontal(|ui| { ui.label(tr("Settings Name:")); - let r = craft_ui::ComboBox::from_id_salt("tpl-select").selected_text(&st.selected).width(300.0).show_ui(ui, |ui| { + let r = egui::ComboBox::from_id_salt("tpl-select").selected_text(&st.selected).width(300.0).show_ui(ui, |ui| { for n in &list { ui.selectable_value(&mut st.selected, n.clone(), n); } diff --git a/crates/ui-egui/src/panels/scriptui_view.rs b/crates/ui-egui/src/panels/scriptui_view.rs index 4b365afdf..8b056d81e 100644 --- a/crates/ui-egui/src/panels/scriptui_view.rs +++ b/crates/ui-egui/src/panels/scriptui_view.rs @@ -216,7 +216,7 @@ fn draw_widget(app: &mut EffectcraftApp, ui: &mut egui::Ui, origin: egui::Pos2, let mut pick: Option = None; ui.add_enabled_ui(w.enabled, |ui| { ui.scope_builder(UiBuilder::new().max_rect(rect), |ui| { - craft_ui::ComboBox::from_id_salt(id).selected_text(cur).width(rect.width() - 8.0).show_ui(ui, |ui| { + egui::ComboBox::from_id_salt(id).selected_text(cur).width(rect.width() - 8.0).show_ui(ui, |ui| { for (i, it) in w.items.iter().enumerate() { if it == "-" { ui.separator(); diff --git a/crates/ui-egui/src/panels/settings.rs b/crates/ui-egui/src/panels/settings.rs index ba9af77f1..56f6dc394 100644 --- a/crates/ui-egui/src/panels/settings.rs +++ b/crates/ui-egui/src/panels/settings.rs @@ -83,7 +83,7 @@ fn page_ui(app: &mut EffectcraftApp, ui: &mut egui::Ui, page: &Page, cur: &Value ui.add_sized(vec2(label_w, 18.0), egui::Label::new(tr("Default Output:"))); let shown = if sel.is_empty() { tr("System Default").to_string() } else { sel.clone() }; let shown_name = shown.clone(); - let r = craft_ui::ComboBox::from_id_salt(("settings", key)).selected_text(shown).width(260.0).show_ui(ui, |ui| { + let r = egui::ComboBox::from_id_salt(("settings", key)).selected_text(shown).width(260.0).show_ui(ui, |ui| { if ui.selectable_label(sel.is_empty(), tr("System Default")).clicked() { acts.push(Act::Set(key.into(), json!(""))); } @@ -173,7 +173,7 @@ fn page_ui(app: &mut EffectcraftApp, ui: &mut egui::Ui, page: &Page, cur: &Value let curv = v.as_str().map_or_else(|| v.to_string(), str::to_string); let shown = opts.iter().find(|o| o.1 == curv).map(|o| o.0).unwrap_or(curv.as_str()).to_string(); value_text = tr(&shown).to_string(); - craft_ui::ComboBox::from_id_salt(("settings", key)) + egui::ComboBox::from_id_salt(("settings", key)) .selected_text(tr(&shown)) .width(220.0) .show_ui(ui, |ui| { @@ -529,7 +529,7 @@ fn appearance_ui(app: &mut EffectcraftApp, ui: &mut egui::Ui, cur: &Value, t: &T ui.horizontal(|ui| { ui.add_sized(vec2(250.0, 18.0), egui::Label::new(format!("{}:", tr("Appearance Mode"))).truncate()); let shown = APPEARANCE_MODES.iter().find(|(_, v)| *v == mode).map_or(mode.as_str(), |(l, _)| *l); - let r = craft_ui::ComboBox::from_id_salt(("settings", "appearance.appearanceMode")) + let r = egui::ComboBox::from_id_salt(("settings", "appearance.appearanceMode")) .selected_text(tr(shown)) .width(220.0) .show_ui(ui, |ui| { diff --git a/crates/ui-egui/src/panels/shortcut_editor.rs b/crates/ui-egui/src/panels/shortcut_editor.rs index 80011613d..4a1e3c05e 100644 --- a/crates/ui-egui/src/panels/shortcut_editor.rs +++ b/crates/ui-egui/src/panels/shortcut_editor.rs @@ -268,7 +268,7 @@ pub fn show(app: &mut EffectcraftApp, ctx: &egui::Context, t: &Tokens) { // ---- preset bar ui.horizontal(|ui| { ui.label(tr("Preset:")); - let r = craft_ui::ComboBox::from_id_salt("sc-preset").selected_text(&active).width(220.0).show_ui(ui, |ui| { + let r = egui::ComboBox::from_id_salt("sc-preset").selected_text(&active).width(220.0).show_ui(ui, |ui| { for n in &presets { if ui.selectable_label(*n == active, n).clicked() { run.push(("shortcuts.preset".into(), json!({"op": "select", "name": n}))); diff --git a/crates/ui-egui/src/panels/tracker.rs b/crates/ui-egui/src/panels/tracker.rs index 8d50b4860..90b72f83e 100644 --- a/crates/ui-egui/src/panels/tracker.rs +++ b/crates/ui-egui/src/panels/tracker.rs @@ -541,7 +541,7 @@ pub fn options_dialog(app: &mut EffectcraftApp, ctx: &egui::Context, t: &Tokens) (LowConfidence::Adapt, "Adapt Feature"), ]; let cur = actions.iter().find(|(a, _)| *a == d.opts.action).map(|(_, l)| *l).unwrap_or("Adapt Feature"); - let r = craft_ui::ComboBox::from_id_salt("track-action") + let r = egui::ComboBox::from_id_salt("track-action") .selected_text(cur) .show_ui(ui, |ui| { for (a, l) in actions { @@ -594,7 +594,7 @@ pub fn target_dialog(app: &mut EffectcraftApp, ctx: &egui::Context, t: &Tokens) ui.horizontal(|ui| { ui.label(crate::i18n::tr("Layer:")); let cur = d.target.and_then(|id| layers.iter().find(|(l, _)| *l == id)).map(|(_, n)| n.clone()).unwrap_or_else(|| "None".into()); - let r = craft_ui::ComboBox::from_id_salt("track-target") + let r = egui::ComboBox::from_id_salt("track-target") .selected_text(cur) .width(240.0) .show_ui(ui, |ui| { @@ -627,7 +627,7 @@ pub fn apply_dialog(app: &mut EffectcraftApp, ctx: &egui::Context, t: &Tokens) { ui.horizontal(|ui| { ui.label(crate::i18n::tr("Apply Dimensions:")); let labels = [crate::i18n::tr("X and Y"), crate::i18n::tr("X only"), crate::i18n::tr("Y only")]; - let r = craft_ui::ComboBox::from_id_salt("track-apply-dims") + let r = egui::ComboBox::from_id_salt("track-apply-dims") .selected_text(labels[d.dims.min(2)]) .show_ui(ui, |ui| { for (i, l) in labels.iter().enumerate() { diff --git a/crates/ui-egui/src/panels/viewer_text/tests.rs b/crates/ui-egui/src/panels/viewer_text/tests.rs index be3e84b2c..ed813d4dd 100644 --- a/crates/ui-egui/src/panels/viewer_text/tests.rs +++ b/crates/ui-egui/src/panels/viewer_text/tests.rs @@ -143,9 +143,9 @@ impl ImePass { } /// One native floating window holding the Timeline's group and then the Viewer's. -fn two_group_window() -> craft_ui::docking::Floating { - let groups = vec![craft_ui::docking::Group::new(vec![PanelKind::Timeline], 0), craft_ui::docking::Group::new(vec![PanelKind::Viewer(1)], 0)]; - craft_ui::docking::Floating::stack(groups, [0.0, 0.0, 320.0, 360.0]).expect("two groups make a window") +fn two_group_window() -> craft_behavior::dock::Floating { + let groups = vec![craft_behavior::dock::Group::new(vec![PanelKind::Timeline], 0), craft_behavior::dock::Group::new(vec![PanelKind::Viewer(1)], 0)]; + craft_behavior::dock::Floating::stack(groups, [0.0, 0.0, 320.0, 360.0]).expect("two groups make a window") } impl ImePass { @@ -155,7 +155,7 @@ impl ImePass { fn window( &mut self, app: &mut EffectcraftApp, - window: &craft_ui::docking::Floating, + window: &craft_behavior::dock::Floating, events: Vec, viewer_first: bool, every: bool, diff --git a/crates/ui-egui/src/panels/viewers.rs b/crates/ui-egui/src/panels/viewers.rs index fabfe586f..2959cded0 100644 --- a/crates/ui-egui/src/panels/viewers.rs +++ b/crates/ui-egui/src/panels/viewers.rs @@ -327,7 +327,7 @@ fn add_viewer(app: &mut EffectcraftApp, near: u32) -> u32 { app.ui.viewers.insert(id, None); let p = panel(id); let anchor = [panel(near), PanelKind::Composition].into_iter().find(|q| app.ui.dock.is_open(*q)); - let _ = app.ui.dock.apply(craft_ui::docking::Action::Open { panel: p, anchor }, crate::dock::permissions); + let _ = app.ui.dock.apply(craft_behavior::dock::Action::Open { panel: p, anchor }, crate::dock::permissions); id } diff --git a/crates/ui-egui/src/workspace_state/legacy.rs b/crates/ui-egui/src/workspace_state/legacy.rs index bcb5a9691..73b30bbf5 100644 --- a/crates/ui-egui/src/workspace_state/legacy.rs +++ b/crates/ui-egui/src/workspace_state/legacy.rs @@ -17,8 +17,9 @@ use std::collections::BTreeMap; -use craft_ui::docking::{Floating, Node}; -use craft_ui::layout::{SplitAxis, SplitSize}; +use craft_behavior::dock::{Floating, Node}; +use craft_behavior::flow::Axis; +use craft_behavior::dock::SplitSize; use serde::Deserialize; use super::{Snapshot, VERSION}; @@ -154,13 +155,13 @@ fn workspace(root: OldNode, floating: Vec, windows: &[OldPanelWindo } fn node(old: OldNode, depth: usize) -> Result, String> { - if depth > craft_ui::docking::MAX_DEPTH { + if depth > craft_behavior::dock::MAX_DEPTH { return Err("workspace dock tree exceeds supported limits".into()); } Ok(match old { OldNode::Tabs { panels, active } => Node::Tabs { panels, active }, OldNode::Split { vertical, size, a, b } => Node::Split { - axis: if vertical { SplitAxis::Vertical } else { SplitAxis::Horizontal }, + axis: if vertical { Axis::Y } else { Axis::X }, size: match size { OldSplitSize::Ratio(value) => SplitSize::Ratio(value), OldSplitSize::FixedA(value) => SplitSize::FixedFirst(value), @@ -202,7 +203,7 @@ fn column(entries: Vec, depth: usize) -> Result, } let active = entry.active.min(panels.len().saturating_sub(1)); if entry.open { - if depth.saturating_add(frames.len()) > craft_ui::docking::MAX_DEPTH { + if depth.saturating_add(frames.len()) > craft_behavior::dock::MAX_DEPTH { return Err("workspace dock tree exceeds supported limits".into()); } let height = entry.height.filter(|h| h.is_finite() && *h > 0.0).map(|h| h.min(MAX_FRAME)); @@ -236,7 +237,7 @@ fn column(entries: Vec, depth: usize) -> Result, // Shares the rest with the flexible frames below. (None, None) => SplitSize::Ratio(1.0 / (below_flexible as f32 + 1.0)), }; - Node::Split { axis: SplitAxis::Vertical, size, first: Box::new(tabs), second: Box::new(rest) } + Node::Split { axis: Axis::Y, size, first: Box::new(tabs), second: Box::new(rest) } } }); below_fixed = match (own, below_fixed) { diff --git a/crates/ui-egui/src/workspace_state/legacy/tests.rs b/crates/ui-egui/src/workspace_state/legacy/tests.rs index a3d182f4f..8896d05a0 100644 --- a/crates/ui-egui/src/workspace_state/legacy/tests.rs +++ b/crates/ui-egui/src/workspace_state/legacy/tests.rs @@ -8,7 +8,7 @@ fn stack(count: usize) -> OldNode { #[test] fn stacked_frames_respect_the_remaining_tree_depth() { - let limit = craft_ui::docking::MAX_DEPTH; + let limit = craft_behavior::dock::MAX_DEPTH; assert!(node(stack(limit + 1), 0).is_ok()); assert!(node(stack(limit + 2), 0).is_err()); assert!(node(stack(1), limit).is_ok()); diff --git a/crates/ui-egui/src/workspace_state/tests.rs b/crates/ui-egui/src/workspace_state/tests.rs index aab2814ba..98a42fa65 100644 --- a/crates/ui-egui/src/workspace_state/tests.rs +++ b/crates/ui-egui/src/workspace_state/tests.rs @@ -1,7 +1,8 @@ use super::*; use crate::dock::{Floating, Layout, Node, StackEntry, WorkspaceExt as _}; -use craft_ui::docking::Action; -use craft_ui::layout::{SplitAxis, SplitSize}; +use craft_behavior::dock::Action; +use craft_behavior::flow::Axis; +use craft_behavior::dock::SplitSize; use effectcraft_engine::config::MemoryConfig; fn minimal() -> Workspace { @@ -23,7 +24,7 @@ fn corrupt_future_or_unknown_workspace_keeps_defaults_and_original_file() { ) }; let mut deep = r#"{"Tabs":{"panels":["Composition"],"active":0}}"#.to_string(); - for _ in 0..=craft_ui::docking::MAX_DEPTH { + for _ in 0..=craft_behavior::dock::MAX_DEPTH { deep = format!(r#"{{"Split":{{"vertical":true,"size":{{"Ratio":0.5}},"a":{deep},"b":{{"Tabs":{{"panels":[],"active":0}}}}}}}}"#); } let twice = @@ -215,14 +216,14 @@ fn invalid_tabs_split_and_deep_tree_are_rejected() { let mut snapshot = Snapshot::capture(&UiState::default()); snapshot.dock = Workspace::new(Layout { root: Some(Node::Tabs { panels: vec![PanelKind::Project], active: usize::MAX }), floating: vec![] }); assert!(snapshot.validate().is_err()); - let split = |size, first, second| Node::Split { axis: SplitAxis::Horizontal, size, first: Box::new(first), second: Box::new(second) }; + let split = |size, first, second| Node::Split { axis: Axis::X, size, first: Box::new(first), second: Box::new(second) }; snapshot.dock = Workspace::new(Layout { root: Some(split(SplitSize::FixedFirst(f32::NAN), tabs(&[PanelKind::Project]), tabs(&[PanelKind::Timeline]))), floating: vec![], }); assert!(snapshot.validate().is_err()); let mut root = tabs(&[PanelKind::Composition]); - for _ in 0..=craft_ui::docking::MAX_DEPTH { + for _ in 0..=craft_behavior::dock::MAX_DEPTH { root = split(SplitSize::Ratio(0.5), root, tabs(&[])); } snapshot.dock = Workspace::new(Layout { root: Some(root), floating: vec![] }); diff --git a/crates/ui-egui/tests/it/shared_docking_ui.rs b/crates/ui-egui/tests/it/shared_docking_ui.rs index 48e8b8283..f25b1c92c 100644 --- a/crates/ui-egui/tests/it/shared_docking_ui.rs +++ b/crates/ui-egui/tests/it/shared_docking_ui.rs @@ -1,6 +1,7 @@ //! EffectCraft's workspaces in craft-ui's shared docking: transactions, the command path, pointer //! gestures and persistence. -use craft_ui::docking::{Action, Node, Placement, StackEntry, Zone}; +use craft_behavior::dock::{Action, DockPlacement, Node, StackEntry}; +use craft_ui::docking::Zone; use effectcraft_engine::Session; use effectcraft_ui_egui::{ EffectcraftApp, @@ -29,7 +30,7 @@ fn shared_move_preserves_accordion_metadata_and_unrelated_active_tabs() { workspace.apply(Action::Close { panel: PanelKind::Project }, dock::permissions).unwrap(); assert!(workspace.is_visible(PanelKind::Composition)); workspace - .apply(Action::Move { panel: PanelKind::Preview, anchor: PanelKind::Layer, placement: Placement::Tab { before: None } }, dock::permissions) + .apply(Action::Move { panel: PanelKind::Preview, anchor: PanelKind::Layer, placement: DockPlacement::Tab { before: None } }, dock::permissions) .unwrap(); let Some(Node::Split { second, size, .. }) = &workspace.layout.root else { panic!("split was lost") }; assert_eq!(*size, SplitSize::FixedSecond(300.0)); @@ -44,7 +45,7 @@ fn shared_move_preserves_accordion_metadata_and_unrelated_active_tabs() { let before = workspace.clone(); assert!( workspace - .apply(Action::Move { panel: PanelKind::Preview, anchor: PanelKind::Audio, placement: Placement::Split(Zone::Left) }, dock::permissions) + .apply(Action::Move { panel: PanelKind::Preview, anchor: PanelKind::Audio, placement: DockPlacement::Split(Zone::Left) }, dock::permissions) .is_err() ); assert!(workspace.apply(Action::Float { panel: PanelKind::Preview, rect: [0.0, 0.0, f32::INFINITY, 200.0] }, dock::permissions).is_err()); @@ -70,7 +71,7 @@ fn every_builtin_workspace_validates_and_roundtrips_with_dynamic_identities() { assert!(text.contains("\"ScriptPanel\":77") && text.contains("\"Viewer\":42"), "{text}"); assert_eq!(serde_json::from_str::(&text).unwrap(), workspace); workspace - .apply(Action::Move { panel: PanelKind::ScriptPanel(77), anchor: PanelKind::Viewer(42), placement: Placement::Tab { before: None } }, dock::permissions) + .apply(Action::Move { panel: PanelKind::ScriptPanel(77), anchor: PanelKind::Viewer(42), placement: DockPlacement::Tab { before: None } }, dock::permissions) .unwrap(); assert!(workspace.layout.floating.is_empty()); assert!(workspace.is_visible(PanelKind::ScriptPanel(77))); @@ -221,7 +222,7 @@ fn catalog_docking_action_supports_resize_reorder_and_floating_geometry() { )); for action in [ Action::ResizeSplit { path: vec![], size: SplitSize::FixedFirst(360.0) }, - Action::Move { panel: PanelKind::Info, anchor: PanelKind::Project, placement: Placement::Tab { before: Some(PanelKind::Project) } }, + Action::Move { panel: PanelKind::Info, anchor: PanelKind::Project, placement: DockPlacement::Tab { before: Some(PanelKind::Project) } }, Action::Float { panel: PanelKind::Info, rect: [20.0, 40.0, 300.0, 200.0] }, Action::MoveFloating { panel: PanelKind::Info, rect: [45.0, 65.0, 330.0, 240.0] }, ] { @@ -285,7 +286,7 @@ fn raw_open_actions_are_rejected_through_every_docking_route() { for panel in [PanelKind::ScriptPanel(77), PanelKind::Viewer(42)] { for action in [ Action::Open { panel, anchor: Some(PanelKind::Project) }, - Action::OpenAt { panel, anchor: PanelKind::Project, placement: Placement::Tab { before: None } }, + Action::OpenAt { panel, anchor: PanelKind::Project, placement: DockPlacement::Tab { before: None } }, ] { for id in ["ui.dock", "window.panel.layout", "window.dockAction"] { let error = invoke(&mut app, id, json!({"action": action})).unwrap_err(); diff --git a/crates/ui-egui/tests/it/ui_effect_controls.rs b/crates/ui-egui/tests/it/ui_effect_controls.rs index 49de1f24c..ce8275dde 100644 --- a/crates/ui-egui/tests/it/ui_effect_controls.rs +++ b/crates/ui-egui/tests/it/ui_effect_controls.rs @@ -165,7 +165,7 @@ fn effect_header_arrows_ignore_hidden_panels_with_stale_focus() { "closed" => h.state_mut().close_panel(PanelKind::EffectControls), "maximized" => h.state_mut().toggle_maximize(PanelKind::Composition), "floating under maximized" => { - h.state_mut().apply_dock(craft_ui::docking::Action::Float { panel: PanelKind::EffectControls, rect: [40.0, 40.0, 600.0, 400.0] }).unwrap(); + h.state_mut().apply_dock(craft_behavior::dock::Action::Float { panel: PanelKind::EffectControls, rect: [40.0, 40.0, 600.0, 400.0] }).unwrap(); h.state_mut().toggle_maximize(PanelKind::Composition); } _ => h.state_mut().ui.start_screen = true, @@ -187,10 +187,10 @@ fn effect_header_arrows_work_wherever_effect_controls_is_on_screen() { let (mut h, lid, [(fx, prop), _, _]) = header_arrow_harness(); h.state_mut().toggle_maximize(PanelKind::EffectControls); if place == "floating" { - h.state_mut().apply_dock(craft_ui::docking::Action::Float { panel: PanelKind::EffectControls, rect: [40.0, 40.0, 600.0, 400.0] }).unwrap(); + h.state_mut().apply_dock(craft_behavior::dock::Action::Float { panel: PanelKind::EffectControls, rect: [40.0, 40.0, 600.0, 400.0] }).unwrap(); } else { - let placement = craft_ui::docking::Placement::Tab { before: None }; - h.state_mut().apply_dock(craft_ui::docking::Action::Move { panel: PanelKind::EffectControls, anchor: PanelKind::Composition, placement }).unwrap(); + let placement = craft_behavior::dock::DockPlacement::Tab { before: None }; + h.state_mut().apply_dock(craft_behavior::dock::Action::Move { panel: PanelKind::EffectControls, anchor: PanelKind::Composition, placement }).unwrap(); h.state_mut().toggle_maximize(PanelKind::Composition); assert_eq!(h.state().ui.maximized, Some(PanelKind::Composition), "the frame was maximized from its Composition tab"); } diff --git a/crates/ui-egui/tests/it/ui_panel_windows.rs b/crates/ui-egui/tests/it/ui_panel_windows.rs index d2750bb05..72b8bfff6 100644 --- a/crates/ui-egui/tests/it/ui_panel_windows.rs +++ b/crates/ui-egui/tests/it/ui_panel_windows.rs @@ -58,7 +58,7 @@ fn panel_windows_survive_restart_with_hostile_places_made_safe() { let ctx = egui::Context::default(); invoke(&mut app, &ctx, json!({"panel": "Project", "window": true})).unwrap(); let hostile = [90_000.0, -99_000.0, 99_000.0, 0.5]; - app.apply_dock(craft_ui::docking::Action::SetNative { panel: PanelKind::Project, rect: Some(hostile) }).unwrap(); + app.apply_dock(craft_behavior::dock::Action::SetNative { panel: PanelKind::Project, rect: Some(hostile) }).unwrap(); eframe::App::on_exit(&mut app); let restarted = EffectcraftApp::new(Session { config: Some(store), ..Default::default() }); assert_eq!(native(&restarted, PanelKind::Project), Some(sanitized_window_rect(hostile))); @@ -73,7 +73,7 @@ fn a_click_on_a_floating_panel_does_nothing_while_a_dialog_is_open() { use egui_kittest::Harness; let mut app = EffectcraftApp::new(Session::default()); app.ui.start_screen = false; - app.apply_dock(craft_ui::docking::Action::Float { panel: PanelKind::Project, rect: [80.0, 120.0, 320.0, 240.0] }).unwrap(); + app.apply_dock(craft_behavior::dock::Action::Float { panel: PanelKind::Project, rect: [80.0, 120.0, 320.0, 240.0] }).unwrap(); let mut h = Harness::builder().with_size(vec2(1400.0, 900.0)).build_eframe(move |_| app); h.run_steps(3); let close = |h: &Harness<'_, EffectcraftApp>| { diff --git a/crates/ui-egui/tests/it/ui_scrolling.rs b/crates/ui-egui/tests/it/ui_scrolling.rs index 2913a6770..738878d82 100644 --- a/crates/ui-egui/tests/it/ui_scrolling.rs +++ b/crates/ui-egui/tests/it/ui_scrolling.rs @@ -462,7 +462,7 @@ fn effect_values_stay_clear_of_the_keyframe_navigator() { app.session.execute("prop.toggleAnimation", json!({"layer": lid, "path": path})).unwrap(); app.session.execute("prop.set", json!({"layer": lid, "path": path, "value": [123456.7, 123456.7]})).unwrap(); let uid = app.session.active_comp().unwrap().layer(effectcraft_engine::project::LayerId(lid)).unwrap().props.prop(path).unwrap().uid; - app.apply_dock(craft_ui::docking::Action::Float { panel: PanelKind::EffectControls, rect: [300.0, 150.0, 330.0, 500.0] }).unwrap(); + app.apply_dock(craft_behavior::dock::Action::Float { panel: PanelKind::EffectControls, rect: [300.0, 150.0, 330.0, 500.0] }).unwrap(); h.run_steps(3); let value = rect(&h, &format!("effectControls.prop.{uid}.value.1")); let nav = rect(&h, &format!("effectControls.prop.{uid}.prevKey")); diff --git a/crates/ui-egui/tests/it/ui_viewers.rs b/crates/ui-egui/tests/it/ui_viewers.rs index bfbcad51e..fc8857198 100644 --- a/crates/ui-egui/tests/it/ui_viewers.rs +++ b/crates/ui-egui/tests/it/ui_viewers.rs @@ -74,13 +74,13 @@ fn new_viewers_lock_route_comps_and_activate_on_click() { assert_eq!((h.state().ui.active_viewer, shows(&h, 0), shows(&h, 1)), (1, Some(a), Some(a))); // Side by side, so both draw. h.state_mut() - .apply_dock(craft_ui::docking::Action::Move { + .apply_dock(craft_behavior::dock::Action::Move { panel: PanelKind::Viewer(1), anchor: PanelKind::Composition, - placement: craft_ui::docking::Placement::Split(craft_ui::docking::Zone::Right), + placement: craft_behavior::dock::DockPlacement::Split(craft_ui::docking::Zone::Right), }) .unwrap(); - h.state_mut().apply_dock(craft_ui::docking::Action::Activate { panel: PanelKind::Composition }).unwrap(); + h.state_mut().apply_dock(craft_behavior::dock::Action::Activate { panel: PanelKind::Composition }).unwrap(); h.run_steps(3); // Opening B shows it in the active (unlocked) viewer; the locked one keeps A. invoke(&mut h, "comp.open", json!({"comp": b})); @@ -154,13 +154,13 @@ fn viewers_snapshot() { h.run_steps(3); invoke(&mut h, "view.newViewer", json!({})); h.state_mut() - .apply_dock(craft_ui::docking::Action::Move { + .apply_dock(craft_behavior::dock::Action::Move { panel: PanelKind::Viewer(1), anchor: PanelKind::Composition, - placement: craft_ui::docking::Placement::Split(craft_ui::docking::Zone::Right), + placement: craft_behavior::dock::DockPlacement::Split(craft_ui::docking::Zone::Right), }) .unwrap(); - h.state_mut().apply_dock(craft_ui::docking::Action::Activate { panel: PanelKind::Composition }).unwrap(); + h.state_mut().apply_dock(craft_behavior::dock::Action::Activate { panel: PanelKind::Composition }).unwrap(); invoke(&mut h, "comp.open", json!({"comp": other.0})); for _ in 0..300 { h.step(); diff --git a/crates/ui-egui/tests/it/ui_workspace_focus.rs b/crates/ui-egui/tests/it/ui_workspace_focus.rs index af8ecd9ad..338c8c2b7 100644 --- a/crates/ui-egui/tests/it/ui_workspace_focus.rs +++ b/crates/ui-egui/tests/it/ui_workspace_focus.rs @@ -229,7 +229,7 @@ fn tab_traversal_activates_an_inactive_dock_tab_without_editing_the_project() { ); key(&mut h, Key::Space, Modifiers::NONE); let mut activated = before; - activated.apply(craft_ui::docking::Action::Activate { panel: PanelKind::EffectControls }, dock::permissions).unwrap(); + activated.apply(craft_behavior::dock::Action::Activate { panel: PanelKind::EffectControls }, dock::permissions).unwrap(); assert_eq!(h.state().ui.dock, activated); assert_eq!(h.state().ui.focused, PanelKind::EffectControls); assert!(!h.state().playback.playing); From d7470ccc3b61ebb8c46153e61ccbe4defe2b6bf9 Mon Sep 17 00:00:00 2001 From: aiongg Date: Tue, 24 Nov 2026 16:47:46 +0000 Subject: [PATCH 407/451] media: one craft-audio dependency; the wav markers come from the same pin --- Cargo.lock | 1527 ++++++++++++++++++++++++++++--- crates/media/Cargo.toml | 1 - crates/media/src/wav_markers.rs | 2 +- 3 files changed, 1399 insertions(+), 131 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b967eb41d..ed23309d2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -129,6 +129,15 @@ dependencies = [ "zerocopy", ] +[[package]] +name = "aho-corasick" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c982642fa9e8606056828ee9a8505737230110bb1099153c79efe865c59d12ba" +dependencies = [ + "memchr", +] + [[package]] name = "aligned" version = "0.4.3" @@ -209,6 +218,22 @@ dependencies = [ "libc", ] +[[package]] +name = "annotate-snippets" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "710e8eae58854cdc1790fcb56cca04d712a17be849eeb81da2a724bf4bae2bc4" +dependencies = [ + "anstyle", + "unicode-width", +] + +[[package]] +name = "anstyle" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" + [[package]] name = "anyhow" version = "1.0.104" @@ -343,7 +368,7 @@ dependencies = [ "futures-lite", "parking", "polling", - "rustix 1.1.5", + "rustix 1.1.6", "slab", "windows-sys 0.61.2", ] @@ -374,7 +399,7 @@ dependencies = [ "cfg-if", "event-listener", "futures-lite", - "rustix 1.1.5", + "rustix 1.1.6", ] [[package]] @@ -400,7 +425,7 @@ dependencies = [ "cfg-if", "futures-core", "futures-io", - "rustix 1.1.5", + "rustix 1.1.6", "signal-hook-registry", "slab", "windows-sys 0.61.2", @@ -501,7 +526,7 @@ dependencies = [ "anyhow", "arrayvec", "log", - "nom", + "nom 8.0.0", "num-rational", "v_frame", ] @@ -512,6 +537,25 @@ version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac07cdecf99051d9a5238b80f35af32cdeba5b336e55d957b318b50137e18da5" +[[package]] +name = "bindgen" +version = "0.72.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "993776b509cfb49c750f11b8f07a46fa23e0a1386ffc01fb1e7d343efc387895" +dependencies = [ + "annotate-snippets", + "bitflags 2.13.2", + "cexpr", + "clang-sys", + "itertools 0.13.0", + "proc-macro2", + "quote", + "regex", + "rustc-hash 2.1.3", + "shlex 1.3.0", + "syn 2.0.119", +] + [[package]] name = "bit-set" version = "0.10.0" @@ -573,6 +617,12 @@ dependencies = [ "no_std_io2", ] +[[package]] +name = "block" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" + [[package]] name = "block-buffer" version = "0.10.4" @@ -831,6 +881,16 @@ version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" +[[package]] +name = "calendrical_calculations" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5abbd6eeda6885048d357edc66748eea6e0268e3dd11f326fff5bd248d779c26" +dependencies = [ + "core_maths", + "displaydoc", +] + [[package]] name = "calloop" version = "0.13.0" @@ -853,7 +913,7 @@ checksum = "4dbf9978365bac10f54d1d4b04f7ce4427e51f71d61f2fe15e3fed5166474df7" dependencies = [ "bitflags 2.13.2", "polling", - "rustix 1.1.5", + "rustix 1.1.6", "slab", "tracing", ] @@ -877,7 +937,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "138efcf0940a02ebf0cc8d1eff41a1682a46b431630f4c52450d6265876021fa" dependencies = [ "calloop 0.14.4", - "rustix 1.1.5", + "rustix 1.1.6", "wayland-backend", "wayland-client", ] @@ -936,7 +996,7 @@ dependencies = [ "find-msvc-tools", "jobserver", "libc", - "shlex", + "shlex 2.0.1", ] [[package]] @@ -945,6 +1005,25 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom 7.1.3", +] + +[[package]] +name = "cfg-expr" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edd44d82755fb9210fb10d9daf8dd7e522da0efe1d5f263cffc5db07725663ff" +dependencies = [ + "smallvec", + "target-lexicon", +] + [[package]] name = "cfg-if" version = "1.0.5" @@ -983,7 +1062,22 @@ version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1aa79e62e7697b8e29b513a68abacf485adcd1fe8284a4316c5ae868e6633327" dependencies = [ + "iana-time-zone", + "js-sys", "num-traits", + "wasm-bindgen", + "windows-link 0.2.1", +] + +[[package]] +name = "clang-sys" +version = "1.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "157a8ba7b480713b56f4c09fd13fc3e0a22a5dfab8097ba61cbc5feef950788a" +dependencies = [ + "glob", + "libc", + "libloading", ] [[package]] @@ -1049,6 +1143,12 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "cookie-factory" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9885fa71e26b8ab7855e2ec7cae6e9b380edff76cd052e07c683a0319d51b3a2" + [[package]] name = "core-foundation" version = "0.9.4" @@ -1099,12 +1199,34 @@ dependencies = [ "libc", ] +[[package]] +name = "core-graphics2" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b65858d95344d2711161cd92196732f67d6c5fea238cf12f994584828731a5c" +dependencies = [ + "bitflags 2.13.2", + "block", + "cfg-if", + "core-foundation 0.10.1", + "libc", +] + [[package]] name = "core_detect" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f8f80099a98041a3d1622845c271458a2d73e688351bf3cb999266764b81d48" +[[package]] +name = "core_maths" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77745e017f5edba1a9c1d854f6f3a52dac8a12dd5af5d2f54aecf61e43d80d30" +dependencies = [ + "libm", +] + [[package]] name = "coreaudio-rs" version = "0.13.0" @@ -1193,15 +1315,24 @@ dependencies = [ [[package]] name = "craft-aep" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" [[package]] -name = "craft-audio" +name = "craft-appkit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=30596f73c5ef851ba3dad9cf145669f391e2eb0d#30596f73c5ef851ba3dad9cf145669f391e2eb0d" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" dependencies = [ - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=30596f73c5ef851ba3dad9cf145669f391e2eb0d)", - "thiserror 2.0.21", + "block2 0.6.2", + "objc2-app-kit 0.3.2", + "objc2-foundation 0.3.2", +] + +[[package]] +name = "craft-atomic" +version = "0.1.0" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +dependencies = [ + "rustix 1.1.6", ] [[package]] @@ -1217,15 +1348,52 @@ dependencies = [ "thiserror 2.0.21", ] +[[package]] +name = "craft-audio" +version = "0.1.0" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +dependencies = [ + "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", + "craft-xml 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", + "log", + "thiserror 2.0.21", +] + +[[package]] +name = "craft-behavior" +version = "0.1.0" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +dependencies = [ + "accesskit", + "bitflags 2.13.2", + "craft-host", + "craft-keymap", + "craft-theme", + "craft-tracked", + "craft-ui-macros", + "emath", + "kurbo", + "serde", + "smallvec", +] + [[package]] name = "craft-cfb" version = "0.1.0" source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" +[[package]] +name = "craft-cloud-ui" +version = "0.1.0" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +dependencies = [ + "egui", +] + [[package]] name = "craft-cms" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=58964adec11197594d9b6b79a94ae6232221211a#58964adec11197594d9b6b79a94ae6232221211a" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" dependencies = [ "md-5", "rayon", @@ -1234,7 +1402,7 @@ dependencies = [ [[package]] name = "craft-codepage" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" [[package]] name = "craft-color" @@ -1244,10 +1412,18 @@ dependencies = [ "serde", ] +[[package]] +name = "craft-color" +version = "0.1.0" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +dependencies = [ + "serde", +] + [[package]] name = "craft-doc" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" dependencies = [ "craft-ecproj-format", "craft-pcraft-format", @@ -1261,7 +1437,10 @@ dependencies = [ [[package]] name = "craft-docpath" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +dependencies = [ + "serde", +] [[package]] name = "craft-dpx" @@ -1274,7 +1453,7 @@ dependencies = [ [[package]] name = "craft-dpx" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" dependencies = [ "thiserror 2.0.21", ] @@ -1282,7 +1461,7 @@ dependencies = [ [[package]] name = "craft-ecproj-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" dependencies = [ "serde", "serde_json", @@ -1292,7 +1471,7 @@ dependencies = [ [[package]] name = "craft-eps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=068e079c7be4b100a8a6b305b31ac881e069727e#068e079c7be4b100a8a6b305b31ac881e069727e" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" [[package]] name = "craft-exr" @@ -1306,7 +1485,7 @@ dependencies = [ [[package]] name = "craft-exr" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3b8e426a260695af840a2cd79a064d40778f939e#3b8e426a260695af840a2cd79a064d40778f939e" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" dependencies = [ "exr", "flate2", @@ -1315,26 +1494,51 @@ dependencies = [ "thiserror 2.0.21", ] +[[package]] +name = "craft-font-catalog" +version = "0.1.0" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +dependencies = [ + "harfrust 0.13.3", + "kurbo", + "skrifa 0.47.0", + "thiserror 2.0.21", + "unicode-bidi", + "unicode-segmentation", + "windows-registry", +] + [[package]] name = "craft-fonts-build" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" [[package]] name = "craft-frame" version = "0.1.0" source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ - "craft-color", + "craft-color 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", "craft-time 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", "rayon", "serde", ] +[[package]] +name = "craft-frame" +version = "0.1.0" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +dependencies = [ + "craft-color 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", + "craft-time 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", + "rayon", + "serde", +] + [[package]] name = "craft-gif" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=ba25ccd233934d1b2f74e3c0f235168bf5f13ef3#ba25ccd233934d1b2f74e3c0f235168bf5f13ef3" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" dependencies = [ "gif", "image", @@ -1348,12 +1552,29 @@ dependencies = [ "thiserror 2.0.21", ] +[[package]] +name = "craft-host" +version = "0.1.0" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +dependencies = [ + "bitflags 2.13.2", + "craft-i18n", + "egui", + "serde", + "toml", + "web-time", +] + [[package]] name = "craft-i18n" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" dependencies = [ + "chrono", "fixed_decimal", + "icu_calendar", + "icu_collator", + "icu_datetime", "icu_decimal", "icu_locale_core", "icu_locale_fallback", @@ -1363,6 +1584,7 @@ dependencies = [ "icu_provider", "icu_provider_adapters", "icu_provider_blob", + "icu_time", "log", "objc2-foundation 0.3.2", "sys-locale", @@ -1382,15 +1604,30 @@ dependencies = [ [[package]] name = "craft-jsonrpc" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=bc186ca719958fcce3b6ee24794277eabed14609#bc186ca719958fcce3b6ee24794277eabed14609" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" dependencies = [ "serde_json", ] +[[package]] +name = "craft-keymap" +version = "0.1.0" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +dependencies = [ + "craft-host", + "craft-i18n", + "craft-tracked", + "craft-ui-macros", + "craft-xml 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", + "egui", + "serde", + "serde_json", +] + [[package]] name = "craft-lottie" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" dependencies = [ "craft-zip", "serde_json", @@ -1400,12 +1637,16 @@ dependencies = [ [[package]] name = "craft-media" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=30596f73c5ef851ba3dad9cf145669f391e2eb0d#30596f73c5ef851ba3dad9cf145669f391e2eb0d" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" +dependencies = [ + "chrono", + "thiserror 2.0.21", +] [[package]] name = "craft-media" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" dependencies = [ "chrono", "thiserror 2.0.21", @@ -1417,11 +1658,25 @@ version = "0.1.0" source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", - "craft-color", - "craft-frame", + "craft-color 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", + "craft-frame 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", "craft-time 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", - "craft-y4m", + "serde", + "thiserror 2.0.21", +] + +[[package]] +name = "craft-media-source" +version = "0.1.0" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +dependencies = [ + "craft-audio 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", + "craft-color 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", + "craft-frame 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", + "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", + "craft-time 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", + "craft-y4m 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", "serde", "thiserror 2.0.21", ] @@ -1429,8 +1684,9 @@ dependencies = [ [[package]] name = "craft-mesh" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" dependencies = [ + "craft-zip", "miniz_oxide 0.9.1", "serde_json", ] @@ -1438,7 +1694,7 @@ dependencies = [ [[package]] name = "craft-mime" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" dependencies = [ "chrono", "craft-codepage", @@ -1448,7 +1704,7 @@ dependencies = [ [[package]] name = "craft-pcraft-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" dependencies = [ "flate2", "serde", @@ -1459,16 +1715,48 @@ dependencies = [ [[package]] name = "craft-pdf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=068e079c7be4b100a8a6b305b31ac881e069727e#068e079c7be4b100a8a6b305b31ac881e069727e" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" dependencies = [ "hayro-syntax", + "serde", "thiserror 2.0.21", ] +[[package]] +name = "craft-platform" +version = "0.1.0" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +dependencies = [ + "async-channel", + "async-io", + "async-process", + "core-graphics2", + "craft-atomic", + "craft-docpath", + "craft-host", + "craft-i18n", + "craft-theme", + "futures-lite", + "js-sys", + "log", + "objc2-app-kit 0.3.2", + "rfd", + "serde", + "serde_json", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "web-time", + "windows 0.62.2", + "x11rb", + "xcap", + "zbus", +] + [[package]] name = "craft-ps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=068e079c7be4b100a8a6b305b31ac881e069727e#068e079c7be4b100a8a6b305b31ac881e069727e" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" dependencies = [ "craft-eps", "kurbo", @@ -1492,7 +1780,7 @@ dependencies = [ [[package]] name = "craft-psd" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=53198114310dbc2b41e18e4eaf2fd83e69964189#53198114310dbc2b41e18e4eaf2fd83e69964189" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" dependencies = [ "encoding_rs", "flate2", @@ -1503,12 +1791,14 @@ dependencies = [ [[package]] name = "craft-quit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" dependencies = [ "dispatch2", "egui", "objc2 0.6.5", "objc2-app-kit 0.3.2", + "wasm-bindgen", + "web-sys", ] [[package]] @@ -1525,6 +1815,23 @@ dependencies = [ "zune-jpeg", ] +[[package]] +name = "craft-settings" +version = "0.1.0" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +dependencies = [ + "craft-atomic", + "craft-host", + "dirs", + "log", + "serde", + "serde_json", + "toml", + "toml_edit", + "web-sys", + "web-time", +] + [[package]] name = "craft-sniff" version = "0.1.0" @@ -1533,14 +1840,16 @@ source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa3 [[package]] name = "craft-svg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3dff4793f1a5bd1f99a4fe3280d48f515158dff3#3dff4793f1a5bd1f99a4fe3280d48f515158dff3" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" dependencies = [ - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=3dff4793f1a5bd1f99a4fe3280d48f515158dff3)", + "craft-xml 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", "flate2", "kurbo", "quick-xml 0.41.0", + "resvg", "roxmltree", "thiserror 2.0.21", + "usvg", "vectorcraft-geom", "vectorcraft-pathops", ] @@ -1553,6 +1862,29 @@ dependencies = [ "thiserror 2.0.21", ] +[[package]] +name = "craft-tga" +version = "0.1.0" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +dependencies = [ + "thiserror 2.0.21", +] + +[[package]] +name = "craft-theme" +version = "0.1.0" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +dependencies = [ + "bitflags 2.13.2", + "craft-tracked", + "craft-ui-macros", + "ecolor", + "log", + "serde", + "serde_json", + "smallvec", +] + [[package]] name = "craft-tiff" version = "0.1.0" @@ -1565,7 +1897,7 @@ dependencies = [ [[package]] name = "craft-time" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=0d6dd8bed815b8366869a800d2bf22588ca62dcb#0d6dd8bed815b8366869a800d2bf22588ca62dcb" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ "serde", "thiserror 2.0.21", @@ -1574,20 +1906,12 @@ dependencies = [ [[package]] name = "craft-time" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" dependencies = [ "serde", "thiserror 2.0.21", ] -[[package]] -name = "craft-timeline" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=0d6dd8bed815b8366869a800d2bf22588ca62dcb#0d6dd8bed815b8366869a800d2bf22588ca62dcb" -dependencies = [ - "craft-time 0.1.0 (git+https://github.com/storytold/craft-libs?rev=0d6dd8bed815b8366869a800d2bf22588ca62dcb)", -] - [[package]] name = "craft-timeline" version = "0.1.0" @@ -1599,41 +1923,194 @@ dependencies = [ "serde_json", ] +[[package]] +name = "craft-timeline" +version = "0.1.0" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +dependencies = [ + "craft-time 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", + "serde", + "web-time", +] + +[[package]] +name = "craft-tracked" +version = "0.1.0" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" + [[package]] name = "craft-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" dependencies = [ - "craft-fonts-build", + "craft-cloud-ui", + "craft-ui-canvas", + "craft-ui-contract", + "craft-ui-panels", + "craft-ui-patterns", + "craft-ui-shell", + "craft-ui-widgets", +] + +[[package]] +name = "craft-ui-canvas" +version = "0.1.0" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +dependencies = [ + "craft-behavior", "craft-i18n", + "craft-keymap", + "craft-theme", + "craft-ui-macros", + "craft-ui-panels", "egui", - "epaint", - "js-sys", - "log", - "objc2 0.6.5", - "objc2-app-kit 0.3.2", - "objc2-foundation 0.3.2", "serde", + "serde_json", +] + +[[package]] +name = "craft-ui-contract" +version = "0.1.0" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +dependencies = [ + "accesskit", + "craft-behavior", + "craft-codepage", + "craft-font-catalog", + "craft-fonts-build", + "craft-host", + "craft-i18n", + "craft-keymap", + "craft-platform", + "craft-quit", + "craft-settings", + "craft-svg", + "craft-theme", + "craft-tracked", + "craft-ui-macros", + "craft-window", + "egui", + "epaint_default_fonts", + "flate2", + "inventory", + "log", + "scoped-tls", + "serde", + "serde_json", + "siphasher", "skrifa 0.44.0", - "wasm-bindgen", + "smallvec", + "toml", + "typeid", "wasm-bindgen-futures", - "web-sys", + "web-time", +] + +[[package]] +name = "craft-ui-macros" +version = "0.1.0" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "craft-ui-panels" +version = "0.1.0" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +dependencies = [ + "craft-behavior", + "craft-host", + "craft-i18n", + "craft-keymap", + "craft-quit", + "craft-theme", + "craft-ui-macros", + "craft-ui-widgets", + "egui", + "serde", + "serde_json", +] + +[[package]] +name = "craft-ui-patterns" +version = "0.1.0" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +dependencies = [ + "craft-behavior", + "craft-host", + "craft-i18n", + "craft-keymap", + "craft-pdf", + "craft-theme", + "craft-ui-macros", + "craft-ui-panels", + "egui", + "serde", + "serde_json", + "toml", + "toml_edit", + "zeroize", +] + +[[package]] +name = "craft-ui-shell" +version = "0.1.0" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +dependencies = [ + "craft-behavior", + "craft-host", + "craft-i18n", + "craft-platform", + "craft-svg", + "craft-theme", + "craft-ui-macros", + "craft-ui-panels", + "craft-window", + "egui", + "raw-window-handle", + "serde", + "web-time", +] + +[[package]] +name = "craft-ui-widgets" +version = "0.1.0" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +dependencies = [ + "craft-behavior", + "craft-host", + "craft-i18n", + "craft-keymap", + "craft-svg", + "craft-theme", + "craft-ui-contract", + "craft-ui-macros", + "egui", + "log", + "serde", + "smallvec", ] [[package]] name = "craft-update" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" dependencies = [ "chrono", + "craft-host", + "craft-theme", + "craft-ui", "dunce", "egui", "flate2", - "getrandom 0.3.4", "image", "log", "plist", - "rustix 1.1.5", + "rustix 1.1.6", "semver", "serde", "serde_json", @@ -1650,7 +2127,7 @@ dependencies = [ [[package]] name = "craft-vectorcraft-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" dependencies = [ "flate2", "serde", @@ -1669,15 +2146,58 @@ dependencies = [ "thiserror 2.0.21", ] +[[package]] +name = "craft-video" +version = "0.1.0" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +dependencies = [ + "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", + "rav1e", + "rayon", + "thiserror 2.0.21", +] + [[package]] name = "craft-webp" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" dependencies = [ "image", "thiserror 2.0.21", ] +[[package]] +name = "craft-win32" +version = "0.1.0" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +dependencies = [ + "winsafe", +] + +[[package]] +name = "craft-window" +version = "0.1.0" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +dependencies = [ + "craft-appkit", + "craft-atomic", + "craft-behavior", + "craft-host", + "craft-settings", + "craft-win32", + "egui", + "muda", + "objc2 0.6.5", + "objc2-app-kit 0.3.2", + "objc2-foundation 0.3.2", + "raw-window-handle", + "serde", + "serde_json", + "wayland-client", + "winsafe", + "x11rb", +] + [[package]] name = "craft-xml" version = "0.1.0" @@ -1691,7 +2211,7 @@ dependencies = [ [[package]] name = "craft-xml" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=3dff4793f1a5bd1f99a4fe3280d48f515158dff3#3dff4793f1a5bd1f99a4fe3280d48f515158dff3" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" dependencies = [ "quick-xml 0.41.0", "serde", @@ -1706,10 +2226,18 @@ dependencies = [ "thiserror 2.0.21", ] +[[package]] +name = "craft-y4m" +version = "0.1.0" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +dependencies = [ + "thiserror 2.0.21", +] + [[package]] name = "craft-zip" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87#5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" dependencies = [ "flate2", "thiserror 2.0.21", @@ -1801,6 +2329,12 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c87e182de0887fd5361989c677c4e8f5000cd9491d6d563161a8f3a5519fc7f" +[[package]] +name = "data-url" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be1e0bca6c3637f992fc1cc7cbc52a78c1ef6db076dbf1059c4323d6a2048376" + [[package]] name = "deranged" version = "0.5.8" @@ -1817,6 +2351,27 @@ dependencies = [ "crypto-common", ] +[[package]] +name = "dirs" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d57d423b3c82e89b9a24ca3091fee61f456a26edbd28d26c65906f4bc1dcd8f" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.59.0", +] + [[package]] name = "dispatch" version = "0.2.0" @@ -1876,6 +2431,61 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d8b14ccef22fc6f5a8f4d7d768562a182c04ce9a3b3157b91390b52ddfdf1a76" +[[package]] +name = "drm" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80bc8c5c6c2941f70a55c15f8d9f00f9710ebda3ffda98075f996a0e6c92756f" +dependencies = [ + "bitflags 2.13.2", + "bytemuck", + "drm-ffi", + "drm-fourcc", + "libc", + "rustix 0.38.44", +] + +[[package]] +name = "drm" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a41816e58f47f49acfd956651055ddcf137c4882c2098c30c448817af21183a" +dependencies = [ + "bitflags 2.13.2", + "bytemuck", + "bytemuck_derive", + "drm-ffi", + "drm-fourcc", + "libc", + "rustix 1.1.6", +] + +[[package]] +name = "drm-ffi" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51a91c9b32ac4e8105dec255e849e0d66e27d7c34d184364fb93e469db08f690" +dependencies = [ + "drm-sys", + "rustix 1.1.6", +] + +[[package]] +name = "drm-fourcc" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0aafbcdb8afc29c1a7ee5fbe53b5d62f4565b35a042a662ca9fecd0b54dae6f4" + +[[package]] +name = "drm-sys" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc8e1361066d91f5ffccff060a3c3be9c3ecde15be2959c1937595f7a82a9f8" +dependencies = [ + "libc", + "linux-raw-sys 0.9.4", +] + [[package]] name = "dunce" version = "1.0.5" @@ -1921,7 +2531,7 @@ dependencies = [ [[package]] name = "ecolor" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=6d518fc799681571963842f95b55a6b68431b15a#6d518fc799681571963842f95b55a6b68431b15a" +source = "git+https://github.com/storytold/egui.git?rev=f5025284445ea19c35f746d96fc0b75468b3f560#f5025284445ea19c35f746d96fc0b75468b3f560" dependencies = [ "bytemuck", "emath", @@ -2079,12 +2689,12 @@ dependencies = [ name = "effectcraft-export" version = "0.25.1" dependencies = [ - "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", - "craft-exr 0.1.0 (git+https://github.com/storytold/craft-libs?rev=3b8e426a260695af840a2cd79a064d40778f939e)", + "craft-audio 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", + "craft-exr 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", "craft-gif", - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", - "craft-tga", - "craft-video", + "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", + "craft-tga 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", + "craft-video 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", "effectcraft-color", "effectcraft-effects", "effectcraft-keyframe", @@ -2194,7 +2804,7 @@ dependencies = [ name = "effectcraft-interchange" version = "0.25.1" dependencies = [ - "craft-timeline 0.1.0 (git+https://github.com/storytold/craft-libs?rev=0d6dd8bed815b8366869a800d2bf22588ca62dcb)", + "craft-timeline 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", "effectcraft-color", "effectcraft-keyframe", "effectcraft-project", @@ -2245,18 +2855,17 @@ dependencies = [ name = "effectcraft-media" version = "0.25.1" dependencies = [ - "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=30596f73c5ef851ba3dad9cf145669f391e2eb0d)", - "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", - "craft-color", + "craft-audio 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", + "craft-color 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", "craft-docpath", - "craft-dpx 0.1.0 (git+https://github.com/storytold/craft-libs?rev=5a7a63a21dd03dd1a2bc6c308a3a6ce818caae87)", - "craft-exr 0.1.0 (git+https://github.com/storytold/craft-libs?rev=3b8e426a260695af840a2cd79a064d40778f939e)", - "craft-frame", + "craft-dpx 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", + "craft-exr 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", + "craft-frame 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", "craft-gif", - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", - "craft-media-source", - "craft-time 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", - "craft-video", + "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", + "craft-media-source 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", + "craft-time 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", + "craft-video 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", "craft-webp", "effectcraft-color", "effectcraft-effects", @@ -2361,7 +2970,7 @@ name = "effectcraft-psd" version = "0.25.1" dependencies = [ "craft-codepage", - "craft-psd 0.1.0 (git+https://github.com/storytold/craft-libs?rev=53198114310dbc2b41e18e4eaf2fd83e69964189)", + "craft-psd 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", "miniz_oxide 0.9.1", ] @@ -2369,7 +2978,7 @@ dependencies = [ name = "effectcraft-raster" version = "0.25.1" dependencies = [ - "craft-exr 0.1.0 (git+https://github.com/storytold/craft-libs?rev=3b8e426a260695af840a2cd79a064d40778f939e)", + "craft-exr 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", "effectcraft-color", "effectcraft-geom", "rayon", @@ -2461,7 +3070,7 @@ name = "effectcraft-text" version = "0.25.1" dependencies = [ "effectcraft-keyframe", - "harfrust", + "harfrust 0.12.0", "kurbo", "skrifa 0.44.0", "unicode-bidi", @@ -2495,6 +3104,7 @@ version = "0.25.1" dependencies = [ "bytemuck", "chrono", + "craft-behavior", "craft-mime", "craft-quit", "craft-ui", @@ -2558,7 +3168,7 @@ dependencies = [ [[package]] name = "eframe" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=6d518fc799681571963842f95b55a6b68431b15a#6d518fc799681571963842f95b55a6b68431b15a" +source = "git+https://github.com/storytold/egui.git?rev=f5025284445ea19c35f746d96fc0b75468b3f560#f5025284445ea19c35f746d96fc0b75468b3f560" dependencies = [ "ahash", "bytemuck", @@ -2593,7 +3203,7 @@ dependencies = [ [[package]] name = "egui" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=6d518fc799681571963842f95b55a6b68431b15a#6d518fc799681571963842f95b55a6b68431b15a" +source = "git+https://github.com/storytold/egui.git?rev=f5025284445ea19c35f746d96fc0b75468b3f560#f5025284445ea19c35f746d96fc0b75468b3f560" dependencies = [ "accesskit", "ahash", @@ -2612,7 +3222,7 @@ dependencies = [ [[package]] name = "egui-wgpu" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=6d518fc799681571963842f95b55a6b68431b15a#6d518fc799681571963842f95b55a6b68431b15a" +source = "git+https://github.com/storytold/egui.git?rev=f5025284445ea19c35f746d96fc0b75468b3f560#f5025284445ea19c35f746d96fc0b75468b3f560" dependencies = [ "ahash", "bytemuck", @@ -2631,7 +3241,7 @@ dependencies = [ [[package]] name = "egui-winit" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=6d518fc799681571963842f95b55a6b68431b15a#6d518fc799681571963842f95b55a6b68431b15a" +source = "git+https://github.com/storytold/egui.git?rev=f5025284445ea19c35f746d96fc0b75468b3f560#f5025284445ea19c35f746d96fc0b75468b3f560" dependencies = [ "accesskit_winit", "arboard", @@ -2657,7 +3267,7 @@ dependencies = [ [[package]] name = "egui_extras" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=6d518fc799681571963842f95b55a6b68431b15a#6d518fc799681571963842f95b55a6b68431b15a" +source = "git+https://github.com/storytold/egui.git?rev=f5025284445ea19c35f746d96fc0b75468b3f560#f5025284445ea19c35f746d96fc0b75468b3f560" dependencies = [ "ahash", "egui", @@ -2670,7 +3280,7 @@ dependencies = [ [[package]] name = "egui_glow" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=6d518fc799681571963842f95b55a6b68431b15a#6d518fc799681571963842f95b55a6b68431b15a" +source = "git+https://github.com/storytold/egui.git?rev=f5025284445ea19c35f746d96fc0b75468b3f560#f5025284445ea19c35f746d96fc0b75468b3f560" dependencies = [ "bytemuck", "egui", @@ -2683,7 +3293,7 @@ dependencies = [ [[package]] name = "egui_kittest" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=6d518fc799681571963842f95b55a6b68431b15a#6d518fc799681571963842f95b55a6b68431b15a" +source = "git+https://github.com/storytold/egui.git?rev=f5025284445ea19c35f746d96fc0b75468b3f560#f5025284445ea19c35f746d96fc0b75468b3f560" dependencies = [ "eframe", "egui", @@ -2706,11 +3316,23 @@ checksum = "252afb9ae5eaa683babdc6a068b3f5726eb19e05070c731f9b2a23a7c3e8ed34" [[package]] name = "emath" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=6d518fc799681571963842f95b55a6b68431b15a#6d518fc799681571963842f95b55a6b68431b15a" +source = "git+https://github.com/storytold/egui.git?rev=f5025284445ea19c35f746d96fc0b75468b3f560#f5025284445ea19c35f746d96fc0b75468b3f560" dependencies = [ "bytemuck", ] +[[package]] +name = "embedded-io" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef1a6892d9eef45c8fa6b9e0086428a2cca8491aca8f787c534a3d6d0bcb3ced" + +[[package]] +name = "embedded-io" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" + [[package]] name = "encoding_rs" version = "0.8.42" @@ -2787,7 +3409,7 @@ dependencies = [ [[package]] name = "epaint" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=6d518fc799681571963842f95b55a6b68431b15a#6d518fc799681571963842f95b55a6b68431b15a" +source = "git+https://github.com/storytold/egui.git?rev=f5025284445ea19c35f746d96fc0b75468b3f560#f5025284445ea19c35f746d96fc0b75468b3f560" dependencies = [ "ahash", "bytemuck", @@ -2795,7 +3417,7 @@ dependencies = [ "emath", "epaint_default_fonts", "font-types", - "harfrust", + "harfrust 0.12.0", "log", "nohash-hasher", "parking_lot", @@ -2813,7 +3435,7 @@ dependencies = [ [[package]] name = "epaint_default_fonts" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=6d518fc799681571963842f95b55a6b68431b15a#6d518fc799681571963842f95b55a6b68431b15a" +source = "git+https://github.com/storytold/egui.git?rev=f5025284445ea19c35f746d96fc0b75468b3f560#f5025284445ea19c35f746d96fc0b75468b3f560" [[package]] name = "equator" @@ -2848,7 +3470,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -2976,8 +3598,8 @@ dependencies = [ "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", "craft-jpeg", "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", - "craft-video", - "craft-y4m", + "craft-video 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", + "craft-y4m 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", "filmcraft-bitstream", "filmcraft-color", "filmcraft-frame", @@ -3077,10 +3699,10 @@ dependencies = [ "craft-exr 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", "craft-hdr", "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", - "craft-media-source", + "craft-media-source 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", "craft-psd 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", "craft-sniff", - "craft-tga", + "craft-tga 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", "craft-tiff", "filmcraft-color", "filmcraft-dng", @@ -3149,6 +3771,12 @@ dependencies = [ "zlib-rs", ] +[[package]] +name = "float-cmp" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4" + [[package]] name = "float8" version = "0.6.1" @@ -3303,6 +3931,30 @@ dependencies = [ "slab", ] +[[package]] +name = "gbm" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce852e998d3ca5e4a97014fb31c940dc5ef344ec7d364984525fd11e8a547e6a" +dependencies = [ + "bitflags 2.13.2", + "drm 0.14.1", + "drm-fourcc", + "gbm-sys", + "libc", + "wayland-backend", + "wayland-server", +] + +[[package]] +name = "gbm-sys" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c13a5f2acc785d8fb6bf6b7ab6bfb0ef5dad4f4d97e8e70bb8e470722312f76f" +dependencies = [ + "libc", +] + [[package]] name = "gemm" version = "0.19.0" @@ -3438,7 +4090,7 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bd49230192a3797a9a4d6abe9b3eed6f7fa4c8a8a4947977c6f80025f92cbd8" dependencies = [ - "rustix 1.1.5", + "rustix 1.1.6", "windows-link 0.2.1", ] @@ -3489,6 +4141,15 @@ dependencies = [ "weezl", ] +[[package]] +name = "gl" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a94edab108827d67608095e269cf862e60d920f144a5026d3dbcfd8b877fb404" +dependencies = [ + "gl_generator", +] + [[package]] name = "gl_generator" version = "0.14.0" @@ -3516,6 +4177,12 @@ dependencies = [ "vello_common", ] +[[package]] +name = "glob" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4eba85ea1d0a966a983acd07deee566e67395d2d96b6fb39e62b5a833f1eb0b" + [[package]] name = "glow" version = "0.17.0" @@ -3644,6 +4311,19 @@ dependencies = [ "smallvec", ] +[[package]] +name = "harfrust" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "948d0741125ba89cd3e1c23e5642415b6ade7e1d29d67ba25fb925b533e989d6" +dependencies = [ + "bitflags 2.13.2", + "bytemuck", + "once_cell", + "read-fonts 0.43.3", + "smallvec", +] + [[package]] name = "hashbrown" version = "0.14.5" @@ -3692,7 +4372,7 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a" [[package]] name = "hayro-jbig2" version = "0.3.0" -source = "git+https://github.com/storytold/craft-libs?rev=068e079c7be4b100a8a6b305b31ac881e069727e#068e079c7be4b100a8a6b305b31ac881e069727e" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" dependencies = [ "hayro-ccitt", ] @@ -3706,7 +4386,7 @@ checksum = "c75ab947623ef4ccaa7acf0579edf7cbb5a73838e3839a7be73335e522f433a1" [[package]] name = "hayro-syntax" version = "0.7.2" -source = "git+https://github.com/storytold/craft-libs?rev=068e079c7be4b100a8a6b305b31ac881e069727e#068e079c7be4b100a8a6b305b31ac881e069727e" +source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" dependencies = [ "hayro-jbig2", "hayro-jpeg2000", @@ -3750,6 +4430,63 @@ version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" +[[package]] +name = "iana-time-zone" +version = "0.1.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "log", + "wasm-bindgen", + "windows-core 0.61.2", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "icu_calendar" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58655df2f728e46e4eee80bddebefacf52ec3e77cdb925014b47c5a5905eb55c" +dependencies = [ + "calendrical_calculations", + "displaydoc", + "icu_locale_core", + "icu_provider", + "serde", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_collator" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08984ed58ac439ebf3e13d2cf26b0c46a60afcd21721c1d14087c0b240344dda" +dependencies = [ + "icu_collections", + "icu_locale_core", + "icu_normalizer", + "icu_properties", + "icu_provider", + "serde", + "smallvec", + "utf16_iter", + "utf8_iter", + "zerovec", +] + [[package]] name = "icu_collections" version = "2.3.0" @@ -3758,12 +4495,37 @@ checksum = "fa68d21081c4a05d5a901a1c62add574c77048b6a1c67be3b50ce0b60d4ca513" dependencies = [ "displaydoc", "potential_utf", + "serde", "utf8_iter", "yoke", "zerofrom", "zerovec", ] +[[package]] +name = "icu_datetime" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c44df99c4c5297b05653d1a1629f13bdc9fd4044acfbbaf30b15194a1eed4cd6" +dependencies = [ + "displaydoc", + "fixed_decimal", + "icu_calendar", + "icu_decimal", + "icu_locale_core", + "icu_pattern", + "icu_plurals", + "icu_provider", + "icu_time", + "potential_utf", + "serde", + "smallvec", + "tinystr", + "writeable", + "zerotrie", + "zerovec", +] + [[package]] name = "icu_decimal" version = "2.3.0" @@ -3825,6 +4587,7 @@ dependencies = [ "icu_normalizer_data", "icu_properties", "icu_provider", + "serde", "smallvec", "utf16_iter", "utf8_iter", @@ -3875,6 +4638,7 @@ dependencies = [ "icu_locale_core", "icu_properties_data", "icu_provider", + "serde", "zerotrie", "zerovec", ] @@ -3927,6 +4691,22 @@ dependencies = [ "zerovec", ] +[[package]] +name = "icu_time" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af37e1c3b9f3ab564b619fdf4b22de169f6381eb0f7048e3ca454290c438126b" +dependencies = [ + "calendrical_calculations", + "displaydoc", + "icu_calendar", + "icu_locale_core", + "icu_provider", + "serde", + "zerotrie", + "zerovec", +] + [[package]] name = "idna" version = "1.1.0" @@ -3978,6 +4758,12 @@ dependencies = [ "quick-error 2.0.1", ] +[[package]] +name = "imagesize" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65b27460c2c92b037f3f94c538ed9a3342f3fdf923606781629ccb35f82d042a" + [[package]] name = "indexmap" version = "2.14.2" @@ -4005,6 +4791,24 @@ version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4275b20e6057cd7733fd8df8a5a31701e4fe44497dad0f3fa0e1c4fb971506be" +[[package]] +name = "inventory" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6928282826c822ad91bf1c9a1cb90a30ba1c26770749929b4656cd6be829cd7c" +dependencies = [ + "rustversion", +] + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + [[package]] name = "itertools" version = "0.14.0" @@ -4236,6 +5040,54 @@ dependencies = [ "redox_syscall 0.9.4", ] +[[package]] +name = "libspa" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "882f7427e7989dcc9d388b7f05c4630390a1d7696f9ffa469cd4a7a48f0b4c40" +dependencies = [ + "bitflags 2.13.2", + "cc", + "cookie-factory", + "libc", + "libspa-sys", + "nom 8.0.0", + "rustix 1.1.6", + "system-deps", +] + +[[package]] +name = "libspa-sys" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b6e17bdaf63ed0d5e4144022624032b41fd9733112e8c74ac26fc9bf1291924" +dependencies = [ + "bindgen", + "cc", + "system-deps", +] + +[[package]] +name = "libwayshot-xcap" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea8a46e4d016ef464e386e4970f5415fe0939c2d63abe0c2f539c05ef88c5fe5" +dependencies = [ + "drm 0.15.0", + "gbm", + "gl", + "image", + "khronos-egl", + "memmap2", + "rustix 1.1.6", + "thiserror 2.0.21", + "tracing", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-protocols-wlr", +] + [[package]] name = "linebender_resource_handle" version = "0.1.1" @@ -4261,6 +5113,12 @@ version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" +[[package]] +name = "linux-raw-sys" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" + [[package]] name = "linux-raw-sys" version = "0.12.1" @@ -4387,6 +5245,12 @@ dependencies = [ "walkdir", ] +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "miniz_oxide" version = "0.8.9" @@ -4557,6 +5421,16 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + [[package]] name = "nom" version = "8.0.0" @@ -4587,7 +5461,7 @@ version = "0.50.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -4744,8 +5618,8 @@ dependencies = [ "block2 0.5.1", "libc", "objc2 0.5.2", - "objc2-core-data", - "objc2-core-image", + "objc2-core-data 0.2.2", + "objc2-core-image 0.2.2", "objc2-foundation 0.2.2", "objc2-quartz-core 0.2.2", ] @@ -4758,10 +5632,17 @@ checksum = "d49e936b501e5c5bf01fda3a9452ff86dc3ea98ad5f283e1455153142d97518c" dependencies = [ "bitflags 2.13.2", "block2 0.6.2", + "libc", "objc2 0.6.5", + "objc2-cloud-kit 0.3.2", + "objc2-core-data 0.3.2", "objc2-core-foundation", "objc2-core-graphics", + "objc2-core-image 0.3.2", + "objc2-core-text", + "objc2-core-video", "objc2-foundation 0.3.2", + "objc2-quartz-core 0.3.2", ] [[package]] @@ -4779,6 +5660,38 @@ dependencies = [ "objc2-foundation 0.3.2", ] +[[package]] +name = "objc2-av-foundation" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "478ae33fcac9df0a18db8302387c666b8ef08a3e2d62b510ca4fc278a384b6c0" +dependencies = [ + "bitflags 2.13.2", + "block2 0.6.2", + "dispatch2", + "objc2 0.6.5", + "objc2-avf-audio", + "objc2-core-audio-types", + "objc2-core-foundation", + "objc2-core-graphics", + "objc2-core-image 0.3.2", + "objc2-core-video", + "objc2-foundation 0.3.2", + "objc2-image-io", + "objc2-media-toolbox", + "objc2-quartz-core 0.3.2", +] + +[[package]] +name = "objc2-avf-audio" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13a380031deed8e99db00065c45937da434ca987c034e13b87e4441f9e4090be" +dependencies = [ + "objc2 0.6.5", + "objc2-foundation 0.3.2", +] + [[package]] name = "objc2-cloud-kit" version = "0.2.2" @@ -4792,6 +5705,17 @@ dependencies = [ "objc2-foundation 0.2.2", ] +[[package]] +name = "objc2-cloud-kit" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73ad74d880bb43877038da939b7427bba67e9dd42004a18b809ba7d87cee241c" +dependencies = [ + "bitflags 2.13.2", + "objc2 0.6.5", + "objc2-foundation 0.3.2", +] + [[package]] name = "objc2-contacts" version = "0.2.2" @@ -4837,6 +5761,17 @@ dependencies = [ "objc2-foundation 0.2.2", ] +[[package]] +name = "objc2-core-data" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b402a653efbb5e82ce4df10683b6b28027616a2715e90009947d50b8dd298fa" +dependencies = [ + "bitflags 2.13.2", + "objc2 0.6.5", + "objc2-foundation 0.3.2", +] + [[package]] name = "objc2-core-foundation" version = "0.3.2" @@ -4844,7 +5779,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536" dependencies = [ "bitflags 2.13.2", + "block2 0.6.2", "dispatch2", + "libc", "objc2 0.6.5", ] @@ -4855,10 +5792,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e022c9d066895efa1345f8e33e584b9f958da2fd4cd116792e15e07e4720a807" dependencies = [ "bitflags 2.13.2", + "block2 0.6.2", "dispatch2", + "libc", "objc2 0.6.5", "objc2-core-foundation", "objc2-io-surface", + "objc2-metal 0.3.2", ] [[package]] @@ -4873,6 +5813,16 @@ dependencies = [ "objc2-metal 0.2.2", ] +[[package]] +name = "objc2-core-image" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5d563b38d2b97209f8e861173de434bd0214cf020e3423a52624cd1d989f006" +dependencies = [ + "objc2 0.6.5", + "objc2-foundation 0.3.2", +] + [[package]] name = "objc2-core-location" version = "0.2.2" @@ -4885,6 +5835,49 @@ dependencies = [ "objc2-foundation 0.2.2", ] +[[package]] +name = "objc2-core-media" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05ec576860167a15dd9fce7fbee7512beb4e31f532159d3482d1f9c6caedf31d" +dependencies = [ + "bitflags 2.13.2", + "block2 0.6.2", + "dispatch2", + "objc2 0.6.5", + "objc2-core-audio", + "objc2-core-audio-types", + "objc2-core-foundation", + "objc2-core-video", +] + +[[package]] +name = "objc2-core-text" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cde0dfb48d25d2b4862161a4d5fcc0e3c24367869ad306b0c9ec0073bfed92d" +dependencies = [ + "bitflags 2.13.2", + "objc2 0.6.5", + "objc2-core-foundation", + "objc2-core-graphics", +] + +[[package]] +name = "objc2-core-video" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d425caf1df73233f29fd8a5c3e5edbc30d2d4307870f802d18f00d83dc5141a6" +dependencies = [ + "bitflags 2.13.2", + "block2 0.6.2", + "objc2 0.6.5", + "objc2-core-foundation", + "objc2-core-graphics", + "objc2-io-surface", + "objc2-metal 0.3.2", +] + [[package]] name = "objc2-encode" version = "4.1.0" @@ -4912,10 +5905,22 @@ checksum = "e3e0adef53c21f888deb4fa59fc59f7eb17404926ee8a6f59f5df0fd7f9f3272" dependencies = [ "bitflags 2.13.2", "block2 0.6.2", + "libc", "objc2 0.6.5", "objc2-core-foundation", ] +[[package]] +name = "objc2-image-io" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32b0446e98cf4a784cc7a0177715ff317eeaa8463841c616cfc78aa4f953c4ea" +dependencies = [ + "objc2 0.6.5", + "objc2-core-foundation", + "objc2-core-graphics", +] + [[package]] name = "objc2-io-kit" version = "0.3.2" @@ -4949,6 +5954,18 @@ dependencies = [ "objc2-foundation 0.2.2", ] +[[package]] +name = "objc2-media-toolbox" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edd9fdde720df3da7046bb9097811000c1e7ab5cd579fa89d96b27d56781fb30" +dependencies = [ + "objc2 0.6.5", + "objc2-core-audio-types", + "objc2-core-foundation", + "objc2-core-media", +] + [[package]] name = "objc2-metal" version = "0.2.2" @@ -5019,9 +6036,9 @@ dependencies = [ "bitflags 2.13.2", "block2 0.5.1", "objc2 0.5.2", - "objc2-cloud-kit", - "objc2-core-data", - "objc2-core-image", + "objc2-cloud-kit 0.2.2", + "objc2-core-data 0.2.2", + "objc2-core-image 0.2.2", "objc2-core-location", "objc2-foundation 0.2.2", "objc2-link-presentation", @@ -5091,6 +6108,12 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + [[package]] name = "orbclient" version = "0.3.55" @@ -5127,7 +6150,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d8fae84b431384b68627d0f9b3b1245fcf9f46f6c0e3dc902e9dce64edd1967" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys 0.45.0", ] [[package]] @@ -5262,6 +6285,12 @@ dependencies = [ "siphasher", ] +[[package]] +name = "pico-args" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315" + [[package]] name = "pin-project" version = "1.1.13" @@ -5299,6 +6328,31 @@ dependencies = [ "futures-io", ] +[[package]] +name = "pipewire" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bde71084c4e25959d68f1ea54daa75e5ecdb338e5caf0b5510143b79baa32d5c" +dependencies = [ + "bitflags 2.13.2", + "libc", + "libspa", + "libspa-sys", + "pipewire-sys", + "rustix 1.1.6", +] + +[[package]] +name = "pipewire-sys" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce653f53e63e5b93853218092ee9a8906a5d082c92f3f1db26316955dd63ce0" +dependencies = [ + "bindgen", + "libspa-sys", + "system-deps", +] + [[package]] name = "pkg-config" version = "0.3.34" @@ -5347,7 +6401,7 @@ dependencies = [ "concurrent-queue", "hermit-abi", "pin-project-lite", - "rustix 1.1.5", + "rustix 1.1.6", "windows-sys 0.61.2", ] @@ -5394,6 +6448,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6764c3b5dd454e283a30e6dfe78e9b31096d9e32036b5d1eaac7a6119ccb9a24" dependencies = [ "cobs", + "embedded-io 0.4.0", + "embedded-io 0.6.1", "serde", ] @@ -5735,6 +6791,17 @@ dependencies = [ "once_cell", ] +[[package]] +name = "read-fonts" +version = "0.43.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "005c8acf251756c478b0bf402885bfd88a1476020c4c7e6060edc1aa68da38ea" +dependencies = [ + "bytemuck", + "font-types", + "once_cell", +] + [[package]] name = "read-fonts" version = "0.44.0" @@ -5779,6 +6846,39 @@ dependencies = [ "bitflags 2.13.2", ] +[[package]] +name = "redox_users" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60dc65c0ff1a7ae1294b0c67b9f14baf70b644404010370171787bfac1038fc0" +dependencies = [ + "libredox", + "thiserror 2.0.21", +] + +[[package]] +name = "regex" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f020237b6c8eed93db2e2cb53c00c60a8e1bc73da7d073199a1180401450218d" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad8553b9b26413251cbf30e620595c7a41b3887f03da04579c0e6b0d6a06b4b2" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + [[package]] name = "regex-lite" version = "0.1.9" @@ -5806,6 +6906,21 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19b30a45b0cd0bcca8037f3d0dc3421eaf95327a17cad11964fb8179b4fc4832" +[[package]] +name = "resvg" +version = "0.48.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67e3803f97b999e80cbf7c6ecdd07a8102204d92e1633cf48783720c521196bd" +dependencies = [ + "bytemuck", + "log", + "pico-args", + "rgb", + "svgtypes", + "tiny-skia 0.12.0", + "usvg", +] + [[package]] name = "rfd" version = "0.17.2" @@ -5833,6 +6948,15 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "rgb" +version = "0.8.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47b34b781b31e5d73e9fbc8689c70551fd1ade9a19e3e28cfec8580a79290cc4" +dependencies = [ + "bytemuck", +] + [[package]] name = "ring" version = "0.17.14" @@ -5892,15 +7016,15 @@ dependencies = [ [[package]] name = "rustix" -version = "1.1.5" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891efababe418670775f199f0d233d84843c227a0949a883ce15b37c78d6629d" +checksum = "e5e76742e5294153d4dde1207dbec5bdd81eef6fabdc0d2118babadabfd858aa" dependencies = [ "bitflags 2.13.2", "errno", "libc", "linux-raw-sys 0.12.1", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -5957,7 +7081,7 @@ dependencies = [ "security-framework", "security-framework-sys", "webpki-root-certs", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -6184,6 +7308,12 @@ dependencies = [ "digest", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "shlex" version = "2.0.1" @@ -6231,6 +7361,15 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" +[[package]] +name = "simplecss" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a9c6883ca9c3c7c90e888de77b7a5c849c779d25d74a1269b0218b14e8b136c" +dependencies = [ + "log", +] + [[package]] name = "siphasher" version = "1.0.4" @@ -6328,7 +7467,7 @@ dependencies = [ "libc", "log", "memmap2", - "rustix 1.1.5", + "rustix 1.1.6", "thiserror 2.0.21", "wayland-backend", "wayland-client", @@ -6404,6 +7543,9 @@ name = "strict-num" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6637bab7722d379c8b41ba849228d680cc12d0a45ba1fa2b48f2a30577a06731" +dependencies = [ + "float-cmp", +] [[package]] name = "string-interner" @@ -6453,6 +7595,16 @@ version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" +[[package]] +name = "svgtypes" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f12b12995e3638c70618c1facb1ce65302f6a6f706b675f07c58a5d7391120e" +dependencies = [ + "kurbo", + "siphasher", +] + [[package]] name = "symphonia" version = "0.5.5" @@ -6881,6 +8033,19 @@ dependencies = [ "windows 0.61.3", ] +[[package]] +name = "system-deps" +version = "7.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "396a35feb67335377e0251fcbc1092fc85c484bd4e3a7a54319399da127796e7" +dependencies = [ + "cfg-expr", + "heck", + "pkg-config", + "toml", + "version-compare", +] + [[package]] name = "tag_ptr" version = "0.1.0" @@ -6903,6 +8068,12 @@ dependencies = [ "libc", ] +[[package]] +name = "target-lexicon" +version = "0.13.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca" + [[package]] name = "tempfile" version = "3.27.0" @@ -6912,8 +8083,8 @@ dependencies = [ "fastrand", "getrandom 0.4.3", "once_cell", - "rustix 1.1.5", - "windows-sys 0.61.2", + "rustix 1.1.6", + "windows-sys 0.52.0", ] [[package]] @@ -7043,6 +8214,7 @@ dependencies = [ "bytemuck", "cfg-if", "log", + "png", "tiny-skia-path 0.12.0", ] @@ -7125,8 +8297,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1340ea94a5856333492c9064b02c778b191dd2c853778d9609debdcdfea3a614" dependencies = [ "indexmap", + "serde_core", + "serde_spanned", "toml_datetime", "toml_parser", + "toml_writer", "winnow", ] @@ -7184,7 +8359,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8765b90061cba6c22b5831f675da109ae5561588290f9fa2317adab2714d5a6" dependencies = [ "memchr", - "nom", + "nom 8.0.0", "petgraph", ] @@ -7209,6 +8384,12 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ce898823d8cd0f028662d2f349694b1af0a5cc9be83f1d213a00d3147445e1e" +[[package]] +name = "typeid" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" + [[package]] name = "typenum" version = "1.20.1" @@ -7330,6 +8511,25 @@ dependencies = [ "serde", ] +[[package]] +name = "usvg" +version = "0.48.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "977d0a4abdef933f424a99fe09f95576e089b90aebc6f016a3bc813762493e91" +dependencies = [ + "data-url", + "imagesize", + "kurbo", + "log", + "pico-args", + "roxmltree", + "simplecss", + "siphasher", + "strict-num", + "svgtypes", + "tiny-skia-path 0.12.0", +] + [[package]] name = "utf16_iter" version = "1.0.5" @@ -7428,6 +8628,12 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "version-compare" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03c2856837ef78f57382f06b2b8563a2f512f7185d732608fd9176cb3b8edf0e" + [[package]] name = "version_check" version = "0.9.5" @@ -7664,7 +8870,7 @@ checksum = "38a91b4eaddff87b1cd1074985e3713da4af2c49742d1b356b2c01670a67a078" dependencies = [ "cc", "downcast-rs", - "rustix 1.1.5", + "rustix 1.1.6", "scoped-tls", "smallvec", "wayland-sys", @@ -7677,7 +8883,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3c36a0f861ad76d0901f2800b46321410d9f73f2ea88aac0650d86c32688073" dependencies = [ "bitflags 2.13.2", - "rustix 1.1.5", + "rustix 1.1.6", "wayland-backend", "wayland-scanner", ] @@ -7699,7 +8905,7 @@ version = "0.31.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a52d18780be9b1314328a3de5f930b73d2200112e3849ca6cb11822793fb34d" dependencies = [ - "rustix 1.1.5", + "rustix 1.1.6", "wayland-client", "xcursor", ] @@ -7779,6 +8985,19 @@ dependencies = [ "quote", ] +[[package]] +name = "wayland-server" +version = "0.31.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dde9c29be0f723a573977de51ee455bf3dfa03652730a74f9dd3b337e374d75" +dependencies = [ + "bitflags 2.13.2", + "downcast-rs", + "rustix 1.1.6", + "wayland-backend", + "wayland-scanner", +] + [[package]] name = "wayland-sys" version = "0.31.11" @@ -7786,7 +9005,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d8eab23fefc9e41f8e841df4a9c707e8a8c4ed26e944ef69297184de2785e3be" dependencies = [ "dlib", + "libc", "log", + "memoffset", "once_cell", "pkg-config", ] @@ -8025,6 +9246,12 @@ dependencies = [ "web-sys", ] +[[package]] +name = "widestring" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72069c3113ab32ab29e5584db3c6ec55d416895e60715417b5b883a357c3e471" + [[package]] name = "winapi" version = "0.3.9" @@ -8047,7 +9274,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -8553,7 +9780,7 @@ dependencies = [ "libc", "log", "os_pipe", - "rustix 1.1.5", + "rustix 1.1.6", "thiserror 2.0.21", "tree_magic_mini", "wayland-backend", @@ -8599,7 +9826,7 @@ dependencies = [ "libc", "libloading", "once_cell", - "rustix 1.1.5", + "rustix 1.1.6", "x11rb-protocol", ] @@ -8609,6 +9836,48 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea6fc2961e4ef194dcbfe56bb845534d0dc8098940c7e5c012a258bfec6701bd" +[[package]] +name = "xcap" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da270fd7c8581d43d731cb690bcc791fc0a7b3bc96e131a4b6552d0379640a9e" +dependencies = [ + "dispatch2", + "image", + "libwayshot-xcap", + "log", + "objc2 0.6.5", + "objc2-app-kit 0.3.2", + "objc2-av-foundation", + "objc2-core-foundation", + "objc2-core-graphics", + "objc2-core-media", + "objc2-core-video", + "objc2-foundation 0.3.2", + "percent-encoding", + "pipewire", + "rand 0.10.3", + "scopeguard", + "serde", + "thiserror 2.0.21", + "url", + "widestring", + "windows 0.62.2", + "xcb", + "zbus", +] + +[[package]] +name = "xcb" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6c2ad15e0e922856ee89afe862b8992334bbe7953adad56cd1199358cb30566" +dependencies = [ + "bitflags 2.13.2", + "libc", + "quick-xml 0.41.0", +] + [[package]] name = "xcursor" version = "0.3.11" @@ -8702,7 +9971,7 @@ dependencies = [ "hex", "libc", "ordered-stream", - "rustix 1.1.5", + "rustix 1.1.6", "serde", "serde_repr", "tracing", diff --git a/crates/media/Cargo.toml b/crates/media/Cargo.toml index 6d8c08790..26c6801e0 100644 --- a/crates/media/Cargo.toml +++ b/crates/media/Cargo.toml @@ -10,7 +10,6 @@ rust-version.workspace = true workspace = true [dependencies] -craft-audio-markers = { package = "craft-audio", version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1", default-features = false } craft-docpath = { workspace = true } effectcraft-time = { workspace = true } effectcraft-color = { workspace = true } diff --git a/crates/media/src/wav_markers.rs b/crates/media/src/wav_markers.rs index bc198d1b7..83f7e8a69 100644 --- a/crates/media/src/wav_markers.rs +++ b/crates/media/src/wav_markers.rs @@ -1,5 +1,5 @@ //! WAV cue/adtl/RF64/XMP metadata is parsed by craft-audio; timeline policy remains here. -use craft_audio_markers::wav_markers as shared; +use craft_audio::wav_markers as shared; use effectcraft_color::Label; use effectcraft_project::Marker; use effectcraft_time::Tick; From b119944dc970d48baef6cd66ad8bc978bf4a698b Mon Sep 17 00:00:00 2001 From: aiongg Date: Tue, 24 Nov 2026 16:54:17 +0000 Subject: [PATCH 408/451] Host the craft-ui runtime: install, frame input, close path, update dialogs on a DialogHost, fonts through craft_ui::fonts::load, app-local capture slot and font menu --- Cargo.toml | 5 +- apps/effectcraft-web/src/app.rs | 6 +- apps/effectcraft/src/main.rs | 5 +- crates/model/src/scene.rs | 2 +- crates/ui-egui/Cargo.toml | 5 +- crates/ui-egui/src/app.rs | 18 +- crates/ui-egui/src/app/frame.rs | 14 +- crates/ui-egui/src/app/prefs.rs | 7 +- crates/ui-egui/src/app/screenshot.rs | 6 +- crates/ui-egui/src/capture.rs | 211 +++++++++++++++++++++++ crates/ui-egui/src/framework.rs | 153 ++++++++++++++++ crates/ui-egui/src/lib.rs | 8 +- crates/ui-egui/src/panels/text_panels.rs | 34 +++- crates/ui-egui/src/panels/unsaved.rs | 62 +++---- crates/ui-egui/src/panels/viewer.rs | 1 + crates/ui-egui/src/theme.rs | 2 +- crates/ui-egui/src/updates_ui.rs | 57 ++++-- 17 files changed, 503 insertions(+), 93 deletions(-) create mode 100644 crates/ui-egui/src/capture.rs create mode 100644 crates/ui-egui/src/framework.rs diff --git a/Cargo.toml b/Cargo.toml index ff30114bb..a3a717b1e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,6 @@ craft-mime = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", craft-pdf = { git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1", version = "=0.1.0", default-features = false, features = ["read"] } craft-docpath = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } craft-jsonrpc = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } -craft-quit = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } craft-ecproj-format = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } craft-dpx = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } craft-ps = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1", default-features = false, features = ["read"] } @@ -129,6 +128,10 @@ half = "2.7" # Shared UI and the complete egui family select reviewed immutable commits below. craft-ui = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } craft-behavior = { git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } +craft-host = { git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } +craft-keymap = { git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } +craft-theme = { git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } +craft-window = { git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } # `default_fonts` and `monochrome_emoji_fonts` are explicit: the app's `FontDefinitions::default()` # and its `✔`/`▣` chrome glyphs need both, and kittest's own dev-dependencies do not propagate. egui = { version = "0.37", default-features = false, features = ["default_fonts", "monochrome_emoji_fonts"] } diff --git a/apps/effectcraft-web/src/app.rs b/apps/effectcraft-web/src/app.rs index 99e71117f..444b8c0cd 100644 --- a/apps/effectcraft-web/src/app.rs +++ b/apps/effectcraft-web/src/app.rs @@ -113,8 +113,8 @@ impl eframe::App for WebApp { } /// The browser host's logic tick: run queued UI actions, tick the shared app, poll API replies, flush Render - /// Queue downloads, persist the session snapshot when enabled, publish GPU/frame-worker/disk-cache info and close - /// the IME pass. + /// Queue downloads, persist the session snapshot when enabled, publish GPU/frame-worker/disk-cache info, close + /// the IME pass and run the root window's close path. fn logic(&mut self, ctx: &egui::Context, frame: &mut eframe::Frame) { let actions = ACTIONS.with(|a| std::mem::take(&mut *a.borrow_mut())); for f in actions { @@ -146,6 +146,7 @@ impl eframe::App for WebApp { diskcache::configure(d.disk_cache_enabled, d.disk_cache_max_gb, storage::quota()); api::set_info("diskCache", diskcache::stats()); self.app.finish_ime_logic(ctx); + self.app.close_path(ctx); } fn ui(&mut self, ui: &mut egui::Ui, frame: &mut eframe::Frame) { @@ -277,6 +278,7 @@ pub async fn start(canvas_id: String) -> Result<(), JsValue> { canvas, eframe::WebOptions::default(), Box::new(move |cc| { + effectcraft_ui_egui::framework::install_headless(&cc.egui_ctx); EffectcraftApp::install_ime_reset_hooks(&cc.egui_ctx); CTX.with(|c| *c.borrow_mut() = Some(cc.egui_ctx.clone())); // The page owns this shared presentation device; worker devices retain their diff --git a/apps/effectcraft/src/main.rs b/apps/effectcraft/src/main.rs index a008a7b7a..74f1eaf4d 100644 --- a/apps/effectcraft/src/main.rs +++ b/apps/effectcraft/src/main.rs @@ -299,6 +299,7 @@ fn run_desktop(reporter: &crash_report::Shutdown) -> eframe::Result { "EffectCraft", options, Box::new(move |cc| { + effectcraft_ui_egui::framework::install(&cc.egui_ctx)?; EffectcraftApp::install_ime_reset_hooks(&cc.egui_ctx); match &cc.wgpu_render_state { Some(rs) => { @@ -548,7 +549,7 @@ struct Desktop { impl eframe::App for Desktop { /// The desktop host's logic tick: update the macOS menu bar, run the shared app tick, close the IME pass, show the - /// file dialogs asked for and, last, hand a close to the platform quit. + /// file dialogs asked for and, last, the root window's close path. fn logic(&mut self, ctx: &egui::Context, frame: &mut eframe::Frame) { #[cfg(target_os = "macos")] self.menu_sync.before(&mut self.app, |app| self.menu.update(app, ctx)); @@ -560,7 +561,7 @@ impl eframe::App for Desktop { if let Some(asked) = &self.file_dialogs { file_dialogs::show_asked(asked, frame, ctx); } - effectcraft_ui_egui::panels::unsaved::quit_on_close(ctx); + self.app.close_path(ctx); } fn ui(&mut self, ui: &mut egui::Ui, frame: &mut eframe::Frame) { diff --git a/crates/model/src/scene.rs b/crates/model/src/scene.rs index 07fee0397..a8ea124b6 100644 --- a/crates/model/src/scene.rs +++ b/crates/model/src/scene.rs @@ -440,7 +440,7 @@ mod tests { // The decoded image has already taken four pixels from this budget. let mut pixels_left = 4; let mut warnings = vec![]; - let clamped = cm::TextureRef { image: 0, uv_set: 0, wrap: [cm::Wrap::Clamp; 2] }; + let clamped = cm::TextureRef { image: 0, uv_set: 0, wrap: [cm::Wrap::Clamp; 2], transform: None }; let first = ensure_texture(&scene, &decoded, clamped, &mut textures, &mut texture_of, &mut pixels_left, &mut warnings).unwrap(); let shared = ensure_texture(&scene, &decoded, clamped, &mut textures, &mut texture_of, &mut pixels_left, &mut warnings).unwrap(); diff --git a/crates/ui-egui/Cargo.toml b/crates/ui-egui/Cargo.toml index c7957f79a..2f3d940b0 100644 --- a/crates/ui-egui/Cargo.toml +++ b/crates/ui-egui/Cargo.toml @@ -13,7 +13,10 @@ workspace = true craft-mime = { workspace = true } craft-ui = { workspace = true } craft-behavior = { workspace = true } -craft-quit = { workspace = true, features = ["ui"] } +craft-host = { workspace = true } +craft-keymap = { workspace = true } +craft-theme = { workspace = true } +craft-window = { workspace = true } effectcraft-time = { workspace = true } effectcraft-geom = { workspace = true } effectcraft-color = { workspace = true } diff --git a/crates/ui-egui/src/app.rs b/crates/ui-egui/src/app.rs index ae0fbf38d..3fc3803ad 100644 --- a/crates/ui-egui/src/app.rs +++ b/crates/ui-egui/src/app.rs @@ -128,6 +128,8 @@ impl EffectcraftApp { template_thumbs: Default::default(), template_list: None, updates_rt: updates_ui::Runtime::default(), + framework_dialogs: craft_ui::dialog::DialogHost::new(), + framework_host: crate::framework::host(), } .with_ui_commands() } @@ -158,10 +160,12 @@ impl eframe::App for EffectcraftApp { } } - /// Feed pending synthetic input into `raw_input` only once fonts are ready (so a non-drawing pass never consumes + /// Hand the runtime this frame's root values (`before_input`), then feed pending synthetic input into `raw_input` + /// only once fonts are ready (so a non-drawing pass never consumes /// a batch), then prepare pointer wrapping; ending a numeric scrub clears the history merge key so the next edit /// starts a new undo step. fn raw_input_hook(&mut self, ctx: &egui::Context, raw_input: &mut egui::RawInput) { + self.before_input(ctx); raw_input.events.append(&mut self.forwarded.events); raw_input.dropped_files.append(&mut self.forwarded.files); let injected = self.synthetic_in_flight || !self.synthetic.is_empty(); @@ -177,19 +181,23 @@ impl eframe::App for EffectcraftApp { } } - /// The logic-only tick: run `tick`, close the IME pass with `finish_ime_logic` and, last, hand a close to the - /// platform quit (`panels::unsaved::quit_on_close`). It does not read pass-time - /// input state (events, pointer and time are stale here), only the viewport information eframe refreshed. + /// The logic-only tick: run `tick`, close the IME pass with `finish_ime_logic` and, last, the root window's close + /// path (`close_path`, which asks about unsaved changes, and on macOS quits through the platform). It does not + /// read pass-time input state (events, pointer and time are stale here), only the viewport information eframe + /// refreshed. A close request must be answered while hidden too; an answered file dialog can change the project, + /// so the tick's dialog answers run first. fn logic(&mut self, ctx: &egui::Context, frame: &mut eframe::Frame) { // Never `ctx.input(|i| i.time)` here: `Context::run_logic` leaves events, pointer state and // time at the previous full pass's values (only the viewport information is refreshed). self.tick(ctx, frame); self.finish_ime_logic(ctx); - crate::panels::unsaved::quit_on_close(ctx); + self.close_path(ctx); } /// Draw one UI pass through `draw`. fn ui(&mut self, ui: &mut egui::Ui, frame: &mut eframe::Frame) { + #[cfg(not(target_arch = "wasm32"))] + crate::framework::before_ui(ui.ctx(), &*frame); self.draw(ui, frame); } } diff --git a/crates/ui-egui/src/app/frame.rs b/crates/ui-egui/src/app/frame.rs index 59c12267c..9d8cf2743 100644 --- a/crates/ui-egui/src/app/frame.rs +++ b/crates/ui-egui/src/app/frame.rs @@ -122,11 +122,6 @@ impl EffectcraftApp { } }); } - // Do not interpret a close as permission to abandon the still-running script. Once - // Stop finishes it, the normal unsaved-changes prompt can handle a new close request. - if ctx.input(|i| i.viewport().close_requested()) { - ctx.send_viewport_cmd(egui::ViewportCommand::CancelClose); - } self.drain_control(ctx, self.now); ctx.request_repaint_after(std::time::Duration::from_millis(50)); } @@ -187,9 +182,6 @@ impl EffectcraftApp { self.apply_gpu_failure(ctx); if self.gpu_failure_applied == Some(true) { self.close_after_device_loss(ctx); - // On macOS the app quits through `-[NSApplication terminate:]` instead of closing the - // window while AppKit's run loop is running (#341). - craft_quit::on_close_request(ctx); return; } if self.session.script_ui.render_host.is_some() { @@ -281,10 +273,6 @@ impl EffectcraftApp { self.tick_script_render(ctx); return; } - // A close request (the window's button, Quit, `app.quit`) must be answered while hidden. - // An answered file dialog can change the project, so the answers above run first. The host - // calls `panels::unsaved::quit_on_close` last in its `logic`. - panels::unsaved::on_close_requested(self, ctx); let title = panels::unsaved::window_title(self); if title != self.window_title { ctx.send_viewport_cmd(egui::ViewportCommand::Title(title.clone())); @@ -494,6 +482,7 @@ impl EffectcraftApp { if let Some(rect) = crate::color_picker::take_automation(&ctx) { self.auto.add("colorPicker.eyedropper", rect, "Eyedropper"); } + crate::framework::return_window_keys(&ctx); let tab_had_widget_focus = ctx.egui_wants_keyboard_input(); menus::handle_shortcuts(self, &ctx); if !ctx.input(|i| i.pointer.primary_down()) { @@ -544,6 +533,7 @@ impl EffectcraftApp { panels::learn::coach(self, &ctx); let lift = panels::media_panels::import_card(self, ui, full); self.draw_toast(ui, full, lift); + self.framework_dialogs.run(ui); } /// Workspace-layout auto-save: a background write that also runs while hidden, once the diff --git a/crates/ui-egui/src/app/prefs.rs b/crates/ui-egui/src/app/prefs.rs index 218760337..5b7a13d6f 100644 --- a/crates/ui-egui/src/app/prefs.rs +++ b/crates/ui-egui/src/app/prefs.rs @@ -17,10 +17,9 @@ impl EffectcraftApp { ctx.set_theme(theme::theme_preference(&p.appearance.appearance_mode, self.ui.theme.is_light())); let tips = p.general.show_tool_tips; ctx.all_styles_mut(|s| s.interaction.tooltip_delay = if tips { 0.5 } else { f32::INFINITY }); - // Settings ▸ Appearance ▸ UI Scale (#284). egui's own Ctrl+= / Ctrl+- / Ctrl+0 zoom stays - // off: Ctrl+0 is Window ▸ Project, and the scale is a setting. - ctx.options_mut(|o| o.zoom_with_keyboard = false); - ctx.set_zoom_factor(p.appearance.ui_scale as f32 / 100.0); + // Settings ▸ Appearance ▸ UI Scale (#284) is the runtime's root scale (`frame_input`), which + // writes the zoom factor; egui's own Ctrl+= / Ctrl+- / Ctrl+0 zoom is off under the runtime + // (Ctrl+0 is Window ▸ Project). self.ui.cache_when_idle = p.previews.cache_frames_when_idle; self.ui.viewer.fast_preview = p.previews.fast_previews; // No limit of its own below the common budget on the desktop, the browser's cap there: diff --git a/crates/ui-egui/src/app/screenshot.rs b/crates/ui-egui/src/app/screenshot.rs index bf7dace0d..7d95b4472 100644 --- a/crates/ui-egui/src/app/screenshot.rs +++ b/crates/ui-egui/src/app/screenshot.rs @@ -206,7 +206,7 @@ impl EffectcraftApp { fn drain_completed_screenshots(&mut self, geom: DrawGeometry) { let mut i = 0; while i < self.pending_screenshots.len() { - let taken = self.pending_screenshots.get(i).and_then(|s| s.slot.as_ref()).and_then(craft_ui::capture::CaptureSlot::take); + let taken = self.pending_screenshots.get(i).and_then(|s| s.slot.as_ref()).and_then(crate::capture::CaptureSlot::take); let Some(result) = taken else { i += 1; continue; @@ -324,7 +324,7 @@ impl EffectcraftApp { continue; } }; - let (slot, callback) = craft_ui::capture::CaptureSlot::new(ctx, egui::ViewportId::ROOT, MAX_SHOT_BYTES); + let (slot, callback) = crate::capture::CaptureSlot::new(ctx, egui::ViewportId::ROOT, MAX_SHOT_BYTES); ctx.send_viewport_cmd(egui::ViewportCommand::Screenshot(callback)); let s = &mut self.pending_screenshots[i]; s.slot = Some(slot); @@ -356,7 +356,7 @@ mod tests { assert!(app.session.refuse_export(&text).is_ok()); let (tx, rx) = std::sync::mpsc::channel(); app.admit_screenshot(&ctx, Some(text.clone()), ShotTarget::Window, tx); - let (slot, callback) = craft_ui::capture::CaptureSlot::new(&ctx, egui::ViewportId::ROOT, MAX_SHOT_BYTES); + let (slot, callback) = crate::capture::CaptureSlot::new(&ctx, egui::ViewportId::ROOT, MAX_SHOT_BYTES); let shot = app.pending_screenshots.last_mut().unwrap(); shot.issued = Some(geom); shot.slot = Some(slot); diff --git a/crates/ui-egui/src/capture.rs b/crates/ui-egui/src/capture.rs new file mode 100644 index 000000000..7e58c204f --- /dev/null +++ b/crates/ui-egui/src/capture.rs @@ -0,0 +1,211 @@ +//! One-shot completion slots for `ui.screenshot` captures. +//! +//! The app keeps request ids, paths, deadlines, settling and budgets in its request record +//! (`control::PendingShot`). A slot only correlates one capture with one record, checks the image against +//! a per-image byte bound, and wakes the owning viewport. +//! +//! [`CaptureSlot::new`] sends nothing: send its callback with [`egui::ViewportCommand::Screenshot`] +//! when the capture is due. The callback holds only a weak reference to the slot, so dropping the +//! slot releases its image and makes a late result inert. Every retry needs a +//! fresh slot and callback. +//! +//! The slot holds a strong [`egui::Context`]: keep it in the app's request record, never in +//! `Context`-owned data, which would form a cycle. + +use std::mem::size_of; +use std::sync::{Arc, Mutex, MutexGuard, PoisonError, Weak}; + +use egui::{Color32, ColorImage, Context, ScreenshotCallback, ViewportId}; + +/// Why a completed screenshot was rejected and released. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub(crate) enum CaptureError { + /// The checked pixel count, or its byte count, overflowed `usize`. + DimensionsOverflow { width: usize, height: usize }, + /// The pixel buffer does not match the dimensions, or the image has no area. + MalformedImage { width: usize, height: usize, pixels: usize }, + /// The image is larger than the slot's per-image byte bound. + ImageTooLarge { bytes: usize, max_bytes: usize }, +} + +impl core::fmt::Display for CaptureError { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + match self { + Self::DimensionsOverflow { width, height } => { + write!(f, "screenshot dimensions {width}×{height} overflow the checked pixel or byte count") + } + Self::MalformedImage { width, height, pixels } => write!(f, "screenshot has {pixels} pixels for its {width}×{height} dimensions"), + Self::ImageTooLarge { bytes, max_bytes } => write!(f, "screenshot uses {bytes} bytes, over the {max_bytes}-byte per-image limit"), + } + } +} + +impl std::error::Error for CaptureError {} + +enum SlotState { + Pending, + Ready(Result, CaptureError>), + Taken, + Cancelled, +} + +struct Shared { + state: Mutex, + /// The live request owns the strong context; the callback only upgrades it briefly to wake. + context: Context, + viewport: ViewportId, + max_image_bytes: usize, +} + +/// The live request side of a capture. Dropping it cancels the completion and releases any +/// retained image. +#[must_use = "the slot must be kept alive to receive and take the screenshot"] +pub(crate) struct CaptureSlot { + shared: Arc, +} + +impl CaptureSlot { + /// A completion slot for a capture of `viewport` and its one-shot callback. `max_image_bytes` + /// bounds this one image; the app reserves its aggregate budget itself. + pub(crate) fn new(context: &Context, viewport: ViewportId, max_image_bytes: usize) -> (Self, ScreenshotCallback) { + let shared = Arc::new(Shared { state: Mutex::new(SlotState::Pending), context: context.clone(), viewport, max_image_bytes }); + let weak = Arc::downgrade(&shared); + let callback = ScreenshotCallback::new(move |image| complete(&weak, image)); + (Self { shared }, callback) + } + + /// The completed result, at most once; `None` while pending and after an + /// earlier take. The request record knows which. + pub(crate) fn take(&self) -> Option, CaptureError>> { + let mut state = lock(&self.shared.state); + if !matches!(&*state, SlotState::Ready(_)) { + return None; + } + match core::mem::replace(&mut *state, SlotState::Taken) { + SlotState::Ready(result) => Some(result), + _ => None, + } + } +} + +impl Drop for CaptureSlot { + fn drop(&mut self) { + close(&self.shared); + } +} + +impl core::fmt::Debug for CaptureSlot { + /// The viewport only: logging never holds or dumps screenshot contents. + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + f.debug_struct("CaptureSlot").field("viewport", &self.shared.viewport).finish_non_exhaustive() + } +} + +/// Locks the slot state, recovering from poisoning. Release the guard before calling into the +/// context: a repaint observer may take or cancel re-entrantly. +fn lock(state: &Mutex) -> MutexGuard<'_, SlotState> { + state.lock().unwrap_or_else(PoisonError::into_inner) +} + +/// Marks the slot closed; the retained image drops after the mutex is released. +fn close(shared: &Shared) { + let previous = { + let mut state = lock(&shared.state); + core::mem::replace(&mut *state, SlotState::Cancelled) + }; + drop(previous); +} + +/// Checks and stores a completed image, then wakes the owning viewport, with the slot lock +/// released. A cancelled, taken or dropped slot stores nothing and does not wake. +fn complete(weak: &Weak, image: Arc) { + let Some(shared) = weak.upgrade() else { return }; + let result = checked_image(image, shared.max_image_bytes); + let wake = { + let mut state = lock(&shared.state); + if matches!(&*state, SlotState::Pending) { + *state = SlotState::Ready(result); + true + } else { + false + } + }; + if wake { + shared.context.request_repaint_of(shared.viewport); + } +} + +/// `image` when it has area, its buffer matches its size, and its byte count (checked) is within +/// `max_image_bytes`. +fn checked_image(image: Arc, max_image_bytes: usize) -> Result, CaptureError> { + let [width, height] = image.size; + if width == 0 || height == 0 { + return Err(CaptureError::MalformedImage { width, height, pixels: image.pixels.len() }); + } + let pixels = width.checked_mul(height).ok_or(CaptureError::DimensionsOverflow { width, height })?; + let bytes = pixels.checked_mul(size_of::()).ok_or(CaptureError::DimensionsOverflow { width, height })?; + if image.pixels.len() != pixels { + return Err(CaptureError::MalformedImage { width, height, pixels: image.pixels.len() }); + } + if bytes > max_image_bytes { + return Err(CaptureError::ImageTooLarge { bytes, max_bytes: max_image_bytes }); + } + Ok(image) +} + +#[cfg(test)] +mod tests { + use super::*; + + fn image(size: [usize; 2]) -> Arc { + Arc::new(ColorImage::filled(size, Color32::RED)) + } + + fn observe_repaints(ctx: &Context) -> Arc>> { + let requests = Arc::new(Mutex::new(Vec::new())); + let observed = requests.clone(); + ctx.set_repaint_observer(move |info| observed.lock().unwrap().push(info.viewport_id)); + requests + } + + #[test] + fn a_completion_wakes_its_viewport_and_is_taken_once() { + let ctx = Context::default(); + let requests = observe_repaints(&ctx); + let viewport = ViewportId::from_hash_of("window"); + let (slot, callback) = CaptureSlot::new(&ctx, viewport, 1024); + assert!(slot.take().is_none(), "pending"); + let shot = image([2, 1]); + callback.complete(shot.clone()); + assert!(Arc::ptr_eq(&slot.take().unwrap().unwrap(), &shot)); + assert!(slot.take().is_none(), "taken once"); + assert_eq!(*requests.lock().unwrap(), [viewport]); + } + + #[test] + fn a_dropped_slot_releases_a_late_image_without_waking() { + let ctx = Context::default(); + let requests = observe_repaints(&ctx); + let (slot, callback) = CaptureSlot::new(&ctx, ViewportId::ROOT, 1024); + drop(slot); + let late = image([2, 2]); + let weak = Arc::downgrade(&late); + callback.complete(late); + assert!(weak.upgrade().is_none()); + assert!(requests.lock().unwrap().is_empty()); + } + + #[test] + fn oversized_malformed_and_overflowing_images_are_errors() { + let ctx = Context::default(); + let (slot, callback) = CaptureSlot::new(&ctx, ViewportId::ROOT, 16); + callback.complete(image([3, 3])); + assert!(matches!(slot.take(), Some(Err(CaptureError::ImageTooLarge { bytes: 36, max_bytes: 16 })))); + let (slot, callback) = CaptureSlot::new(&ctx, ViewportId::ROOT, 1024); + callback.complete(Arc::new(ColorImage { size: [2, 2], source_size: egui::Vec2::ZERO, pixels: vec![Color32::RED; 3] })); + assert!(matches!(slot.take(), Some(Err(CaptureError::MalformedImage { width: 2, height: 2, pixels: 3 })))); + let (slot, callback) = CaptureSlot::new(&ctx, ViewportId::ROOT, 1024); + callback.complete(Arc::new(ColorImage { size: [usize::MAX, 2], source_size: egui::Vec2::ZERO, pixels: Vec::new() })); + assert!(matches!(slot.take(), Some(Err(CaptureError::DimensionsOverflow { .. })))); + } +} diff --git a/crates/ui-egui/src/framework.rs b/crates/ui-egui/src/framework.rs new file mode 100644 index 000000000..fc2976792 --- /dev/null +++ b/crates/ui-egui/src/framework.rs @@ -0,0 +1,153 @@ +//! The craft-ui runtime, hosted from EffectCraft's own eframe `App` (craft-libs docs/craft-framework.md, section 2.2). +//! The desktop app calls [`install`] once, [`EffectcraftApp::before_input`] in `raw_input_hook`, +//! [`EffectcraftApp::close_path`] last in `logic`, and [`before_ui`] first in `ui`; the browser build and tests +//! install with [`install_headless`]. The framework dialogs run on [`EffectcraftApp::framework_dialogs`] after +//! EffectCraft's own UI. +//! +//! The runtime takes Escape, Tab and the clipboard events for the whole window unless one of EffectCraft's own egui +//! widgets has the keyboard. [`return_window_keys`] puts the window's Escape and plain Enter back into egui's input +//! for EffectCraft's own handlers; the Composition viewer is declared to the runtime with [`host_canvas`], which keeps +//! Tab, the edit chords and the clipboard events in egui's input for EffectCraft's shortcuts. + +use std::sync::{Arc, OnceLock}; + +use craft_host::target::ShellInfo; +use craft_host::{AppInfo, Host}; +use craft_keymap::Overrides; +use craft_ui::fonts::{I18nScripts, SystemFonts, UiFonts}; +use craft_ui::runtime::commands::{CommandInput, CommandSet as _, NavCommand, QuitCommand}; +use craft_ui::runtime::env::{RootEnv, Scale}; +use craft_ui::runtime::focus::{EditSet, KeepKeys, KeyUse}; +use craft_ui::runtime::frame::{FrameInput, FrameOutput}; +use craft_ui::runtime::keys::{Intent, with_window_intents}; +use craft_ui::shell::embed::{self, CloseDecision}; +use craft_window::system::WindowSystem; +use egui::ViewportId; + +use crate::EffectcraftApp; + +/// Each pass of the root window, first in `App::ui`: hands the runtime the native window it answers the hit test of +/// (Windows) and fits the window to its monitor once. +#[cfg(not(target_arch = "wasm32"))] +pub use craft_ui::shell::embed::before_ui; + +/// The id every OS window of the app carries, as the desktop entry and the update app name it. +const APP_ID: &str = "ai.storyteller.effectcraft"; + +/// The scripts of the interface languages, for the font stack. +static SCRIPTS: I18nScripts = I18nScripts; + +/// The runtime's first font stack: egui's bundled faces and no installed system fonts. EffectCraft's own definitions +/// ([`crate::theme::install`]) replace it before anything is drawn. +fn ui_fonts() -> UiFonts<'static> { + UiFonts::new(&SCRIPTS).system_fonts(SystemFonts::Off) +} + +fn install_with(ctx: &egui::Context, shell: ShellInfo, windows: Arc) -> Result<(), String> { + let spec = craft_ui::InstallSpec::new(shell, windows).app_id(APP_ID); + embed::install(ctx, spec, &ui_fonts()).map(drop).map_err(|error| format!("the UI runtime could not be installed: {error}")) +} + +/// Installs the runtime on the desktop window's context, once, before the first pass. EffectCraft keeps the system +/// title bar, so the window gets no frame decision. +#[cfg(not(target_arch = "wasm32"))] +pub fn install(ctx: &egui::Context) -> Result<(), String> { + let shell = ShellInfo::default().backend(craft_host::target::Backend::from_env()); + install_with(ctx, shell, Arc::new(craft_window::system::SystemWindows)) +} + +/// Installs the runtime on a context with no native window of its own: the browser build's canvas and test windows. +pub fn install_headless(ctx: &egui::Context) { + if let Err(error) = install_with(ctx, ShellInfo::default(), Arc::new(craft_window::system::NoWindows)) { + log::warn!("{error}"); + } +} + +/// Who EffectCraft is to the framework's dialogs (the update dialogs show its name and icon). +pub(crate) fn host() -> Arc { + Arc::new( + Host::builder(AppInfo { id: "effectcraft", name: "EffectCraft", version: env!("CARGO_PKG_VERSION") }) + .icon_png(include_bytes!("../../../assets/app-icon/hicolor/128x128/apps/ai.storyteller.effectcraft.png")) + .build(), + ) +} + +/// EffectCraft's own shortcut table keeps the keys the framework binds by default: Cmd+Q is `app.quit`, and F6 is +/// free for the user to bind there, so the framework's quit and pane moves are unbound. Overrides are keyed by command +/// id, which the command sets give. +fn command_overrides() -> Arc { + static OVERRIDES: OnceLock> = OnceLock::new(); + OVERRIDES + .get_or_init(|| { + let mut overrides = Overrides::new(); + for id in [QuitCommand::Quit.id(), NavCommand::NextPane.id(), NavCommand::PreviousPane.id()] { + overrides.insert(id, Vec::new()); + } + Arc::new(overrides) + }) + .clone() +} + +impl EffectcraftApp { + /// The framework's part of `App::raw_input_hook`, once per frame before the first pass: takes what the runtime + /// gathered since the last frame and gives the coming passes the root values (theme mode and interface scale). + pub fn before_input(&mut self, ctx: &egui::Context) { + embed::before_input(ctx, |output| self.frame_input(ctx, output)); + } + + /// The root values of this frame. EffectCraft registers no commands with the runtime (its own shortcut table runs + /// every key, [`command_overrides`]) and lets it toggle no chrome, so the output carries nothing it acts on. The + /// interface scale is Settings > Appearance > UI Scale; the runtime writes it to the context. While one of + /// EffectCraft's own dialogs or a command's file dialog is up, the runtime blocks the panels floated into windows + /// of their own. + pub(crate) fn frame_input(&mut self, ctx: &egui::Context, _output: FrameOutput) -> FrameInput { + let mode = if self.tokens.kind.is_light() { craft_theme::Mode::Light } else { craft_theme::Mode::Dark }; + let scale = self.session.prefs.appearance.ui_scale as f32 / 100.0; + let root = RootEnv::new().mode(mode).scale(Scale::new(scale)); + let app_modal = self.floats_blocked(ctx).then_some(ViewportId::ROOT); + FrameInput::new(root).commands(CommandInput::new().overrides(command_overrides())).host(Arc::clone(&self.framework_host)).app_modal(app_modal) + } + + /// The framework's part of `App::logic`, after EffectCraft's own: the root window's close path + /// ([`crate::panels::unsaved::close_decision`]). + pub fn close_path(&mut self, ctx: &egui::Context) { + embed::logic(ctx, || crate::panels::unsaved::close_decision(self)); + } +} + +/// Declares the Composition viewer `id`, drawn in this pass, as the window's document canvas. With nothing focused it +/// is the window's key target: Tab (the Composition Mini-Flowchart), the edit chords and the clipboard events stay in +/// egui's input for EffectCraft's shortcuts. +pub(crate) fn host_canvas(ctx: &egui::Context, id: egui::Id) { + const KEYS: KeyUse = KeyUse::CANVAS.with_keep(KeepKeys::Tab).with_edits(EditSet::ALL); + craft_ui::runtime::focus::host_canvas(ctx, id, KEYS); +} + +/// Puts the window's Escape and plain Enter (the keys the runtime routes to no component while nothing has framework +/// focus) back into egui's input as key presses, first in the pass, so EffectCraft's dialogs, popups, tools and +/// shortcuts read them from egui as they read every other key. +pub(crate) fn return_window_keys(ctx: &egui::Context) { + for (key, intent) in [(egui::Key::Escape, Intent::Cancel), (egui::Key::Enter, Intent::Submit)] { + if take_window_intent(ctx, intent) { + ctx.input_mut(|i| { + let modifiers = i.modifiers; + i.events.insert(0, egui::Event::Key { key, physical_key: Some(key), pressed: true, repeat: false, modifiers }); + }); + } + } +} + +/// Takes the window's `intent` when it is there: no later reader sees it. +fn take_window_intent(ctx: &egui::Context, intent: Intent) -> bool { + let mut taken = false; + with_window_intents(ctx, false, |intents| { + taken = intents.take(intent.clone()); + taken + }); + taken +} + +/// Whether the close decision is `Close`. +pub(crate) fn decide(close: bool) -> CloseDecision { + if close { CloseDecision::Close } else { CloseDecision::Hold } +} diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 1d39857df..8f5030fcb 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -21,6 +21,7 @@ pub const UPDATE_APP: craft_update::app::App = craft_update::app::App { pub mod audio; pub mod automation; pub mod bench; +pub(crate) mod capture; pub mod color_picker; pub mod control; pub mod credits; @@ -28,6 +29,7 @@ pub mod display_gpu; pub mod dock; pub mod dock_ui; mod expression_diagnostics; +pub mod framework; pub mod frames; pub mod gpu_failure; pub mod header; @@ -103,7 +105,7 @@ struct PendingShot { /// The geometry epoch bound to the issued capture command, if it was issued. issued: Option, /// The shared completion slot; dropping it cancels a late callback. - slot: Option, + slot: Option, /// Bytes reserved against [`EffectcraftApp::shot_bytes`]. reserved_bytes: usize, /// Geometry retries used. @@ -472,6 +474,10 @@ pub struct EffectcraftApp { /// Audio scrubbing's open output (Ctrl/Cmd-drag the current time, `playback.scrubAudio`). pub scrub: Option, pub(crate) updates_rt: updates_ui::Runtime, + /// The framework dialogs (the update dialogs), run once per pass after EffectCraft's own UI. + pub framework_dialogs: craft_ui::dialog::DialogHost, + /// Who EffectCraft is to the framework's dialogs. + pub(crate) framework_host: std::sync::Arc, /// Audio panel VU meters. pub meter: audio::Meter, /// Waveform peak summaries per footage item (see `panels::waveform`). diff --git a/crates/ui-egui/src/panels/text_panels.rs b/crates/ui-egui/src/panels/text_panels.rs index f22d775a3..e4be44d3f 100644 --- a/crates/ui-egui/src/panels/text_panels.rs +++ b/crates/ui-egui/src/panels/text_panels.rs @@ -795,11 +795,6 @@ pub(super) fn font_picker(app: &mut EffectcraftApp, ui: &mut egui::Ui, id: egui: let changed = search.changed(); let mut open = true; // The search lives in the field; the menu's header is the filter row, its list the fonts. - let menu = craft_ui::combo::Menu::new(ui, &search) - .open(&mut open) - .height(380.0) - .close_behavior(egui::PopupCloseBehavior::CloseOnClickOutside) - .style(egui::style::StyleModifier::default()); let app_ref = &mut *app; let header = |ui: &mut egui::Ui| { ui.set_width(rect.width().max(180.0)); @@ -922,7 +917,7 @@ pub(super) fn font_picker(app: &mut EffectcraftApp, ui: &mut egui::Ui, id: egui: } chosen }; - let chosen = menu.show_ui_with_header(header, list).flatten(); + let chosen = header_menu(&search, &mut open, FONT_MENU_HEIGHT, header, list).flatten(); if chosen.is_some() || !open || escape { ui.data_mut(|d| { d.insert_temp(id.with("open"), false); @@ -1095,6 +1090,33 @@ fn fit_preview(lines: &[Vec<[f32; 2]>], room: Rect, baseline: f32) -> Option<(f3 Some((k, o)) } + +/// The tallest the font menu gets, its header included. +const FONT_MENU_HEIGHT: f32 = 380.0; + +/// A menu under `field` while `open` is true: `header` stays at the top and the list it hands its result to scrolls +/// under it, the whole menu up to `height` tall and at least as wide as the field. A click outside closes it (`open` +/// turns false). Returns what `list` returned, or `None` while the menu is closed. +fn header_menu( + field: &egui::Response, + open: &mut bool, + height: f32, + header: impl FnOnce(&mut egui::Ui) -> H, + list: impl FnOnce(&mut egui::Ui, H) -> R, +) -> Option { + egui::Popup::from_response(field) + .open_bool(open) + .width(field.rect.width()) + .close_behavior(egui::PopupCloseBehavior::CloseOnClickOutside) + .show(|ui| { + ui.set_min_width(ui.available_width()); + ui.set_max_height(height); + let header = header(ui); + egui::ScrollArea::vertical().max_height(ui.available_height().max(0.0)).show(ui, |ui| list(ui, header)).inner + }) + .map(|shown| shown.inner) +} + #[cfg(test)] mod tests { use super::*; diff --git a/crates/ui-egui/src/panels/unsaved.rs b/crates/ui-egui/src/panels/unsaved.rs index be12668da..016bc60d4 100644 --- a/crates/ui-egui/src/panels/unsaved.rs +++ b/crates/ui-egui/src/panels/unsaved.rs @@ -55,25 +55,24 @@ fn ask(app: &mut EffectcraftApp, id: &str, params: &Value) -> bool { true } -/// The window's close button (and Quit, which closes it): keep the window open and ask. -pub fn on_close_requested(app: &mut EffectcraftApp, ctx: &egui::Context) { - if !ctx.input(|i| i.viewport().close_requested()) || app.dialog_state.unsaved.quitting { - return; +/// The root window's close decision, which the runtime's close path (`crate::framework`, `close_path`) asks when the +/// window's close button, Quit or `app.quit` closes the window. A lost graphics device and an answered Quit prompt +/// close; a running script render holds the window (a close is no permission to abandon the script, and once Stop +/// finishes it a new close is asked about as usual); a modified project holds it while the Unsaved Changes prompt +/// asks. On macOS a close that nothing holds quits through the platform (the runtime's close path). +pub fn close_decision(app: &mut EffectcraftApp) -> craft_ui::shell::embed::CloseDecision { + if app.device_lost_close.is_some() { + return crate::framework::decide(true); + } + if app.session.script_ui.render_host.is_some() { + return crate::framework::decide(false); + } + if app.dialog_state.unsaved.quitting { + return crate::framework::decide(true); } // Logged, so a window that closes on its own shows it (#234). log::info!("the window was asked to close"); - if ask(app, "app.quit", &json!({})) { - ctx.send_viewport_cmd(egui::ViewportCommand::CancelClose); - } -} - -/// On macOS a close that nothing held open quits through `-[NSApplication terminate:]` instead: -/// closing the window while AppKit's run loop is running crashes on a Mac with a Touch Bar -/// (#341). `on_exit` still runs. A desktop host calls it last in `logic`, after -/// `EffectcraftApp::tick` (which runs [`on_close_requested`]) and its own work. Returns whether -/// that quit was scheduled; other platforms close the window as before. -pub fn quit_on_close(ctx: &egui::Context) -> bool { - craft_quit::on_close_request(ctx) + crate::framework::decide(!ask(app, "app.quit", &json!({}))) } /// The project's display name: its file name, or `Untitled Project.ecproj`. @@ -204,6 +203,7 @@ mod tests { fn app() -> (EffectcraftApp, egui::Context) { let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); let app = EffectcraftApp::new(effectcraft_engine::Session::default()); crate::theme::install(&ctx, &app.tokens, crate::i18n::language(&app)); (app, ctx) @@ -218,29 +218,17 @@ mod tests { } let mut out = ctx.run_ui(raw, |ui| { app.auto.begin_frame(); - on_close_requested(app, ui.ctx()); + app.close_path(ui.ctx()); crate::panels::dialogs::show(app, ui.ctx()); }); out.textures_delta.clear(); out.viewport_output.get(&egui::ViewportId::ROOT).is_some_and(|v| v.commands.contains(&egui::ViewportCommand::CancelClose)) } - /// One frame of the dialogs with the window's close button pressed, through - /// [`on_close_requested`] and then [`quit_on_close`] as the app runs them; returns whether the - /// close was canceled and whether the platform quit was scheduled. - fn close_frame(app: &mut EffectcraftApp, ctx: &egui::Context) -> (bool, bool) { - let mut raw = egui::RawInput::default(); - raw.viewports.entry(egui::ViewportId::ROOT).or_default().events.push(egui::ViewportEvent::Close); - let mut quits = false; - let mut out = ctx.run_ui(raw, |ui| { - app.auto.begin_frame(); - on_close_requested(app, ui.ctx()); - quits = quit_on_close(ui.ctx()); - crate::panels::dialogs::show(app, ui.ctx()); - }); - out.textures_delta.clear(); - let canceled = out.viewport_output.get(&egui::ViewportId::ROOT).is_some_and(|v| v.commands.contains(&egui::ViewportCommand::CancelClose)); - (canceled, quits) + /// One frame of the dialogs with the window's close button pressed, through the runtime's close path as the app + /// runs it; returns whether the close was canceled (held, or taken by the platform quit on macOS). + fn close_frame(app: &mut EffectcraftApp, ctx: &egui::Context) -> bool { + frame(app, ctx, true) } fn modified(app: &mut EffectcraftApp) { @@ -401,7 +389,7 @@ mod tests { fn closing_a_saved_project_quits_through_the_platform_on_macos() { let (mut app, ctx) = app(); let macos = cfg!(target_os = "macos"); - assert_eq!(close_frame(&mut app, &ctx), (macos, macos)); + assert_eq!(close_frame(&mut app, &ctx), macos); assert!(app.dialog.is_none(), "nothing to ask"); } @@ -409,14 +397,14 @@ mod tests { fn closing_a_modified_project_asks_before_the_platform_quit() { let (mut app, ctx) = app(); modified(&mut app); - assert_eq!(close_frame(&mut app, &ctx), (true, false), "the prompt holds the window and nothing quits"); + assert!(close_frame(&mut app, &ctx), "the prompt holds the window"); assert_eq!(app.dialog, Some(Dialog::UnsavedChanges)); answer_with(&mut app, &ctx, Answer::Cancel); assert!(app.session.is_dirty() && !app.dialog_state.unsaved.quitting); - assert_eq!(close_frame(&mut app, &ctx), (true, false), "asked again after Cancel"); + assert!(close_frame(&mut app, &ctx), "asked again after Cancel"); answer_with(&mut app, &ctx, Answer::Discard); let macos = cfg!(target_os = "macos"); - assert_eq!(close_frame(&mut app, &ctx), (macos, macos), "Don't Save quits"); + assert_eq!(close_frame(&mut app, &ctx), macos, "Don't Save closes"); } /// While the window is minimized or hidden, eframe runs `App::logic` without `App::ui` and diff --git a/crates/ui-egui/src/panels/viewer.rs b/crates/ui-egui/src/panels/viewer.rs index 1fa58e635..41c2f2ab1 100644 --- a/crates/ui-egui/src/panels/viewer.rs +++ b/crates/ui-egui/src/panels/viewer.rs @@ -885,6 +885,7 @@ fn phase_menu(app: &mut EffectcraftApp, ui: &mut egui::Ui, ectx: &EvalCtx, v: &m // Interaction. let resp = ui.interact(area, egui::Id::unique("viewer-interact"), Sense::click_and_drag()); + crate::framework::host_canvas(ui.ctx(), resp.id); let menu_hits_id = egui::Id::unique(("viewer-menu-hits", cid.0)); // A right-click an overlay took (the Cryptomatte eyedropper's) opens the menu too. let forwarded = ui.data_mut(|d| d.remove_temp::(egui::Id::unique(FORWARDED_SECONDARY))); diff --git a/crates/ui-egui/src/theme.rs b/crates/ui-egui/src/theme.rs index e18d834ee..0126fd8cc 100644 --- a/crates/ui-egui/src/theme.rs +++ b/crates/ui-egui/src/theme.rs @@ -393,7 +393,7 @@ pub fn install(ctx: &egui::Context, t: &Tokens, language: &str) { stack.push("noto-symbols2".into()); } install_script_fallbacks(&mut fonts, language); - ctx.set_fonts(fonts); + craft_ui::fonts::load(ctx, fonts); apply_visuals(ctx, t); } diff --git a/crates/ui-egui/src/updates_ui.rs b/crates/ui-egui/src/updates_ui.rs index 1b2ce3347..ab7dcdc11 100644 --- a/crates/ui-egui/src/updates_ui.rs +++ b/crates/ui-egui/src/updates_ui.rs @@ -1,9 +1,12 @@ -//! Software updates, background check at startup, and startup prompt modal. +//! Software updates, background check at startup, and startup prompt modal, as craft-update's +//! dialogs on the app's [`DialogHost`](craft_ui::dialog::DialogHost). use crate::EffectcraftApp; #[cfg(not(target_arch = "wasm32"))] -use craft_update::dialog::{CheckResultDialog, CheckResultResponse}; +use craft_ui::dialog::DialogResult; +#[cfg(not(target_arch = "wasm32"))] +use craft_update::stack_dialogs::{CheckChoice, UpdateCheckDialog}; #[cfg(not(target_arch = "wasm32"))] use craft_update::updater::{Action, Status, Updater}; @@ -60,7 +63,7 @@ pub(crate) fn restart_to_update(rt: &mut Runtime, ctx: &egui::Context, clean: bo } // Without a prompt this only takes the close a finished installation queued, so a save after // Cancel does not close the app. - let _ = rt.updater.show_if(ctx, true); + let _ = rt.updater.take_close(true); ctx.send_viewport_cmd(egui::ViewportCommand::Close); } @@ -82,9 +85,9 @@ pub(crate) fn tick(app: &mut EffectcraftApp, ctx: &egui::Context) { { let rt = &mut app.updates_rt; if std::mem::take(&mut rt.check_requested) { - rt.updater.check_now(ctx); + rt.updater.check_now(); } else if rt.startup_check { - rt.updater.check_at_start(ctx); + rt.updater.check_at_start(); } rt.updater.tick(ctx); } @@ -101,28 +104,48 @@ pub(crate) fn result_window_open(open: bool, status: &Status, check_requested: b !matches!(status, Status::Idle) || (open && check_requested) } +/// One pass of the update flow, before the dialog host runs: answers the result dialog closed in +/// the last pass, drives the update prompt, and keeps the result dialog open and current while it +/// answers Help ▸ Check for Updates or the updater has something to report. pub(crate) fn show(app: &mut EffectcraftApp, ctx: &egui::Context) { #[cfg(not(target_arch = "wasm32"))] { // The restart helper is scheduled before the app closes, so no update starts over unsaved work. let clean = !app.session.is_dirty(); - match app.updates_rt.updater.show_if(ctx, clean) { + // Answered before the dialog is kept open below, so a dismissed outcome does not open again at once. + match app.framework_dialogs.take::() { + Some(DialogResult::Ok(CheckChoice::CheckNow | CheckChoice::CheckAgain)) => app.updates_rt.updater.check_now(), + Some(DialogResult::Ok(CheckChoice::RestartToUpdate)) => restart_to_update(&mut app.updates_rt, ctx, clean), + Some(DialogResult::Ok(CheckChoice::Update)) => { + app.updates_rt.updater.request_install(clean); + } + Some(DialogResult::Ok(CheckChoice::Download)) => ctx.open_url(egui::OpenUrl::new_tab(crate::UPDATE_APP.releases_url())), + // Closing the dialog dismisses the outcome it showed. + Some(_) => { + app.updates_rt.manual_window_open = false; + app.updates_rt.updater.dismiss_status(); + } + None => {} + } + match app.updates_rt.updater.run(&mut app.framework_dialogs, clean) { Action::OpenUrl(url) => ctx.open_url(egui::OpenUrl::new_tab(url)), Action::Close => ctx.send_viewport_cmd(egui::ViewportCommand::Close), - Action::None => {} + _ => {} } let rt = &mut app.updates_rt; rt.manual_window_open = result_window_open(rt.manual_window_open, rt.updater.status(), rt.check_requested); - if rt.manual_window_open { - match CheckResultDialog::new(&crate::UPDATE_APP, env!("CARGO_PKG_VERSION")).show(ctx, rt.updater.status()) { - CheckResultResponse::None => {} - CheckResultResponse::Close => { - rt.manual_window_open = false; - rt.updater.dismiss_status(); - } - CheckResultResponse::CheckAgain => rt.updater.check_now(ctx), - CheckResultResponse::RestartToUpdate => restart_to_update(rt, ctx, clean), - } + let shows = rt.manual_window_open; + let (status, installing, message) = (rt.updater.status().clone(), rt.updater.is_installing(), rt.updater.status_message()); + let dialogs = &mut app.framework_dialogs; + if shows && !dialogs.is_open::() { + dialogs.open(UpdateCheckDialog::new(env!("CARGO_PKG_VERSION"))); + } else if !shows && dialogs.is_open::() { + dialogs.cancel::(ctx); + } + if let Some(dialog) = dialogs.get_mut::() { + dialog.set_status(status); + dialog.set_installing(installing); + dialog.set_message(message); } } From e34fc9ecaa3998a5d0e4939ab5f969c7162b42df Mon Sep 17 00:00:00 2001 From: aiongg Date: Tue, 24 Nov 2026 16:55:12 +0000 Subject: [PATCH 409/451] Tests: the runtime installed in every harness and bare context that runs the app's UI --- crates/ui-egui/src/app/clipboard.rs | 2 + crates/ui-egui/src/app/frame.rs | 11 ++++ crates/ui-egui/src/app/prefs.rs | 1 + crates/ui-egui/src/app/viewer_frames.rs | 4 +- crates/ui-egui/src/color_picker.rs | 5 +- crates/ui-egui/src/i18n.rs | 1 + crates/ui-egui/src/lifecycle_tests.rs | 1 + crates/ui-egui/src/menus/tests.rs | 9 ++- crates/ui-egui/src/native_menu.rs | 3 + crates/ui-egui/src/num_math.rs | 1 + crates/ui-egui/src/panels/effects_presets.rs | 1 + crates/ui-egui/src/panels/forms.rs | 3 + crates/ui-egui/src/panels/home.rs | 2 + crates/ui-egui/src/panels/markers_ui.rs | 1 + crates/ui-egui/src/panels/project.rs | 1 + crates/ui-egui/src/panels/scriptui_view.rs | 1 + crates/ui-egui/src/panels/settings.rs | 3 + crates/ui-egui/src/panels/shortcut_editor.rs | 1 + crates/ui-egui/src/panels/text_panels.rs | 1 + crates/ui-egui/src/panels/timeline/tests.rs | 1 + .../ui-egui/src/panels/viewer_text/tests.rs | 3 + crates/ui-egui/src/pointer_wrap/tests.rs | 1 + crates/ui-egui/src/theme.rs | 5 ++ crates/ui-egui/src/widgets.rs | 2 + .../ui-egui/tests/it/native_menu_text_keys.rs | 4 +- .../ui-egui/tests/it/render_queue_snapshot.rs | 4 +- crates/ui-egui/tests/it/shared_docking_ui.rs | 6 +- crates/ui-egui/tests/it/ui_3d.rs | 16 ++--- crates/ui-egui/tests/it/ui_accessibility.rs | 2 +- .../tests/it/ui_accessibility_audit.rs | 2 +- crates/ui-egui/tests/it/ui_agent_audit.rs | 2 +- .../ui-egui/tests/it/ui_alt_drag_duplicate.rs | 4 +- crates/ui-egui/tests/it/ui_angles.rs | 2 +- .../ui-egui/tests/it/ui_audio_panel_levels.rs | 2 +- crates/ui-egui/tests/it/ui_audio_scrub.rs | 30 ++++----- .../ui-egui/tests/it/ui_azerty_shortcuts.rs | 6 +- crates/ui-egui/tests/it/ui_batch_links.rs | 2 +- crates/ui-egui/tests/it/ui_batch_switches.rs | 4 +- .../tests/it/ui_blank_context_menus.rs | 2 +- crates/ui-egui/tests/it/ui_camera_tracker.rs | 12 ++-- .../tests/it/ui_character_eyedropper.rs | 4 +- .../tests/it/ui_character_stroke_order.rs | 2 +- crates/ui-egui/tests/it/ui_checkbox_drag.rs | 2 +- crates/ui-egui/tests/it/ui_color_hex.rs | 2 +- crates/ui-egui/tests/it/ui_comp_presets.rs | 10 +-- crates/ui-egui/tests/it/ui_crypto_pick.rs | 4 +- .../ui-egui/tests/it/ui_crypto_pick_undo.rs | 2 +- crates/ui-egui/tests/it/ui_crypto_select.rs | 2 +- crates/ui-egui/tests/it/ui_dialog_preview.rs | 2 +- crates/ui-egui/tests/it/ui_dock_resize.rs | 2 +- crates/ui-egui/tests/it/ui_drag_drop.rs | 14 ++-- crates/ui-egui/tests/it/ui_effect_controls.rs | 64 +++++++++---------- .../tests/it/ui_effect_drop_highlight.rs | 2 +- crates/ui-egui/tests/it/ui_effect_names.rs | 2 +- .../tests/it/ui_effects_presets_keyboard.rs | 2 +- crates/ui-egui/tests/it/ui_env_light_gpu.rs | 2 +- .../ui-egui/tests/it/ui_export_overwrite.rs | 2 +- .../ui-egui/tests/it/ui_expression_values.rs | 2 +- .../ui-egui/tests/it/ui_flowchart_keyboard.rs | 4 +- crates/ui-egui/tests/it/ui_font_search.rs | 14 ++-- crates/ui-egui/tests/it/ui_form_fit.rs | 2 +- crates/ui-egui/tests/it/ui_frame_step.rs | 8 +-- crates/ui-egui/tests/it/ui_fx_editors.rs | 4 +- crates/ui-egui/tests/it/ui_gpu.rs | 10 +-- crates/ui-egui/tests/it/ui_gradient_editor.rs | 2 +- .../ui-egui/tests/it/ui_gradient_handles.rs | 2 +- crates/ui-egui/tests/it/ui_gradient_value.rs | 2 +- crates/ui-egui/tests/it/ui_graph_fit.rs | 2 +- crates/ui-egui/tests/it/ui_graph_theme.rs | 2 +- crates/ui-egui/tests/it/ui_group_rename.rs | 2 +- crates/ui-egui/tests/it/ui_guide_layers.rs | 2 +- .../ui-egui/tests/it/ui_info_tracker_a11y.rs | 2 +- crates/ui-egui/tests/it/ui_inline_edit.rs | 2 +- crates/ui-egui/tests/it/ui_keyframes.rs | 6 +- crates/ui-egui/tests/it/ui_large_project.rs | 2 +- .../ui-egui/tests/it/ui_layer_panel_zoom.rs | 2 +- .../tests/it/ui_layer_source_picker.rs | 6 +- crates/ui-egui/tests/it/ui_light_settings.rs | 2 +- crates/ui-egui/tests/it/ui_live_preview.rs | 6 +- crates/ui-egui/tests/it/ui_locked_color.rs | 2 +- crates/ui-egui/tests/it/ui_marker_names.rs | 6 +- .../tests/it/ui_media_browser_cache.rs | 2 +- .../tests/it/ui_media_browser_copy_path.rs | 3 +- crates/ui-egui/tests/it/ui_menus.rs | 4 +- crates/ui-egui/tests/it/ui_new_primitive.rs | 2 +- crates/ui-egui/tests/it/ui_object_matte.rs | 2 +- crates/ui-egui/tests/it/ui_panel_focus.rs | 2 +- crates/ui-egui/tests/it/ui_panel_windows.rs | 2 +- crates/ui-egui/tests/it/ui_panels.rs | 10 +-- .../ui-egui/tests/it/ui_parameter_spacing.rs | 4 +- crates/ui-egui/tests/it/ui_presets_folder.rs | 5 +- crates/ui-egui/tests/it/ui_preview_align.rs | 2 +- crates/ui-egui/tests/it/ui_project_delete.rs | 2 +- .../ui-egui/tests/it/ui_project_duplicate.rs | 2 +- .../ui-egui/tests/it/ui_project_keyboard.rs | 2 +- .../ui-egui/tests/it/ui_project_new_folder.rs | 2 +- crates/ui-egui/tests/it/ui_project_rows.rs | 4 +- crates/ui-egui/tests/it/ui_quick_offset.rs | 4 +- crates/ui-egui/tests/it/ui_ram_preview.rs | 8 +-- crates/ui-egui/tests/it/ui_render_queue.rs | 4 +- .../tests/it/ui_render_queue_keyboard.rs | 2 +- crates/ui-egui/tests/it/ui_roto_objects.rs | 2 +- .../tests/it/ui_roto_span_confidence.rs | 2 +- crates/ui-egui/tests/it/ui_script_console.rs | 4 +- .../tests/it/ui_script_console_keyboard.rs | 2 +- crates/ui-egui/tests/it/ui_script_render.rs | 2 +- crates/ui-egui/tests/it/ui_scriptui.rs | 12 ++-- crates/ui-egui/tests/it/ui_scrolling.rs | 4 +- crates/ui-egui/tests/it/ui_self_drop.rs | 2 +- crates/ui-egui/tests/it/ui_settings_info.rs | 8 +-- .../ui-egui/tests/it/ui_settings_keyboard.rs | 2 +- crates/ui-egui/tests/it/ui_shortcut_scopes.rs | 1 + crates/ui-egui/tests/it/ui_tabs.rs | 4 +- crates/ui-egui/tests/it/ui_tail.rs | 2 +- crates/ui-egui/tests/it/ui_text_edit.rs | 26 ++++---- .../ui-egui/tests/it/ui_text_range_handles.rs | 2 +- crates/ui-egui/tests/it/ui_theme_favorites.rs | 2 +- .../ui-egui/tests/it/ui_time_zoom_controls.rs | 2 +- .../tests/it/ui_timeline_audio_levels.rs | 6 +- .../tests/it/ui_timeline_effect_label.rs | 2 +- .../tests/it/ui_timeline_group_select.rs | 2 +- .../tests/it/ui_timeline_interacting.rs | 2 +- .../ui-egui/tests/it/ui_timeline_marquee.rs | 6 +- crates/ui-egui/tests/it/ui_timeline_pan.rs | 2 +- crates/ui-egui/tests/it/ui_timeline_shapes.rs | 2 +- .../ui-egui/tests/it/ui_timeline_switches.rs | 4 +- crates/ui-egui/tests/it/ui_timeline_trim.rs | 2 +- crates/ui-egui/tests/it/ui_timeline_zoom.rs | 4 +- .../ui-egui/tests/it/ui_toolbar_gradient.rs | 2 +- crates/ui-egui/tests/it/ui_tracker.rs | 4 +- .../ui-egui/tests/it/ui_unreadable_footage.rs | 2 +- .../ui-egui/tests/it/ui_video_preview_off.rs | 2 +- crates/ui-egui/tests/it/ui_view_layout.rs | 2 +- crates/ui-egui/tests/it/ui_viewer.rs | 16 ++--- crates/ui-egui/tests/it/ui_viewer_trackpad.rs | 2 +- crates/ui-egui/tests/it/ui_viewers.rs | 6 +- crates/ui-egui/tests/it/ui_visual_review.rs | 2 +- crates/ui-egui/tests/it/ui_web_gpu_storage.rs | 4 +- crates/ui-egui/tests/it/ui_web_offload.rs | 2 +- crates/ui-egui/tests/it/ui_window_title.rs | 2 +- .../ui-egui/tests/it/ui_workflow_selection.rs | 8 +-- crates/ui-egui/tests/it/ui_workspace_focus.rs | 7 +- crates/ui-egui/tests/it/viewer_geometry.rs | 5 +- 143 files changed, 341 insertions(+), 282 deletions(-) diff --git a/crates/ui-egui/src/app/clipboard.rs b/crates/ui-egui/src/app/clipboard.rs index 23b5080e0..f06d6f22d 100644 --- a/crates/ui-egui/src/app/clipboard.rs +++ b/crates/ui-egui/src/app/clipboard.rs @@ -37,6 +37,7 @@ mod copy_frame_tests { session.execute("layer.newSolid", json!({"color": "#ff0000"})).unwrap(); let mut app = EffectcraftApp::new(session); let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); let mut output = ctx.run_ui(egui::RawInput::default(), |ui| { crate::menus::invoke(&mut app, ui.ctx(), "comp.copyFrame", json!({})).unwrap(); app.handle_events(ui.ctx()); @@ -52,6 +53,7 @@ mod copy_frame_tests { #[test] fn a_malformed_image_is_an_error_not_a_crash() { let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); let mut output = ctx.run_ui(egui::RawInput::default(), |ui| { assert!(copy_image(ui.ctx(), 4, 4, &[0; 10]).is_err()); assert!(copy_image(ui.ctx(), 0, 4, &[]).is_err()); diff --git a/crates/ui-egui/src/app/frame.rs b/crates/ui-egui/src/app/frame.rs index 9d8cf2743..cca733c7c 100644 --- a/crates/ui-egui/src/app/frame.rs +++ b/crates/ui-egui/src/app/frame.rs @@ -753,6 +753,7 @@ mod tests { let mut app = EffectcraftApp::new(effectcraft_engine::Session::default()); app.session.events.push(effectcraft_engine::Event::Toast { message: "Earlier background error".into(), error: true }); let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); app.handle_events(&ctx); app.report_import_errors("file.import", &json!({"errors":["Later import error"]})); ctx.run_ui(egui::RawInput::default(), |ui| app.draw_toast(ui, ui.max_rect(), 0.0)).textures_delta.clear(); @@ -783,6 +784,7 @@ mod tests { app.report_import_errors("file.import", &json!({"errors":[first, "Earlier details"]})); app.report_import_errors("file.import", &json!({"errors":[first, "Later details"]})); let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); ctx.run_ui(egui::RawInput::default(), |ui| app.draw_toast(ui, ui.max_rect(), 0.0)).textures_delta.clear(); let r = app.auto.elements.iter().find(|e| e.id == "toast").unwrap().rect; let pos = egui::pos2(r[0] + 4.0, r[1] + 4.0); @@ -806,6 +808,7 @@ mod tests { let mut app = EffectcraftApp::new(effectcraft_engine::Session::default()); app.session.events.extend((0..40).map(|i| effectcraft_engine::Event::Toast { message: format!("Error {i}"), error: true })); let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); app.handle_events(&ctx); assert!(app.error_toasts.len() <= 32); assert_eq!(app.error_toasts.front().unwrap().message, "Error 0"); @@ -833,6 +836,7 @@ mod tests { effectcraft_engine::Event::Toast { message: "Second.vectorcraft failed".into(), error: true }, ]); let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); app.handle_events(&ctx); ctx.run_ui(egui::RawInput::default(), |ui| app.draw_toast(ui, ui.max_rect(), 0.0)).textures_delta.clear(); assert!(app.auto.elements.iter().any(|e| e.id == "toast" && e.label.contains("First.vectorcraft"))); @@ -868,6 +872,7 @@ mod tests { app.ui.status = "First foreground status".into(); app.session.events.push(effectcraft_engine::Event::Toast { message: "An unseen import error".into(), error: true }); let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); app.handle_events(&ctx); ctx.run_ui(egui::RawInput::default(), |ui| app.draw_toast(ui, ui.max_rect(), 0.0)).textures_delta.clear(); app.ui.status = "Another foreground status".into(); @@ -885,6 +890,7 @@ mod tests { app.ui.status = "A local drop failed".into(); app.session.events.push(effectcraft_engine::Event::Toast { message: "A later background import failed".into(), error: true }); let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); app.handle_events(&ctx); ctx.run_ui(egui::RawInput::default(), |ui| app.draw_toast(ui, ui.max_rect(), 0.0)).textures_delta.clear(); let click = |app: &mut EffectcraftApp| { @@ -919,6 +925,7 @@ mod tests { let mut app = EffectcraftApp::new(effectcraft_engine::Session::default()); app.session.events.push(effectcraft_engine::Event::Toast { message: "An earlier error".into(), error: true }); let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); app.handle_events(&ctx); ctx.run_ui(egui::RawInput::default(), |ui| app.draw_toast(ui, ui.max_rect(), 0.0)).textures_delta.clear(); app.ui.status = "An unrelated later status".into(); @@ -936,6 +943,7 @@ mod tests { app.report_import_errors("file.import", &json!({"errors": ["first failed file", "second failed file"]})); app.session.events.push(effectcraft_engine::Event::Toast { message: "Sequence has missing frames".into(), error: false }); let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); app.handle_events(&ctx); ctx.run_ui(egui::RawInput::default(), |ui| app.draw_toast(ui, ui.max_rect(), 0.0)).textures_delta.clear(); assert!(app.auto.elements.iter().any(|e| e.id == "toast" && e.label.contains("second failed file"))); @@ -948,6 +956,7 @@ mod tests { app.ui.status = "A foreground status".into(); app.toast = Some(("Saved".into(), 0.0)); let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); for now in [0.0, 3.0, 6.0, 6.1] { app.now = now; app.auto.elements.clear(); @@ -963,6 +972,7 @@ mod tests { app.toast = Some(("An old toast".into(), 0.0)); app.now = 8.0; let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); ctx.run_ui(egui::RawInput::default(), |ui| app.draw_toast(ui, ui.max_rect(), 0.0)).textures_delta.clear(); assert!(app.auto.elements.iter().all(|e| !e.label.contains("old toast"))); app.ui.status.clear(); @@ -978,6 +988,7 @@ mod tests { app.ui.status = "A local drop failed".into(); app.session.events.push(effectcraft_engine::Event::Toast { message: "Imported 1 item. Failed first file\nFailed second file".into(), error: true }); let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); app.handle_events(&ctx); for now in [0.0, 3.0, 6.0] { app.now = now; diff --git a/crates/ui-egui/src/app/prefs.rs b/crates/ui-egui/src/app/prefs.rs index 5b7a13d6f..284558250 100644 --- a/crates/ui-egui/src/app/prefs.rs +++ b/crates/ui-egui/src/app/prefs.rs @@ -128,6 +128,7 @@ mod appearance_tests { #[test] fn auto_mode_leaves_the_native_window_following_the_system() { let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); let mut app = app(); app.hooks.system_theme = Some(Box::new(|_| Some(egui::Theme::Light))); app.set_pref("appearance.appearanceMode", json!("auto")).unwrap(); diff --git a/crates/ui-egui/src/app/viewer_frames.rs b/crates/ui-egui/src/app/viewer_frames.rs index d9e6e84f2..80eb84af6 100644 --- a/crates/ui-egui/src/app/viewer_frames.rs +++ b/crates/ui-egui/src/app/viewer_frames.rs @@ -273,7 +273,7 @@ mod tests { session.execute("layer.newSolid", serde_json::json!({"color": "#808080"})).unwrap(); session.execute("effect.apply", serde_json::json!({"layer": 1, "effect": "Apply Color LUT"})).unwrap(); session.execute("prop.set", serde_json::json!({"layer": 1, "path": "effects/#1/lut", "value": lut.to_string_lossy()})).unwrap(); - let mut harness = egui_kittest::Harness::builder().with_size(egui::vec2(1200.0, 800.0)).build_eframe(|_| crate::EffectcraftApp::new(session)); + let mut harness = egui_kittest::Harness::builder().with_size(egui::vec2(1200.0, 800.0)).with_context_setup(crate::framework::install_headless).build_eframe(|_| crate::EffectcraftApp::new(session)); let centre = |h: &egui_kittest::Harness<'_, crate::EffectcraftApp>| { h.state().viewer_image.as_ref().map(|img| img.pixels[img.pixels.len() / 2 + img.size[0] / 2].r()) }; @@ -308,7 +308,7 @@ mod tests { let cid = session.active_comp_id().unwrap(); let item = session.execute("file.import", serde_json::json!({"paths": [png.to_string_lossy()]})).unwrap()["items"][0].clone(); session.execute("layer.addItem", serde_json::json!({"item": item})).unwrap(); - let mut harness = egui_kittest::Harness::builder().with_size(egui::vec2(1200.0, 800.0)).build_eframe(|_| crate::EffectcraftApp::new(session)); + let mut harness = egui_kittest::Harness::builder().with_size(egui::vec2(1200.0, 800.0)).with_context_setup(crate::framework::install_headless).build_eframe(|_| crate::EffectcraftApp::new(session)); let centre = |h: &egui_kittest::Harness<'_, crate::EffectcraftApp>| { h.state().viewer_image.as_ref().map(|img| img.pixels[img.pixels.len() / 2 + img.size[0] / 2].r()) }; diff --git a/crates/ui-egui/src/color_picker.rs b/crates/ui-egui/src/color_picker.rs index 2b9982cec..7c8812957 100644 --- a/crates/ui-egui/src/color_picker.rs +++ b/crates/ui-egui/src/color_picker.rs @@ -674,7 +674,7 @@ mod tests { let mut session = effectcraft_engine::Session::default(); session.execute("comp.new", serde_json::json!({"width": 320, "height": 180, "duration": 2})).unwrap(); session.execute("layer.newSolid", serde_json::json!({"color": "#204060"})).unwrap(); - let mut harness = egui_kittest::Harness::builder().with_size(vec2(1200.0, 800.0)).build_eframe(|_| crate::EffectcraftApp::new(session)); + let mut harness = egui_kittest::Harness::builder().with_size(vec2(1200.0, 800.0)).with_context_setup(crate::framework::install_headless).build_eframe(|_| crate::EffectcraftApp::new(session)); settle_sampling_viewer(&mut harness); harness } @@ -751,7 +751,7 @@ mod tests { let lid = s.execute("layer.newSolid", serde_json::json!({"color": "#ffffff"})).unwrap()["layer"].as_u64().unwrap(); s.execute("effect.apply", serde_json::json!({"layers": [lid], "effect": "Exposure"})).unwrap(); s.execute("prop.set", serde_json::json!({"layer": lid, "path": "effects/#1/master/exposure", "value": 2.0})).unwrap(); - let mut harness = egui_kittest::Harness::builder().with_size(vec2(1200.0, 800.0)).build_eframe(|_| crate::EffectcraftApp::new(s)); + let mut harness = egui_kittest::Harness::builder().with_size(vec2(1200.0, 800.0)).with_context_setup(crate::framework::install_headless).build_eframe(|_| crate::EffectcraftApp::new(s)); for _ in 0..400 { harness.step(); if harness.state().frames.inflight() == 0 && harness.state().viewer_f16.is_some() { @@ -840,6 +840,7 @@ mod tests { #[test] fn a_picker_can_sample_behind_its_own_dialog_but_not_a_new_modal() { let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); let point = pos2(20.0, 20.0); let mut output = ctx.run_ui(egui::RawInput { events: vec![egui::Event::PointerMoved(point)], ..Default::default() }, |ui| { let ctx = ui.ctx(); diff --git a/crates/ui-egui/src/i18n.rs b/crates/ui-egui/src/i18n.rs index f10cff01b..b9b3cf3bc 100644 --- a/crates/ui-egui/src/i18n.rs +++ b/crates/ui-egui/src/i18n.rs @@ -9347,6 +9347,7 @@ mod tests { fn general_settings_exposes_the_language_automation_id() { let mut app = EffectcraftApp::new(effectcraft_engine::Session::default()); let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); let tokens = crate::theme::Tokens::for_kind(crate::theme::ThemeKind::Dark); crate::theme::install(&ctx, &tokens, language(&app)); crate::panels::settings::open(&mut app, "general"); diff --git a/crates/ui-egui/src/lifecycle_tests.rs b/crates/ui-egui/src/lifecycle_tests.rs index fe9041987..ab02aff37 100644 --- a/crates/ui-egui/src/lifecycle_tests.rs +++ b/crates/ui-egui/src/lifecycle_tests.rs @@ -82,6 +82,7 @@ fn a_control_command_that_needs_no_ui_completes_without_a_pass() { #[test] fn a_pass_that_cannot_draw_receives_no_synthetic_input() { let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); let frame = eframe::Frame::_new_kittest(); let mut app = app_with_comp(); assert!(!app.is_ready(), "a fresh app installs its fonts in its first pass"); diff --git a/crates/ui-egui/src/menus/tests.rs b/crates/ui-egui/src/menus/tests.rs index 101c23956..97b678c61 100644 --- a/crates/ui-egui/src/menus/tests.rs +++ b/crates/ui-egui/src/menus/tests.rs @@ -16,6 +16,7 @@ fn zoom_steps_land_on_whole_screen_magnifications() { #[test] fn shortcut_passes_share_frame_start_modifiers() { let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); let mut starts = Vec::new(); let mut output = ctx.run_ui(egui::RawInput { events: vec![egui::Event::ModifiersChanged(egui::Modifiers::SHIFT)], ..Default::default() }, |ui| { let ctx = ui.ctx(); @@ -84,6 +85,7 @@ fn ctrl_backslash_maximizes_or_restores_the_window() { assert!(m.command && k == egui::Key::Backslash, "{m:?} {k:?}"); assert!(bindings(&app.session).iter().any(|b| (b.0, b.1) == (m, k) && b.2 == "window.maximizeApp")); let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); let run = |app: &mut EffectcraftApp, maximized: bool| { let input = egui::RawInput { viewports: std::iter::once((egui::ViewportId::ROOT, egui::ViewportInfo { maximized: Some(maximized), ..Default::default() })).collect(), @@ -408,6 +410,7 @@ fn file_dialogs_block_floating_windows_only_while_up() { use std::sync::{Arc, Mutex}; let mut app = EffectcraftApp::new(effectcraft_engine::Session::default()); let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); let pending: Arc>> = Arc::default(); let queue = pending.clone(); app.hooks.file_dialog_async = Some(Box::new(move |_dialog, done| queue.lock().unwrap().push(done))); @@ -491,6 +494,7 @@ fn a_dialog_that_cannot_open_reports_an_error() { use std::sync::{Arc, Mutex}; let mut app = EffectcraftApp::new(effectcraft_engine::Session::default()); let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); let pending: Arc>> = Arc::default(); let queue = pending.clone(); app.hooks.file_dialog_async = Some(Box::new(move |_dialog, done| queue.lock().unwrap().push(done))); @@ -588,6 +592,7 @@ fn dropped_files_keep_import_errors_alongside_local_drop_errors() { let mut app = EffectcraftApp::new(effectcraft_host::session()); app.session.prefs.import.drag_import_as = "comp".into(); let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); let mut dropped_files: Vec = vec![std::sync::Arc::new(Drop("no-local-path".into()))]; if bad_import { dropped_files.push(std::sync::Arc::new(Drop(path.clone()))); @@ -697,7 +702,7 @@ fn closing_the_render_queue_reveals_the_panel_receiving_focus() { fn closing_a_floating_queue_preserves_the_maximized_composition() { let mut session = effectcraft_engine::Session::default(); session.execute("comp.new", json!({"name": "A", "width": 32, "height": 32, "duration": 2})).unwrap(); - let mut h = egui_kittest::Harness::builder().with_size(egui::vec2(1200.0, 800.0)).build_eframe(|_| EffectcraftApp::new(session)); + let mut h = egui_kittest::Harness::builder().with_size(egui::vec2(1200.0, 800.0)).with_context_setup(crate::framework::install_headless).build_eframe(|_| EffectcraftApp::new(session)); h.run_steps(3); let ctx = h.ctx.clone(); let app = h.state_mut(); @@ -771,7 +776,7 @@ fn queue_close_keeps_passive_viewer_focus_across_frames() { let mut session = effectcraft_engine::Session::default(); let a = session.execute("comp.new", json!({"name": "A", "width": 32, "height": 32, "duration": 2})).unwrap()["comp"].as_u64().unwrap(); let b = session.execute("comp.new", json!({"name": "B", "width": 32, "height": 32, "duration": 2})).unwrap()["comp"].as_u64().unwrap(); - let mut h = egui_kittest::Harness::builder().with_size(egui::vec2(1200.0, 800.0)).build_eframe(|_| EffectcraftApp::new(session)); + let mut h = egui_kittest::Harness::builder().with_size(egui::vec2(1200.0, 800.0)).with_context_setup(crate::framework::install_headless).build_eframe(|_| EffectcraftApp::new(session)); h.run_steps(3); let ctx = h.ctx.clone(); let app = h.state_mut(); diff --git a/crates/ui-egui/src/native_menu.rs b/crates/ui-egui/src/native_menu.rs index f856db01d..a905fc7a0 100644 --- a/crates/ui-egui/src/native_menu.rs +++ b/crates/ui-egui/src/native_menu.rs @@ -768,6 +768,7 @@ mod tests { let spec = build(&app); let dup = spec.items().into_iter().find(|i| i.command == "edit.duplicate").map(|i| i.id.clone()).unwrap(); let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); app.dialog_state.delete_items.command = Some((json!({"items": []}), json!({"items": 1, "layers": 1, "comps": 1}))); app.dialog = Some(crate::Dialog::DeleteItems); // Chosen with the mouse, Duplicate still runs. @@ -915,6 +916,7 @@ mod tests { fn a_file_dialog_takes_the_edit_keys_from_a_focused_text_field() { let mut app = app(); let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); let mut text = String::new(); for _ in 0..2 { let mut out = ctx.run_ui(egui::RawInput::default(), |ui| ui.text_edit_singleline(&mut text).request_focus()); @@ -996,6 +998,7 @@ mod tests { app.session.execute("layer.newNull", json!({})).unwrap(); app.session.execute("edit.undo", json!({})).unwrap(); let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); let history = label(&build_now(&app, &ctx), "edit.undo"); let redo_history = label(&build_now(&app, &ctx), "edit.redo"); assert!(history.starts_with(undo) && history != undo, "{history}"); diff --git a/crates/ui-egui/src/num_math.rs b/crates/ui-egui/src/num_math.rs index 68225511c..111d92dff 100644 --- a/crates/ui-egui/src/num_math.rs +++ b/crates/ui-egui/src/num_math.rs @@ -368,6 +368,7 @@ mod tests { fn a_drag_value_reads_typed_arithmetic() { use egui::{Context, Event, Key, Modifiers, PointerButton, Pos2, RawInput, Rect, pos2, vec2}; let ctx = Context::default(); + crate::framework::install_headless(&ctx); let mut value = 10.0_f64; let mut time = 0.0; let field = Rect::from_min_size(pos2(100.0, 100.0), vec2(80.0, 20.0)); diff --git a/crates/ui-egui/src/panels/effects_presets.rs b/crates/ui-egui/src/panels/effects_presets.rs index db42e8992..39f9fdade 100644 --- a/crates/ui-egui/src/panels/effects_presets.rs +++ b/crates/ui-egui/src/panels/effects_presets.rs @@ -870,6 +870,7 @@ mod tests { assert_eq!(v.iter().map(|p| p.name.as_str()).collect::>(), vec!["bounce", "Zoom In"]); assert!(scan_presets(&d.join("missing")).is_empty()); let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); let set_time = |time| { let mut output = ctx.run_ui(egui::RawInput { time: Some(time), ..Default::default() }, |_| {}); output.textures_delta.clear(); diff --git a/crates/ui-egui/src/panels/forms.rs b/crates/ui-egui/src/panels/forms.rs index 4fa92bab6..ff93c9e6c 100644 --- a/crates/ui-egui/src/panels/forms.rs +++ b/crates/ui-egui/src/panels/forms.rs @@ -1090,6 +1090,7 @@ mod tests { for (import_as, background) in [("footage", false), ("composition", true), ("compositionLayerSizes", true)] { let mut app = EffectcraftApp::new(effectcraft_host::session()); let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); crate::theme::install(&ctx, &app.tokens, crate::i18n::language(&app)); app.dialog_state.form = Form { title: "Import".into(), @@ -1118,6 +1119,7 @@ mod tests { fn a_numeric_form_opens_with_its_first_number_selected() { let mut app = EffectcraftApp::new(effectcraft_engine::Session::default()); let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); crate::theme::install(&ctx, &app.tokens, crate::i18n::language(&app)); app.dialog_state.form = Form { title: "Position".into(), @@ -1185,6 +1187,7 @@ mod tests { fn premiere_export_dialog() { let mut app = EffectcraftApp::new(effectcraft_engine::Session::default()); let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); crate::theme::install(&ctx, &app.tokens, crate::i18n::language(&app)); app.session.execute("comp.new", json!({"name": "Spot", "width": 64, "height": 36, "frameRate": 25, "duration": 1})).unwrap(); app.session.execute("layer.newSolid", json!({"color": "#ff0000"})).unwrap(); diff --git a/crates/ui-egui/src/panels/home.rs b/crates/ui-egui/src/panels/home.rs index 601f4f1ef..968206d66 100644 --- a/crates/ui-egui/src/panels/home.rs +++ b/crates/ui-egui/src/panels/home.rs @@ -583,6 +583,7 @@ mod tests { s.prefs.push_recent("/projects/Alpha.ecproj"); let mut app = EffectcraftApp::new(s); let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); crate::theme::install(&ctx, &app.tokens, crate::i18n::language(&app)); ctx.run_ui(Default::default(), |_| {}).textures_delta.clear(); ctx.run_ui(Default::default(), |ui| { @@ -616,6 +617,7 @@ mod tests { app.ui.start_screen = true; app.ui.home_learn = true; let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); crate::theme::install(&ctx, &app.tokens, crate::i18n::language(&app)); let frame = |app: &mut EffectcraftApp| { ctx.run_ui(Default::default(), |ui| { diff --git a/crates/ui-egui/src/panels/markers_ui.rs b/crates/ui-egui/src/panels/markers_ui.rs index 26cfffc33..88f692964 100644 --- a/crates/ui-egui/src/panels/markers_ui.rs +++ b/crates/ui-egui/src/panels/markers_ui.rs @@ -629,6 +629,7 @@ mod tests { assert_eq!(app.session.execute("markers.list", json!({})).unwrap()[0]["chapter"], ""); // Enter is OK and Cmd+Backspace is Delete. let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); crate::theme::install(&ctx, &app.tokens, crate::i18n::language(&app)); // The dialog opens with Comment focused (#922), a multi-line field where Enter types a // new line; with the focus elsewhere, Enter is OK. diff --git a/crates/ui-egui/src/panels/project.rs b/crates/ui-egui/src/panels/project.rs index 57d2c60fa..3567e2dcc 100644 --- a/crates/ui-egui/src/panels/project.rs +++ b/crates/ui-egui/src/panels/project.rs @@ -1657,6 +1657,7 @@ mod tests { let long = p.add_item("A rather long composition name for the list", Label::Aqua, Some(folder), ItemKind::Folder); let app = EffectcraftApp::new(s); let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); let mut fit = (0.0, 0.0); ctx.run_ui(Default::default(), |ui| { let painter = ui.painter(); diff --git a/crates/ui-egui/src/panels/scriptui_view.rs b/crates/ui-egui/src/panels/scriptui_view.rs index 8b056d81e..81f038138 100644 --- a/crates/ui-egui/src/panels/scriptui_view.rs +++ b/crates/ui-egui/src/panels/scriptui_view.rs @@ -785,6 +785,7 @@ mod tests { /// frame's scroll output (viewport and content size). fn panel_frames(dock: egui::Vec2, first: egui::Vec2, then: egui::Vec2) -> (Rect, egui::Vec2) { let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); ctx.all_styles_mut(|s| s.spacing.scroll = egui::style::ScrollStyle::solid()); let screen = Rect::from_min_size(egui::Pos2::ZERO, vec2(800.0, 600.0)); let mut last = (Rect::NOTHING, egui::Vec2::ZERO); diff --git a/crates/ui-egui/src/panels/settings.rs b/crates/ui-egui/src/panels/settings.rs index 56f6dc394..5984450be 100644 --- a/crates/ui-egui/src/panels/settings.rs +++ b/crates/ui-egui/src/panels/settings.rs @@ -1331,6 +1331,7 @@ mod tests { fn sam2_settings_offer_file_installation_without_downloads() { let mut app = EffectcraftApp::new(effectcraft_engine::Session::default()); let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); let tokens = app.tokens; let mut actions = vec![]; let mut output = ctx @@ -1356,6 +1357,7 @@ mod tests { app.session.sys_memory = Some(effectcraft_engine::sysinfo::SysMemory { total: 64 << 30, available: 60 << 30 }); let page = pages().into_iter().find(|p| p.id == "memory").unwrap(); let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); let tokens = app.tokens; let cur = serde_json::to_value(&app.session.prefs).unwrap(); let mut actions = vec![]; @@ -1385,6 +1387,7 @@ mod tests { // (one frame's elements: `find` returns the first match) app.auto = Default::default(); let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); let (tokens, cur) = (app.tokens, serde_json::to_value(&app.session.prefs).unwrap()); let mut actions = vec![]; let mut output = ctx diff --git a/crates/ui-egui/src/panels/shortcut_editor.rs b/crates/ui-egui/src/panels/shortcut_editor.rs index 4a1e3c05e..847acd818 100644 --- a/crates/ui-egui/src/panels/shortcut_editor.rs +++ b/crates/ui-egui/src/panels/shortcut_editor.rs @@ -676,6 +676,7 @@ mod tests { fn the_ok_button_stays_inside_the_dialog_in_a_small_window() { let mut app = EffectcraftApp::new(effectcraft_engine::Session::default()); let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); crate::theme::install(&ctx, &app.tokens, crate::i18n::language(&app)); open(&mut app); for size in [vec2(1680.0, 1020.0), vec2(1280.0, 720.0)] { diff --git a/crates/ui-egui/src/panels/text_panels.rs b/crates/ui-egui/src/panels/text_panels.rs index e4be44d3f..b206acf54 100644 --- a/crates/ui-egui/src/panels/text_panels.rs +++ b/crates/ui-egui/src/panels/text_panels.rs @@ -1157,6 +1157,7 @@ mod tests { #[test] fn font_menu_rows_draw_a_name_the_interface_fonts_have() { let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); crate::theme::install(&ctx, &Tokens::for_kind(Default::default()), "en"); ctx.run_ui(Default::default(), |_| {}).textures_delta.clear(); let row = |display: &str| effectcraft_engine::FontRow { family: "Menu Name Test".into(), display: display.into(), recent: false, variable: false }; diff --git a/crates/ui-egui/src/panels/timeline/tests.rs b/crates/ui-egui/src/panels/timeline/tests.rs index 1cd5e3423..6acaf5692 100644 --- a/crates/ui-egui/src/panels/timeline/tests.rs +++ b/crates/ui-egui/src/panels/timeline/tests.rs @@ -472,6 +472,7 @@ fn drawn_text(mut draw: impl FnMut(&mut egui::Ui)) -> Vec { } } let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); ctx.run_ui(Default::default(), |ui| draw(ui)).textures_delta.clear(); let mut frame = ctx.run_ui(Default::default(), |ui| draw(ui)); frame.textures_delta.clear(); diff --git a/crates/ui-egui/src/panels/viewer_text/tests.rs b/crates/ui-egui/src/panels/viewer_text/tests.rs index ed813d4dd..3017fb632 100644 --- a/crates/ui-egui/src/panels/viewer_text/tests.rs +++ b/crates/ui-egui/src/panels/viewer_text/tests.rs @@ -22,6 +22,7 @@ fn doc_text(app: &EffectcraftApp, lid: LayerId) -> String { fn feed(app: &mut EffectcraftApp, events: Vec) { let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); let raw = egui::RawInput { screen_rect: Some(egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(320.0, 180.0))), events, ..Default::default() }; let mut out = ctx.run_ui(raw, |ui| keyboard(app, ui, egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(320.0, 180.0)))); out.textures_delta.clear(); @@ -44,6 +45,7 @@ fn ending_an_edit_from_another_panel_clears_the_preedit() { let (mut app, lid) = editor("abc", 0, 0); let session = app.session.state.text_edit.as_ref().map_or(1, |e| e.session); let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); let mut out = ctx.run_ui(egui::RawInput::default(), |ui| { let viewport = ui.ctx().viewport_id(); let preedit = Preedit { owner: ImeOwner { layer: lid, session }, text: "x".into() }; @@ -243,6 +245,7 @@ fn discarded_custom_request_then_home_rearms_the_identical_caret() { app.ui.tool = Tool::Type; app.ui.focused = PanelKind::Composition; let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); install_hooks(&ctx); let mut frame = eframe::Frame::_new_kittest(); let raw = || egui::RawInput { screen_rect: Some(Rect::from_min_size(Pos2::ZERO, vec2(1200.0, 800.0))), ..Default::default() }; diff --git a/crates/ui-egui/src/pointer_wrap/tests.rs b/crates/ui-egui/src/pointer_wrap/tests.rs index 314f7ad3d..dedeac5cb 100644 --- a/crates/ui-egui/src/pointer_wrap/tests.rs +++ b/crates/ui-egui/src/pointer_wrap/tests.rs @@ -288,6 +288,7 @@ fn real_properties_and_angle_drags_keep_each_gesture_in_one_undo_step() { app.show_panel(panel); app.toggle_maximize(panel); let ctx = Context::default(); + crate::framework::install_headless(&ctx); let bounds = Rect::from_min_size(Pos2::ZERO, vec2(1600.0, 1000.0)); let mut frame = eframe::Frame::_new_kittest(); let mut time = 0.0; diff --git a/crates/ui-egui/src/theme.rs b/crates/ui-egui/src/theme.rs index 0126fd8cc..bc5f71200 100644 --- a/crates/ui-egui/src/theme.rs +++ b/crates/ui-egui/src/theme.rs @@ -682,6 +682,7 @@ mod script_font_tests { /// interface's fonts installed. fn assert_drawn(language: &str, text: &str) { let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); super::install(&ctx, &super::Tokens::for_kind(super::ThemeKind::Dark), language); let mut out = ctx.run_ui(egui::RawInput::default(), |_| {}); // No renderer here: drop the frame's texture uploads (egui asserts on unhandled ones in debug). @@ -767,6 +768,7 @@ mod script_font_tests { #[test] fn simplified_chinese_interface_draws_simplified_hanzi_after_another_language() { let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); let tokens = super::Tokens::for_kind(super::ThemeKind::Dark); super::install(&ctx, &tokens, "en"); super::install(&ctx, &tokens, "zh-hans"); @@ -798,6 +800,7 @@ mod script_font_tests { return; } let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); super::install(&ctx, &super::Tokens::for_kind(super::ThemeKind::Dark), "en"); let mut out = ctx.run_ui(egui::RawInput::default(), |_| {}); out.textures_delta.clear(); @@ -839,6 +842,7 @@ mod script_font_tests { return; } let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); ctx.set_pixels_per_point(2.0); super::install(&ctx, &super::Tokens::for_kind(super::ThemeKind::Dark), "ja"); let mut out = ctx.run_ui(egui::RawInput::default(), |_| {}); @@ -923,6 +927,7 @@ mod tests { #[test] fn every_family_reaches_the_symbol_fallback() { let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); install(&ctx, &Tokens::for_kind(Default::default()), "en"); ctx.run_ui(Default::default(), |_| {}).textures_delta.clear(); for family in [FontFamily::Proportional, FontFamily::Monospace, FontFamily::Name("medium".into()), FontFamily::Name("semibold".into())] { diff --git a/crates/ui-egui/src/widgets.rs b/crates/ui-egui/src/widgets.rs index 87a6d217e..fb4902a75 100644 --- a/crates/ui-egui/src/widgets.rs +++ b/crates/ui-egui/src/widgets.rs @@ -1399,6 +1399,7 @@ mod tests { #[test] fn inline_editors_select_all_only_as_they_open() { let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); let mut text = String::from("Comp 1"); let mut id = egui::Id::NULL; let frame = |ctx: &egui::Context, text: &mut String, id: &mut egui::Id| { @@ -1438,6 +1439,7 @@ mod tests { #[test] fn field_text_is_vertically_centred() { let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); let t = Tokens::for_kind(Default::default()); for h in [22.0, 26.0, 30.0] { let field = Rect::from_min_size(pos2(20.0, 40.0), vec2(220.0, h)); diff --git a/crates/ui-egui/tests/it/native_menu_text_keys.rs b/crates/ui-egui/tests/it/native_menu_text_keys.rs index d740c6b46..b00583f5e 100644 --- a/crates/ui-egui/tests/it/native_menu_text_keys.rs +++ b/crates/ui-egui/tests/it/native_menu_text_keys.rs @@ -136,7 +136,7 @@ fn native_windows(h: &mut Harness<'_, EffectcraftApp>) -> Host { fn edit_menu_keys_edit_a_text_field_in_a_panel_window() { let mut app = app(); menus::invoke(&mut app, &egui::Context::default(), "window.panelWindow", json!({"panel": "Project", "window": true})).unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| app); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.ctx.set_os(egui::os::OperatingSystem::Mac); let host = native_windows(&mut h); let at = center(&h, "project.search"); @@ -163,7 +163,7 @@ fn edit_menu_keys_edit_a_text_field_in_a_panel_window() { #[test] fn edit_menu_keys_edit_a_docked_text_field() { - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| app()); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app()); h.ctx.set_os(egui::os::OperatingSystem::Mac); h.run_steps(3); let at = center(&h, "project.search"); diff --git a/crates/ui-egui/tests/it/render_queue_snapshot.rs b/crates/ui-egui/tests/it/render_queue_snapshot.rs index 27054119d..164a4daf0 100644 --- a/crates/ui-egui/tests/it/render_queue_snapshot.rs +++ b/crates/ui-egui/tests/it/render_queue_snapshot.rs @@ -31,7 +31,7 @@ fn render_queue_panel_snapshot() { } let ids: Vec = s.project.render_queue.iter().take(3).map(|i| i.id).collect(); let mut app = Some(EffectcraftApp::new(s)); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| app.take().expect("app")); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app.take().expect("app")); h.ctx.data_mut(|d| d.insert_temp(egui::Id::unique("rq-ui"), (ids, None::))); h.state_mut().show_panel(effectcraft_ui_egui::dock::PanelKind::RenderQueue); h.run_steps(4); @@ -55,7 +55,7 @@ fn templates_dialog_snapshot() { let kind = std::env::var("RQ_TEMPLATES_KIND").unwrap_or_else(|_| "outputModule".into()); s.execute("app.templates", json!({"kind": kind})).unwrap(); let mut app = Some(EffectcraftApp::new(s)); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).build_eframe(|_| app.take().expect("app")); + let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app.take().expect("app")); h.run_steps(4); assert!(h.state().dialog.is_some(), "the Templates dialog is open"); let img = h.render_serialized().expect("render"); diff --git a/crates/ui-egui/tests/it/shared_docking_ui.rs b/crates/ui-egui/tests/it/shared_docking_ui.rs index f25b1c92c..12e598a19 100644 --- a/crates/ui-egui/tests/it/shared_docking_ui.rs +++ b/crates/ui-egui/tests/it/shared_docking_ui.rs @@ -114,7 +114,7 @@ fn pointer_drop_merges_floats_and_redocks_without_project_changes() { ), dock::tabs(&[PanelKind::Timeline], 0), )); - let mut h = Harness::builder().with_size(vec2(1200.0, 760.0)).build_eframe(move |_| app); + let mut h = Harness::builder().with_size(vec2(1200.0, 760.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| app); h.run_steps(4); let project = h.state().session.project.clone(); let times = h.state().session.state.times.clone(); @@ -193,7 +193,7 @@ fn float_command_rejects_malformed_rectangles_and_keeps_one_docked_panel() { /// still moves it from there. #[test] fn floating_panel_dragged_towards_the_window_edge_keeps_moving() { - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| { + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| { let mut app = EffectcraftApp::new(Session::default()); app.ui.start_screen = false; app @@ -326,7 +326,7 @@ fn stacked_panels_resize_by_pointer_without_changing_closed_entries() { session.execute("comp.new", json!({"width": 160, "height": 90, "duration": 1})).unwrap(); let mut app = EffectcraftApp::new(session); app.ui.start_screen = false; - let mut h = Harness::builder().with_size(vec2(1000.0, 720.0)).build_eframe(move |_| app); + let mut h = Harness::builder().with_size(vec2(1000.0, 720.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| app); h.run_steps(4); h.state_mut().ui.dock = dock::docked(dock::stack(&[(PanelKind::Preview, true, Some(100.0)), (PanelKind::Properties, true, None), (PanelKind::Align, false, Some(77.0))])); diff --git a/crates/ui-egui/tests/it/ui_3d.rs b/crates/ui-egui/tests/it/ui_3d.rs index 0f7a10b7e..f2c61a64b 100644 --- a/crates/ui-egui/tests/it/ui_3d.rs +++ b/crates/ui-egui/tests/it/ui_3d.rs @@ -33,7 +33,7 @@ fn settle(h: &mut Harness<'_, EffectcraftApp>) { #[test] fn viewer_registers_3d_controls() { - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| app()); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app()); settle(&mut h); h.step(); let ids: Vec = h.state().auto.previous.iter().chain(h.state().auto.elements.iter()).map(|e| e.id.clone()).collect(); @@ -64,7 +64,7 @@ fn click_id(h: &mut Harness<'_, EffectcraftApp>, id: &str) { /// and switches it, as After Effects' Composition panel does. #[test] fn renderer_menu_shows_and_switches_the_comp_renderer() { - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| app()); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app()); h.state_mut().session.execute("comp.settings", json!({"renderer": "classic3D"})).unwrap(); h.run_steps(3); let label = |h: &Harness<'_, EffectcraftApp>| h.state().auto.find("viewer.renderer3d").map(|e| e.label.clone()); @@ -82,7 +82,7 @@ fn renderer_menu_shows_and_switches_the_comp_renderer() { #[test] fn camera_and_light_dialogs_create_layers() { - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| app()); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app()); h.step(); let ctx = h.ctx.clone(); let n0 = h.state().session.active_comp().unwrap().layers.len(); @@ -112,7 +112,7 @@ fn camera_and_light_dialogs_create_layers() { fn snapshot() { let _device = crate::gpu_test::lock(); let dir = std::env::var("EC_SNAPSHOT_DIR").ok(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_pixels_per_point(1.0).wgpu().build_eframe(|_| app()); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_pixels_per_point(1.0).wgpu().with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app()); let shots: [(&str, Option<&str>); 4] = [("active", None), ("custom1", Some("view.3d.custom1")), ("top", Some("view.3d.top")), ("left", Some("view.3d.left"))]; for (name, cmd) in shots { @@ -155,7 +155,7 @@ fn snapshot() { /// frame, and 3D layers reaching past the frame draw pixels there. #[test] fn extended_viewer_renders_past_the_comp_frame() { - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| app()); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app()); h.state_mut().session.execute("view.3d.custom1", json!({})).unwrap(); // Zoom out so the viewer shows plenty of pasteboard. h.state_mut().ui.viewer.zoom = Some(0.15); @@ -209,7 +209,7 @@ fn layout_views_draw_the_camera_and_follow_its_position() { s.execute("layer.setSwitch", json!({"layer": solid, "switch": "threeD", "value": true})).unwrap(); let cam = s.execute("layer.newCamera", json!({"position": [320, 180, -300], "poi": [320, 180, 0]})).unwrap()["layer"].as_u64().unwrap(); s.execute("view.layout", json!({"views": 4})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); settle(&mut h); let centre = |h: &Harness<'_, EffectcraftApp>, view: &str| { let id = format!("viewer.view.{view}.camera.{cam}"); @@ -235,7 +235,7 @@ fn four_views() -> Harness<'static, EffectcraftApp> { s.execute("layer.setSwitch", json!({"layer": solid, "switch": "threeD", "value": true})).unwrap(); s.execute("layer.newCamera", json!({"position": [320, 180, -300], "poi": [320, 180, 0]})).unwrap(); s.execute("view.layout", json!({"views": 4})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); settle(&mut h); h } @@ -288,7 +288,7 @@ fn gizmo_harness(w: u32, h: u32) -> (Harness<'static, EffectcraftApp>, u64) { let solid = s.execute("layer.newSolid", json!({"color": "#ff0000", "width": w, "height": h})).unwrap()["layer"].as_u64().unwrap(); s.execute("layer.setSwitch", json!({"layer": solid, "switch": "threeD", "value": true})).unwrap(); s.execute("layer.select", json!({"layers": [solid]})).unwrap(); - let mut harness = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut harness = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); settle(&mut harness); (harness, solid) } diff --git a/crates/ui-egui/tests/it/ui_accessibility.rs b/crates/ui-egui/tests/it/ui_accessibility.rs index df283b0f9..12803dd00 100644 --- a/crates/ui-egui/tests/it/ui_accessibility.rs +++ b/crates/ui-egui/tests/it/ui_accessibility.rs @@ -22,7 +22,7 @@ fn harness() -> Harness<'static, EffectcraftApp> { s.execute("file.openDemoProject", json!({})).unwrap(); // A text layer under edit gives the Character / Paragraph panels their controls. let _ = s.execute("layer.select", json!({"layers": ["EFFECTCRAFT"]})); - Harness::builder().with_size(egui::vec2(1680.0, 1020.0)).build_eframe(|_| EffectcraftApp::new(s)) + Harness::builder().with_size(egui::vec2(1680.0, 1020.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)) } #[test] diff --git a/crates/ui-egui/tests/it/ui_accessibility_audit.rs b/crates/ui-egui/tests/it/ui_accessibility_audit.rs index fecf2b4ca..0ef4f0872 100644 --- a/crates/ui-egui/tests/it/ui_accessibility_audit.rs +++ b/crates/ui-egui/tests/it/ui_accessibility_audit.rs @@ -142,7 +142,7 @@ fn app_session() -> Session { } fn harness() -> Harness<'static, EffectcraftApp> { - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(app_session())); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(app_session())); // The default workspace gives Preview a short frame at the top of the right column; its // controls below that frame stay in the tree and would be counted against the panel under it. // The per-panel pass opens Preview again for its own scenario. diff --git a/crates/ui-egui/tests/it/ui_agent_audit.rs b/crates/ui-egui/tests/it/ui_agent_audit.rs index c3f556457..59e4bd0a8 100644 --- a/crates/ui-egui/tests/it/ui_agent_audit.rs +++ b/crates/ui-egui/tests/it/ui_agent_audit.rs @@ -21,7 +21,7 @@ fn session() -> Session { } fn harness(s: Session) -> Harness<'static, EffectcraftApp> { - let mut h = Harness::builder().with_size(egui::vec2(1680.0, 1020.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1680.0, 1020.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); h } diff --git a/crates/ui-egui/tests/it/ui_alt_drag_duplicate.rs b/crates/ui-egui/tests/it/ui_alt_drag_duplicate.rs index b7fa93301..f9ec80d92 100644 --- a/crates/ui-egui/tests/it/ui_alt_drag_duplicate.rs +++ b/crates/ui-egui/tests/it/ui_alt_drag_duplicate.rs @@ -18,7 +18,7 @@ fn harness() -> (Harness<'static, EffectcraftApp>, u64, u64) { s.execute("prop.set", json!({"layer": a, "path": "transform/position", "value": [150.0, 180.0]})).unwrap(); s.execute("prop.set", json!({"layer": b, "path": "transform/position", "value": [450.0, 180.0]})).unwrap(); s.execute("layer.select", json!({"layers": [a, b]})).unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(4); (h, a, b) } @@ -139,7 +139,7 @@ fn alt_dragging_a_gizmo_arrow_moves_a_copy() { let solid = s.execute("layer.newSolid", json!({"color": "#ff0000", "width": 200, "height": 200})).unwrap()["layer"].as_u64().unwrap(); s.execute("layer.setSwitch", json!({"layer": solid, "switch": "threeD", "value": true})).unwrap(); s.execute("layer.select", json!({"layers": [solid]})).unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(6); let p0 = pos(&h, LayerId(solid)); let [x, y, w, hh] = h.state().auto.find(&format!("viewer.gizmo.{solid}.x")).expect("x arrow registered").rect; diff --git a/crates/ui-egui/tests/it/ui_angles.rs b/crates/ui-egui/tests/it/ui_angles.rs index 1f9845151..522599e3c 100644 --- a/crates/ui-egui/tests/it/ui_angles.rs +++ b/crates/ui-egui/tests/it/ui_angles.rs @@ -49,7 +49,7 @@ fn harness(panel: Panel, angle: f64) -> (Harness<'static, EffectcraftApp>, u64, app.toggle_maximize(panel.kind()); app.ui.timeline.layer_reveal.insert(layer, vec!["rotation".into()]); app.ui.timeline.open_layers.insert(layer); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| app); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.run_steps(4); (h, layer, uid) } diff --git a/crates/ui-egui/tests/it/ui_audio_panel_levels.rs b/crates/ui-egui/tests/it/ui_audio_panel_levels.rs index 9f7121c0b..fd58cf514 100644 --- a/crates/ui-egui/tests/it/ui_audio_panel_levels.rs +++ b/crates/ui-egui/tests/it/ui_audio_panel_levels.rs @@ -54,7 +54,7 @@ fn sound_layer(s: &mut Session, levels: [f64; 2]) -> u64 { /// The harness with layer `l` selected and the Audio panel up. fn harness(mut s: Session, l: u64) -> Harness<'static, EffectcraftApp> { s.execute("layer.select", json!({"layers": [l]})).unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.state_mut().show_panel(PanelKind::Audio); h.run_steps(4); h diff --git a/crates/ui-egui/tests/it/ui_audio_scrub.rs b/crates/ui-egui/tests/it/ui_audio_scrub.rs index ff5f124e8..c14476d0f 100644 --- a/crates/ui-egui/tests/it/ui_audio_scrub.rs +++ b/crates/ui-egui/tests/it/ui_audio_scrub.rs @@ -135,7 +135,7 @@ fn scrubbing_plays_one_frame_per_new_frame() { fn cmd_dragging_the_current_time_scrubs_and_an_idle_scrub_closes() { let fake = Fake::default(); let (app, _) = setup(true, &fake); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).build_eframe(|_| app); + let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.run_steps(3); let cti = h.state().auto.find("timeline.cti").expect("current time indicator").clone(); let from = pos2(cti.rect[0] + cti.rect[2] / 2.0, cti.rect[1] + cti.rect[3] / 2.0); @@ -217,7 +217,7 @@ fn preview_with_audio_holds_the_first_frame_and_sounds_from_it() { app.frames.set_remote(Some(renderer)); let ahead = (app.frames.lanes() * 2).max(4) as i64; app.session.execute("comp.settings", json!({"comp": cid.0, "duration": (4 * ahead) as f64 / 30.0})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(1.0 / 30.0).build_eframe(|_| app); + let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(1.0 / 30.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.state_mut().use_manual_clock(); h.run_steps(2); gate.discard(&mut h); @@ -254,7 +254,7 @@ fn preview_with_audio_sounds_without_caching_the_work_area() { let gate = GatedFrames::default(); let renderer: Arc = Arc::new(gate.clone()); app.frames.set_remote(Some(renderer)); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(1.0 / 30.0).build_eframe(|_| app); + let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(1.0 / 30.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.state_mut().use_manual_clock(); h.run_steps(2); gate.discard(&mut h); @@ -281,7 +281,7 @@ fn a_preview_behind_its_sound_drops_frames_and_keeps_the_sound() { let gate = GatedFrames::default(); let renderer: Arc = Arc::new(gate.clone()); app.frames.set_remote(Some(renderer)); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(1.0 / 30.0).build_eframe(|_| app); + let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(1.0 / 30.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.state_mut().use_manual_clock(); h.run_steps(2); gate.discard(&mut h); @@ -346,7 +346,7 @@ fn a_sound_in_the_first_100_ms_is_heard() { app.session.execute("layer.timing", json!({"layers": [l], "in": start, "out": start + 0.1})).unwrap(); app.session.execute("time.set", json!({"time": start})).unwrap(); let first = (start * 30.0) as i64; - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(1.0 / 30.0).build_eframe(|_| app); + let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(1.0 / 30.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.state_mut().use_manual_clock(); h.run_steps(2); let now = h.state().now(); @@ -366,7 +366,7 @@ fn a_sound_in_the_first_100_ms_is_heard() { fn audio_only_previews_start_at_once() { let fake = Fake::default(); let (app, cid) = setup(true, &fake); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).build_eframe(|_| app); + let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.state_mut().use_manual_clock(); h.run_steps(2); let now = h.state().now(); @@ -382,7 +382,7 @@ fn no_device_plays_the_picture_and_stop_ends_the_wait() { let fake = Fake::default(); let (mut app, cid) = setup_long(true, &fake, 10.0); app.hooks.audio_device = Some(Box::new(|_| None)); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(1.0 / 30.0).build_eframe(|_| app); + let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(1.0 / 30.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.state_mut().use_manual_clock(); h.run_steps(2); let now = h.state().now(); @@ -451,7 +451,7 @@ fn startup_finishes_at_any_ram_preview_budget() { if !device { app.hooks.audio_device = Some(Box::new(|_| None)); } - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(1.0 / 30.0).build_eframe(|_| app); + let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(1.0 / 30.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.state_mut().use_manual_clock(); h.run_steps(2); let budget = ((fit as f64 + 0.5) * 9216.0 / 0.9) as usize; @@ -482,7 +482,7 @@ fn extended_viewer(fake: &Fake) -> (Harness<'static, EffectcraftApp>, ItemId, [u let mut app = EffectcraftApp::new(s); let f = fake.clone(); app.hooks.audio_device = Some(Box::new(move |_| Some(Box::new(f.clone()) as Box))); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(1.0 / 30.0).build_eframe(|_| app); + let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(1.0 / 30.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.state_mut().use_manual_clock(); // The viewer shows the pasteboard: frames render the extended region. let deadline = std::time::Instant::now() + std::time::Duration::from_secs(30); @@ -591,7 +591,7 @@ fn a_device_that_fails_to_start_plays_the_picture() { let fake = Fake::default(); let (mut app, cid) = setup_long(true, &fake, 8.0); app.hooks.audio_device = Some(Box::new(|_| Some(Box::new(Broken) as Box))); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(1.0 / 30.0).build_eframe(|_| app); + let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(1.0 / 30.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.state_mut().use_manual_clock(); h.run_steps(2); assert!(until_started(&mut h), "it left its startup"); @@ -644,7 +644,7 @@ fn a_started_preview_follows_its_sound() { let device = Playing::default(); let d = device.clone(); app.hooks.audio_device = Some(Box::new(move |_| Some(Box::new(d.clone()) as Box))); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(1.0 / 30.0).build_eframe(|_| app); + let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(1.0 / 30.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.state_mut().use_manual_clock(); h.run_steps(2); assert!(until_started(&mut h) && h.state().audio.is_some(), "the sound started"); @@ -671,7 +671,7 @@ fn startup_does_not_wait_when_the_ram_preview_holds_no_frame() { for budget in [0, 9216 / 2] { let fake = Fake::default(); let (app, _) = setup_long(true, &fake, 8.0); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(1.0 / 30.0).build_eframe(|_| app); + let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(1.0 / 30.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.state_mut().use_manual_clock(); h.run_steps(2); h.state().frames.set_budget(budget); @@ -720,7 +720,7 @@ fn adding_markers_does_not_stop_the_sound() { let fake = Fake::default(); let (app, cid) = setup(true, &fake); // Everything is cached before the preview starts, so the sound starts at once. - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(1.0 / 31.0).build_eframe(|_| app); + let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(1.0 / 31.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.run_steps(2); let deadline = std::time::Instant::now() + std::time::Duration::from_secs(60); let now = h.ctx.input(|i| i.time); @@ -751,7 +751,7 @@ fn unmuting_a_silent_preview_starts_audio_at_its_current_frame() { app.session.execute("layer.setSwitch", json!({"layers": [layer], "switch": "audio", "value": false})).unwrap(); let gate = GatedFrames::default(); app.frames.set_remote(Some(Arc::new(gate.clone()))); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(1.0 / 30.0).build_eframe(|_| app); + let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(1.0 / 30.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.state_mut().use_manual_clock(); h.run_steps(2); gate.render(&mut h, cid, &(0..60).collect::>()); @@ -871,7 +871,7 @@ fn preview_rate_audio_drives_video_at_half_speed_and_loops() { let gate = GatedFrames::default(); app.frames.set_remote(Some(Arc::new(gate.clone()))); let ahead = (app.frames.parallelism() * 2).max(4) as i64; - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).build_eframe(|_| app); + let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.state_mut().use_manual_clock(); h.run_steps(2); gate.discard(&mut h); diff --git a/crates/ui-egui/tests/it/ui_azerty_shortcuts.rs b/crates/ui-egui/tests/it/ui_azerty_shortcuts.rs index dde4b1905..f8f0c74b9 100644 --- a/crates/ui-egui/tests/it/ui_azerty_shortcuts.rs +++ b/crates/ui-egui/tests/it/ui_azerty_shortcuts.rs @@ -14,7 +14,7 @@ fn physical_shortcuts_distinguish_azerty_zoom_keys() { for (command, keys) in [("timeline.zoomIn", "Physical+6"), ("timeline.zoomOut", "Physical+Minus")] { app.session.execute("shortcuts.set", json!({"command": command, "keys": keys})).unwrap(); } - let mut h = Harness::builder().with_size(vec2(1200.0, 800.0)).build_eframe(|_| app); + let mut h = Harness::builder().with_size(vec2(1200.0, 800.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.run_steps(3); h.state_mut().ui.timeline.pps = Some(100.0); for (physical, expected) in [(Key::Num6, 150.0), (Key::Minus, 100.0)] { @@ -49,7 +49,7 @@ fn shifted_one_toggles_only_selected_video_and_iso_key_maximizes() { let mut app = EffectcraftApp::new(s); app.session.execute("shortcuts.set", json!({"command": "layer.setSwitch", "params": {"switch": "video"}, "keys": "Shift+1"})).unwrap(); app.session.execute("shortcuts.set", json!({"command": "window.maximizePanel", "keys": "IntlBackslash"})).unwrap(); - let mut h = Harness::builder().with_size(vec2(1200.0, 800.0)).build_eframe(|_| app); + let mut h = Harness::builder().with_size(vec2(1200.0, 800.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.run_steps(3); for visible in [false, true] { h.event(Event::Key { key: Key::Num1, physical_key: Some(Key::Num1), pressed: true, repeat: false, modifiers: Modifiers::SHIFT }); @@ -72,7 +72,7 @@ fn timeline_shift_p_reveals_instead_of_adding_a_text_animator() { s.execute("layer.newSolid", json!({"name": "Box"})).unwrap(); let mut app = EffectcraftApp::new(s); app.session.execute("shortcuts.set", json!({"command": "layer.addTextAnimator", "params": {"properties": ["position"]}, "keys": "Shift+P"})).unwrap(); - let mut h = Harness::builder().with_size(vec2(1200.0, 800.0)).build_eframe(|_| app); + let mut h = Harness::builder().with_size(vec2(1200.0, 800.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.run_steps(3); h.state_mut().ui.focused = effectcraft_ui_egui::dock::PanelKind::Timeline; h.event(Event::Key { key: Key::P, physical_key: Some(Key::P), pressed: true, repeat: false, modifiers: Modifiers::SHIFT }); diff --git a/crates/ui-egui/tests/it/ui_batch_links.rs b/crates/ui-egui/tests/it/ui_batch_links.rs index 5b2cea090..bbbbf76ee 100644 --- a/crates/ui-egui/tests/it/ui_batch_links.rs +++ b/crates/ui-egui/tests/it/ui_batch_links.rs @@ -20,7 +20,7 @@ fn harness() -> (Harness<'static, EffectcraftApp>, [u64; 6]) { s.execute("prop.set", json!({"layer": ids[3], "path": "transform/position", "value": [60, 40]})).unwrap(); s.execute("prop.set", json!({"layer": ids[3], "path": "transform/scale", "value": [50, 50]})).unwrap(); s.history.undo.clear(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.state_mut().ui.timeline.show_modes = true; h.state_mut().ui.timeline.columns_w = 900.0; h.run_steps(3); diff --git a/crates/ui-egui/tests/it/ui_batch_switches.rs b/crates/ui-egui/tests/it/ui_batch_switches.rs index 407ac194e..da174138b 100644 --- a/crates/ui-egui/tests/it/ui_batch_switches.rs +++ b/crates/ui-egui/tests/it/ui_batch_switches.rs @@ -22,7 +22,7 @@ fn harness() -> (Harness<'static, EffectcraftApp>, Vec) { .collect(); ids.reverse(); s.execute("edit.deselectAll", json!({})).unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); (h, ids) } @@ -165,7 +165,7 @@ fn switch_targets_skip_the_layers_the_switch_does_not_apply_to() { let cam = s.execute("layer.newCamera", json!({})).unwrap()["layer"].as_u64().unwrap(); s.execute("effect.apply", json!({"effect": "ec.blur.gaussian", "layers": [solid]})).unwrap(); s.execute("edit.deselectAll", json!({})).unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); select(&mut h, &[solid, null, cam]); diff --git a/crates/ui-egui/tests/it/ui_blank_context_menus.rs b/crates/ui-egui/tests/it/ui_blank_context_menus.rs index 31312d5b2..37f96f86e 100644 --- a/crates/ui-egui/tests/it/ui_blank_context_menus.rs +++ b/crates/ui-egui/tests/it/ui_blank_context_menus.rs @@ -12,7 +12,7 @@ use serde_json::json; fn harness() -> Harness<'static, EffectcraftApp> { let mut session = Session::default(); session.execute("comp.new", json!({"name":"Empty", "width":640,"height":360,"duration":4})).unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(session)); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(session)); // English whatever the system language: the menu items found below by label are translated. h.state_mut().session.prefs.general.language = "en".into(); h.run_steps(3); diff --git a/crates/ui-egui/tests/it/ui_camera_tracker.rs b/crates/ui-egui/tests/it/ui_camera_tracker.rs index 579e92d07..45e40c446 100644 --- a/crates/ui-egui/tests/it/ui_camera_tracker.rs +++ b/crates/ui-egui/tests/it/ui_camera_tracker.rs @@ -75,7 +75,7 @@ fn click(h: &mut Harness<'_, EffectcraftApp>, at: egui::Pos2, modifiers: egui::M #[test] fn deleting_viewer_track_points_preserves_the_effect_and_layer() { let (a, plate, uid) = app(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| a); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| a); h.state_mut().show_panel(PanelKind::Composition); h.run_steps(4); let point = rect(&h, "viewer.cameraTracker.point.7").center(); @@ -92,7 +92,7 @@ fn deleting_viewer_track_points_preserves_the_effect_and_layer() { #[test] fn viewer_points_selection_and_effect_controls() { let (a, plate, uid) = app(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| a); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| a); h.state_mut().show_panel(PanelKind::Composition); h.run_steps(4); let all = ids(&h); @@ -188,7 +188,7 @@ fn blender_export_button_opens_python_dialog_and_writes_scene() { let builder = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)); let builder = if shot.is_some() { builder.wgpu() } else { builder }; let _device = shot.is_some().then(crate::gpu_test::lock); - let mut h = builder.build_eframe(|_| a); + let mut h = builder.with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| a); h.state_mut().show_panel(PanelKind::EffectControls); h.run_steps(5); let button = rect(&h, &format!("effectControls.cameraTracker.{uid}.exportBlender")); @@ -207,7 +207,7 @@ fn blender_export_button_opens_python_dialog_and_writes_scene() { #[test] fn effect_controls_show_how_many_frames_a_partial_solve_solved() { let (a, plate, uid) = app(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| a); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| a); h.state_mut().show_panel(PanelKind::EffectControls); h.run_steps(4); let line = format!("effectControls.cameraTracker.{uid}.partialSolve"); @@ -247,7 +247,7 @@ fn drag_with(h: &mut Harness<'_, EffectcraftApp>, button: egui::PointerButton, f #[test] fn viewer_zooms_and_pans_over_the_track_points() { let (a, ..) = app(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| a); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| a); h.state_mut().show_panel(PanelKind::Composition); h.run_steps(4); // Wheel over a point: zooms. @@ -310,7 +310,7 @@ fn snapshot_showcase_track() { s.execute("layer.select", json!({"layers": ["#1"]})).unwrap(); s.execute("track.camera", json!({"layer": "#1", "wait": true})).unwrap(); s.execute("time.set", json!({"time": 2.0})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_pixels_per_point(1.0).wgpu().build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_pixels_per_point(1.0).wgpu().with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.state_mut().show_panel(PanelKind::Composition); settle(&mut h); let pts: Vec = ids(&h).into_iter().filter(|i| i.starts_with("viewer.cameraTracker.point.")).collect(); diff --git a/crates/ui-egui/tests/it/ui_character_eyedropper.rs b/crates/ui-egui/tests/it/ui_character_eyedropper.rs index ea4eecd99..205bd9937 100644 --- a/crates/ui-egui/tests/it/ui_character_eyedropper.rs +++ b/crates/ui-egui/tests/it/ui_character_eyedropper.rs @@ -48,7 +48,7 @@ fn character_fill_eyedropper_samples_viewer_and_keeps_text_selection() { let mut app = EffectcraftApp::new(s); app.set_workspace("Text"); let builder = Harness::builder().with_size(vec2(1600.0, 1400.0)); - let mut h = if std::env::var_os("EC_SNAPSHOT_DIR").is_some() { builder.wgpu().build_eframe(|_| app) } else { builder.build_eframe(|_| app) }; + let mut h = if std::env::var_os("EC_SNAPSHOT_DIR").is_some() { builder.wgpu().with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app) } else { builder.with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app) }; h.state_mut().show_panel(PanelKind::Character); settle(&mut h); click_auto(&mut h, "character.fill.eyedropper"); @@ -76,7 +76,7 @@ fn character_stroke_eyedropper_samples_viewer() { app.ui.viewer.show_layer_controls = false; app.ui.dock = dock::docked(dock::hsplit(SplitSize::FixedSecond(360.0), dock::tabs(&[PanelKind::Composition], 0), dock::tabs(&[PanelKind::Character], 0))); let builder = Harness::builder().with_size(vec2(1200.0, 760.0)); - let mut h = if std::env::var_os("EC_SNAPSHOT_DIR").is_some() { builder.wgpu().build_eframe(|_| app) } else { builder.build_eframe(|_| app) }; + let mut h = if std::env::var_os("EC_SNAPSHOT_DIR").is_some() { builder.wgpu().with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app) } else { builder.with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app) }; h.state_mut().show_panel(PanelKind::Character); h.state_mut().show_panel(PanelKind::Composition); settle(&mut h); diff --git a/crates/ui-egui/tests/it/ui_character_stroke_order.rs b/crates/ui-egui/tests/it/ui_character_stroke_order.rs index db89f7c1a..80596a6ea 100644 --- a/crates/ui-egui/tests/it/ui_character_stroke_order.rs +++ b/crates/ui-egui/tests/it/ui_character_stroke_order.rs @@ -49,7 +49,7 @@ fn character_stroke_order_menu_sets_layer_fill_and_stroke() { let mut app = EffectcraftApp::new(s); app.set_workspace("Text"); let builder = Harness::builder().with_size(vec2(1600.0, 1400.0)); - let mut h = if std::env::var_os("EC_SNAPSHOT_DIR").is_some() { builder.wgpu().build_eframe(|_| app) } else { builder.build_eframe(|_| app) }; + let mut h = if std::env::var_os("EC_SNAPSHOT_DIR").is_some() { builder.wgpu().with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app) } else { builder.with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app) }; h.state_mut().show_panel(PanelKind::Character); h.run_steps(4); diff --git a/crates/ui-egui/tests/it/ui_checkbox_drag.rs b/crates/ui-egui/tests/it/ui_checkbox_drag.rs index ba65e54dc..263ace3da 100644 --- a/crates/ui-egui/tests/it/ui_checkbox_drag.rs +++ b/crates/ui-egui/tests/it/ui_checkbox_drag.rs @@ -20,7 +20,7 @@ fn view_options_drag_checks_and_unchecks_neighbours() { let mut session = Session::default(); session.prefs.disk.disk_cache_enabled = false; session.execute("comp.new", json!({"width":32,"height":32,"duration":1})).unwrap(); - let mut h = Harness::builder().with_size(vec2(1200.0, 900.0)).build_eframe(|_| EffectcraftApp::new(session)); + let mut h = Harness::builder().with_size(vec2(1200.0, 900.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(session)); h.state_mut().ui.viewer.rulers = false; h.state_mut().ui.viewer.guides = true; h.state_mut().ui.viewer.grid = false; diff --git a/crates/ui-egui/tests/it/ui_color_hex.rs b/crates/ui-egui/tests/it/ui_color_hex.rs index 8a5a39b8e..d94fa10bb 100644 --- a/crates/ui-egui/tests/it/ui_color_hex.rs +++ b/crates/ui-egui/tests/it/ui_color_hex.rs @@ -51,7 +51,7 @@ fn hex_code_sets_an_effect_colour() { let mut app = EffectcraftApp::new(s); app.show_panel(PanelKind::EffectControls); app.toggle_maximize(PanelKind::EffectControls); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| app); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.run_steps(4); let midtones = |h: &Harness<'_, EffectcraftApp>| { let c = h.state().session.active_comp().unwrap().layer(LayerId(layer)).unwrap().props.find(uid).unwrap().value.as_color(); diff --git a/crates/ui-egui/tests/it/ui_comp_presets.rs b/crates/ui-egui/tests/it/ui_comp_presets.rs index 93cd02030..a9b006df9 100644 --- a/crates/ui-egui/tests/it/ui_comp_presets.rs +++ b/crates/ui-egui/tests/it/ui_comp_presets.rs @@ -9,7 +9,7 @@ use serde_json::json; fn harness() -> Harness<'static, EffectcraftApp> { let mut s = Session::default(); s.execute("comp.new", json!({"name": "Edit", "width": 2560, "height": 1440, "frameRate": 60, "duration": 4})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_step_dt(1.0 / 60.0).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_step_dt(1.0 / 60.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); h } @@ -115,7 +115,7 @@ fn composition_settings_buttons_fit_every_language() { s.execute("comp.new", json!({"name": "Edit", "width": 2560, "height": 1440, "frameRate": 60, "duration": 4})).unwrap(); s.prefs.general.language = language.into(); let mut h = - Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_step_dt(1.0 / 60.0).allow_missing_glyphs().build_eframe(|_| EffectcraftApp::new(s)); + Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_step_dt(1.0 / 60.0).allow_missing_glyphs().with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); open_settings(&mut h); let mut oks = vec![]; @@ -148,7 +148,7 @@ fn rect_of(h: &Harness<'_, EffectcraftApp>, id: &str) -> egui::Rect { fn composition_settings_view_stays_put_when_it_scrolls() { let mut s = Session::default(); s.execute("comp.new", json!({"name": "Edit", "width": 2560, "height": 1440, "frameRate": 60, "duration": 4})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 520.0)).with_step_dt(1.0 / 60.0).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 520.0)).with_step_dt(1.0 / 60.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); open_settings(&mut h); let (view, ok) = (rect_of(&h, "dialog.comp.view"), rect_of(&h, "dialog.comp.ok")); @@ -183,7 +183,7 @@ fn composition_settings_refits_when_the_language_changes() { .with_max_steps(30) // `run` checks accessibility after settling; that is not what this test is about. .with_accessibility_check(false) - .build_eframe(|_| EffectcraftApp::new(s)); + .with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); open_settings(&mut h); click(&mut h, "dialog.comp.tab.advanced"); @@ -203,7 +203,7 @@ fn composition_settings_refits_when_the_language_changes() { /// leaves the Home screen for the new composition; Cancel keeps it. #[test] fn new_composition_dialog_ok_leaves_the_home_screen() { - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_step_dt(1.0 / 60.0).build_eframe(|_| EffectcraftApp::new(Session::default())); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_step_dt(1.0 / 60.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(Session::default())); h.run_steps(3); h.state_mut().ui.start_screen = true; h.state_mut().dialog = Some(Dialog::NewComp); diff --git a/crates/ui-egui/tests/it/ui_crypto_pick.rs b/crates/ui-egui/tests/it/ui_crypto_pick.rs index 28d1b97c2..6c84a6331 100644 --- a/crates/ui-egui/tests/it/ui_crypto_pick.rs +++ b/crates/ui-egui/tests/it/ui_crypto_pick.rs @@ -92,7 +92,7 @@ fn harness(s: Session, size: egui::Vec2, ppp: f32, ec: f32) -> Harness<'static, /// [`harness`] whose steps advance the clock by `dt` seconds. fn harness_dt(s: Session, size: egui::Vec2, ppp: f32, ec: f32, dt: f32) -> Harness<'static, EffectcraftApp> { let app = app(s, ec); - let mut h = Harness::builder().with_size(size).with_pixels_per_point(ppp).with_step_dt(dt).build_eframe(|_| app); + let mut h = Harness::builder().with_size(size).with_pixels_per_point(ppp).with_step_dt(dt).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); settle(&mut h); h } @@ -651,7 +651,7 @@ fn picks_on_the_gpu_viewer() { } let (s, ids) = crypto_session("gpu", 1919, 1079, false); let app = app(s, 420.0); - let mut h = Harness::builder().with_size(vec2(1400.0, 900.0)).with_pixels_per_point(1.0).wgpu_setup(setup).build_eframe(|_| app); + let mut h = Harness::builder().with_size(vec2(1400.0, 900.0)).with_pixels_per_point(1.0).wgpu_setup(setup).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); settle(&mut h); if h.state().gpu_adapter().is_none() { eprintln!("the viewer stayed on the CPU ({adapter}): skipping"); diff --git a/crates/ui-egui/tests/it/ui_crypto_pick_undo.rs b/crates/ui-egui/tests/it/ui_crypto_pick_undo.rs index 7780dac0c..8ed0426d2 100644 --- a/crates/ui-egui/tests/it/ui_crypto_pick_undo.rs +++ b/crates/ui-egui/tests/it/ui_crypto_pick_undo.rs @@ -94,7 +94,7 @@ fn harness(s: Session, size: egui::Vec2) -> Harness<'static, EffectcraftApp> { dock::hsplit(SplitSize::FixedSecond(420.0), dock::tabs(&[PanelKind::Composition], 0), dock::tabs(&[PanelKind::EffectControls], 0)), dock::hsplit(SplitSize::FixedSecond(300.0), dock::tabs(&[PanelKind::Timeline], 0), dock::tabs(&[PanelKind::History], 0)), )); - let mut h = Harness::builder().with_size(size).with_pixels_per_point(1.0).with_step_dt(0.25).build_eframe(|_| app); + let mut h = Harness::builder().with_size(size).with_pixels_per_point(1.0).with_step_dt(0.25).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); settle(&mut h); h } diff --git a/crates/ui-egui/tests/it/ui_crypto_select.rs b/crates/ui-egui/tests/it/ui_crypto_select.rs index 9331913d4..35076cff0 100644 --- a/crates/ui-egui/tests/it/ui_crypto_select.rs +++ b/crates/ui-egui/tests/it/ui_crypto_select.rs @@ -63,7 +63,7 @@ fn harness(s: Session) -> Harness<'static, EffectcraftApp> { dock::hsplit(SplitSize::FixedSecond(420.0), dock::tabs(&[PanelKind::Composition], 0), dock::tabs(&[PanelKind::EffectControls], 0)), dock::tabs(&[PanelKind::Timeline], 0), )); - let mut h = Harness::builder().with_size(vec2(1400.0, 800.0)).with_pixels_per_point(1.0).with_step_dt(0.25).build_eframe(|_| app); + let mut h = Harness::builder().with_size(vec2(1400.0, 800.0)).with_pixels_per_point(1.0).with_step_dt(0.25).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); settle(&mut h); h } diff --git a/crates/ui-egui/tests/it/ui_dialog_preview.rs b/crates/ui-egui/tests/it/ui_dialog_preview.rs index ce5f2803e..e18827caa 100644 --- a/crates/ui-egui/tests/it/ui_dialog_preview.rs +++ b/crates/ui-egui/tests/it/ui_dialog_preview.rs @@ -17,7 +17,7 @@ fn harness(setup: impl FnOnce(&mut Session)) -> Harness<'static, EffectcraftApp> let mut s = Session::default(); s.execute("comp.new", json!({"name": "Main", "width": 320, "height": 180, "duration": 10})).unwrap(); setup(&mut s); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); h } diff --git a/crates/ui-egui/tests/it/ui_dock_resize.rs b/crates/ui-egui/tests/it/ui_dock_resize.rs index 11ca740cb..29af2cdce 100644 --- a/crates/ui-egui/tests/it/ui_dock_resize.rs +++ b/crates/ui-egui/tests/it/ui_dock_resize.rs @@ -44,7 +44,7 @@ fn focused_dock_resize_owns_arrows_and_keeps_pointer_dragging() { if directory.is_some() { builder = builder.wgpu(); } - let mut h = builder.build_eframe(move |_| app); + let mut h = builder.with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| app); h.run_steps(4); snapshots(&mut h, directory.as_deref(), "workspace"); h.state_mut().ui.focused = PanelKind::Composition; diff --git a/crates/ui-egui/tests/it/ui_drag_drop.rs b/crates/ui-egui/tests/it/ui_drag_drop.rs index d7e99046b..631a9c220 100644 --- a/crates/ui-egui/tests/it/ui_drag_drop.rs +++ b/crates/ui-egui/tests/it/ui_drag_drop.rs @@ -28,7 +28,7 @@ fn harness() -> (Harness<'static, EffectcraftApp>, u64) { s.execute("layer.newSolid", json!({"name": name, "color": "#406080"})).unwrap(); } s.execute("time.set", json!({"time": 1.0})).unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); (h, clip) } @@ -299,7 +299,7 @@ fn project_footage_dropped_on_empty_timeline_creates_first_comp() { s.execute("file.importPlaceholder", json!({"name": "Landscape.png", "width": 640, "height": 360, "frameRate": 24, "duration": 5})).unwrap()["item"] .as_u64() .unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); assert!(h.state().session.active_comp().is_none()); let from = rect(&h, &format!("project.item.{footage}.name")).center(); @@ -322,7 +322,7 @@ fn multiple_selected_footage_dropped_on_empty_timeline_asks_how_to_create_comps( let first = s.execute("file.importPlaceholder", json!({"name": "First.png", "width": 160, "height": 90})).unwrap()["item"].as_u64().unwrap(); let second = s.execute("file.importPlaceholder", json!({"name": "Second.png", "width": 300, "height": 200})).unwrap()["item"].as_u64().unwrap(); s.state.project_selection = vec![effectcraft_engine::project::ItemId(first), effectcraft_engine::project::ItemId(second)]; - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); let from = rect(&h, &format!("project.item.{first}.name")).center(); let to = rect(&h, "panel.Timeline").center(); @@ -341,7 +341,7 @@ fn project_footage_dropped_on_empty_viewer_creates_first_comp() { s.execute("file.importPlaceholder", json!({"name": "Landscape.png", "width": 640, "height": 360, "frameRate": 24, "duration": 5})).unwrap()["item"] .as_u64() .unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); assert!(h.state().session.active_comp().is_none()); let from = rect(&h, &format!("project.item.{footage}.name")).center(); @@ -364,7 +364,7 @@ fn multiple_selected_footage_dropped_on_empty_viewer_asks_how_to_create_comps() let first = s.execute("file.importPlaceholder", json!({"name": "First.png", "width": 160, "height": 90})).unwrap()["item"].as_u64().unwrap(); let second = s.execute("file.importPlaceholder", json!({"name": "Second.png", "width": 300, "height": 200})).unwrap()["item"].as_u64().unwrap(); s.state.project_selection = vec![effectcraft_engine::project::ItemId(first), effectcraft_engine::project::ItemId(second)]; - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); let from = rect(&h, &format!("project.item.{first}.name")).center(); let viewer = rect(&h, "panel.Composition"); @@ -650,7 +650,7 @@ fn import_dialog_offers_the_image_sequence_option() { /// of it, as in After Effects. #[test] fn new_composition_from_footage_makes_a_comp_of_the_picked_file() { - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(Session::default())); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(Session::default())); h.run_steps(3); let dir = frames("fromfootage", 2); let pick = dir.join("frame_0002.png").to_string_lossy().to_string(); @@ -702,7 +702,7 @@ fn a_dropped_folder_imports_as_one_sequence_with_sequence_interpretation() { fn illustrator_import_offers_and_applies_retain_layer_sizes() { let path = std::env::temp_dir().join(format!("effectcraft-retain-ui-{}.ai", std::process::id())); std::fs::write(&path, b"%PDF-1.4\n1 0 obj << /Type /Catalog /Pages 2 0 R >> endobj\n2 0 obj << /Type /Pages /Kids [3 0 R] /Count 1 >> endobj\n3 0 obj << /Type /Page /Parent 2 0 R /MediaBox [0 0 120 80] /Contents 4 0 R >> endobj\n4 0 obj << >> stream\n1 0 0 rg 20 15 30 20 re f\nendstream endobj\n%%EOF").unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(effectcraft_host::session())); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(effectcraft_host::session())); h.run_steps(3); let ctx = h.ctx.clone(); effectcraft_ui_egui::menus::invoke(h.state_mut(), &ctx, "file.import", json!({"paths": [path]})).unwrap(); diff --git a/crates/ui-egui/tests/it/ui_effect_controls.rs b/crates/ui-egui/tests/it/ui_effect_controls.rs index ce8275dde..0a8a5095b 100644 --- a/crates/ui-egui/tests/it/ui_effect_controls.rs +++ b/crates/ui-egui/tests/it/ui_effect_controls.rs @@ -104,7 +104,7 @@ fn header_arrow_harness() -> (Harness<'static, EffectcraftApp>, LayerId, [(u64, let mut app = EffectcraftApp::new(s); app.show_panel(PanelKind::EffectControls); app.toggle_maximize(PanelKind::EffectControls); - let mut h = Harness::builder().with_size(egui::vec2(1000.0, 700.0)).with_step_dt(1.0 / 60.0).build_eframe(|_| app); + let mut h = Harness::builder().with_size(egui::vec2(1000.0, 700.0)).with_step_dt(1.0 / 60.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.run_steps(4); (h, LayerId(lid), effects) } @@ -439,7 +439,7 @@ fn effect_header_down_and_up_scroll_the_picked_effect_into_view() { app.show_panel(PanelKind::EffectControls); app.toggle_maximize(PanelKind::EffectControls); app.ui.focused = PanelKind::EffectControls; - let mut h = Harness::builder().with_size(egui::vec2(800.0, 300.0)).with_step_dt(1.0 / 60.0).build_eframe(|_| app); + let mut h = Harness::builder().with_size(egui::vec2(800.0, 300.0)).with_step_dt(1.0 / 60.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.run_steps(4); let panel = rect_of(&h, "panel.EffectControls"); let last = fx[fx.len() - 1]; @@ -463,7 +463,7 @@ fn effect_header_down_and_up_scroll_the_picked_effect_into_view() { #[test] fn effect_controls_widgets_register_automation_ids() { let (app, x) = app(); - let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).build_eframe(|_| app); + let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); settle(&mut h); let have = ids(&h); let want = [ @@ -515,7 +515,7 @@ fn tint_swap_button_targets_its_instance_and_undoes_both_colors() { let blur = s.execute("effect.apply", json!({"effect": "Gaussian Blur"})).unwrap()["effects"][0].as_u64().unwrap(); let mut app = EffectcraftApp::new(s); app.show_panel(PanelKind::EffectControls); - let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).build_eframe(|_| app); + let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.run_steps(4); let id = format!("effectControls.effect.{target}.swapColors"); let rect = h.state().auto.find(&id).unwrap().rect; @@ -542,7 +542,7 @@ fn tint_swap_button_targets_its_instance_and_undoes_both_colors() { #[test] fn crosshair_and_eyedropper_pick_from_the_viewer() { let (app, x) = app(); - let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).build_eframe(|_| app); + let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); settle(&mut h); // Crosshair: a click at comp (330, 190) is layer (105, 55) on the 200%-scaled layer // (anchor (100, 50) at position (320, 180)). @@ -580,7 +580,7 @@ fn the_eyedropper_samples_under_the_pointer_in_a_region_of_interest() { app.session.execute("view.setRegionOfInterest", json!({"rect": [0.0, 0.0, 320.0, 180.0]})).unwrap(); // (Not the red it will pick.) app.session.execute("prop.set", json!({"layer": x.small, "prop": x.color, "value": [0.0, 0.0, 1.0, 1.0]})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).build_eframe(|_| app); + let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); settle(&mut h); h.state_mut().ui.fx_pick = Some(FxPick { kind: "color".into(), layer: x.small, prop: x.color, name: "Color".into() }); h.step(); @@ -611,7 +611,7 @@ fn the_eyedropper_stays_armed_until_the_viewer_has_a_frame() { let KV::Color(c) = v else { panic!("{v:?}") }; c }; - let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.state_mut().ui.fx_pick = Some(FxPick { kind: "color".into(), layer: top, prop, name: "Color".into() }); h.step(); let pos = effectcraft_ui_egui::panels::viewer::comp_to_screen(&h.ctx, [100.0, 100.0]).unwrap(); @@ -642,7 +642,7 @@ fn keyer_eyedropper_picks_the_screen_from_the_effect_input() { s.state.selected_layers = vec![LayerId(screen)]; let mut app = EffectcraftApp::new(s); app.show_panel(PanelKind::EffectControls); - let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).build_eframe(|_| app); + let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); settle(&mut h); h.state_mut().ui.fx_pick = Some(FxPick { kind: "color".into(), layer: screen, prop, name: "Screen Colour".into() }); h.step(); @@ -664,7 +664,7 @@ fn keyer_eyedropper_picks_the_screen_from_the_effect_input() { #[test] fn command_clicking_an_effect_twirl_closes_and_opens_its_groups() { let (app, x) = app(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| app); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); let fx = h.state_mut().session.execute("effect.apply", json!({"layers": [x.small], "effect": "Color Grading"})).unwrap()["effects"][0].as_u64().unwrap(); // Only this effect open, so its header is on screen. let l = layer(&h.state().session, x.small); @@ -694,7 +694,7 @@ fn command_clicking_an_effect_twirl_closes_and_opens_its_groups() { #[test] fn shift_click_on_effect_headers_selects_a_range_and_command_toggles() { let (app, x) = app(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| app); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); let fx: Vec = layer(&h.state().session, x.small).effects().unwrap().groups().map(|g| g.uid).collect(); // All twirled closed, so every header is on screen. h.state_mut().ui.fx_closed.extend(fx.iter().copied()); @@ -756,7 +756,7 @@ fn type_into(h: &mut Harness<'_, EffectcraftApp>, id: &str, text: &str) { #[test] fn angle_revolutions_scrub_and_take_typing() { let (app, x) = app(); - let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).build_eframe(|_| app); + let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); settle(&mut h); let angle = |h: &Harness<'_, EffectcraftApp>| layer(&h.state().session, x.small).effects().unwrap().find(x.angle).unwrap().value.as_f64(); h.state_mut().session.execute("prop.set", json!({"layer": x.small, "prop": x.angle, "value": 45.0})).unwrap(); @@ -820,7 +820,7 @@ fn right_click_in_effect_controls_shows_the_effect_menu() { s.state.selected_layers = vec![LayerId(b), LayerId(a)]; let mut app = EffectcraftApp::new(s); app.show_panel(PanelKind::EffectControls); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| app); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.run_steps(3); let category = " Blur & Sharpen"; // An effect's header: its own menu. @@ -883,7 +883,7 @@ fn extractor_offers_the_exr_layers_and_channels() { s.state.selected_layers = vec![LayerId(l)]; let mut app = EffectcraftApp::new(s); app.show_panel(PanelKind::EffectControls); - let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).build_eframe(|_| app); + let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); settle(&mut h); let values = |h: &Harness<'_, EffectcraftApp>| -> Vec { let l = layer(&h.state().session, l); @@ -956,7 +956,7 @@ fn cryptomatte_layer_popup_follows_the_footage() { s.state.selected_layers = vec![LayerId(l)]; let mut app = EffectcraftApp::new(s); app.show_panel(PanelKind::EffectControls); - let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).build_eframe(|_| app); + let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); settle(&mut h); // The file has only CryptoMaterial, so that is what the closed popup shows, and all it lists. assert!(h.query_by_label("CryptoMaterial").is_some() && h.query_by_label("CryptoObject").is_none()); @@ -996,7 +996,7 @@ fn point_picker_handle_follows_hover_then_commits_once_across_effects() { app.show_panel(PanelKind::EffectControls); app.ui.viewer.zoom = Some(0.85); app.ui.viewer.pan = [25.0, -10.0]; - let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).build_eframe(|_| app); + let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); settle(&mut h); let id = format!("viewer.effectPoint.{point}"); let original = rect_of(&h, &id).center(); @@ -1027,7 +1027,7 @@ fn point_picker_handle_follows_hover_then_commits_once_across_effects() { #[test] fn point_picker_preview_cancels_and_works_with_layer_controls_hidden() { let (app, x) = app(); - let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).build_eframe(|_| app); + let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); settle(&mut h); let value = layer(&h.state().session, x.small).props.find(x.point).unwrap().value.clone(); let undo = h.state().session.history.undo.len(); @@ -1058,7 +1058,7 @@ fn radial_center_stays_draggable_when_its_property_is_selected() { let effect = l.effects().unwrap().groups().find(|g| g.match_id == "ec.blur.ccradialfast").unwrap(); let point = effect.get("center").unwrap().uid; app.session.state.selected_props = vec![(LayerId(x.small), point)]; - let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).build_eframe(|_| app); + let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); settle(&mut h); let id = format!("viewer.effectPoint.{point}"); assert!(ids(&h).contains(&id), "selected point must keep its handle"); @@ -1085,7 +1085,7 @@ fn radial_center_stays_draggable_when_its_property_is_selected() { #[test] fn clicking_an_effect_parameter_activates_its_header_and_handles() { let (app, x) = app(); - let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_step_dt(1.0 / 60.0).build_eframe(|_| app); + let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_step_dt(1.0 / 60.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); settle(&mut h); let name = rect_of(&h, &format!("effectControls.prop.{}.name", x.point)).center(); click(&mut h, name); @@ -1111,7 +1111,7 @@ fn non_point_parameters_activate_handles_across_effect_families() { s.state.selected_props.clear(); let mut app = EffectcraftApp::new(s); app.show_panel(PanelKind::EffectControls); - let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).build_eframe(|_| app); + let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); settle(&mut h); let name = rect_of(&h, &format!("effectControls.prop.{prop}.name")).center(); click(&mut h, name); @@ -1125,7 +1125,7 @@ fn non_point_parameters_activate_handles_across_effect_families() { #[test] fn custom_effect_editors_activate_their_owner() { let (app, x) = app(); - let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).build_eframe(|_| app); + let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); settle(&mut h); let graph = rect_of(&h, &format!("effectControls.effect.{}.curves.graph", x.curves)).center(); click(&mut h, graph); @@ -1167,7 +1167,7 @@ fn file_and_text_parameters_have_widgets() { assert_eq!(exts, ["cube"]); vec![pick.lock().unwrap().clone()] })); - let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).build_eframe(|_| app); + let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); settle(&mut h); let ctx = h.ctx.clone(); let r = effectcraft_ui_egui::menus::invoke(h.state_mut(), &ctx, "effect.apply", json!({"effect": "Apply Color LUT"})).unwrap(); @@ -1217,7 +1217,7 @@ fn file_and_text_parameters_have_widgets() { #[test] fn effect_control_name_can_be_renamed_from_its_header() { let (app, x) = app(); - let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_step_dt(1.0 / 60.0).build_eframe(|_| app); + let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_step_dt(1.0 / 60.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); settle(&mut h); let name = format!("effectControls.effect.{}.name", x.point_fx); let point = rect_of(&h, &name).center(); @@ -1242,7 +1242,7 @@ fn effect_control_name_can_be_renamed_from_its_header() { #[test] fn effect_rename_opens_with_the_name_selected() { let (app, x) = app(); - let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_step_dt(1.0 / 60.0).build_eframe(|_| app); + let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_step_dt(1.0 / 60.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); settle(&mut h); let edit = format!("effectControls.effect.{}.nameEdit", x.point_fx); let current_name = @@ -1294,7 +1294,7 @@ fn effect_rename_opens_with_the_name_selected() { #[test] fn double_clicking_an_effect_property_name_reveals_it_in_the_timeline() { let (app, x) = app(); - let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_step_dt(1.0 / 60.0).build_eframe(|_| app); + let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_step_dt(1.0 / 60.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); settle(&mut h); let row = format!("timeline.prop.{}.name", x.point); assert!(!ids(&h).contains(&row), "the effect's property is not in the Timeline before the double-click"); @@ -1309,7 +1309,7 @@ fn double_clicking_an_effect_property_name_reveals_it_in_the_timeline() { #[test] fn effect_rename_escape_keeps_the_name() { let (app, x) = app(); - let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_step_dt(1.0 / 60.0).build_eframe(|_| app); + let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_step_dt(1.0 / 60.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); settle(&mut h); let point = rect_of(&h, &format!("effectControls.effect.{}.name", x.point_fx)).center(); double_click(&mut h, point); @@ -1371,7 +1371,7 @@ fn select_layer(h: &mut Harness<'_, EffectcraftApp>, layer: u64) { #[test] fn locked_effect_controls_keep_their_layer_until_it_is_deleted() { let (app, a, b, fa, fb) = two_layers(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| app); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.run_steps(4); assert!(shows_effect(&h, fa) && !shows_effect(&h, fb), "A is shown before locking"); let comp = h.state().session.active_comp_id().unwrap().0; @@ -1424,7 +1424,7 @@ fn locked_effect_controls_keep_their_layer_until_it_is_deleted() { #[test] fn replacing_the_project_unlocks_effect_controls() { let (app, a, b, _, _) = two_layers(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| app); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.run_steps(4); let lock = rect_of(&h, "panel.tab.EffectControls.lock").center(); click(&mut h, lock); @@ -1453,7 +1453,7 @@ fn a_lock_request_with_no_layer_shown_fails_and_keeps_the_other_comps_lock() { } } let (app, a, _, _, _) = two_layers(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| app); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.run_steps(4); assert_eq!(send(&mut h)["ok"], true); let kept = h.state().ui.effect_controls_lock; @@ -1484,7 +1484,7 @@ fn a_lock_request_while_locked_in_another_comp_fails() { } } let (app, a, _, _, _) = two_layers(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| app); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.run_steps(4); assert_eq!(send(&mut h)["ok"], true); let kept = h.state().ui.effect_controls_lock; @@ -1516,7 +1516,7 @@ fn a_lock_request_after_a_project_replacement_does_not_report_the_old_lock() { } } let (app, a, _, _, _) = two_layers(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| app); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.run_steps(4); assert_eq!(send(&mut h)["ok"], true); assert_eq!(h.state().ui.effect_controls_lock.map(|l| l.layer), Some(a)); @@ -1532,7 +1532,7 @@ fn a_lock_request_after_a_project_replacement_does_not_report_the_old_lock() { #[test] fn applying_an_effect_while_locked_keeps_the_selection() { let (app, a, b, fa, _) = two_layers(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| app); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.run_steps(4); let lock = rect_of(&h, "panel.tab.EffectControls.lock").center(); click(&mut h, lock); @@ -1567,7 +1567,7 @@ fn effect_controls_lock_over_the_control_channel() { } } let (app, a, b, fa, fb) = two_layers(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| app); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.run_steps(4); assert_eq!(send(&mut h, json!({"effectControlsLocked": true}))["ok"], true); assert_eq!(h.state().ui.effect_controls_lock.map(|l| l.layer), Some(a)); diff --git a/crates/ui-egui/tests/it/ui_effect_drop_highlight.rs b/crates/ui-egui/tests/it/ui_effect_drop_highlight.rs index ddef6c94b..48ad490d4 100644 --- a/crates/ui-egui/tests/it/ui_effect_drop_highlight.rs +++ b/crates/ui-egui/tests/it/ui_effect_drop_highlight.rs @@ -23,7 +23,7 @@ fn effect_drag_highlights_the_layer_under_the_pointer() { s.execute("comp.new", json!({"name": "Main", "width": 640, "height": 360, "duration": 4})).unwrap(); let a = s.execute("layer.newNull", json!({})).unwrap()["layer"].as_u64().unwrap(); let b = s.execute("layer.newNull", json!({})).unwrap()["layer"].as_u64().unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); assert!(h.state().auto.find("timeline.dropTarget").is_none(), "nothing is lit without a drag"); let (row_a, row_b) = (rect(&h, &format!("timeline.layer.{a}.row")), rect(&h, &format!("timeline.layer.{b}.row"))); diff --git a/crates/ui-egui/tests/it/ui_effect_names.rs b/crates/ui-egui/tests/it/ui_effect_names.rs index 01b57178b..680b8dd2e 100644 --- a/crates/ui-egui/tests/it/ui_effect_names.rs +++ b/crates/ui-egui/tests/it/ui_effect_names.rs @@ -34,7 +34,7 @@ fn harness(language: &str) -> (Harness<'static, EffectcraftApp>, u64) { app.show_panel(PanelKind::Timeline); // The Chinese/Japanese names under test have no installed face on every host: draw tofu // instead of failing the missing-glyph gate (the glyph coverage test covers the bundled set). - let mut h = Harness::builder().with_size(vec2(1400.0, 900.0)).allow_missing_glyphs().build_eframe(|_| app); + let mut h = Harness::builder().with_size(vec2(1400.0, 900.0)).allow_missing_glyphs().with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.run_steps(4); (h, fx) } diff --git a/crates/ui-egui/tests/it/ui_effects_presets_keyboard.rs b/crates/ui-egui/tests/it/ui_effects_presets_keyboard.rs index 1dc8341bc..8e30181b9 100644 --- a/crates/ui-egui/tests/it/ui_effects_presets_keyboard.rs +++ b/crates/ui-egui/tests/it/ui_effects_presets_keyboard.rs @@ -16,7 +16,7 @@ fn harness() -> Harness<'static, EffectcraftApp> { let mut s = Session::default(); s.execute("comp.new", json!({"name": "Main", "width": 320, "height": 180, "duration": 4})).unwrap(); s.execute("layer.newSolid", json!({"name": "Red", "color": "#c04040"})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.state_mut().show_panel(PanelKind::EffectsPresets); h.run_steps(4); h diff --git a/crates/ui-egui/tests/it/ui_env_light_gpu.rs b/crates/ui-egui/tests/it/ui_env_light_gpu.rs index 185980fb6..a5b492ca0 100644 --- a/crates/ui-egui/tests/it/ui_env_light_gpu.rs +++ b/crates/ui-egui/tests/it/ui_env_light_gpu.rs @@ -57,7 +57,7 @@ fn environment_light_lights_the_scene_on_the_gpu() { .with_size(egui::vec2(1400.0, 900.0)) .with_pixels_per_point(1.0) .wgpu_setup(same_adapter(adapter)) - .build_eframe(|_| EffectcraftApp::new(Session::default())); + .with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(Session::default())); // The project opens once the compositor (built on a worker thread) is attached, so the // frames compared below are GPU frames, not ones the CPU composited meanwhile (see ui_gpu.rs). wait_for_compositor(&mut h); diff --git a/crates/ui-egui/tests/it/ui_export_overwrite.rs b/crates/ui-egui/tests/it/ui_export_overwrite.rs index 997359479..402a82ae4 100644 --- a/crates/ui-egui/tests/it/ui_export_overwrite.rs +++ b/crates/ui-egui/tests/it/ui_export_overwrite.rs @@ -38,7 +38,7 @@ impl Rig { }; std::sync::Arc::make_mut(&mut s.project).add_item("clip.png", Label::Aqua, None, ItemKind::Footage(clip)); let mut app = Some(EffectcraftApp::new(s)); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| app.take().expect("app")); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app.take().expect("app")); h.run_steps(2); Rig { h, dir } } diff --git a/crates/ui-egui/tests/it/ui_expression_values.rs b/crates/ui-egui/tests/it/ui_expression_values.rs index b797e6cf6..2f3173591 100644 --- a/crates/ui-egui/tests/it/ui_expression_values.rs +++ b/crates/ui-egui/tests/it/ui_expression_values.rs @@ -77,7 +77,7 @@ fn setup() -> (Harness<'static, EffectcraftApp>, Ids) { app.show_panel(PanelKind::EffectControls); app.ui.timeline.open_layers.insert(l); app.ui.timeline.open_groups.insert(transform); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| app); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.run_steps(4); (h, ids) } diff --git a/crates/ui-egui/tests/it/ui_flowchart_keyboard.rs b/crates/ui-egui/tests/it/ui_flowchart_keyboard.rs index 7cdc74f0c..a03eaeafb 100644 --- a/crates/ui-egui/tests/it/ui_flowchart_keyboard.rs +++ b/crates/ui-egui/tests/it/ui_flowchart_keyboard.rs @@ -28,7 +28,7 @@ fn sized(w: f32, hh: f32) -> Harness<'static, EffectcraftApp> { id(s.execute("comp.new", json!({"name": "Main", "width": 100, "height": 100, "duration": 2})).unwrap()); s.execute("layer.addItem", json!({"item": mid})).unwrap(); s.execute("layer.addItem", json!({"item": inner})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(w, hh)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(w, hh)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.state_mut().show_panel(PanelKind::Flowchart); h.state_mut().ui.maximized = Some(PanelKind::Flowchart); h.run_steps(4); @@ -108,7 +108,7 @@ fn the_toolbar_automation_labels_stay_english_in_another_language() { let mut s = Session::default(); s.execute("comp.new", json!({"name": "Main", "width": 100, "height": 100, "duration": 2})).unwrap(); s.prefs.general.language = "fr".into(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).allow_missing_glyphs().build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).allow_missing_glyphs().with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.state_mut().show_panel(PanelKind::Flowchart); h.state_mut().ui.maximized = Some(PanelKind::Flowchart); h.run_steps(4); diff --git a/crates/ui-egui/tests/it/ui_font_search.rs b/crates/ui-egui/tests/it/ui_font_search.rs index 44b650be4..d326646bc 100644 --- a/crates/ui-egui/tests/it/ui_font_search.rs +++ b/crates/ui-egui/tests/it/ui_font_search.rs @@ -37,9 +37,9 @@ fn font_search_filters_selects_and_undoes_in_both_panels() { let lid = s.execute("layer.newText", json!({"text": "Keep this text", "font": "Inter"})).unwrap()["layer"].as_u64().unwrap(); let builder = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)); let mut h = if std::env::var_os("EC_SNAPSHOT_DIR").is_some() { - builder.wgpu().build_eframe(move |_| EffectcraftApp::new(s)) + builder.wgpu().with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)) } else { - builder.build_eframe(move |_| EffectcraftApp::new(s)) + builder.with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)) }; h.state_mut().show_panel(panel); h.run_steps(3); @@ -94,7 +94,7 @@ fn font_search_preserves_edited_text_and_applies_only_to_selected_characters() { let lid = s.execute("layer.newText", json!({"text": "First second", "font": "Inter"})).unwrap()["layer"].as_u64().unwrap(); s.execute("text.edit", json!({"layer": lid})).unwrap(); s.execute("text.setSelection", json!({"start": 0, "end": 5})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); h.state_mut().show_panel(PanelKind::Character); h.run_steps(3); click(&mut h, "character.font"); @@ -143,7 +143,7 @@ fn font_menu_lists_a_name_the_interface_fonts_lack_in_english() { let mut s = Session::default(); s.execute("comp.new", json!({"width": 320, "height": 180})).unwrap(); let lid = s.execute("layer.newText", json!({"text": "Native", "font": "Inter"})).unwrap()["layer"].as_u64().unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); h.state_mut().show_panel(PanelKind::Character); h.run_steps(3); click(&mut h, "character.font"); @@ -192,7 +192,7 @@ fn font_menu_filters_variable_fonts() { let mut s = Session::default(); s.execute("comp.new", json!({"width": 320, "height": 180})).unwrap(); let lid = s.execute("layer.newText", json!({"text": "Var", "font": "Inter"})).unwrap()["layer"].as_u64().unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); h.state_mut().show_panel(PanelKind::Character); h.run_steps(3); let families = |h: &Harness<'_, EffectcraftApp>| -> Vec { @@ -232,7 +232,7 @@ fn font_menu_grows_back_after_an_empty_search() { let mut s = Session::default(); s.execute("comp.new", json!({"width": 320, "height": 180})).unwrap(); let lid = s.execute("layer.newText", json!({"text": "Grow", "font": "Inter"})).unwrap()["layer"].as_u64().unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); h.state_mut().show_panel(PanelKind::Character); h.run_steps(3); let rows = |h: &Harness<'_, EffectcraftApp>| h.state().auto.query("character.font.option.").len(); @@ -266,7 +266,7 @@ fn font_menu_rescan_button_adds_fonts_installed_later() { let mut s = Session::default(); s.execute("comp.new", json!({"width": 320, "height": 180})).unwrap(); s.execute("layer.newText", json!({"text": "Keep this text", "font": "Inter"})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); h.state_mut().show_panel(PanelKind::Character); h.run_steps(3); click(&mut h, "character.font"); diff --git a/crates/ui-egui/tests/it/ui_form_fit.rs b/crates/ui-egui/tests/it/ui_form_fit.rs index bdf8f0cb8..fec67e8f7 100644 --- a/crates/ui-egui/tests/it/ui_form_fit.rs +++ b/crates/ui-egui/tests/it/ui_form_fit.rs @@ -14,7 +14,7 @@ fn rect(h: &Harness<'_, EffectcraftApp>, id: &str) -> Rect { fn project_settings_fits_the_form_width() { let mut session = Session::default(); session.prefs.disk.disk_cache_enabled = false; - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(session)); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(session)); h.run_steps(4); let ctx = h.ctx.clone(); menus::invoke(h.state_mut(), &ctx, "file.projectSettings", json!({})).unwrap(); diff --git a/crates/ui-egui/tests/it/ui_frame_step.rs b/crates/ui-egui/tests/it/ui_frame_step.rs index a57e35295..75d71887d 100644 --- a/crates/ui-egui/tests/it/ui_frame_step.rs +++ b/crates/ui-egui/tests/it/ui_frame_step.rs @@ -20,7 +20,7 @@ fn cmd_arrows_step_the_current_frame() { let mut session = Session::default(); session.execute("comp.new", json!({"name": "Main", "width": 320, "height": 180, "frameRate": 30.0, "duration": 4.0})).unwrap(); let cid = session.state.active_comp.unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).build_eframe(|_| EffectcraftApp::new(session)); + let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(session)); h.run_steps(2); let frame = |h: &Harness<'_, EffectcraftApp>| { let app = h.state(); @@ -53,7 +53,7 @@ fn plain_arrows_nudge_the_selected_layer() { session.execute("comp.new", json!({"name": "Main", "width": 320, "height": 180, "frameRate": 30.0, "duration": 4.0})).unwrap(); let lid = session.execute("layer.newSolid", json!({"name": "Box", "width": 40, "height": 40, "color": "#ff0000"})).unwrap()["layer"].as_u64().unwrap(); session.execute("layer.select", json!({"layers": [lid]})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).build_eframe(|_| EffectcraftApp::new(session)); + let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(session)); h.run_steps(2); let x = |h: &Harness<'_, EffectcraftApp>| { h.state().session.active_comp().unwrap().layer(LayerId(lid)).unwrap().props.prop("transform/position").unwrap().value.as_vec3()[0] @@ -83,7 +83,7 @@ fn clicking_a_timeline_row_then_arrows_nudge_the_layer() { session.execute("comp.new", json!({"name": "Main", "width": 320, "height": 180, "frameRate": 30.0, "duration": 4.0})).unwrap(); let lid = session.execute("layer.newSolid", json!({"name": "Box", "width": 40, "height": 40, "color": "#ff0000"})).unwrap()["layer"].as_u64().unwrap(); session.execute("edit.deselectAll", json!({})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(session)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(session)); h.run_steps(3); let row = { let e = h.state().auto.find(&format!("timeline.layer.{lid}.row")).expect("timeline row"); @@ -114,7 +114,7 @@ fn arrows_nudge_from_any_panel_but_project() { session.execute("comp.new", json!({"name": "Main", "width": 320, "height": 180, "frameRate": 30.0, "duration": 4.0})).unwrap(); let lid = session.execute("layer.newSolid", json!({"name": "Box", "width": 40, "height": 40, "color": "#ff0000"})).unwrap()["layer"].as_u64().unwrap(); session.execute("layer.select", json!({"layers": [lid]})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).build_eframe(|_| EffectcraftApp::new(session)); + let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(session)); h.run_steps(2); let x = |h: &Harness<'_, EffectcraftApp>| { h.state().session.active_comp().unwrap().layer(LayerId(lid)).unwrap().props.prop("transform/position").unwrap().value.as_vec3()[0] diff --git a/crates/ui-egui/tests/it/ui_fx_editors.rs b/crates/ui-egui/tests/it/ui_fx_editors.rs index b4d999311..bf2591541 100644 --- a/crates/ui-egui/tests/it/ui_fx_editors.rs +++ b/crates/ui-egui/tests/it/ui_fx_editors.rs @@ -17,7 +17,7 @@ fn harness(s: Session) -> Harness<'static, EffectcraftApp> { let mut app = EffectcraftApp::new(s); app.show_panel(PanelKind::EffectControls); app.toggle_maximize(PanelKind::EffectControls); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1400.0)).build_eframe(|_| app); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1400.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.run_steps(4); h } @@ -287,7 +287,7 @@ fn mesh_warp_vertices_drag_on_the_viewer() { fn composition_tabs_and_scrolling_preview() { let mut s = Session::default(); s.execute("file.openDemoProject", json!({})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(4); rect(&h, "panel.tab.Timeline.close"); rect(&h, "preview.scroll"); diff --git a/crates/ui-egui/tests/it/ui_gpu.rs b/crates/ui-egui/tests/it/ui_gpu.rs index 28edac27d..24addb35a 100644 --- a/crates/ui-egui/tests/it/ui_gpu.rs +++ b/crates/ui-egui/tests/it/ui_gpu.rs @@ -60,7 +60,7 @@ fn the_interface_draws_and_composites_on_the_cpu_while_the_gpu_compositor_is_bui } let (release, gate) = std::sync::mpsc::channel::<()>(); let s = small_session(); - let mut h = Harness::builder().with_size(egui::vec2(1200.0, 800.0)).wgpu().build_eframe(move |_| { + let mut h = Harness::builder().with_size(egui::vec2(1200.0, 800.0)).wgpu().with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| { let mut app = EffectcraftApp::new(s); // The status line's 5 s expiry reads the app clock: a manual one makes the steps below // stand for a known span of time. @@ -118,7 +118,7 @@ fn a_compositor_build_that_panics_leaves_the_viewer_on_the_cpu() { return; } let s = small_session(); - let mut h = Harness::builder().with_size(egui::vec2(1200.0, 800.0)).wgpu().build_eframe(move |_| { + let mut h = Harness::builder().with_size(egui::vec2(1200.0, 800.0)).wgpu().with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| { let mut app = EffectcraftApp::new(s); app.hooks.before_gpu_build = Some(Box::new(|| panic!("synthetic shader compiler panic"))); app @@ -169,7 +169,7 @@ fn viewer_draws_gpu_frames_that_match_the_cpu() { .with_size(egui::vec2(1400.0, 900.0)) .with_pixels_per_point(1.0) .wgpu_setup(same_adapter(adapter)) - .build_eframe(|_| EffectcraftApp::new(Session::default())); + .with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(Session::default())); // The project opens once the compositor (built on a worker thread) is attached. A frame the // CPU composited while it was being built has the GPU frame's key, so the viewer would keep // showing it, and the comparison below would be the CPU against itself. @@ -215,7 +215,7 @@ fn a_lost_device_draws_nothing_autosaves_and_closes() { let mut s = Session { autosave_folder_override: Some(dir.clone()), ..Default::default() }; s.execute("comp.new", json!({"name": "Unsaved", "width": 64, "height": 64, "duration": 1})).unwrap(); assert!(s.is_dirty()); - let mut h = Harness::builder().with_size(egui::vec2(1200.0, 800.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1200.0, 800.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); let told = std::rc::Rc::new(std::cell::RefCell::new(Vec::new())); let log = told.clone(); h.state_mut().hooks.device_lost = Some(Box::new(move |saved| log.borrow_mut().push(saved))); @@ -259,7 +259,7 @@ fn the_viewer_exposes_32_bpc_frames_on_the_gpu() { let lid = s.execute("layer.newSolid", json!({"color": "#ffffff"})).unwrap()["layer"].as_u64().unwrap(); s.execute("effect.apply", json!({"layers": [lid], "effect": "Exposure"})).unwrap(); s.execute("prop.set", json!({"layer": lid, "path": "effects/#1/master/exposure", "value": 2.0})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1200.0, 800.0)).wgpu().build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1200.0, 800.0)).wgpu().with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); settle(&mut h); let p = h.state().viewer_f16().expect("a half-float viewer frame").pixel(0).unwrap(); let l = effectcraft_engine::color::srgb_to_linear(p[0] / p[3]); diff --git a/crates/ui-egui/tests/it/ui_gradient_editor.rs b/crates/ui-egui/tests/it/ui_gradient_editor.rs index f5ee8634b..258bf5324 100644 --- a/crates/ui-egui/tests/it/ui_gradient_editor.rs +++ b/crates/ui-egui/tests/it/ui_gradient_editor.rs @@ -45,7 +45,7 @@ fn setup(timing: &[(&str, serde_json::Value)]) -> (Harness<'static, EffectcraftA s.execute(cmd, p).unwrap(); } let (groups, colors) = gradient_fill(&s.active_comp().unwrap().layer(LayerId(l)).unwrap().props).expect("a Gradient Fill"); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.state_mut().ui.timeline.open_layers.insert(l); h.state_mut().ui.timeline.open_groups.extend(groups); h.run_steps(3); diff --git a/crates/ui-egui/tests/it/ui_gradient_handles.rs b/crates/ui-egui/tests/it/ui_gradient_handles.rs index f5d9d273e..02a242c59 100644 --- a/crates/ui-egui/tests/it/ui_gradient_handles.rs +++ b/crates/ui-egui/tests/it/ui_gradient_handles.rs @@ -53,7 +53,7 @@ fn setup(in_group: bool, prep: impl FnOnce(&mut Session, u64, u64)) -> (Session, } fn harness(s: Session) -> Harness<'static, EffectcraftApp> { - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(4); h } diff --git a/crates/ui-egui/tests/it/ui_gradient_value.rs b/crates/ui-egui/tests/it/ui_gradient_value.rs index 84c3844c0..26ec7b328 100644 --- a/crates/ui-egui/tests/it/ui_gradient_value.rs +++ b/crates/ui-egui/tests/it/ui_gradient_value.rs @@ -31,7 +31,7 @@ fn the_timeline_gradient_value_opens_an_editor() { let l = s.execute("layer.newShape", json!({"kind": "rect"})).unwrap()["layer"].as_u64().unwrap(); s.execute("layer.addShapeItem", json!({"layer": l, "kind": "gfill"})).unwrap(); let (groups, colors) = gradient_fill(&s.active_comp().unwrap().layer(LayerId(l)).unwrap().props).expect("a Gradient Fill"); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.state_mut().ui.timeline.open_layers.insert(l); h.state_mut().ui.timeline.open_groups.extend(groups); h.run_steps(3); diff --git a/crates/ui-egui/tests/it/ui_graph_fit.rs b/crates/ui-egui/tests/it/ui_graph_fit.rs index d80ae315e..69ebb3737 100644 --- a/crates/ui-egui/tests/it/ui_graph_fit.rs +++ b/crates/ui-egui/tests/it/ui_graph_fit.rs @@ -20,7 +20,7 @@ fn harness(select_layer: bool) -> (Harness<'static, EffectcraftApp>, u64, u64) { } let uid = s.active_comp().unwrap().layer(id).unwrap().props.prop("transform/rotation").unwrap().uid; s.execute("layer.select", json!({"layers": if select_layer { vec![id.0] } else { vec![] }})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.state_mut().ui.timeline.pps = Some(300.0); h.state_mut().ui.timeline.start = 0.0; h.run_steps(3); diff --git a/crates/ui-egui/tests/it/ui_graph_theme.rs b/crates/ui-egui/tests/it/ui_graph_theme.rs index 49c6689a0..2f04e2a97 100644 --- a/crates/ui-egui/tests/it/ui_graph_theme.rs +++ b/crates/ui-egui/tests/it/ui_graph_theme.rs @@ -33,7 +33,7 @@ fn the_graph_editor_follows_the_theme() { } s.execute("layer.select", json!({"layers": [id.0]})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); h.state_mut().ui.timeline.graph_editor = true; h.run_steps(4); let ctx = h.ctx.clone(); diff --git a/crates/ui-egui/tests/it/ui_group_rename.rs b/crates/ui-egui/tests/it/ui_group_rename.rs index 999ed1e3e..4abb75063 100644 --- a/crates/ui-egui/tests/it/ui_group_rename.rs +++ b/crates/ui-egui/tests/it/ui_group_rename.rs @@ -28,7 +28,7 @@ fn harness() -> (Harness<'static, EffectcraftApp>, Fx) { s.active_comp().unwrap().layer(effectcraft_engine::project::LayerId(l)).unwrap().props.group(path).unwrap().groups().next().unwrap().uid }; let (anim, mask, group) = (first(&s, text, "text/animators"), first(&s, shape, "masks"), first(&s, shape, "contents")); - let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_step_dt(1.0 / 60.0).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_step_dt(1.0 / 60.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(6); (h, Fx { text, shape, effect, anim, mask, group }) } diff --git a/crates/ui-egui/tests/it/ui_guide_layers.rs b/crates/ui-egui/tests/it/ui_guide_layers.rs index 92196f5f1..e5b8b59f1 100644 --- a/crates/ui-egui/tests/it/ui_guide_layers.rs +++ b/crates/ui-egui/tests/it/ui_guide_layers.rs @@ -21,7 +21,7 @@ fn harness() -> (Harness<'static, EffectcraftApp>, LayerId, LayerId) { }; let left = solid("Left", 160.0); let right = solid("Right", 480.0); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(session)); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(session)); h.run_steps(3); (h, left, right) } diff --git a/crates/ui-egui/tests/it/ui_info_tracker_a11y.rs b/crates/ui-egui/tests/it/ui_info_tracker_a11y.rs index b527474c3..623e7b043 100644 --- a/crates/ui-egui/tests/it/ui_info_tracker_a11y.rs +++ b/crates/ui-egui/tests/it/ui_info_tracker_a11y.rs @@ -15,7 +15,7 @@ fn harness(panel: PanelKind) -> Harness<'static, EffectcraftApp> { let mut s = Session::default(); s.execute("comp.new", json!({"name": "Main", "width": 320, "height": 180, "duration": 4})).unwrap(); s.execute("layer.newSolid", json!({"name": "Red", "color": "#c04040"})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.state_mut().show_panel(panel); h.state_mut().ui.maximized = Some(panel); h.run_steps(4); diff --git a/crates/ui-egui/tests/it/ui_inline_edit.rs b/crates/ui-egui/tests/it/ui_inline_edit.rs index dc7fd02e1..0213cb943 100644 --- a/crates/ui-egui/tests/it/ui_inline_edit.rs +++ b/crates/ui-egui/tests/it/ui_inline_edit.rs @@ -14,7 +14,7 @@ fn harness() -> (Harness<'static, EffectcraftApp>, u64) { let comp = s.active_comp_id().unwrap().0; // Arabic, Hebrew, Devanagari and Thai names typed below need installed system faces: draw // tofu on a host without them rather than failing the missing-glyph gate. - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).allow_missing_glyphs().build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).allow_missing_glyphs().with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(4); (h, comp) } diff --git a/crates/ui-egui/tests/it/ui_keyframes.rs b/crates/ui-egui/tests/it/ui_keyframes.rs index d8cce232d..e79430f95 100644 --- a/crates/ui-egui/tests/it/ui_keyframes.rs +++ b/crates/ui-egui/tests/it/ui_keyframes.rs @@ -21,7 +21,7 @@ fn harness() -> (Harness<'static, EffectcraftApp>, LayerId, u64) { } let uid = s.active_comp().unwrap().layer(id).unwrap().props.prop("transform/opacity").unwrap().uid; s.execute("layer.select", json!({"layers": [id.0]})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); let ctx = h.ctx.clone(); effectcraft_ui_egui::menus::invoke(h.state_mut(), &ctx, "timeline.reveal.opacity", json!({})).unwrap(); @@ -518,7 +518,7 @@ fn properties_panel_edits_every_selected_layer() { s.execute("layer.select", json!({"layers": ids})).unwrap(); let first = s.state.selected_layers[0]; let uid = s.active_comp().unwrap().layer(first).unwrap().props.prop("transform/position").unwrap().uid; - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.state_mut().show_panel(effectcraft_ui_egui::dock::PanelKind::Properties); h.run_steps(4); assert_eq!(h.state().auto.find("properties.selectedObjects").map(|e| e.label.clone()), Some("(3) Selected Objects".into())); @@ -571,7 +571,7 @@ fn ctrl_alt_scrub_in_the_timeline_is_proportional() { } let middle = ids[1]; let uid = s.active_comp().unwrap().layer(LayerId(middle)).unwrap().props.prop("transform/position").unwrap().uid; - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); let ctx = h.ctx.clone(); effectcraft_ui_egui::menus::invoke(h.state_mut(), &ctx, "timeline.reveal.position", json!({})).unwrap(); diff --git a/crates/ui-egui/tests/it/ui_large_project.rs b/crates/ui-egui/tests/it/ui_large_project.rs index 1b41371db..a2c0a3476 100644 --- a/crates/ui-egui/tests/it/ui_large_project.rs +++ b/crates/ui-egui/tests/it/ui_large_project.rs @@ -15,7 +15,7 @@ fn spec() -> LargeSpec { } fn harness(s: Session) -> Harness<'static, EffectcraftApp> { - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); h } diff --git a/crates/ui-egui/tests/it/ui_layer_panel_zoom.rs b/crates/ui-egui/tests/it/ui_layer_panel_zoom.rs index 73ed95cbd..57e96cb1d 100644 --- a/crates/ui-egui/tests/it/ui_layer_panel_zoom.rs +++ b/crates/ui-egui/tests/it/ui_layer_panel_zoom.rs @@ -23,7 +23,7 @@ fn box_id(h: &Harness<'_, EffectcraftApp>) -> u64 { /// The harness with Box open in the Layer panel (focused). fn harness() -> Harness<'static, EffectcraftApp> { - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| app()); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app()); h.run_steps(3); let id = box_id(&h); h.state_mut().session.execute("layer.select", json!({"layers": [id]})).unwrap(); diff --git a/crates/ui-egui/tests/it/ui_layer_source_picker.rs b/crates/ui-egui/tests/it/ui_layer_source_picker.rs index 2daa450c4..a34bc1938 100644 --- a/crates/ui-egui/tests/it/ui_layer_source_picker.rs +++ b/crates/ui-egui/tests/it/ui_layer_source_picker.rs @@ -107,7 +107,7 @@ fn timeline_source_drop_down_picks_the_layer_and_undo_restores_none() { let mut app = EffectcraftApp::new(s); app.ui.timeline.open_layers.insert(light); app.ui.timeline.open_groups.insert(group); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| app); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.run_steps(4); let value_id = format!("timeline.prop.{source}.value"); @@ -176,7 +176,7 @@ fn effect_controls_layer_param_picks_through_the_shared_widget() { s.state.selected_layers = vec![LayerId(base)]; let mut app = EffectcraftApp::new(s); app.show_panel(PanelKind::EffectControls); - let mut h = Harness::builder().with_size(vec2(1600.0, 1100.0)).build_eframe(|_| app); + let mut h = Harness::builder().with_size(vec2(1600.0, 1100.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.run_steps(4); let value_id = format!("effectControls.prop.{prop}.value"); @@ -221,7 +221,7 @@ fn snapshot_source_dropdown_open_and_chosen() { let mut app = EffectcraftApp::new(s); app.ui.timeline.open_layers.insert(light); app.ui.timeline.open_groups.insert(group); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_pixels_per_point(2.0).wgpu().build_eframe(|_| app); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_pixels_per_point(2.0).wgpu().with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.run_steps(4); let save = |h: &mut Harness<'_, EffectcraftApp>, name: &str| { if let Ok(dir) = std::env::var("EC_SNAPSHOT_DIR") { diff --git a/crates/ui-egui/tests/it/ui_light_settings.rs b/crates/ui-egui/tests/it/ui_light_settings.rs index aac090802..7d310ee70 100644 --- a/crates/ui-egui/tests/it/ui_light_settings.rs +++ b/crates/ui-egui/tests/it/ui_light_settings.rs @@ -10,7 +10,7 @@ use serde_json::{Value, json}; fn harness() -> Harness<'static, EffectcraftApp> { let mut s = Session::default(); s.execute("comp.new", json!({"name": "Lights", "width": 640, "height": 360, "duration": 2})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.step(); h } diff --git a/crates/ui-egui/tests/it/ui_live_preview.rs b/crates/ui-egui/tests/it/ui_live_preview.rs index abe3cc427..6c5e0b1d8 100644 --- a/crates/ui-egui/tests/it/ui_live_preview.rs +++ b/crates/ui-egui/tests/it/ui_live_preview.rs @@ -45,7 +45,7 @@ fn opacity_edits_show_completed_intermediate_frames_before_the_drag_stops() { let renderer = Arc::new(HeldRenderer::default()); let mut app = EffectcraftApp::new(session); app.frames.set_remote(Some(renderer.clone())); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(0.016).build_eframe(|_| app); + let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(0.016).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.run_steps(3); assert_eq!(h.state().frames.dispatch_remote(), 1); renderer.finish(); @@ -95,7 +95,7 @@ fn position_anchor_and_effect_edits_present_intermediate_pixels() { let renderer = Arc::new(HeldRenderer::default()); let mut app = EffectcraftApp::new(session); app.frames.set_remote(Some(renderer.clone())); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(0.016).build_eframe(|_| app); + let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(0.016).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.run_steps(3); h.state().frames.dispatch_remote(); let initial = renderer.finish(); @@ -124,7 +124,7 @@ fn continuous_opacity_preview_probe() { let mut session = Session::default(); session.execute("comp.new", json!({"width":1920,"height":1080,"duration":1})).unwrap(); let layer = session.execute("layer.newSolid", json!({"color":"#ffffff"})).unwrap()["layer"].as_u64().unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(1.0 / 60.0).build_eframe(|_| EffectcraftApp::new(session)); + let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(1.0 / 60.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(session)); let ready = Instant::now(); while h.state_mut().viewer_pixels().is_none() && ready.elapsed() < Duration::from_secs(5) { h.step(); diff --git a/crates/ui-egui/tests/it/ui_locked_color.rs b/crates/ui-egui/tests/it/ui_locked_color.rs index 5d7d1edd7..530940b45 100644 --- a/crates/ui-egui/tests/it/ui_locked_color.rs +++ b/crates/ui-egui/tests/it/ui_locked_color.rs @@ -63,7 +63,7 @@ fn locked_viewer_follows_display_profile_and_simulation() { s.execute("prefs.set", json!({"key": "previews.displayProfile", "value": "srgb"})).unwrap(); s.execute("view.displayColorManagement", json!({"value": true})).unwrap(); let images = Images::default(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).renderer(Capture(images.clone())).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).renderer(Capture(images.clone())).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); invoke(&mut h, "view.splitLockedViewer", json!({})); let first = expected_center(&mut h); diff --git a/crates/ui-egui/tests/it/ui_marker_names.rs b/crates/ui-egui/tests/it/ui_marker_names.rs index 190bd77bb..66fe11688 100644 --- a/crates/ui-egui/tests/it/ui_marker_names.rs +++ b/crates/ui-egui/tests/it/ui_marker_names.rs @@ -20,7 +20,7 @@ fn the_name_box_follows_the_theme() { s.execute("layer.newSolid", json!({"name": "Bed", "color": "#204060", "width": 640, "height": 360})).unwrap(); s.execute("markers.set", json!({"new": true, "time": 1.0, "comment": "Verse"})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); h.run_steps(4); let ctx = h.ctx.clone(); @@ -63,7 +63,7 @@ fn a_short_duration_stays_visible_beside_the_name_box() { // a second marker half a second later gives the timeline's scale (points per second) s.execute("markers.set", json!({"new": true, "time": 1.5})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); h.run_steps(5); let tokens = h.state().tokens; let centre = |id: &str| { @@ -100,7 +100,7 @@ fn a_later_name_box_does_not_hide_an_earlier_duration_cap() { s.execute("comp.new", json!({"width": 640, "height": 360, "duration": 4})).unwrap(); s.execute("markers.set", json!({"new": true, "time": 1.0, "duration": 0.5, "label": "Red"})).unwrap(); s.execute("markers.set", json!({"new": true, "time": 1.3, "comment": "This name overlaps the earlier endpoint", "label": "Blue"})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); h.run_steps(5); let a = h.state().auto.find("timeline.marker.0").unwrap().rect; let b = h.state().auto.find("timeline.marker.1").unwrap().rect; diff --git a/crates/ui-egui/tests/it/ui_media_browser_cache.rs b/crates/ui-egui/tests/it/ui_media_browser_cache.rs index 44ca9dd81..293c6ec2b 100644 --- a/crates/ui-egui/tests/it/ui_media_browser_cache.rs +++ b/crates/ui-egui/tests/it/ui_media_browser_cache.rs @@ -81,7 +81,7 @@ fn browser_cache_refreshes_filters_navigates_and_recovers_from_errors() { } let mut session = Session { browser: Some(browser.clone()), ..Default::default() }; session.prefs.general.language = "en".into(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_step_dt(1.0 / 60.0).build_eframe(|_| { + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_step_dt(1.0 / 60.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| { let mut app = EffectcraftApp::new(session); app.ui.start_screen = false; app.show_panel(PanelKind::MediaBrowser); diff --git a/crates/ui-egui/tests/it/ui_media_browser_copy_path.rs b/crates/ui-egui/tests/it/ui_media_browser_copy_path.rs index 8372b2be5..3c612fcd9 100644 --- a/crates/ui-egui/tests/it/ui_media_browser_copy_path.rs +++ b/crates/ui-egui/tests/it/ui_media_browser_copy_path.rs @@ -54,7 +54,7 @@ fn file_folder_and_virtual_paths_copy_from_the_context_menu_without_document_cha session.prefs.general.language = "en".into(); session.execute("comp.new", json!({"width": 64, "height": 36, "duration": 2})).unwrap(); // The Chinese folder and file names need an installed CJK face. - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_step_dt(1.0 / 60.0).allow_missing_glyphs().build_eframe(|_| { + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_step_dt(1.0 / 60.0).allow_missing_glyphs().with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| { let mut app = EffectcraftApp::new(session); app.ui.start_screen = false; app.show_panel(PanelKind::MediaBrowser); @@ -91,6 +91,7 @@ fn file_folder_and_virtual_paths_copy_from_the_context_menu_without_document_cha fn copy_path_control_command_preserves_the_path_and_rejects_bad_arguments() { let mut app = EffectcraftApp::new(Session::default()); let ctx = egui::Context::default(); + effectcraft_ui_egui::framework::install_headless(&ctx); let project = app.session.project.clone(); let revision = app.session.revision; let history = app.session.history.undo.len(); diff --git a/crates/ui-egui/tests/it/ui_menus.rs b/crates/ui-egui/tests/it/ui_menus.rs index 512f1f376..0d4376a44 100644 --- a/crates/ui-egui/tests/it/ui_menus.rs +++ b/crates/ui-egui/tests/it/ui_menus.rs @@ -12,7 +12,7 @@ use serde_json::json; fn harness() -> Harness<'static, EffectcraftApp> { let mut s = Session::default(); s.execute("file.openDemoProject", json!({})).unwrap(); - let mut h = Harness::builder().with_size(vec2(1400.0, 900.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(vec2(1400.0, 900.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); h } @@ -299,7 +299,7 @@ fn space_previews_after_opening_the_demo_from_home() { let s = Session::default(); let mut app = EffectcraftApp::new(s); app.ui.start_screen = true; - Harness::builder().with_size(vec2(1400.0, 900.0)).build_eframe(|_| app) + Harness::builder().with_size(vec2(1400.0, 900.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app) }; h.run_steps(3); let demo = rect(&h, "home.file.openDemoProject"); diff --git a/crates/ui-egui/tests/it/ui_new_primitive.rs b/crates/ui-egui/tests/it/ui_new_primitive.rs index c40aa23ed..015fa03c2 100644 --- a/crates/ui-egui/tests/it/ui_new_primitive.rs +++ b/crates/ui-egui/tests/it/ui_new_primitive.rs @@ -11,7 +11,7 @@ use serde_json::json; fn harness() -> Harness<'static, EffectcraftApp> { let mut s = Session::default(); s.execute("comp.new", json!({"name": "Scene", "width": 640, "height": 360, "duration": 2})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.step(); h } diff --git a/crates/ui-egui/tests/it/ui_object_matte.rs b/crates/ui-egui/tests/it/ui_object_matte.rs index 5f30ba03b..1806fc640 100644 --- a/crates/ui-egui/tests/it/ui_object_matte.rs +++ b/crates/ui-egui/tests/it/ui_object_matte.rs @@ -20,7 +20,7 @@ fn harness() -> Harness<'static, EffectcraftApp> { s.execute("layer.newSolid", json!({"name": "Plate", "color": "#406080", "width": 640, "height": 360})).unwrap(); s.execute("layer.newSolid", json!({"name": "Box", "color": "#e04020", "width": 80, "height": 80})).unwrap(); s.execute("edit.deselectAll", json!({})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); h.run_steps(3); h } diff --git a/crates/ui-egui/tests/it/ui_panel_focus.rs b/crates/ui-egui/tests/it/ui_panel_focus.rs index 0d436f702..99d687379 100644 --- a/crates/ui-egui/tests/it/ui_panel_focus.rs +++ b/crates/ui-egui/tests/it/ui_panel_focus.rs @@ -19,7 +19,7 @@ fn harness() -> (Harness<'static, EffectcraftApp>, u64, u64) { s.execute("layer.newSolid", json!({"name": "Red", "color": [1.0, 0.0, 0.0, 1.0]})).unwrap(); s.state.open_comps = vec![ItemId(main)]; s.state.active_comp = Some(ItemId(main)); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); (h, other, main) } diff --git a/crates/ui-egui/tests/it/ui_panel_windows.rs b/crates/ui-egui/tests/it/ui_panel_windows.rs index 72b8bfff6..9f9dec821 100644 --- a/crates/ui-egui/tests/it/ui_panel_windows.rs +++ b/crates/ui-egui/tests/it/ui_panel_windows.rs @@ -74,7 +74,7 @@ fn a_click_on_a_floating_panel_does_nothing_while_a_dialog_is_open() { let mut app = EffectcraftApp::new(Session::default()); app.ui.start_screen = false; app.apply_dock(craft_behavior::dock::Action::Float { panel: PanelKind::Project, rect: [80.0, 120.0, 320.0, 240.0] }).unwrap(); - let mut h = Harness::builder().with_size(vec2(1400.0, 900.0)).build_eframe(move |_| app); + let mut h = Harness::builder().with_size(vec2(1400.0, 900.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| app); h.run_steps(3); let close = |h: &Harness<'_, EffectcraftApp>| { let e = h.state().auto.elements.iter().find(|e| e.id.starts_with("panel.float.") && e.id.ends_with(".close")).expect("the floating window's ×"); diff --git a/crates/ui-egui/tests/it/ui_panels.rs b/crates/ui-egui/tests/it/ui_panels.rs index 2c2d650e9..5646f221b 100644 --- a/crates/ui-egui/tests/it/ui_panels.rs +++ b/crates/ui-egui/tests/it/ui_panels.rs @@ -18,7 +18,7 @@ fn harness() -> Harness<'static, EffectcraftApp> { let mut s = Session::default(); s.execute("comp.new", json!({"name": "Panels", "width": 320, "height": 180, "duration": 4})).unwrap(); s.execute("layer.newSolid", json!({"name": "Plate", "color": "#406080"})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); h } @@ -169,7 +169,7 @@ fn saved_workspaces_persist_across_sessions() { let store = std::sync::Arc::new(MemoryConfig::default()); let launch = || { let s = Session { config: Some(store.clone()), ..Default::default() }; - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(2); h }; @@ -338,7 +338,7 @@ fn ui_scale_setting_sizes_the_interface() { assert_eq!(ctx.zoom_factor(), 0.9); // A saved scale applies from the first frame. let s = Session { prefs: effectcraft_engine::prefs::Prefs::from_json(&h.state().session.prefs.to_json()), ..Default::default() }; - let mut h2 = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h2 = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h2.run_steps(3); assert_eq!(h2.ctx.zoom_factor(), 0.9); } @@ -359,7 +359,7 @@ fn settings_buttons_stay_in_view_at_200_percent() { s.prefs.disk.disk_cache_enabled = false; s.prefs.set("appearance.uiScale", json!(200)).unwrap(); s.save_prefs(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); assert_eq!(scale(&h), (200, 2.0)); let rect = |h: &Harness<'_, EffectcraftApp>, id: &str| { @@ -423,7 +423,7 @@ fn panels_snapshot() { s.execute("file.openDemoProject", json!({})).unwrap(); let solid = s.project.items.values().find(|i| matches!(i.kind, effectcraft_engine::project::ItemKind::Solid(_))).map(|i| i.id.0); let mut app = Some(EffectcraftApp::new(s)); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| app.take().expect("app")); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app.take().expect("app")); h.run_steps(3); let ctx = h.ctx.clone(); effectcraft_ui_egui::menus::invoke(h.state_mut(), &ctx, "window.workspace", json!({"name": "All Panels"})).unwrap(); diff --git a/crates/ui-egui/tests/it/ui_parameter_spacing.rs b/crates/ui-egui/tests/it/ui_parameter_spacing.rs index 167029f7c..21fe4d442 100644 --- a/crates/ui-egui/tests/it/ui_parameter_spacing.rs +++ b/crates/ui-egui/tests/it/ui_parameter_spacing.rs @@ -33,7 +33,7 @@ fn click(h: &mut Harness<'_, EffectcraftApp>, id: &str) { #[test] fn fixed_compact_rows_preserve_checkbox_and_point_hit_targets() { let (a, lid, checkbox, point) = setup(); - let mut h = Harness::builder().with_size(vec2(1500.0, 1000.0)).build_eframe(|_| a); + let mut h = Harness::builder().with_size(vec2(1500.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| a); h.run_steps(4); let fx = h.state().auto.find(&format!("effectControls.row.{checkbox}")).unwrap().rect; let tl = h.state().auto.find(&format!("timeline.prop.{checkbox}.row")).unwrap().rect; @@ -66,7 +66,7 @@ fn nested_groups_keep_indentation_value_alignment_and_effect_gaps_at_fixed_compa a.show_panel(PanelKind::EffectControls); a.ui.fx_closed.extend(closed); a.ui.timeline.search = "Temperature".into(); - let mut h = Harness::builder().with_size(vec2(1500.0, 1800.0)).build_eframe(|_| a); + let mut h = Harness::builder().with_size(vec2(1500.0, 1800.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| a); h.run_steps(4); let rect = |h: &Harness<'_, EffectcraftApp>, id: String| h.state().auto.find(&id).unwrap_or_else(|| panic!("no {id}")).rect; let name_x = |kind: &str, uid| rect(&h, format!("effectControls.{kind}.{uid}.name"))[0]; diff --git a/crates/ui-egui/tests/it/ui_presets_folder.rs b/crates/ui-egui/tests/it/ui_presets_folder.rs index 1bcd9189c..842812974 100644 --- a/crates/ui-egui/tests/it/ui_presets_folder.rs +++ b/crates/ui-egui/tests/it/ui_presets_folder.rs @@ -39,7 +39,7 @@ fn presets_menu_copies_the_configured_folder_without_editing_the_project() { let expected = expected_folder(); for language in ["en", "ja"] { // The `ja` run draws Japanese menu text, which needs an installed CJK face. - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).allow_missing_glyphs().build_eframe(|_| { + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).allow_missing_glyphs().with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| { let mut app = EffectcraftApp::new(Session::default()); app.session.prefs.general.language = language.into(); app.ui.start_screen = false; @@ -67,6 +67,7 @@ fn presets_menu_copies_the_configured_folder_without_editing_the_project() { fn presets_folder_control_command_returns_the_path_or_a_configuration_error() { let mut app = EffectcraftApp::new(Session::default()); let ctx = egui::Context::default(); + effectcraft_ui_egui::framework::install_headless(&ctx); let expected = expected_folder(); let mut reply = None; let mut output = ctx.run_ui(Default::default(), |ui| { @@ -122,7 +123,7 @@ fn shared_preset_rows_search_apply_and_undo_the_selected_definition() { session.prefs.general.language = "en".into(); session.execute("comp.new", json!({"width": 64, "height": 36, "duration": 2})).unwrap(); session.execute("layer.newText", json!({"text": "Cache"})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_step_dt(1.0 / 60.0).build_eframe(|_| { + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_step_dt(1.0 / 60.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| { let mut app = EffectcraftApp::new(session); app.ui.start_screen = false; app.show_panel(PanelKind::EffectsPresets); diff --git a/crates/ui-egui/tests/it/ui_preview_align.rs b/crates/ui-egui/tests/it/ui_preview_align.rs index a41723d61..7588c56bf 100644 --- a/crates/ui-egui/tests/it/ui_preview_align.rs +++ b/crates/ui-egui/tests/it/ui_preview_align.rs @@ -16,7 +16,7 @@ fn harness() -> Harness<'static, EffectcraftApp> { s.execute("comp.new", json!({"name": "Preview", "width": 320, "height": 180, "frameRate": 24, "duration": 10})).unwrap(); s.execute("layer.newSolid", json!({"name": "A", "color": "#406080", "width": 40, "height": 30})).unwrap(); s.execute("layer.newSolid", json!({"name": "B", "color": "#806040", "width": 60, "height": 20})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); h } diff --git a/crates/ui-egui/tests/it/ui_project_delete.rs b/crates/ui-egui/tests/it/ui_project_delete.rs index 2a395cf4b..ef66bd866 100644 --- a/crates/ui-egui/tests/it/ui_project_delete.rs +++ b/crates/ui-egui/tests/it/ui_project_delete.rs @@ -24,7 +24,7 @@ fn harness() -> (Harness<'static, EffectcraftApp>, Vec, LayerId) { ); let folder = ItemId(s.execute("project.newFolder", json!({"name": "Folder"})).unwrap()["item"].as_u64().unwrap()); let keep = LayerId(s.execute("layer.newNull", json!({"name": "Keep this layer"})).unwrap()["layer"].as_u64().unwrap()); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); let folders: Vec = h.state().session.project.items.values().filter(|i| i.is_folder()).map(|i| i.id.0).collect(); h.state_mut().ui.project_open_folders.extend(folders); h.run_steps(3); diff --git a/crates/ui-egui/tests/it/ui_project_duplicate.rs b/crates/ui-egui/tests/it/ui_project_duplicate.rs index 2037c278b..a83fa0cb7 100644 --- a/crates/ui-egui/tests/it/ui_project_duplicate.rs +++ b/crates/ui-egui/tests/it/ui_project_duplicate.rs @@ -20,7 +20,7 @@ fn harness() -> (Harness<'static, EffectcraftApp>, ItemId, ItemId, ItemId) { let other = comp("Other"); let folder = ItemId(s.execute("project.newFolder", json!({"name": "Bin"})).unwrap()["item"].as_u64().unwrap()); s.execute("project.select", json!({"items": []})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); (h, main, other, folder) } diff --git a/crates/ui-egui/tests/it/ui_project_keyboard.rs b/crates/ui-egui/tests/it/ui_project_keyboard.rs index af2a796fe..5fff9657f 100644 --- a/crates/ui-egui/tests/it/ui_project_keyboard.rs +++ b/crates/ui-egui/tests/it/ui_project_keyboard.rs @@ -23,7 +23,7 @@ fn harness() -> (Harness<'static, EffectcraftApp>, ItemId, ItemId, ItemId) { s.execute("project.move", json!({"items": [comp.0], "folder": folder.0})).unwrap(); s.execute("project.move", json!({"items": [solid.0], "folder": null})).unwrap(); s.execute("project.select", json!({"items": []})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); (h, folder, comp, solid) } diff --git a/crates/ui-egui/tests/it/ui_project_new_folder.rs b/crates/ui-egui/tests/it/ui_project_new_folder.rs index b86bf663d..c19e56858 100644 --- a/crates/ui-egui/tests/it/ui_project_new_folder.rs +++ b/crates/ui-egui/tests/it/ui_project_new_folder.rs @@ -20,7 +20,7 @@ fn harness(comps: usize) -> (Harness<'static, EffectcraftApp>, ItemId) { } let folder = ItemId(s.execute("project.newFolder", json!({"name": "Bin"})).unwrap()["item"].as_u64().unwrap()); s.execute("project.select", json!({"items": []})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.state_mut().ui.project_open_folders.insert(folder.0); h.run_steps(3); (h, folder) diff --git a/crates/ui-egui/tests/it/ui_project_rows.rs b/crates/ui-egui/tests/it/ui_project_rows.rs index b8638bbd1..58b2dc979 100644 --- a/crates/ui-egui/tests/it/ui_project_rows.rs +++ b/crates/ui-egui/tests/it/ui_project_rows.rs @@ -20,7 +20,7 @@ fn harness() -> (Harness<'static, EffectcraftApp>, ItemId, ItemId, ItemId) { s.execute("project.move", json!({"items": [comp.0], "folder": folder.0})).unwrap(); s.execute("project.move", json!({"items": [solid.0], "folder": null})).unwrap(); s.execute("project.select", json!({"items": []})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); (h, folder, comp, solid) } @@ -234,7 +234,7 @@ fn dragging_in_the_empty_area_box_selects_items() { #[test] fn a_short_project_panel_draws() { for height in [400.0, 300.0] { - let mut h = Harness::builder().with_size(egui::vec2(640.0, height)).build_eframe(|_| EffectcraftApp::new(Session::default())); + let mut h = Harness::builder().with_size(egui::vec2(640.0, height)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(Session::default())); h.run_steps(3); assert!(h.state().auto.find("project.empty").is_some(), "the Project panel drew at {height} points"); } diff --git a/crates/ui-egui/tests/it/ui_quick_offset.rs b/crates/ui-egui/tests/it/ui_quick_offset.rs index 0587e85f3..db975f7ab 100644 --- a/crates/ui-egui/tests/it/ui_quick_offset.rs +++ b/crates/ui-egui/tests/it/ui_quick_offset.rs @@ -27,7 +27,7 @@ fn harness() -> (Harness<'static, EffectcraftApp>, Vec) { ids.push(id); } s.execute("layer.select", json!({"layers": ids})).unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); let ctx = h.ctx.clone(); effectcraft_ui_egui::menus::invoke(h.state_mut(), &ctx, "timeline.reveal.opacity", json!({})).unwrap(); @@ -210,7 +210,7 @@ fn a_quick_offset_released_off_screen_ends() { (0..40).map(|i| s.execute("layer.newSolid", json!({"name": format!("L{i}"), "color": "#e04020"})).unwrap()["layer"].as_u64().unwrap()).collect(); let (top, next) = (ids[39], ids[38]); s.execute("layer.select", json!({"layers": [top, next]})).unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); let from = center(&h, &format!("timeline.layer.{top}.bar")); h.input_mut().events.push(Event::PointerMoved(from)); diff --git a/crates/ui-egui/tests/it/ui_ram_preview.rs b/crates/ui-egui/tests/it/ui_ram_preview.rs index 8b3748a3f..5cfe808b7 100644 --- a/crates/ui-egui/tests/it/ui_ram_preview.rs +++ b/crates/ui-egui/tests/it/ui_ram_preview.rs @@ -30,7 +30,7 @@ fn an_edit_in_another_comp_keeps_the_cached_frames_and_undo_finds_them_again() { let b = s.execute("comp.new", json!({"name": "B", "width": 64, "height": 36, "duration": 1})).unwrap()["comp"].as_u64().unwrap(); let a = s.execute("comp.new", json!({"name": "A", "width": 64, "height": 36, "duration": 1})).unwrap()["comp"].as_u64().unwrap(); s.execute("layer.newSolid", json!({"color": "#3080ff"})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); settle(&mut h); assert!(shown_cached(&h, a), "A's frame rendered"); // Edit B (open it, add a layer), then come back to A: its frame is still in RAM. @@ -59,7 +59,7 @@ fn the_timeline_shows_the_cached_frames_in_green() { let mut s = Session::default(); s.execute("comp.new", json!({"name": "Cache", "width": 64, "height": 36, "duration": 2})).unwrap(); s.execute("layer.newSolid", json!({"color": "#3080ff"})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); settle(&mut h); h.run_steps(2); let green = h.state().tokens.cache_green; @@ -91,7 +91,7 @@ fn prefetch_waits_while_edits_keep_coming() { let c = s.execute("comp.new", json!({"name": "Drag", "width": 64, "height": 36, "duration": 2})).unwrap()["comp"].as_u64().unwrap(); let solid = s.execute("layer.newSolid", json!({"color": "#3080ff", "width": 16, "height": 16})).unwrap()["layer"].as_u64().unwrap(); // Short steps between edits; the app clock below is advanced explicitly. - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(0.05).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(0.05).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); // Prefetch waits for EDIT_QUIET on the app clock; a manual clock makes the pause // deterministic instead of depending on how long the test host took to run the steps. h.state_mut().use_manual_clock(); @@ -145,7 +145,7 @@ fn cached_frames_are_counted_at_one_third_resolution() { if let Some(comp) = std::sync::Arc::make_mut(&mut s.project).comp_mut(ItemId(c)) { comp.resolution = res; } - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); settle(&mut h); let series = h.state().shown_series(ItemId(c)); assert_eq!(series.scale, (res.scale(1.0, 1.0) * 1000.0).round() as u32, "{res:?}"); diff --git a/crates/ui-egui/tests/it/ui_render_queue.rs b/crates/ui-egui/tests/it/ui_render_queue.rs index 562b7a1c4..3e29c7cc8 100644 --- a/crates/ui-egui/tests/it/ui_render_queue.rs +++ b/crates/ui-egui/tests/it/ui_render_queue.rs @@ -29,7 +29,7 @@ fn render_settings_template_applies_from_a_menu_moved_to_fit_the_window() { let id = s.project.render_queue[0].id; assert_eq!(s.project.render_queue[0].settings.name, "Best Settings"); let mut app = Some(EffectcraftApp::new(s)); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| app.take().expect("app")); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app.take().expect("app")); // Twirl the item open, as clicking its twirl does. h.ctx.data_mut(|d| d.insert_temp(egui::Id::unique("rq-ui"), (vec![id], None::))); h.state_mut().show_panel(PanelKind::RenderQueue); @@ -79,7 +79,7 @@ fn clicking_the_output_file_name_opens_the_save_dialog() { Some(answer.clone()) })); let mut app = Some(app); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| app.take().expect("app")); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app.take().expect("app")); h.ctx.data_mut(|d| d.insert_temp(egui::Id::unique("rq-ui"), (vec![id], None::))); h.state_mut().show_panel(PanelKind::RenderQueue); h.run_steps(4); diff --git a/crates/ui-egui/tests/it/ui_render_queue_keyboard.rs b/crates/ui-egui/tests/it/ui_render_queue_keyboard.rs index 31c3ba823..7faeb515b 100644 --- a/crates/ui-egui/tests/it/ui_render_queue_keyboard.rs +++ b/crates/ui-egui/tests/it/ui_render_queue_keyboard.rs @@ -19,7 +19,7 @@ fn harness() -> Harness<'static, EffectcraftApp> { let comp = s.execute("comp.new", json!({"name": name, "width": 320, "height": 180, "duration": 4})).unwrap()["comp"].as_u64().unwrap(); s.execute("renderQueue.add", json!({"comp": comp})).unwrap(); } - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.state_mut().show_panel(PanelKind::RenderQueue); h.run_steps(4); h diff --git a/crates/ui-egui/tests/it/ui_roto_objects.rs b/crates/ui-egui/tests/it/ui_roto_objects.rs index cbf52d07d..53a10e83f 100644 --- a/crates/ui-egui/tests/it/ui_roto_objects.rs +++ b/crates/ui-egui/tests/it/ui_roto_objects.rs @@ -74,7 +74,7 @@ fn the_boundary_view_outlines_each_object_and_show_object_picks_one() { // object 0 keeps the boundary colour (pink by default), object 1 is the first palette colour (blue-green) let (pink, cyan) = ([255, 64, 191], [60, 200, 255]); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); h.run_steps(3); h.state_mut().session.execute("layer.select", json!({"layers": [id]})).unwrap(); let ctx = h.ctx.clone(); diff --git a/crates/ui-egui/tests/it/ui_roto_span_confidence.rs b/crates/ui-egui/tests/it/ui_roto_span_confidence.rs index d9730b778..14437f1c0 100644 --- a/crates/ui-egui/tests/it/ui_roto_span_confidence.rs +++ b/crates/ui-egui/tests/it/ui_roto_span_confidence.rs @@ -75,7 +75,7 @@ fn the_span_bar_shows_the_trackers_confidence() { // the model stays loaded while the panel draws (its id is part of the cache keys) s.execute("roto.propagate", json!({"layer": id, "direction": "both", "wait": true})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); h.run_steps(3); h.state_mut().session.execute("layer.select", json!({"layers": [id]})).unwrap(); let ctx = h.ctx.clone(); diff --git a/crates/ui-egui/tests/it/ui_script_console.rs b/crates/ui-egui/tests/it/ui_script_console.rs index 9430bc7a2..4367027dd 100644 --- a/crates/ui-egui/tests/it/ui_script_console.rs +++ b/crates/ui-egui/tests/it/ui_script_console.rs @@ -19,7 +19,7 @@ fn click(h: &mut Harness<'_, EffectcraftApp>, id: &str) { #[test] fn script_console_runs_scripts() { let s = effectcraft_host::session(); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.state_mut().show_panel(PanelKind::ScriptConsole); h.run_steps(3); for id in ["scriptConsole.input", "scriptConsole.output", "scriptConsole.run", "scriptConsole.clear"] { @@ -50,7 +50,7 @@ fn script_console_runs_scripts() { #[ignore] fn script_console_snapshot() { let s = effectcraft_host::session(); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.state_mut().show_panel(PanelKind::ScriptConsole); h.run_steps(2); for code in ["var c = app.project.items.addComp('Console', 320, 180, 1, 2, 24); writeLn('made ' + c.name); c.id", "c.layers.addText('Hi').name", "nope()"] { diff --git a/crates/ui-egui/tests/it/ui_script_console_keyboard.rs b/crates/ui-egui/tests/it/ui_script_console_keyboard.rs index 8072238ea..b83953181 100644 --- a/crates/ui-egui/tests/it/ui_script_console_keyboard.rs +++ b/crates/ui-egui/tests/it/ui_script_console_keyboard.rs @@ -16,7 +16,7 @@ const INPUT: &str = "Script… (⌘/Ctrl+Enter runs)"; fn harness() -> Harness<'static, EffectcraftApp> { let mut s = Session::default(); s.execute("comp.new", json!({"name": "Main", "width": 320, "height": 180, "duration": 4})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.state_mut().show_panel(PanelKind::ScriptConsole); h.state_mut().ui.maximized = Some(PanelKind::ScriptConsole); h.run_steps(4); diff --git a/crates/ui-egui/tests/it/ui_script_render.rs b/crates/ui-egui/tests/it/ui_script_render.rs index b3c24733c..9c2b78071 100644 --- a/crates/ui-egui/tests/it/ui_script_render.rs +++ b/crates/ui-egui/tests/it/ui_script_render.rs @@ -40,7 +40,7 @@ fn harness() -> (Harness<'static, EffectcraftApp>, Arc, std::sync::mpsc::S let path = std::env::temp_dir().join(format!("ec-ui-script-render-{}.mp4", std::process::id())); s.execute("renderQueue.add", json!({"output": path.to_string_lossy()})).unwrap(); let (tx, rx) = std::sync::mpsc::channel(); - let h = Harness::builder().with_size(egui::vec2(1000.0, 700.0)).build_eframe(|_| EffectcraftApp::new(s).with_control(rx)); + let h = Harness::builder().with_size(egui::vec2(1000.0, 700.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s).with_control(rx)); (h, gate, tx) } diff --git a/crates/ui-egui/tests/it/ui_scriptui.rs b/crates/ui-egui/tests/it/ui_scriptui.rs index 6c46e71cf..ea5282a9d 100644 --- a/crates/ui-egui/tests/it/ui_scriptui.rs +++ b/crates/ui-egui/tests/it/ui_scriptui.rs @@ -13,7 +13,7 @@ use serde_json::json; fn harness() -> Harness<'static, EffectcraftApp> { let mut s = effectcraft_host::session(); s.execute("comp.new", json!({"name": "Main", "width": 320, "height": 180, "duration": 4})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); h } @@ -103,7 +103,7 @@ fn panels_open_at_quit_dock_again_at_launch() { let mut s = effectcraft_host::session(); s.config = Some(store.clone()); s.execute("window.restoreScriptPanels", json!({})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); let panel = h.state().session.script_ui.windows.iter().find(|w| w.script == "Hello Panel.jsx").expect("the panel's window").id; assert!(h.state().ui.dock.is_docked(PanelKind::ScriptPanel(panel)), "the panel docks"); @@ -123,7 +123,7 @@ fn a_key_given_to_a_script_runs_it() { let store = std::sync::Arc::new(MemoryConfig::default()); let mut s = effectcraft_host::session(); s.config = Some(store.clone()); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); assert!(h.state().session.shortcuts().find(r#"file.runScript {"name":"Rename Layers.jsx"}"#).is_some(), "the shortcut table is built"); store.write("Scripts/Add Comp.jsx", "app.project.items.addComp('From Key', 64, 64, 1, 1, 25);").unwrap(); @@ -219,7 +219,7 @@ fn on_draw_concave_fills_and_images_render() { let png = png.to_string_lossy().replace('\\', "/"); let mut s = effectcraft_host::session(); s.execute("comp.new", json!({"name": "Main", "width": 320, "height": 180, "duration": 4})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_pixels_per_point(1.0).wgpu().build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_pixels_per_point(1.0).wgpu().with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); let code = format!( r#" @@ -388,7 +388,7 @@ fn scheduled_import_reveals_its_composition_without_manual_clicks() { let mut s = effectcraft_host::session(); let result = s.execute("script.run", json!({"code": "var w=new Window('palette','Automatic import');var b=w.add('button',undefined,'Open');b.onClick=function(){app.scheduleTask(\"var c=app.project.items.addComp('Imported',64,64,1,1,25);c.openInViewer();\",0,false);};w.show();"})).unwrap(); assert_eq!(result["ok"], true, "{result}"); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.state_mut().ui.start_screen = true; h.run_steps(2); h.state_mut().session.execute("scriptui.click", json!({"window":"Automatic import","widget":"Open"})).unwrap(); @@ -542,7 +542,7 @@ fn a_docked_panel_button_opens_the_file_dialog() { store.write("Scripts/ScriptUI Panels/Subtitles Panel.jsx", panel).unwrap(); let mut s = effectcraft_host::session(); s.config = Some(store.clone()); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); let asked: Arc>>> = Arc::default(); let log = asked.clone(); diff --git a/crates/ui-egui/tests/it/ui_scrolling.rs b/crates/ui-egui/tests/it/ui_scrolling.rs index 738878d82..bec6fc244 100644 --- a/crates/ui-egui/tests/it/ui_scrolling.rs +++ b/crates/ui-egui/tests/it/ui_scrolling.rs @@ -17,7 +17,7 @@ use super::ui_tail::drag; fn harness(w: f32, h: f32) -> Harness<'static, EffectcraftApp> { let mut s = Session::default(); s.execute("file.openDemoProject", json!({})).unwrap(); - let mut h = Harness::builder().with_size(vec2(w, h)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(vec2(w, h)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); h } @@ -539,7 +539,7 @@ fn settings_page_column_fits_japanese_names() { eprintln!("required Japanese input {expected:?}: {:?}", face.info); } - let mut h = Harness::builder().with_size(vec2(1400.0, 900.0)).build_eframe(|_| app); + let mut h = Harness::builder().with_size(vec2(1400.0, 900.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.run_steps(3); let ctx = h.ctx.clone(); effectcraft_ui_egui::menus::invoke(h.state_mut(), &ctx, "app.settings", json!({"page": "scripting"})).unwrap(); diff --git a/crates/ui-egui/tests/it/ui_self_drop.rs b/crates/ui-egui/tests/it/ui_self_drop.rs index f8a44de83..2148d4312 100644 --- a/crates/ui-egui/tests/it/ui_self_drop.rs +++ b/crates/ui-egui/tests/it/ui_self_drop.rs @@ -14,7 +14,7 @@ fn harness() -> (Harness<'static, EffectcraftApp>, u64, u64) { let clip = s.execute("comp.new", json!({"name": "Clip", "width": 160, "height": 90, "frameRate": 30, "duration": 1})).unwrap()["comp"].as_u64().unwrap(); let main = s.execute("comp.new", json!({"name": "Main", "width": 320, "height": 180, "frameRate": 30, "duration": 4})).unwrap()["comp"].as_u64().unwrap(); s.execute("layer.newSolid", json!({"name": "Bottom", "color": "#406080"})).unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); (h, main, clip) } diff --git a/crates/ui-egui/tests/it/ui_settings_info.rs b/crates/ui-egui/tests/it/ui_settings_info.rs index 955a709b4..fd6718002 100644 --- a/crates/ui-egui/tests/it/ui_settings_info.rs +++ b/crates/ui-egui/tests/it/ui_settings_info.rs @@ -37,7 +37,7 @@ fn check_info_transaction(via_escape: bool) { session.save_prefs(); session.execute("comp.new", json!({"width":32,"height":32,"duration":2})).unwrap(); let original_brightness = session.prefs.appearance.brightness; - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(session)); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(session)); h.run_steps(4); let ctx = h.ctx.clone(); menus::invoke(h.state_mut(), &ctx, "app.settings", json!({"page":"appearance"})).unwrap(); @@ -125,7 +125,7 @@ fn gpu_information_names_the_adapter_and_why_the_gpu_is_off() { window_adapter: Some("NVIDIA GeForce RTX 4070 (Dx12, DiscreteGpu)".into()), ..Default::default() }; - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(session)); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(session)); h.run_steps(4); let ctx = h.ctx.clone(); menus::invoke(h.state_mut(), &ctx, "app.gpuInfo", json!({})).unwrap(); @@ -140,7 +140,7 @@ fn gpu_information_dialog_stays_in_place() { let mut session = Session::default(); session.prefs.appearance.ui_scale = 125; session.execute("comp.new", json!({"width":32,"height":32,"duration":2})).unwrap(); - let mut h = Harness::builder().with_size(vec2(1280.0, 720.0)).build_eframe(|_| EffectcraftApp::new(session)); + let mut h = Harness::builder().with_size(vec2(1280.0, 720.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(session)); h.run_steps(4); let ctx = h.ctx.clone(); menus::invoke(h.state_mut(), &ctx, "app.settings", json!({"page":"previews"})).unwrap(); @@ -161,7 +161,7 @@ fn gpu_information_dialog_stays_in_place() { fn gpu_information_enter_presses_ok() { let mut session = Session::default(); session.execute("comp.new", json!({"width":32,"height":32,"duration":2})).unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(session)); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(session)); h.run_steps(4); let enter = |h: &mut Harness<'_, EffectcraftApp>| { for pressed in [true, false] { diff --git a/crates/ui-egui/tests/it/ui_settings_keyboard.rs b/crates/ui-egui/tests/it/ui_settings_keyboard.rs index e74ccfd94..041dcdf7b 100644 --- a/crates/ui-egui/tests/it/ui_settings_keyboard.rs +++ b/crates/ui-egui/tests/it/ui_settings_keyboard.rs @@ -11,7 +11,7 @@ use egui_kittest::kittest::{NodeT, Queryable}; use serde_json::json; fn harness(page: &str) -> Harness<'static, EffectcraftApp> { - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(Session::default())); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(Session::default())); h.run_steps(3); let ctx = h.ctx.clone(); effectcraft_ui_egui::menus::invoke(h.state_mut(), &ctx, "app.settings", json!({"page": page})).unwrap(); diff --git a/crates/ui-egui/tests/it/ui_shortcut_scopes.rs b/crates/ui-egui/tests/it/ui_shortcut_scopes.rs index 6c79fe72a..17904322a 100644 --- a/crates/ui-egui/tests/it/ui_shortcut_scopes.rs +++ b/crates/ui-egui/tests/it/ui_shortcut_scopes.rs @@ -20,6 +20,7 @@ fn app() -> EffectcraftApp { /// Press `key` with `modifiers` and run the shortcut dispatcher on it. fn press(app: &mut EffectcraftApp, key: Key, modifiers: Modifiers) { let ctx = egui::Context::default(); + effectcraft_ui_egui::framework::install_headless(&ctx); let raw = egui::RawInput { events: vec![egui::Event::Key { key, physical_key: None, pressed: true, repeat: false, modifiers }], ..Default::default() }; let mut output = ctx.run_ui(raw, |ui| effectcraft_ui_egui::menus::handle_shortcuts(app, ui.ctx())); output.textures_delta.clear(); diff --git a/crates/ui-egui/tests/it/ui_tabs.rs b/crates/ui-egui/tests/it/ui_tabs.rs index cc9e56041..fe40ca05f 100644 --- a/crates/ui-egui/tests/it/ui_tabs.rs +++ b/crates/ui-egui/tests/it/ui_tabs.rs @@ -20,7 +20,7 @@ fn harness() -> (Harness<'static, EffectcraftApp>, u64, u64) { s.execute("layer.addItem", json!({"item": pre})).unwrap(); s.state.open_comps = vec![ItemId(main)]; s.state.active_comp = Some(ItemId(main)); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); (h, pre, main) } @@ -440,7 +440,7 @@ fn open_comps_are_tabs_in_the_timeline_row_and_the_rest_are_in_its_overflow_menu .collect(); s.state.open_comps = vec![ItemId(comps[0])]; s.state.active_comp = Some(ItemId(comps[0])); - let mut h = Harness::builder().with_size(egui::vec2(1000.0, 800.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1000.0, 800.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); let alone = rect(&h, "panel.tab.RenderQueue"); h.state_mut().session.state.open_comps = comps.iter().map(|c| ItemId(*c)).collect(); diff --git a/crates/ui-egui/tests/it/ui_tail.rs b/crates/ui-egui/tests/it/ui_tail.rs index 293ba87ae..e4684cf45 100644 --- a/crates/ui-egui/tests/it/ui_tail.rs +++ b/crates/ui-egui/tests/it/ui_tail.rs @@ -15,7 +15,7 @@ fn harness_at(size: egui::Vec2) -> Harness<'static, EffectcraftApp> { let mut s = Session::default(); s.execute("comp.new", json!({"name": "Tail", "width": 640, "height": 360, "duration": 4})).unwrap(); s.execute("layer.newSolid", json!({"name": "Plate", "color": "#406080", "width": 640, "height": 360})).unwrap(); - let mut h = Harness::builder().with_size(size).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(size).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); h } diff --git a/crates/ui-egui/tests/it/ui_text_edit.rs b/crates/ui-egui/tests/it/ui_text_edit.rs index 24a43522f..5b52c723d 100644 --- a/crates/ui-egui/tests/it/ui_text_edit.rs +++ b/crates/ui-egui/tests/it/ui_text_edit.rs @@ -19,7 +19,7 @@ fn app() -> EffectcraftApp { /// A headless window at the size and frame step the viewer tests here are written for. fn harness(a: EffectcraftApp) -> Harness<'static, EffectcraftApp> { - Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_step_dt(1.0 / 60.0).build_eframe(move |cc| { + Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_step_dt(1.0 / 60.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |cc| { EffectcraftApp::install_ime_reset_hooks(&cc.egui_ctx); a }) @@ -82,7 +82,7 @@ fn type_tool_skips_hidden_and_unsoloed_text_layers() { let (target, value) = if switch == "video" { (ids[1], false) } else { (ids[0], true) }; s.execute("layer.setSwitch", json!({"layers": [target], "switch": switch, "value": value})).unwrap(); s.execute("edit.deselectAll", json!({})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); h.state_mut().ui.tool = effectcraft_ui_egui::state::Tool::Type; h.run_steps(3); let comp = rect(&h, "viewer.comp"); @@ -94,7 +94,7 @@ fn type_tool_skips_hidden_and_unsoloed_text_layers() { #[test] fn modal_blocks_background_text_events() { - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| app()); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app()); h.run_steps(3); h.state_mut().ui.tool = effectcraft_ui_egui::state::Tool::Type; h.run_steps(1); @@ -870,7 +870,7 @@ fn a_chord_bound_to_both_forwarded_commands_resolves_in_list_order() { fn ime_producer_follows_the_committed_text_and_cause() { // A Latin accent is multi-byte in UTF-8 (the byte offsets below) and Inter draws it, so the // harness keeps its strict missing-glyph check; no CJK fallback face is needed headlessly. - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_step_dt(1.0 / 60.0).build_eframe(|_| app()); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_step_dt(1.0 / 60.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app()); h.state_mut().show_panel(PanelKind::Composition); h.run_steps(3); h.state_mut().ui.tool = effectcraft_ui_egui::state::Tool::Type; @@ -908,7 +908,7 @@ fn click_away_clears_the_canvas_ime_descriptor_in_the_final_pass() { s.execute("comp.new", json!({"name": "Type", "width": 640, "height": 360, "duration": 2})).unwrap(); let solid = s.execute("layer.newSolid", json!({"name": "Plate", "color": "#406080"})).unwrap()["layer"].as_u64().unwrap(); let title = s.execute("layer.newText", json!({"text": "Title", "size": 80, "position": [100, 120], "justify": "left"})).unwrap()["layer"].as_u64().unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_step_dt(1.0 / 60.0).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_step_dt(1.0 / 60.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); h.state_mut().show_panel(PanelKind::Composition); h.run_steps(3); h.state_mut().session.execute("text.edit", json!({"layer": title, "caret": 5})).unwrap(); @@ -930,7 +930,7 @@ fn switching_text_targets_interrupts_and_rejects_a_delayed_commit() { let second = s.execute("layer.newText", json!({"text": "B", "size": 80, "position": [80, 240], "justify": "left"})).unwrap()["layer"].as_u64().unwrap(); // The delayed commit carries a multi-byte accent Inter draws: no broad missing-glyph // allowance, and the stale-composition path is still exercised with real IME events. - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_step_dt(1.0 / 60.0).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_step_dt(1.0 / 60.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); h.state_mut().show_panel(PanelKind::Composition); h.run_steps(3); h.state_mut().session.execute("text.edit", json!({"layer": first, "caret": 1})).unwrap(); @@ -962,7 +962,7 @@ fn a_delayed_preedit_after_a_target_switch_cannot_rearm_the_stale_guard() { s.execute("comp.new", json!({"name": "Type", "width": 640, "height": 360, "duration": 2})).unwrap(); let first = s.execute("layer.newText", json!({"text": "A", "size": 80, "position": [80, 120], "justify": "left"})).unwrap()["layer"].as_u64().unwrap(); let second = s.execute("layer.newText", json!({"text": "B", "size": 80, "position": [80, 240], "justify": "left"})).unwrap()["layer"].as_u64().unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_step_dt(1.0 / 60.0).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_step_dt(1.0 / 60.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); h.state_mut().show_panel(PanelKind::Composition); h.run_steps(3); h.state_mut().session.execute("text.edit", json!({"layer": first, "caret": 1})).unwrap(); @@ -988,7 +988,7 @@ fn late_preedit_and_commit_split_across_idle_frames_cannot_retarget() { s.execute("comp.new", json!({"name": "Type", "width": 640, "height": 360, "duration": 2})).unwrap(); let first = s.execute("layer.newText", json!({"text": "A", "size": 80, "position": [80, 120], "justify": "left"})).unwrap()["layer"].as_u64().unwrap(); let second = s.execute("layer.newText", json!({"text": "B", "size": 80, "position": [80, 240], "justify": "left"})).unwrap()["layer"].as_u64().unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_step_dt(1.0 / 60.0).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_step_dt(1.0 / 60.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); h.state_mut().show_panel(PanelKind::Composition); h.run_steps(3); h.state_mut().session.execute("text.edit", json!({"layer": first, "caret": 1})).unwrap(); @@ -1026,7 +1026,7 @@ fn late_preedit_and_delete_split_across_idle_frames_cannot_retarget() { s.execute("comp.new", json!({"name": "Type", "width": 640, "height": 360, "duration": 2})).unwrap(); let first = s.execute("layer.newText", json!({"text": "A", "size": 80, "position": [80, 120], "justify": "left"})).unwrap()["layer"].as_u64().unwrap(); let second = s.execute("layer.newText", json!({"text": "B", "size": 80, "position": [80, 240], "justify": "left"})).unwrap()["layer"].as_u64().unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_step_dt(1.0 / 60.0).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_step_dt(1.0 / 60.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); h.state_mut().show_panel(PanelKind::Composition); h.run_steps(3); h.state_mut().session.execute("text.edit", json!({"layer": first, "caret": 1})).unwrap(); @@ -1061,7 +1061,7 @@ fn empty_preedit_keeps_the_old_target_until_the_pending_commit_arrives() { s.execute("comp.new", json!({"name": "Type", "width": 640, "height": 360, "duration": 2})).unwrap(); let first = s.execute("layer.newText", json!({"text": "A", "size": 80, "position": [80, 120], "justify": "left"})).unwrap()["layer"].as_u64().unwrap(); let second = s.execute("layer.newText", json!({"text": "B", "size": 80, "position": [80, 240], "justify": "left"})).unwrap()["layer"].as_u64().unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_step_dt(1.0 / 60.0).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_step_dt(1.0 / 60.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); h.state_mut().show_panel(PanelKind::Composition); h.run_steps(3); h.state_mut().session.execute("text.edit", json!({"layer": first, "caret": 1})).unwrap(); @@ -1090,7 +1090,7 @@ fn a_matching_fence_after_old_terminals_admits_the_next_preedit_in_the_same_batc s.execute("comp.new", json!({"name": "Type", "width": 640, "height": 360, "duration": 2})).unwrap(); let first = s.execute("layer.newText", json!({"text": "A", "size": 80, "position": [80, 120], "justify": "left"})).unwrap()["layer"].as_u64().unwrap(); let second = s.execute("layer.newText", json!({"text": "B", "size": 80, "position": [80, 240], "justify": "left"})).unwrap()["layer"].as_u64().unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_step_dt(1.0 / 60.0).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_step_dt(1.0 / 60.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); h.state_mut().show_panel(PanelKind::Composition); h.run_steps(3); h.state_mut().session.execute("text.edit", json!({"layer": first, "caret": 1})).unwrap(); @@ -1121,7 +1121,7 @@ fn delete_surrounding_bytes_through_the_app_replaces_the_emoji() { let mut s = Session::default(); s.execute("comp.new", json!({"name": "Type", "width": 640, "height": 360, "duration": 2})).unwrap(); let lid = s.execute("layer.newText", json!({"text": "café😀", "size": 80, "position": [80, 120], "justify": "left"})).unwrap()["layer"].as_u64().unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_step_dt(1.0 / 60.0).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_step_dt(1.0 / 60.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); h.state_mut().show_panel(PanelKind::Composition); h.run_steps(3); h.state_mut().session.execute("text.edit", json!({"layer": lid, "caret": 5})).unwrap(); @@ -1140,7 +1140,7 @@ fn ime_interruption_editor() -> (Harness<'static, EffectcraftApp>, Pos2) { let mut s = Session::default(); s.execute("comp.new", json!({"name": "Type", "width": 640, "height": 360, "duration": 2})).unwrap(); let lid = s.execute("layer.newText", json!({"text": "abcd", "size": 80, "position": [80, 120], "justify": "left"})).unwrap()["layer"].as_u64().unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_step_dt(1.0 / 60.0).build_eframe(move |cc| { + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_step_dt(1.0 / 60.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |cc| { EffectcraftApp::install_ime_reset_hooks(&cc.egui_ctx); EffectcraftApp::new(s) }); diff --git a/crates/ui-egui/tests/it/ui_text_range_handles.rs b/crates/ui-egui/tests/it/ui_text_range_handles.rs index 7ce301b37..a4458278a 100644 --- a/crates/ui-egui/tests/it/ui_text_range_handles.rs +++ b/crates/ui-egui/tests/it/ui_text_range_handles.rs @@ -42,7 +42,7 @@ fn setup() -> (Session, Ids) { } fn harness(s: Session) -> Harness<'static, EffectcraftApp> { - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(4); h } diff --git a/crates/ui-egui/tests/it/ui_theme_favorites.rs b/crates/ui-egui/tests/it/ui_theme_favorites.rs index 424b28c49..811a970d5 100644 --- a/crates/ui-egui/tests/it/ui_theme_favorites.rs +++ b/crates/ui-egui/tests/it/ui_theme_favorites.rs @@ -37,7 +37,7 @@ fn star_controls_save_and_favorite_menu_selects_the_family() { let store = Arc::new(MemoryConfig::default()); let mut session = Session { config: Some(store.clone()), ..Default::default() }; session.execute("comp.new", json!({"width":32,"height":32,"duration":2})).unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(session)); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(session)); h.run_steps(4); let ctx = h.ctx.clone(); menus::invoke(h.state_mut(), &ctx, "app.settings", json!({"page":"appearance"})).unwrap(); diff --git a/crates/ui-egui/tests/it/ui_time_zoom_controls.rs b/crates/ui-egui/tests/it/ui_time_zoom_controls.rs index c1ea26b2b..7173c332e 100644 --- a/crates/ui-egui/tests/it/ui_time_zoom_controls.rs +++ b/crates/ui-egui/tests/it/ui_time_zoom_controls.rs @@ -24,7 +24,7 @@ fn harness(graph: bool) -> Harness<'static, EffectcraftApp> { let mut app = EffectcraftApp::new(s); // (Opening a comp may zoom; start from the whole comp.) app.ui.timeline.pps = None; - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| app); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.run_steps(3); h.state_mut().session.execute("time.set", json!({"time": 4.0})).unwrap(); h.state_mut().ui.timeline.pps = None; diff --git a/crates/ui-egui/tests/it/ui_timeline_audio_levels.rs b/crates/ui-egui/tests/it/ui_timeline_audio_levels.rs index bc0b9a7f9..b6129bd34 100644 --- a/crates/ui-egui/tests/it/ui_timeline_audio_levels.rs +++ b/crates/ui-egui/tests/it/ui_timeline_audio_levels.rs @@ -72,7 +72,7 @@ fn linked_audio_levels_move_both_channels_by_the_same_db() { let mut s = Session::default(); comps(&mut s); let (l, uid) = add_sound_layer(&mut s, [-6.0, -12.0]); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); reveal(&mut h, l, uid); let levels = |h: &Harness<'_, EffectcraftApp>| h.state().session.active_comp().unwrap().layer(LayerId(l)).unwrap().props.prop("audio/levels").unwrap().clone(); @@ -135,7 +135,7 @@ fn linked_typing_keeps_each_selected_layers_own_balance() { let (a, uid) = add_sound_layer(&mut s, [-6.0, -12.0]); let (b, other) = add_sound_layer(&mut s, [-20.0, -30.0]); s.execute("layer.select", json!({"layers": [a, b]})).unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); reveal(&mut h, a, uid); reveal(&mut h, b, other); click(&mut h, &format!("timeline.prop.{uid}.link")); @@ -150,7 +150,7 @@ fn a_new_project_starts_with_its_audio_levels_unlinked() { let mut s = Session::default(); comps(&mut s); let (l, uid) = add_sound_layer(&mut s, [0.0, 0.0]); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); reveal(&mut h, l, uid); click(&mut h, &format!("timeline.prop.{uid}.link")); assert!(h.state().ui.timeline.is_linked(uid, false)); diff --git a/crates/ui-egui/tests/it/ui_timeline_effect_label.rs b/crates/ui-egui/tests/it/ui_timeline_effect_label.rs index deeee9e5d..a65e49b8c 100644 --- a/crates/ui-egui/tests/it/ui_timeline_effect_label.rs +++ b/crates/ui-egui/tests/it/ui_timeline_effect_label.rs @@ -20,7 +20,7 @@ fn harness() -> (Harness<'static, EffectcraftApp>, u64, u64) { app.ui.timeline.open_layers.insert(layer); let effects = app.session.active_comp().and_then(|c| c.layer(LayerId(layer))).and_then(|l| l.props.sub("effects")).map(|g| g.uid); app.ui.timeline.open_groups.extend(effects); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| app); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.run_steps(4); (h, layer, fx) } diff --git a/crates/ui-egui/tests/it/ui_timeline_group_select.rs b/crates/ui-egui/tests/it/ui_timeline_group_select.rs index 0a553976b..cdcb64d1e 100644 --- a/crates/ui-egui/tests/it/ui_timeline_group_select.rs +++ b/crates/ui-egui/tests/it/ui_timeline_group_select.rs @@ -30,7 +30,7 @@ fn harness() -> (Harness<'static, EffectcraftApp>, u64, [u64; 3]) { all(&l.props, &mut open); } app.ui.timeline.open_groups.extend(open); - let mut h = Harness::builder().with_size(vec2(1600.0, 1100.0)).build_eframe(|_| app); + let mut h = Harness::builder().with_size(vec2(1600.0, 1100.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.run_steps(4); (h, layer, pins) } diff --git a/crates/ui-egui/tests/it/ui_timeline_interacting.rs b/crates/ui-egui/tests/it/ui_timeline_interacting.rs index 5cf11ad0e..34daef19e 100644 --- a/crates/ui-egui/tests/it/ui_timeline_interacting.rs +++ b/crates/ui-egui/tests/it/ui_timeline_interacting.rs @@ -32,7 +32,7 @@ fn fixture(mode: &str) -> Fixture { let opacity = comp.layers.iter().find(|l| l.id.0 == solid).unwrap().props.prop("transform/opacity").unwrap().uid; s.execute("layer.select", json!({"layers": [solid]})).unwrap(); s.execute("view.fastPreviewMode", json!({"mode": mode})).unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); let ctx = h.ctx.clone(); effectcraft_ui_egui::menus::invoke(h.state_mut(), &ctx, "timeline.reveal.opacity", json!({})).unwrap(); diff --git a/crates/ui-egui/tests/it/ui_timeline_marquee.rs b/crates/ui-egui/tests/it/ui_timeline_marquee.rs index 9d72f08aa..6a7069f5b 100644 --- a/crates/ui-egui/tests/it/ui_timeline_marquee.rs +++ b/crates/ui-egui/tests/it/ui_timeline_marquee.rs @@ -21,7 +21,7 @@ fn harness_for(duration: f64) -> (Harness<'static, EffectcraftApp>, u64) { s.execute("prop.addKey", json!({"layer": id, "path": "transform/opacity", "time": t, "value": v})).unwrap(); } s.execute("layer.select", json!({"layers": [id]})).unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); let ctx = h.ctx.clone(); effectcraft_ui_egui::menus::invoke(h.state_mut(), &ctx, "timeline.reveal.opacity", json!({})).unwrap(); @@ -93,7 +93,7 @@ fn a_box_dragged_across_the_outline_and_the_graph_selects_rows_and_keys() { ids.push(id); } s.execute("layer.select", json!({"layers": ids})).unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); let ctx = h.ctx.clone(); effectcraft_ui_egui::menus::invoke(h.state_mut(), &ctx, "timeline.reveal.opacity", json!({})).unwrap(); @@ -138,7 +138,7 @@ fn rows_harness() -> (Harness<'static, EffectcraftApp>, Vec) { ids.push(id); } s.execute("layer.select", json!({"layers": ids})).unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); let ctx = h.ctx.clone(); effectcraft_ui_egui::menus::invoke(h.state_mut(), &ctx, "timeline.reveal.opacity", json!({})).unwrap(); diff --git a/crates/ui-egui/tests/it/ui_timeline_pan.rs b/crates/ui-egui/tests/it/ui_timeline_pan.rs index 56bbd8a45..88cf0d636 100644 --- a/crates/ui-egui/tests/it/ui_timeline_pan.rs +++ b/crates/ui-egui/tests/it/ui_timeline_pan.rs @@ -18,7 +18,7 @@ fn harness() -> (Harness<'static, EffectcraftApp>, u64) { } s.execute("layer.select", json!({"layers": []})).unwrap(); let app = EffectcraftApp::new(s); - let mut h = Harness::builder().with_size(vec2(1200.0, 800.0)).build_eframe(|_| app); + let mut h = Harness::builder().with_size(vec2(1200.0, 800.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.run_steps(4); (h, top) } diff --git a/crates/ui-egui/tests/it/ui_timeline_shapes.rs b/crates/ui-egui/tests/it/ui_timeline_shapes.rs index 6a7f50a10..05a814d87 100644 --- a/crates/ui-egui/tests/it/ui_timeline_shapes.rs +++ b/crates/ui-egui/tests/it/ui_timeline_shapes.rs @@ -13,7 +13,7 @@ use egui_kittest::kittest::Queryable; use serde_json::json; fn harness(s: Session) -> Harness<'static, EffectcraftApp> { - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); h } diff --git a/crates/ui-egui/tests/it/ui_timeline_switches.rs b/crates/ui-egui/tests/it/ui_timeline_switches.rs index ea0798d93..1b0877666 100644 --- a/crates/ui-egui/tests/it/ui_timeline_switches.rs +++ b/crates/ui-egui/tests/it/ui_timeline_switches.rs @@ -22,7 +22,7 @@ fn harness() -> (Harness<'static, EffectcraftApp>, Vec) { .collect(); ids.reverse(); s.execute("edit.deselectAll", json!({})).unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); (h, ids) } @@ -219,7 +219,7 @@ fn the_bar_past_the_source_end_is_striped() { s.execute("comp.new", json!({"name": "Inner", "width": 64, "height": 64, "frameRate": 30, "duration": 2})).unwrap(); s.execute("comp.new", json!({"name": "Outer", "width": 64, "height": 64, "frameRate": 30, "duration": 4})).unwrap(); let l = s.execute("layer.addItem", json!({"item": "Inner"})).unwrap()["layer"].as_u64().unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); let past = format!("timeline.layer.{l}.bar.afterSource"); assert!(h.state().auto.find(&past).is_none(), "the source fills the whole bar"); diff --git a/crates/ui-egui/tests/it/ui_timeline_trim.rs b/crates/ui-egui/tests/it/ui_timeline_trim.rs index 9aaf1f500..b5f3dcff4 100644 --- a/crates/ui-egui/tests/it/ui_timeline_trim.rs +++ b/crates/ui-egui/tests/it/ui_timeline_trim.rs @@ -20,7 +20,7 @@ fn harness() -> (Harness<'static, EffectcraftApp>, u64, u64) { s.execute("layer.timing", json!({"layers": [pre], "in": 3.0, "out": 7.0})).unwrap(); s.execute("layer.select", json!({"layers": []})).unwrap(); let app = EffectcraftApp::new(s); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| app); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.run_steps(4); (h, solid, pre) } diff --git a/crates/ui-egui/tests/it/ui_timeline_zoom.rs b/crates/ui-egui/tests/it/ui_timeline_zoom.rs index 76f55740a..56c9c7f9f 100644 --- a/crates/ui-egui/tests/it/ui_timeline_zoom.rs +++ b/crates/ui-egui/tests/it/ui_timeline_zoom.rs @@ -16,7 +16,7 @@ fn harness() -> (Harness<'static, EffectcraftApp>, u64) { let layer = s.execute("layer.newSolid", json!({"name": "Plate", "color": "#406080"})).unwrap()["layer"].as_u64().unwrap(); let mut app = EffectcraftApp::new(s); app.ui.timeline.pps = Some(200.0); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| app); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.run_steps(3); (h, layer) } @@ -273,7 +273,7 @@ fn shift_dragging_the_work_area_snaps_to_the_current_time() { s.execute("layer.newSolid", json!({"name": "Plate", "color": "#406080"})).unwrap(); let mut app = EffectcraftApp::new(s); app.ui.timeline.pps = Some(100.0); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| app); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); let reset = |h: &mut Harness<'_, EffectcraftApp>| { h.state_mut().session.execute("comp.workArea", json!({"start": 1.0, "end": 4.0})).unwrap(); h.state_mut().session.execute("time.set", json!({"time": 6.0})).unwrap(); diff --git a/crates/ui-egui/tests/it/ui_toolbar_gradient.rs b/crates/ui-egui/tests/it/ui_toolbar_gradient.rs index b5682ffae..047fdb863 100644 --- a/crates/ui-egui/tests/it/ui_toolbar_gradient.rs +++ b/crates/ui-egui/tests/it/ui_toolbar_gradient.rs @@ -38,7 +38,7 @@ fn setup(items: &[&str], tool: serde_json::Value, select: bool) -> (Harness<'sta } s.state.selected_layers = if select { vec![LayerId(l)] } else { vec![] }; s.state.selected_props.clear(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); // With no shape layer selected, Fill / Stroke show while a shape tool is active. if !select { h.state_mut().ui.tool = Tool::Rectangle; diff --git a/crates/ui-egui/tests/it/ui_tracker.rs b/crates/ui-egui/tests/it/ui_tracker.rs index b4e4bf051..2aab9d3e8 100644 --- a/crates/ui-egui/tests/it/ui_tracker.rs +++ b/crates/ui-egui/tests/it/ui_tracker.rs @@ -27,7 +27,7 @@ fn rect(h: &Harness<'_, EffectcraftApp>, id: &str) -> egui::Rect { #[test] fn tracker_panel_and_track_point_widgets() { - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| app()); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app()); h.state_mut().show_panel(PanelKind::Tracker); h.run_steps(3); let all = ids(&h); @@ -140,7 +140,7 @@ fn zoomed_out_track_point_can_be_grabbed() { s.execute("layer.newSolid", json!({"name": "Plate", "color": "#406080"})).unwrap(); s.execute("layer.select", json!({"layers": ["Plate"]})).unwrap(); s.execute("track.motion", json!({})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); h.state_mut().show_panel(PanelKind::Composition); h.run_steps(3); h.state_mut().ui.viewer.zoom = Some(mag); diff --git a/crates/ui-egui/tests/it/ui_unreadable_footage.rs b/crates/ui-egui/tests/it/ui_unreadable_footage.rs index 4d283d62d..fd99cdd25 100644 --- a/crates/ui-egui/tests/it/ui_unreadable_footage.rs +++ b/crates/ui-egui/tests/it/ui_unreadable_footage.rs @@ -50,7 +50,7 @@ fn harness(broken: fn(&Footage) -> bool, proxy: Option) -> (Harness<'st fn open(mut s: Session) -> Harness<'static, EffectcraftApp> { s.execute("project.select", json!({"items": []})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(4); h } diff --git a/crates/ui-egui/tests/it/ui_video_preview_off.rs b/crates/ui-egui/tests/it/ui_video_preview_off.rs index 37a35f856..257885ab6 100644 --- a/crates/ui-egui/tests/it/ui_video_preview_off.rs +++ b/crates/ui-egui/tests/it/ui_video_preview_off.rs @@ -19,7 +19,7 @@ fn an_audio_only_preview_says_video_preview_is_off() { s.execute("comp.new", json!({"name": "Muted", "width": 320, "height": 180, "duration": 10})).unwrap(); let sc = s.prefs.preview.current; s.prefs.preview.get_mut(sc).include_video = false; - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(1.0 / 30.0).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(1.0 / 30.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(4); let chip = |h: &Harness<'_, EffectcraftApp>| h.ctx.data(|d| d.get_temp::(egui::Id::unique("viewer-video-off-chip"))); assert!(chip(&h).is_none()); diff --git a/crates/ui-egui/tests/it/ui_view_layout.rs b/crates/ui-egui/tests/it/ui_view_layout.rs index a6af5c688..05222dd9f 100644 --- a/crates/ui-egui/tests/it/ui_view_layout.rs +++ b/crates/ui-egui/tests/it/ui_view_layout.rs @@ -11,7 +11,7 @@ fn harness(comp: Option<&str>) -> Harness<'static, EffectcraftApp> { if let Some(comp) = comp { s.execute("comp.open", json!({"comp": comp})).unwrap(); } - Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)) + Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)) } /// Click the centre of the automation element `id`. diff --git a/crates/ui-egui/tests/it/ui_viewer.rs b/crates/ui-egui/tests/it/ui_viewer.rs index 6dee87535..3a89c036d 100644 --- a/crates/ui-egui/tests/it/ui_viewer.rs +++ b/crates/ui-egui/tests/it/ui_viewer.rs @@ -23,7 +23,7 @@ fn app() -> EffectcraftApp { } fn harness() -> Harness<'static, EffectcraftApp> { - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| app()); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app()); h.run_steps(3); h } @@ -127,7 +127,7 @@ fn selection_harness() -> Harness<'static, EffectcraftApp> { s.execute("layer.newSolid", json!({"name": name, "color": "#406080", "width": 80, "height": 80})).unwrap(); } s.execute("edit.deselectAll", json!({})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); h.run_steps(3); h } @@ -285,7 +285,7 @@ fn viewer_double_click_opens_the_topmost_layer_over_a_selected_one() { s.execute("layer.addItem", json!({"item": "Inner"})).unwrap(); let back = s.active_comp().unwrap().layers[1].id; s.execute("layer.select", json!({"layers": [back.0]})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); h.run_steps(40); let at = screen(&h, [320.0, 180.0]); h.input_mut().events.push(Event::PointerMoved(at)); @@ -3008,7 +3008,7 @@ fn full_resolution_frames_wider_than_the_texture_limit_fit() { let mut s = Session::default(); s.execute("comp.new", json!({"name": "Wide", "width": 2400, "height": 400, "duration": 1})).unwrap(); s.execute("layer.newSolid", json!({"name": "Plate", "color": "#406080"})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); // (egui's font atlas needs 1024.) h.input_mut().max_texture_side = Some(1024); h.state_mut().session.execute("view.res.full", json!({})).unwrap(); @@ -3115,7 +3115,7 @@ fn frame_sits_on_the_physical_pixel_grid() { for ppp in [1.0f32, 1.25, 1.5] { let mut s = Session::default(); s.execute("comp.new", json!({"name": "Grid", "width": 301, "height": 201, "duration": 1})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_pixels_per_point(ppp).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_pixels_per_point(ppp).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); h.run_steps(3); for (mag, pan) in [(1.0f32, [0.3f32, 0.37]), (2.0, [-0.45, 0.2])] { h.state_mut().ui.viewer.zoom = Some(mag / ppp); @@ -3145,7 +3145,7 @@ fn fit_up_to_100_follows_the_maximized_panel() { h.run_steps(2); }; // A comp larger than the panel: it fills the docked panel, then the maximized one. - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| { + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| { let mut s = Session::default(); s.execute("comp.new", json!({"name": "Big", "width": 3840, "height": 2160, "duration": 4})).unwrap(); EffectcraftApp::new(s) @@ -3505,7 +3505,7 @@ fn null_eye_hides_it_in_the_viewer() { s.execute("comp.new", json!({"name": "Nulls", "width": 640, "height": 360, "duration": 4})).unwrap(); let n = s.execute("layer.newNull", json!({})).unwrap()["layer"].as_u64().unwrap(); s.execute("layer.select", json!({"layers": [n]})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); h.run_steps(3); let handle = format!("viewer.handle.{n}.0"); let eye = format!("timeline.layer.{n}.video"); @@ -3541,7 +3541,7 @@ fn unselected_null_keeps_its_outline() { s.execute("comp.new", json!({"name": "Nulls", "width": 640, "height": 360, "duration": 4})).unwrap(); let n = s.execute("layer.newNull", json!({})).unwrap()["layer"].as_u64().unwrap(); s.execute("layer.select", json!({"layers": [n]})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); h.run_steps(3); // Use the selected box's actual geometry, so transformed nulls use the same outline. let corners: Vec = (0..4).map(|i| rect(&h, &format!("viewer.handle.{n}.{i}")).center()).collect(); diff --git a/crates/ui-egui/tests/it/ui_viewer_trackpad.rs b/crates/ui-egui/tests/it/ui_viewer_trackpad.rs index 55466371a..a45e2643d 100644 --- a/crates/ui-egui/tests/it/ui_viewer_trackpad.rs +++ b/crates/ui-egui/tests/it/ui_viewer_trackpad.rs @@ -11,7 +11,7 @@ use serde_json::json; fn harness() -> Harness<'static, EffectcraftApp> { let mut s = Session::default(); s.execute("comp.new", json!({"name": "View", "width": 640, "height": 360, "duration": 4})).unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.state_mut().show_panel(PanelKind::Composition); h.run_steps(4); h diff --git a/crates/ui-egui/tests/it/ui_viewers.rs b/crates/ui-egui/tests/it/ui_viewers.rs index fc8857198..122f29a3d 100644 --- a/crates/ui-egui/tests/it/ui_viewers.rs +++ b/crates/ui-egui/tests/it/ui_viewers.rs @@ -65,7 +65,7 @@ fn new_viewers_lock_route_comps_and_activate_on_click() { let c = new_comp(&mut s, "C"); let b = new_comp(&mut s, "B"); let a = new_comp(&mut s, "A"); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); // View ▸ New Viewer: viewer 1 shows A too, viewer 0 (the Composition panel) is locked. invoke(&mut h, "view.newViewer", json!({})); @@ -127,7 +127,7 @@ fn a_locked_viewer_keeps_its_comp_when_the_project_panel_opens_another() { let mut s = Session::default(); let b = new_comp(&mut s, "B"); let a = new_comp(&mut s, "A"); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); // Viewer 0 locked to A, and B in viewer 1 (a tab next to it). invoke(&mut h, "view.newViewer", json!({})); @@ -150,7 +150,7 @@ fn viewers_snapshot() { let mut s = Session::default(); s.execute("file.openDemoProject", json!({})).unwrap(); let other = s.project.items.values().filter(|i| i.as_comp().is_some()).map(|i| i.id).find(|id| Some(*id) != s.active_comp_id()).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); invoke(&mut h, "view.newViewer", json!({})); h.state_mut() diff --git a/crates/ui-egui/tests/it/ui_visual_review.rs b/crates/ui-egui/tests/it/ui_visual_review.rs index 6d079f1f5..27f328b95 100644 --- a/crates/ui-egui/tests/it/ui_visual_review.rs +++ b/crates/ui-egui/tests/it/ui_visual_review.rs @@ -18,7 +18,7 @@ fn all_ui_review_captures() { s.execute("layer.newSolid", json!({"name":"Plate","color":"#406080","width":160,"height":120})).unwrap(); s.execute("renderQueue.add", json!({"format":"png","output":"review-[#####].png"})).unwrap(); std::sync::Arc::make_mut(&mut s.project).settings.gpu_acceleration = false; - let mut h = Harness::builder().with_size(size).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(size).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(4); h.render_serialized().unwrap().save(out.join(format!("{label}-workspace.png"))).unwrap(); let ctx = h.ctx.clone(); diff --git a/crates/ui-egui/tests/it/ui_web_gpu_storage.rs b/crates/ui-egui/tests/it/ui_web_gpu_storage.rs index 694d98507..228d26a6c 100644 --- a/crates/ui-egui/tests/it/ui_web_gpu_storage.rs +++ b/crates/ui-egui/tests/it/ui_web_gpu_storage.rs @@ -231,7 +231,7 @@ fn settings_disk_page_shows_the_browser_storage_manager() { let mut s = Session::default(); let host = Arc::new(Storage::default()); s.storage = Some(host.clone()); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(2); effectcraft_ui_egui::panels::settings::open(h.state_mut(), "disk"); h.run_steps(3); @@ -252,7 +252,7 @@ fn settings_disk_page_shows_the_browser_storage_manager() { assert_eq!(*host.cleared.lock().unwrap(), vec!["diskCache".to_string()]); assert!(*host.persist_asked.lock().unwrap()); // Without a host (the desktop) the section is not there. - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(Session::default())); + let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(Session::default())); h.run_steps(2); effectcraft_ui_egui::panels::settings::open(h.state_mut(), "disk"); h.run_steps(3); diff --git a/crates/ui-egui/tests/it/ui_web_offload.rs b/crates/ui-egui/tests/it/ui_web_offload.rs index fde177cb6..a3456a355 100644 --- a/crates/ui-egui/tests/it/ui_web_offload.rs +++ b/crates/ui-egui/tests/it/ui_web_offload.rs @@ -193,7 +193,7 @@ fn waiting_commands_reply_when_their_offloaded_job_ends() { s.execute("layer.newSolid", json!({"color": "#406080"})).unwrap(); s.execute("renderQueue.add", json!({"format": "gif", "output": "/w.gif"})).unwrap(); let (tx, rx) = std::sync::mpsc::channel(); - let mut h = Harness::builder().with_size(egui::vec2(1280.0, 800.0)).build_eframe(|_| EffectcraftApp::new(s).with_control(rx)); + let mut h = Harness::builder().with_size(egui::vec2(1280.0, 800.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s).with_control(rx)); h.run_steps(2); // `renderQueue.render` waits by default: the job goes to the worker, the reply waits. let (req, reply) = ControlRequest::new("engine.execute", json!({"command": "renderQueue.render", "params": {}})); diff --git a/crates/ui-egui/tests/it/ui_window_title.rs b/crates/ui-egui/tests/it/ui_window_title.rs index 66ef62235..66b0991b2 100644 --- a/crates/ui-egui/tests/it/ui_window_title.rs +++ b/crates/ui-egui/tests/it/ui_window_title.rs @@ -9,7 +9,7 @@ use serde_json::json; #[test] fn the_reported_title_follows_the_open_document() { - let mut h = Harness::builder().with_size(vec2(800.0, 600.0)).build_eframe(|_| EffectcraftApp::new(Session::default())); + let mut h = Harness::builder().with_size(vec2(800.0, 600.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(Session::default())); h.run_steps(3); let clean = h.state().window_title().to_owned(); assert!(clean.starts_with("EffectCraft - ") && !clean.ends_with(" *"), "{clean}"); diff --git a/crates/ui-egui/tests/it/ui_workflow_selection.rs b/crates/ui-egui/tests/it/ui_workflow_selection.rs index e7bcedb60..46fda276a 100644 --- a/crates/ui-egui/tests/it/ui_workflow_selection.rs +++ b/crates/ui-egui/tests/it/ui_workflow_selection.rs @@ -14,7 +14,7 @@ fn harness() -> Harness<'static, EffectcraftApp> { s.execute("layer.newSolid", json!({"name":format!("Tile {n}"),"width":80,"height":80,"color":"#406080"})).unwrap(); } s.execute("edit.deselectAll", json!({})).unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); h } @@ -389,7 +389,7 @@ fn project_edit_commands_do_not_target_timeline_layers() { #[test] fn compact_settings_keeps_confirmation_buttons_clickable() { - let mut h = Harness::builder().with_size(vec2(1024.0, 768.0)).build_eframe(|_| EffectcraftApp::new(Session::default())); + let mut h = Harness::builder().with_size(vec2(1024.0, 768.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(Session::default())); h.state_mut().dialog = Some(effectcraft_ui_egui::Dialog::Settings); h.run_steps(4); h.get_by_label(" OK ").click(); @@ -607,7 +607,7 @@ fn timeline_context_menu_creates_shapes_and_masks_from_text() { s.execute("edit.deselectAll", json!({})).unwrap(); let text = s.active_comp().unwrap().layers.iter().find(|l| matches!(l.source, LayerSource::Text)).unwrap().id.0; let plate = s.active_comp().unwrap().layers.iter().find(|l| l.name == "Plate").unwrap().id.0; - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); let row = |h: &Harness<'_, EffectcraftApp>, id: u64| { let r = rect(h, &format!("timeline.layer.{id}.row")); @@ -663,7 +663,7 @@ fn layer_context_menus_offer_create_shapes_from_vector_layer_for_vector_footage( let logo = s.execute("layer.addItem", json!({"item": item})).unwrap()["layer"].as_u64().unwrap(); let plate = s.execute("layer.newSolid", json!({"name":"Plate","width":40,"height":40,"color":"#406080"})).unwrap()["layer"].as_u64().unwrap(); s.execute("edit.deselectAll", json!({})).unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); let right_click = |h: &mut Harness<'_, EffectcraftApp>, p: Pos2| { for pressed in [true, false] { diff --git a/crates/ui-egui/tests/it/ui_workspace_focus.rs b/crates/ui-egui/tests/it/ui_workspace_focus.rs index 338c8c2b7..62a5498b2 100644 --- a/crates/ui-egui/tests/it/ui_workspace_focus.rs +++ b/crates/ui-egui/tests/it/ui_workspace_focus.rs @@ -154,7 +154,7 @@ fn tab_and_shift_tab_traverse_toolbar_and_space_activates_only_focused_tool() { let mut app = EffectcraftApp::new(session); app.ui.start_screen = false; app.ui.show_menu_bar = false; - let mut h = Harness::builder().with_size(vec2(1400.0, 900.0)).build_eframe(move |_| app); + let mut h = Harness::builder().with_size(vec2(1400.0, 900.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| app); h.run_steps(3); for _ in 0..8 { key(&mut h, Key::Tab, Modifiers::NONE); @@ -202,7 +202,7 @@ fn tab_traversal_activates_an_inactive_dock_tab_without_editing_the_project() { { *size = SplitSize::FixedFirst(420.0); } - let mut h = Harness::builder().with_size(vec2(1200.0, 760.0)).build_eframe(move |_| app); + let mut h = Harness::builder().with_size(vec2(1200.0, 760.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| app); h.run_steps(3); assert!(h.state().auto.find("panel.tab.EffectControls").is_some(), "the inactive tab must be visible in this fixture"); let before = h.state().ui.dock.clone(); @@ -255,7 +255,7 @@ impl ControlDriver { let mut app = EffectcraftApp::new(Session::default()).with_control(rx); app.ui.start_screen = false; app.ui.show_menu_bar = false; - let mut driver = Self { h: Harness::builder().with_size(vec2(1200.0, 760.0)).build_eframe(move |_| app), tx }; + let mut driver = Self { h: Harness::builder().with_size(vec2(1200.0, 760.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| app), tx }; driver.frames(4, true); driver.ok("engine.execute", json!({"command":"comp.new", "params":{"name":"Native Validation", "width":160,"height":90,"duration":1}}), true); driver.ok("engine.execute", json!({"command":"layer.newSolid", "params":{"name":"Validation Red","color":"#ff0000"}}), true); @@ -352,6 +352,7 @@ fn unowned_tab_keeps_the_timeline_mini_flowchart_shortcut() { let mut app = EffectcraftApp::new(session); app.ui.focused = PanelKind::Timeline; let ctx = egui::Context::default(); + effectcraft_ui_egui::framework::install_headless(&ctx); let raw = egui::RawInput { events: vec![egui::Event::Key { key: Key::Tab, physical_key: None, pressed: true, repeat: false, modifiers: Modifiers::NONE }], ..Default::default() diff --git a/crates/ui-egui/tests/it/viewer_geometry.rs b/crates/ui-egui/tests/it/viewer_geometry.rs index 72ee46013..d6f8cd190 100644 --- a/crates/ui-egui/tests/it/viewer_geometry.rs +++ b/crates/ui-egui/tests/it/viewer_geometry.rs @@ -26,7 +26,10 @@ fn harness_at_scale(width: f32, kind: ThemeKind, scale: f32) -> Harness<'static, let mut h = Harness::builder() .with_size(vec2(width, 360.0)) .with_pixels_per_point(scale) - .with_context_setup(move |ctx| theme::install(ctx, &tokens, "en")) + .with_context_setup(move |ctx| { + effectcraft_ui_egui::framework::install_headless(ctx); + theme::install(ctx, &tokens, "en"); + }) .build_ui_state( |ui, app: &mut EffectcraftApp| { app.auto.begin_frame(); From 6ebf9b8e520ec8f59116cfaa7397e3f21ff433d3 Mon Sep 17 00:00:00 2001 From: aiongg Date: Tue, 24 Nov 2026 16:56:09 +0000 Subject: [PATCH 410/451] dock: built-in workspaces through next's model constructors --- crates/ui-egui/src/dock.rs | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/crates/ui-egui/src/dock.rs b/crates/ui-egui/src/dock.rs index b08d06349..3d4c70690 100644 --- a/crates/ui-egui/src/dock.rs +++ b/crates/ui-egui/src/dock.rs @@ -186,25 +186,34 @@ pub fn permissions(_panel: &PanelKind) -> Permissions { /// A tab group. pub fn tabs(p: &[PanelKind], active: usize) -> Node { - Node::Tabs { panels: p.to_vec(), active } + Node::tabs(p.to_vec(), active) } /// Stacked panels: (panel, open, height). Open entries share the stack's height in proportion to /// their heights; an entry without one counts as craft-ui's `DockStyle::min_pane` (40). pub fn stack(e: &[(PanelKind, bool, Option)]) -> Node { - Node::Stack { entries: e.iter().map(|&(panel, open, height)| StackEntry { panel, open, height }).collect() } + Node::stack( + e.iter() + .map(|&(panel, open, height)| { + let mut entry = StackEntry::new(panel); + entry.open = open; + entry.height = height; + entry + }) + .collect(), + ) } /// Two frames side by side. pub fn hsplit(size: SplitSize, a: Node, b: Node) -> Node { - Node::Split { axis: Axis::X, size, first: Box::new(a), second: Box::new(b) } + Node::split(Axis::X, size, a, b) } /// Two frames one above the other. pub fn vsplit(size: SplitSize, a: Node, b: Node) -> Node { - Node::Split { axis: Axis::Y, size, first: Box::new(a), second: Box::new(b) } + Node::split(Axis::Y, size, a, b) } /// A workspace of just `root`, with no floating windows. pub fn docked(root: Node) -> Workspace { - Workspace::new(Layout { root: Some(root), floating: Vec::new() }) + Workspace::new(Layout::new(Some(root), Vec::new())) } /// The built-in workspaces: After Effects 2026's (Window ▸ Workspace), less Libraries (an Adobe @@ -234,7 +243,9 @@ pub const WORKSPACES: &[&str] = &[ /// id, so a built-in layout built again is the same set of windows. fn workspace_floating(name: &str) -> Vec> { use PanelKind::*; - let f = |id: u64, panels: &[PanelKind], rect: [f32; 4]| Floating::single(panels.to_vec(), 0, rect).with_id(id); + let f = |id: u64, panels: &[PanelKind], [x, y, w, h]: [f32; 4]| { + Floating::single(id, panels.to_vec(), 0, Rect::from_min_size(pos2(x, y), vec2(w, h))) + }; match name { "Undocked Panels" => vec![ f(1, &[Project, EffectControls], [24.0, 110.0, 320.0, 420.0]), @@ -254,7 +265,7 @@ pub const PREVIEW_FRAME: f32 = TAB_STRIP + 46.0; /// The built-in layout of a named workspace (an unknown name gets Default's). pub fn workspace(name: &str) -> Layout { - Layout { root: Some(workspace_root(name)), floating: workspace_floating(name) } + Layout::new(Some(workspace_root(name)), workspace_floating(name)) } /// The docked tree of a named workspace. From 440a48bf5cea8fc7fd9ad3d53933b50184f50c6c Mon Sep 17 00:00:00 2001 From: aiongg Date: Tue, 24 Nov 2026 16:56:20 +0000 Subject: [PATCH 411/451] dock: workspace queries through next's accessors; floating windows are columns --- crates/ui-egui/src/dock.rs | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/crates/ui-egui/src/dock.rs b/crates/ui-egui/src/dock.rs index 3d4c70690..1a4e59783 100644 --- a/crates/ui-egui/src/dock.rs +++ b/crates/ui-egui/src/dock.rs @@ -464,25 +464,33 @@ fn node_group(node: &Node, p: PanelKind) -> Option> { impl WorkspaceExt for Workspace { fn is_docked(&self, p: PanelKind) -> bool { - self.layout.root.as_ref().is_some_and(|root| node_group(root, p).is_some()) + self.layout().root.as_ref().is_some_and(|root| node_group(root, p).is_some()) } fn is_floating(&self, p: PanelKind) -> bool { - self.layout.floating.iter().any(|w| w.contains(&p)) + self.layout().floating.iter().any(|w| w.contains(&p)) } fn is_open(&self, p: PanelKind) -> bool { - self.layout.contains(&p) + self.layout().contains(&p) } fn is_visible(&self, p: PanelKind) -> bool { - self.layout.panel_state(&p) == PanelState::Front + self.layout().panel_state(&p) == PanelState::Front } fn group_of(&self, p: PanelKind) -> Vec { - self.layout.root.iter().chain(self.layout.floating.iter().map(|w| &w.root)).find_map(|node| node_group(node, p)).unwrap_or_default() + let layout = self.layout(); + layout + .root + .as_ref() + .and_then(|root| node_group(root, p)) + .or_else(|| layout.floating.iter().flat_map(|w| w.groups()).find(|g| g.panels.contains(&p)).map(|g| g.panels.clone())) + .unwrap_or_default() } fn panels(&self) -> Vec { + let layout = self.layout(); let mut out = Vec::new(); - for node in self.layout.root.iter().chain(self.layout.floating.iter().map(|w| &w.root)) { - node_panels(node, &mut out); + if let Some(root) = &layout.root { + node_panels(root, &mut out); } + out.extend(layout.floating.iter().flat_map(|w| w.panels().copied())); out } } @@ -490,12 +498,7 @@ impl WorkspaceExt for Workspace { /// Every panel a workspace names: open, or closed with a recorded place. pub fn referenced_panels(workspace: &Workspace) -> Vec { let mut out = workspace.panels(); - out.extend(workspace.hidden.iter().map(|(p, _)| *p)); - if let Some(saved) = &workspace.saved { - for node in saved.root.iter().chain(saved.floating.iter().map(|w| &w.root)) { - node_panels(node, &mut out); - } - } + out.extend(workspace.hidden().iter().map(|(p, _)| *p)); out } From fa3b952882016f20cf0bd492e3989c2940904e2c Mon Sep 17 00:00:00 2001 From: aiongg Date: Tue, 24 Nov 2026 16:57:36 +0000 Subject: [PATCH 412/451] Cargo.lock: craft-host, craft-keymap, craft-theme and craft-window as direct dependencies of the UI crate --- Cargo.lock | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ed23309d2..544dbab0c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1794,7 +1794,6 @@ version = "0.1.0" source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" dependencies = [ "dispatch2", - "egui", "objc2 0.6.5", "objc2-app-kit 0.3.2", "wasm-bindgen", @@ -3105,10 +3104,13 @@ dependencies = [ "bytemuck", "chrono", "craft-behavior", + "craft-host", + "craft-keymap", "craft-mime", - "craft-quit", + "craft-theme", "craft-ui", "craft-update", + "craft-window", "effectcraft-color", "effectcraft-engine", "effectcraft-geom", From 6581b6f9378ef81b8c74eeaaa3d8bfc4e4e80bca Mon Sep 17 00:00:00 2001 From: nazar-gavrylyk Date: Tue, 24 Nov 2026 19:42:05 +0100 Subject: [PATCH 413/451] #805: Docs: align the video protocol with RFC-0031 D3 and fix reply rules --- docs/video-helper-protocol.md | 64 ++++++++++++++++++++++++++++------- 1 file changed, 52 insertions(+), 12 deletions(-) diff --git a/docs/video-helper-protocol.md b/docs/video-helper-protocol.md index df92305b5..14cf99163 100644 --- a/docs/video-helper-protocol.md +++ b/docs/video-helper-protocol.md @@ -3,7 +3,8 @@ **Status: proposed, not implemented.** This page specifies how EffectCraft will talk to a hardware video helper, as decided in [RFC-0031][rfc-0031] (hardware video in a helper process). Nothing here exists in the app yet. Phase 1 covers **encoding**; decoding is reserved for phase 2 -([decoding](#decoding-phase-2)). +([decoding](#decoding-phase-2)). Where this page is more specific than the RFC or differs from it, +[Differences from RFC-0031](#differences-from-rfc-0031) lists it. A **video helper** is an [external helper](external-helpers.md) that offers hardware video encoding instead of effects. It reuses that page's process model: the helper is a child process, @@ -55,9 +56,12 @@ helper answers with the usual fields plus a `video` object: Video does not use the effect protocol's float RGBA image refs (16 bytes a pixel, about 133 MB at 4K). A picture is **8-bit 4:2:0, three planes**, Y then U then V. The luma plane is `width × height`; each chroma plane is `width/2 × height/2`. Width and height are even and within the -device's `min_size` and `max_size`; other sizes are declined before the encoder opens. Planes are -tightly packed (`stride` = plane width) and sit one after the other in the slot. Colour is given as -[H.273](https://www.itu.int/rec/T-REC-H.273) code points. Only limited range is used at first. +device's `min_size` and `max_size`; other sizes are declined before the encoder opens. Every +`encode.frame` describes the three planes itself (see [Encoding](#encoding)). EffectCraft version 1 +always sends them tightly packed (`stride` = plane width), Y then U then V, one after the other in +the slot's `in` region; a later version can add padding without changing the message. Colour is +given once per job, in `encode.open`, as [H.273](https://www.itu.int/rec/T-REC-H.273) code points. +Only limited range is used at first. ## Encoding @@ -69,8 +73,8 @@ encode.open → encode.opened → (encode.frame → encode.packets)… → encod | Request | Reply | | |---|---|---| | `{"op":"encode.open","job":1,"device":"nvenc:0","codec":"h264","width":1920,"height":1080,"rate":[30,1],"bitrate_kbps":15000,"profile":"high","keyint":60,"colour":{"primaries":1,"transfer":1,"matrix":1,"range":"limited"},"slots":[{"in":{"offset":0,"len":3110400},"out":{"offset":3110400,"len":1048576}},…]}` | `{"op":"encode.opened","job":1,"codec_config":"","delay":2}` | `job` is chosen by EffectCraft and is never reused. `slots` is the memory the helper may use, decided by EffectCraft. `codec_config` is the `avcC` (H.264) or `hvcC` (HEVC) record for the MP4 sample entry. `delay` is the number of frames the encoder holds back (B-frames). | -| `{"op":"encode.frame","job":1,"frame":0,"slot":0}` | `{"op":"encode.packets","job":1,"frame":0,"packets":[{"offset":0,"len":41230,"pts":0,"dts":-2,"key":true}]}` | The picture is in `slots[0].in`. The reply means the slot may be reused and says where the packets are, inside `slots[0].out`. It may hold no packets (the encoder is still holding frames) or several. | -| `{"op":"encode.flush","job":1,"out":{"offset":…,"len":…}}` | `{"op":"encode.packets","job":1,"frame":null,"packets":[…]}` then `{"op":"encode.flushed","job":1}` | The rest of the stream, inside `out`. EffectCraft sizes `out` for the frames the encoder still holds: at least `(delay + 1)` times the length of a slot's `out` region. A packet that still does not fit is `packet_too_large`. | +| `{"op":"encode.frame","job":1,"frame":0,"slot":0,"planes":[{"offset":0,"stride":1920,"size":[1920,1080],"len":2073600},{"offset":2073600,"stride":960,"size":[960,540],"len":518400},{"offset":2592000,"stride":960,"size":[960,540],"len":518400}]}` | `{"op":"encode.packets","job":1,"frame":0,"packets":[{"offset":0,"len":41230,"pts":0,"dts":-2,"key":true}]}` | The picture is in `slots[0].in`. `planes` lists Y, U and V: `offset` is from the start of the file, `size` is in samples, `len` is `stride × height` bytes. EffectCraft sets them, and the helper reads only them. The reply means the slot may be reused and says where the packets are, inside `slots[0].out`. It may hold no packets (the encoder is still holding frames) or several. | +| `{"op":"encode.flush","job":1,"out":{"offset":…,"len":…}}` | `{"op":"encode.packets","job":1,"frame":null,"packets":[…]}` then `{"op":"encode.flushed","job":1}` | The rest of the stream, inside `out`. EffectCraft sizes `out` for the frames the encoder still holds: at least `(delay + 1)` times the length of a slot's `out` region. If the encoder's output still does not fit, the helper answers `error` with code `packet_too_large`. | | `{"op":"encode.close","job":1}` | none | Free everything for the job. EffectCraft sends it after `encode.flushed` or `cancelled`, and frees or reuses the job's regions only then. If the helper was stopped first, there is no reply to wait for: the exchange file is dropped and its regions are never reused (see [stopping](#timeouts-and-errors)). | | `{"op":"cancel","job":1}` | `{"op":"cancelled","job":1}` | Stop now. After it sends `cancel`, EffectCraft ignores every reply for the job except `cancelled`, so replies for frames still in flight are not protocol breaks. The helper stops using the job's regions before it replies `cancelled`, and `cancelled` ends every frame of the job that is still outstanding. | @@ -81,7 +85,8 @@ encode.open → encode.opened → (encode.frame → encode.packets)… → encod - **Packet offsets** are counted from the start of the region the reply uses (`slots[slot].out`, or the `out` region of `encode.flush`). In the example the packet starts at file offset 3110400 + 0. EffectCraft adds the region's offset and checks that `offset + len` is within the - region's length. + region's length. A packet outside the region is a protocol break (see the table below), not a + `packet_too_large` error. - **Timestamps** are in units of 1 / `rate[0]` seconds, so frame `i` has `pts = i × rate[1]`. `dts` may be earlier than `pts`. - **Who owns what.** EffectCraft decides every offset. The helper reads only the slot it is told @@ -91,11 +96,34 @@ encode.open → encode.opened → (encode.frame → encode.packets)… → encod - **Backpressure.** At most 8 frames, and at most 256 MiB, are queued plus in flight together. When the budget is used up EffectCraft waits for a reply before sending the next frame, so a slow GPU slows the export and does not use more memory. -- **Replies are in frame order,** `error` replies included. A reply with an unknown `job` or - `frame`, outside the regions, or larger than its `out` region (`packet_too_large`) is a protocol - break. +- **Replies are in frame order,** `error` replies included. - **Control lines** are at most 1 MiB. Pictures and packets never go through the pipe. +### Job and frame ids + +`job` is a positive whole number that EffectCraft takes from a counter that only goes up, so an id +is never reused, not even after the helper is restarted. `frame` counts from 0 inside a job and is +never reused in it. Every id EffectCraft has sent is **issued**. A job is **open** from +`encode.open` until EffectCraft sends `cancel` or `encode.close`; after that it is **ended**, and +it stays ended. An id EffectCraft has not sent is **never issued**. + +### What EffectCraft does with each reply + +A **protocol break** stops the helper and counts towards the 3 stops. A **job error** ends one job +and the helper carries on; it does not count. + +| Reply | EffectCraft | +|---|---| +| `encode.packets` or `error` for an open job, for the oldest outstanding frame, with every packet inside its region | Accepts it. | +| `encode.packets` or `error` for an open job with a `frame` that was never sent, already answered, or not the oldest outstanding; or `error` without `frame` when no `encode.open` or `encode.flush` is outstanding | Protocol break. | +| `encode.packets` with a packet whose `offset + len` is outside its region | Protocol break. | +| `error` with `packet_too_large`: the helper says the encoder's output does not fit the `out` region it was given, and it did not write past it | Job error. | +| `cancelled` for a job EffectCraft sent `cancel` for | Accepts it; the job's frames are over. | +| `cancelled` for an open job | Protocol break. | +| Any other reply for an **ended** job (late replies for frames that were in flight, a second `cancelled`) | Dropped and logged. The regions it names are not read. Not a break. | +| Any reply for a job that was **never issued** | Protocol break. | +| A line that does not parse, or is over 1 MiB | Protocol break. | + ## Timeouts and errors - **Per frame, not per export.** A frame is outstanding from `encode.frame` until its reply, until @@ -110,8 +138,9 @@ encode.open → encode.opened → (encode.frame → encode.packets)… → encod there when it answers an `encode.frame` (it ends that frame's timeout) and absent for `encode.open` and `encode.flush`. The helper process carries on, but the job is over: EffectCraft sends `cancel`, then `encode.close` once `cancelled` arrives. Frames sent before the - error are not answered. Codes: `unsupported` (the settings are declined), - `device_lost`, `out_of_memory`, `packet_too_large`, `encoder`. + error are not answered; a late reply for one is dropped. Codes: `unsupported` (the settings are declined), + `device_lost`, `out_of_memory`, `packet_too_large` (the encoder's output for a frame does not fit + the `out` region), `encoder`. All of them are job errors. - **EffectCraft stops the helper** when it exits, closes stdout, sends a line that does not parse or does not fit, breaks the rules above, or misses a timeout. After 3 stops it is turned off and listed in `helper_blocklist.txt` until the user retries in Settings, as for effect helpers. @@ -137,6 +166,17 @@ What EffectCraft does with a failure: A hardware export writes to a temporary file and replaces the destination only when it finishes, so a failed or cancelled export leaves any existing file as it was. +## Differences from RFC-0031 + +[D3](https://github.com/storytold/craft-contrib/blob/main/rfcs/0031-hardware-video-helper.md) +describes the frame format. This page follows it, with these differences and additions: + +- **Plane descriptors** are in every `encode.frame`, as D3 says. Colour information is not: it is + sent once per job, in `encode.open`, because it cannot change inside a job. +- **Replies for a cancelled or old job** are ignored, as D3 says, but only for ids EffectCraft has + issued. A reply for a job id it never issued is a protocol break. +- **Limits** D3 leaves open ("a few frames", "a cap on the bytes") are 8 frames and 256 MiB. + ## Decoding (phase 2) `decode.open`, `decode.sample` and the picture replies are reserved for phase 2 and will be From 7e9fc1e49e2a87cd33975ae34815072779608a8d Mon Sep 17 00:00:00 2001 From: nazar-gavrylyk Date: Tue, 24 Nov 2026 19:42:13 +0100 Subject: [PATCH 414/451] #805: Docs: rewrap a line in the video protocol --- docs/video-helper-protocol.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/video-helper-protocol.md b/docs/video-helper-protocol.md index 14cf99163..d8c657a2d 100644 --- a/docs/video-helper-protocol.md +++ b/docs/video-helper-protocol.md @@ -138,8 +138,8 @@ and the helper carries on; it does not count. there when it answers an `encode.frame` (it ends that frame's timeout) and absent for `encode.open` and `encode.flush`. The helper process carries on, but the job is over: EffectCraft sends `cancel`, then `encode.close` once `cancelled` arrives. Frames sent before the - error are not answered; a late reply for one is dropped. Codes: `unsupported` (the settings are declined), - `device_lost`, `out_of_memory`, `packet_too_large` (the encoder's output for a frame does not fit + error are not answered; a late reply for one is dropped. Codes: `unsupported` (the settings are + declined), `device_lost`, `out_of_memory`, `packet_too_large` (the encoder's output for a frame does not fit the `out` region), `encoder`. All of them are job errors. - **EffectCraft stops the helper** when it exits, closes stdout, sends a line that does not parse or does not fit, breaks the rules above, or misses a timeout. After 3 stops it is turned off and From cfc57d390ab8a51a7b298d17af3be10ad824a881 Mon Sep 17 00:00:00 2001 From: nazar-gavrylyk Date: Tue, 24 Nov 2026 19:42:23 +0100 Subject: [PATCH 415/451] #805: Docs: reflow the error bullet in the video protocol --- docs/video-helper-protocol.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/video-helper-protocol.md b/docs/video-helper-protocol.md index d8c657a2d..30e34ceda 100644 --- a/docs/video-helper-protocol.md +++ b/docs/video-helper-protocol.md @@ -136,10 +136,10 @@ and the helper carries on; it does not count. helper. - **`{"op":"error","job":1,"frame":3,"code":"…","message":"…"}`** answers one request. `frame` is there when it answers an `encode.frame` (it ends that frame's timeout) and absent for - `encode.open` and `encode.flush`. The helper process carries on, but the job is over: - EffectCraft sends `cancel`, then `encode.close` once `cancelled` arrives. Frames sent before the - error are not answered; a late reply for one is dropped. Codes: `unsupported` (the settings are - declined), `device_lost`, `out_of_memory`, `packet_too_large` (the encoder's output for a frame does not fit + `encode.open` and `encode.flush`. The helper process carries on, but the job is over: EffectCraft + sends `cancel`, then `encode.close` once `cancelled` arrives. Frames sent before the error are not + answered; a late reply for one is dropped. Codes: `unsupported` (the settings are declined), + `device_lost`, `out_of_memory`, `packet_too_large` (the encoder's output for a frame does not fit the `out` region), `encoder`. All of them are job errors. - **EffectCraft stops the helper** when it exits, closes stdout, sends a line that does not parse or does not fit, breaks the rules above, or misses a timeout. After 3 stops it is turned off and From 96af635ca504af014fc7ccbc19f7f07a07110e36 Mon Sep 17 00:00:00 2001 From: aiongg Date: Tue, 24 Nov 2026 18:59:23 +0000 Subject: [PATCH 416/451] Repin craft-libs to dock-gaps 9fd8b0cdaa --- Cargo.lock | 182 +++++++++++++++++++------------------- Cargo.toml | 72 +++++++-------- crates/effects/Cargo.toml | 2 +- 3 files changed, 128 insertions(+), 128 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 544dbab0c..3424e6e7e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1315,12 +1315,12 @@ dependencies = [ [[package]] name = "craft-aep" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" [[package]] name = "craft-appkit" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ "block2 0.6.2", "objc2-app-kit 0.3.2", @@ -1330,7 +1330,7 @@ dependencies = [ [[package]] name = "craft-atomic" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ "rustix 1.1.6", ] @@ -1351,10 +1351,10 @@ dependencies = [ [[package]] name = "craft-audio" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ - "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", - "craft-xml 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", + "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", + "craft-xml 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", "log", "thiserror 2.0.21", ] @@ -1362,7 +1362,7 @@ dependencies = [ [[package]] name = "craft-behavior" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ "accesskit", "bitflags 2.13.2", @@ -1385,7 +1385,7 @@ source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa3 [[package]] name = "craft-cloud-ui" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ "egui", ] @@ -1393,7 +1393,7 @@ dependencies = [ [[package]] name = "craft-cms" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ "md-5", "rayon", @@ -1402,7 +1402,7 @@ dependencies = [ [[package]] name = "craft-codepage" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" [[package]] name = "craft-color" @@ -1415,7 +1415,7 @@ dependencies = [ [[package]] name = "craft-color" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ "serde", ] @@ -1423,7 +1423,7 @@ dependencies = [ [[package]] name = "craft-doc" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ "craft-ecproj-format", "craft-pcraft-format", @@ -1437,7 +1437,7 @@ dependencies = [ [[package]] name = "craft-docpath" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ "serde", ] @@ -1453,7 +1453,7 @@ dependencies = [ [[package]] name = "craft-dpx" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ "thiserror 2.0.21", ] @@ -1461,7 +1461,7 @@ dependencies = [ [[package]] name = "craft-ecproj-format" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ "serde", "serde_json", @@ -1471,7 +1471,7 @@ dependencies = [ [[package]] name = "craft-eps" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" [[package]] name = "craft-exr" @@ -1485,7 +1485,7 @@ dependencies = [ [[package]] name = "craft-exr" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ "exr", "flate2", @@ -1497,7 +1497,7 @@ dependencies = [ [[package]] name = "craft-font-catalog" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ "harfrust 0.13.3", "kurbo", @@ -1511,7 +1511,7 @@ dependencies = [ [[package]] name = "craft-fonts-build" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" [[package]] name = "craft-frame" @@ -1527,10 +1527,10 @@ dependencies = [ [[package]] name = "craft-frame" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ - "craft-color 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", - "craft-time 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", + "craft-color 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", + "craft-time 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", "rayon", "serde", ] @@ -1538,7 +1538,7 @@ dependencies = [ [[package]] name = "craft-gif" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ "gif", "image", @@ -1555,7 +1555,7 @@ dependencies = [ [[package]] name = "craft-host" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ "bitflags 2.13.2", "craft-i18n", @@ -1568,7 +1568,7 @@ dependencies = [ [[package]] name = "craft-i18n" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ "chrono", "fixed_decimal", @@ -1604,7 +1604,7 @@ dependencies = [ [[package]] name = "craft-jsonrpc" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ "serde_json", ] @@ -1612,13 +1612,13 @@ dependencies = [ [[package]] name = "craft-keymap" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ "craft-host", "craft-i18n", "craft-tracked", "craft-ui-macros", - "craft-xml 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", + "craft-xml 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", "egui", "serde", "serde_json", @@ -1627,7 +1627,7 @@ dependencies = [ [[package]] name = "craft-lottie" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ "craft-zip", "serde_json", @@ -1646,7 +1646,7 @@ dependencies = [ [[package]] name = "craft-media" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ "chrono", "thiserror 2.0.21", @@ -1669,14 +1669,14 @@ dependencies = [ [[package]] name = "craft-media-source" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ - "craft-audio 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", - "craft-color 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", - "craft-frame 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", - "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", - "craft-time 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", - "craft-y4m 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", + "craft-audio 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", + "craft-color 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", + "craft-frame 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", + "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", + "craft-time 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", + "craft-y4m 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", "serde", "thiserror 2.0.21", ] @@ -1684,7 +1684,7 @@ dependencies = [ [[package]] name = "craft-mesh" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ "craft-zip", "miniz_oxide 0.9.1", @@ -1694,7 +1694,7 @@ dependencies = [ [[package]] name = "craft-mime" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ "chrono", "craft-codepage", @@ -1704,7 +1704,7 @@ dependencies = [ [[package]] name = "craft-pcraft-format" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ "flate2", "serde", @@ -1715,7 +1715,7 @@ dependencies = [ [[package]] name = "craft-pdf" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ "hayro-syntax", "serde", @@ -1725,7 +1725,7 @@ dependencies = [ [[package]] name = "craft-platform" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ "async-channel", "async-io", @@ -1756,7 +1756,7 @@ dependencies = [ [[package]] name = "craft-ps" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ "craft-eps", "kurbo", @@ -1780,7 +1780,7 @@ dependencies = [ [[package]] name = "craft-psd" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ "encoding_rs", "flate2", @@ -1791,7 +1791,7 @@ dependencies = [ [[package]] name = "craft-quit" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ "dispatch2", "objc2 0.6.5", @@ -1817,7 +1817,7 @@ dependencies = [ [[package]] name = "craft-settings" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ "craft-atomic", "craft-host", @@ -1839,9 +1839,9 @@ source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa3 [[package]] name = "craft-svg" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ - "craft-xml 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", + "craft-xml 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", "flate2", "kurbo", "quick-xml 0.41.0", @@ -1864,7 +1864,7 @@ dependencies = [ [[package]] name = "craft-tga" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ "thiserror 2.0.21", ] @@ -1872,7 +1872,7 @@ dependencies = [ [[package]] name = "craft-theme" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ "bitflags 2.13.2", "craft-tracked", @@ -1905,7 +1905,7 @@ dependencies = [ [[package]] name = "craft-time" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ "serde", "thiserror 2.0.21", @@ -1925,9 +1925,9 @@ dependencies = [ [[package]] name = "craft-timeline" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ - "craft-time 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", + "craft-time 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", "serde", "web-time", ] @@ -1935,12 +1935,12 @@ dependencies = [ [[package]] name = "craft-tracked" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" [[package]] name = "craft-ui" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ "craft-cloud-ui", "craft-ui-canvas", @@ -1954,7 +1954,7 @@ dependencies = [ [[package]] name = "craft-ui-canvas" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ "craft-behavior", "craft-i18n", @@ -1970,7 +1970,7 @@ dependencies = [ [[package]] name = "craft-ui-contract" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ "accesskit", "craft-behavior", @@ -2008,7 +2008,7 @@ dependencies = [ [[package]] name = "craft-ui-macros" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2019,7 +2019,7 @@ dependencies = [ [[package]] name = "craft-ui-panels" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ "craft-behavior", "craft-host", @@ -2037,7 +2037,7 @@ dependencies = [ [[package]] name = "craft-ui-patterns" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ "craft-behavior", "craft-host", @@ -2058,7 +2058,7 @@ dependencies = [ [[package]] name = "craft-ui-shell" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ "craft-behavior", "craft-host", @@ -2078,7 +2078,7 @@ dependencies = [ [[package]] name = "craft-ui-widgets" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ "craft-behavior", "craft-host", @@ -2097,7 +2097,7 @@ dependencies = [ [[package]] name = "craft-update" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ "chrono", "craft-host", @@ -2126,7 +2126,7 @@ dependencies = [ [[package]] name = "craft-vectorcraft-format" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ "flate2", "serde", @@ -2148,9 +2148,9 @@ dependencies = [ [[package]] name = "craft-video" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ - "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", + "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", "rav1e", "rayon", "thiserror 2.0.21", @@ -2159,7 +2159,7 @@ dependencies = [ [[package]] name = "craft-webp" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ "image", "thiserror 2.0.21", @@ -2168,7 +2168,7 @@ dependencies = [ [[package]] name = "craft-win32" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ "winsafe", ] @@ -2176,7 +2176,7 @@ dependencies = [ [[package]] name = "craft-window" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ "craft-appkit", "craft-atomic", @@ -2210,7 +2210,7 @@ dependencies = [ [[package]] name = "craft-xml" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ "quick-xml 0.41.0", "serde", @@ -2228,7 +2228,7 @@ dependencies = [ [[package]] name = "craft-y4m" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ "thiserror 2.0.21", ] @@ -2236,7 +2236,7 @@ dependencies = [ [[package]] name = "craft-zip" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ "flate2", "thiserror 2.0.21", @@ -2688,12 +2688,12 @@ dependencies = [ name = "effectcraft-export" version = "0.25.1" dependencies = [ - "craft-audio 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", - "craft-exr 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", + "craft-audio 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", + "craft-exr 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", "craft-gif", - "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", - "craft-tga 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", - "craft-video 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", + "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", + "craft-tga 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", + "craft-video 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", "effectcraft-color", "effectcraft-effects", "effectcraft-keyframe", @@ -2803,7 +2803,7 @@ dependencies = [ name = "effectcraft-interchange" version = "0.25.1" dependencies = [ - "craft-timeline 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", + "craft-timeline 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", "effectcraft-color", "effectcraft-keyframe", "effectcraft-project", @@ -2854,17 +2854,17 @@ dependencies = [ name = "effectcraft-media" version = "0.25.1" dependencies = [ - "craft-audio 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", - "craft-color 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", + "craft-audio 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", + "craft-color 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", "craft-docpath", - "craft-dpx 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", - "craft-exr 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", - "craft-frame 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", + "craft-dpx 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", + "craft-exr 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", + "craft-frame 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", "craft-gif", - "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", - "craft-media-source 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", - "craft-time 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", - "craft-video 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", + "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", + "craft-media-source 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", + "craft-time 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", + "craft-video 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", "craft-webp", "effectcraft-color", "effectcraft-effects", @@ -2969,7 +2969,7 @@ name = "effectcraft-psd" version = "0.25.1" dependencies = [ "craft-codepage", - "craft-psd 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", + "craft-psd 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", "miniz_oxide 0.9.1", ] @@ -2977,7 +2977,7 @@ dependencies = [ name = "effectcraft-raster" version = "0.25.1" dependencies = [ - "craft-exr 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1)", + "craft-exr 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", "effectcraft-color", "effectcraft-geom", "rayon", @@ -4374,7 +4374,7 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a" [[package]] name = "hayro-jbig2" version = "0.3.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ "hayro-ccitt", ] @@ -4388,7 +4388,7 @@ checksum = "c75ab947623ef4ccaa7acf0579edf7cbb5a73838e3839a7be73335e522f433a1" [[package]] name = "hayro-syntax" version = "0.7.2" -source = "git+https://github.com/aiongg/craft-libs?rev=3ad64a26ea8a72c03c416681e14f7744393790b1#3ad64a26ea8a72c03c416681e14f7744393790b1" +source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" dependencies = [ "hayro-jbig2", "hayro-jpeg2000", diff --git a/Cargo.toml b/Cargo.toml index a3a717b1e..edc4ed8e3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,28 +11,28 @@ rust-version = "1.95" repository = "https://github.com/storytold/effectcraft" [workspace.dependencies] -craft-timeline = { git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1", default-features = false } -craft-mime = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } -craft-pdf = { git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1", version = "=0.1.0", default-features = false, features = ["read"] } -craft-docpath = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } -craft-jsonrpc = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } -craft-ecproj-format = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } -craft-dpx = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } -craft-ps = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1", default-features = false, features = ["read"] } -craft-exr = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } -craft-gif = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } -craft-tga = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } -craft-psd = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } -craft-codepage = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } -craft-svg = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } -craft-webp = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } -craft-lottie = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } -craft-mesh = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1", default-features = false, features = ["stl", "obj", "gltf", "fbx"] } -craft-aep = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } -craft-doc = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } -craft-vectorcraft-format = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } +craft-timeline = { git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107", default-features = false } +craft-mime = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } +craft-pdf = { git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107", version = "=0.1.0", default-features = false, features = ["read"] } +craft-docpath = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } +craft-jsonrpc = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } +craft-ecproj-format = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } +craft-dpx = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } +craft-ps = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107", default-features = false, features = ["read"] } +craft-exr = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } +craft-gif = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } +craft-tga = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } +craft-psd = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } +craft-codepage = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } +craft-svg = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } +craft-webp = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } +craft-lottie = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } +craft-mesh = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107", default-features = false, features = ["stl", "obj", "gltf", "fbx"] } +craft-aep = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } +craft-doc = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } +craft-vectorcraft-format = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } # craft-update: app-specific pretend versions apply to startup and manual checks. -craft-update = { git = "https://github.com/aiongg/craft-libs", version = "=0.1.0", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1", features = ["ui"] } +craft-update = { git = "https://github.com/aiongg/craft-libs", version = "=0.1.0", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107", features = ["ui"] } # internal effectcraft-time = { path = "crates/time" } effectcraft-geom = { path = "crates/geom" } @@ -97,13 +97,13 @@ same-file = "1.0" tempfile = "3.27" # codecs + containers shared by the Craft apps (crates/media, crates/export); keep all in sync. -craft-media = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1", default-features = false, features = ["isobmff", "matroska"] } -craft-media-source = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } -craft-frame = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } -craft-color = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } -craft-time = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } -craft-audio = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1", default-features = false, features = ["aac-decode", "aac-encode", "alac-decode", "opus-decode", "opus-encode", "ac3-decode", "mp3-decode", "mpa-decode"] } -craft-video = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1", features = ["h264-decode", "h264-encode", "prores", "hevc-encode", "vp9-encode", "av1", "threads"] } +craft-media = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107", default-features = false, features = ["isobmff", "matroska"] } +craft-media-source = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } +craft-frame = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } +craft-color = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } +craft-time = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } +craft-audio = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107", default-features = false, features = ["aac-decode", "aac-encode", "alac-decode", "opus-decode", "opus-encode", "ac3-decode", "mp3-decode", "mpa-decode"] } +craft-video = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107", features = ["h264-decode", "h264-encode", "prores", "hevc-encode", "vp9-encode", "av1", "threads"] } # footage decoding: FilmCraft's pure-Rust crates, pinned to a revision (plan/adr/0001). # Only `crates/media`, `crates/export` and `crates/interchange` may depend on these. @@ -126,12 +126,12 @@ half = "2.7" # ui # Shared frontend components; keep this dependency above the engine boundary. # Shared UI and the complete egui family select reviewed immutable commits below. -craft-ui = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } -craft-behavior = { git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } -craft-host = { git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } -craft-keymap = { git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } -craft-theme = { git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } -craft-window = { git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } +craft-ui = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } +craft-behavior = { git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } +craft-host = { git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } +craft-keymap = { git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } +craft-theme = { git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } +craft-window = { git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } # `default_fonts` and `monochrome_emoji_fonts` are explicit: the app's `FontDefinitions::default()` # and its `✔`/`▣` chrome glyphs need both, and kittest's own dev-dependencies do not propagate. egui = { version = "0.37", default-features = false, features = ["default_fonts", "monochrome_emoji_fonts"] } @@ -236,8 +236,8 @@ lto = "thin" codegen-units = 1 [patch.crates-io] -hayro-syntax = { git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1", version = "=0.7.2" } -hayro-jbig2 = { git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1", version = "=0.3.0" } +hayro-syntax = { git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107", version = "=0.7.2" } +hayro-jbig2 = { git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107", version = "=0.3.0" } ecolor = { git = "https://github.com/storytold/egui.git", rev = "f5025284445ea19c35f746d96fc0b75468b3f560" } emath = { git = "https://github.com/storytold/egui.git", rev = "f5025284445ea19c35f746d96fc0b75468b3f560" } epaint = { git = "https://github.com/storytold/egui.git", rev = "f5025284445ea19c35f746d96fc0b75468b3f560" } diff --git a/crates/effects/Cargo.toml b/crates/effects/Cargo.toml index 1c4ea0b7a..a36022fb9 100644 --- a/crates/effects/Cargo.toml +++ b/crates/effects/Cargo.toml @@ -10,7 +10,7 @@ rust-version.workspace = true workspace = true [dependencies] -craft-cms = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3ad64a26ea8a72c03c416681e14f7744393790b1" } +craft-cms = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } effectcraft-geom = { workspace = true } effectcraft-color = { workspace = true } effectcraft-keyframe = { workspace = true } From ccb628207f5d8d55e91db871f5ff723101a5b082 Mon Sep 17 00:00:00 2001 From: nazar-gavrylyk Date: Tue, 24 Nov 2026 20:14:12 +0100 Subject: [PATCH 417/451] #805: Docs: define how a flush's packets and encode.flushed are accepted --- docs/video-helper-protocol.md | 37 +++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/docs/video-helper-protocol.md b/docs/video-helper-protocol.md index 30e34ceda..7493f8a97 100644 --- a/docs/video-helper-protocol.md +++ b/docs/video-helper-protocol.md @@ -74,7 +74,7 @@ encode.open → encode.opened → (encode.frame → encode.packets)… → encod |---|---|---| | `{"op":"encode.open","job":1,"device":"nvenc:0","codec":"h264","width":1920,"height":1080,"rate":[30,1],"bitrate_kbps":15000,"profile":"high","keyint":60,"colour":{"primaries":1,"transfer":1,"matrix":1,"range":"limited"},"slots":[{"in":{"offset":0,"len":3110400},"out":{"offset":3110400,"len":1048576}},…]}` | `{"op":"encode.opened","job":1,"codec_config":"","delay":2}` | `job` is chosen by EffectCraft and is never reused. `slots` is the memory the helper may use, decided by EffectCraft. `codec_config` is the `avcC` (H.264) or `hvcC` (HEVC) record for the MP4 sample entry. `delay` is the number of frames the encoder holds back (B-frames). | | `{"op":"encode.frame","job":1,"frame":0,"slot":0,"planes":[{"offset":0,"stride":1920,"size":[1920,1080],"len":2073600},{"offset":2073600,"stride":960,"size":[960,540],"len":518400},{"offset":2592000,"stride":960,"size":[960,540],"len":518400}]}` | `{"op":"encode.packets","job":1,"frame":0,"packets":[{"offset":0,"len":41230,"pts":0,"dts":-2,"key":true}]}` | The picture is in `slots[0].in`. `planes` lists Y, U and V: `offset` is from the start of the file, `size` is in samples, `len` is `stride × height` bytes. EffectCraft sets them, and the helper reads only them. The reply means the slot may be reused and says where the packets are, inside `slots[0].out`. It may hold no packets (the encoder is still holding frames) or several. | -| `{"op":"encode.flush","job":1,"out":{"offset":…,"len":…}}` | `{"op":"encode.packets","job":1,"frame":null,"packets":[…]}` then `{"op":"encode.flushed","job":1}` | The rest of the stream, inside `out`. EffectCraft sizes `out` for the frames the encoder still holds: at least `(delay + 1)` times the length of a slot's `out` region. If the encoder's output still does not fit, the helper answers `error` with code `packet_too_large`. | +| `{"op":"encode.flush","job":1,"out":{"offset":…,"len":…}}` | `{"op":"encode.packets","job":1,"frame":null,"packets":[…]}` then `{"op":"encode.flushed","job":1}` | EffectCraft sends it only after every `encode.frame` has been answered, and after it sends only `cancel` or `encode.close`. The helper answers with exactly one `encode.packets` with `"frame":null` (its `packets` may be empty), then exactly one `encode.flushed`. The packets are the rest of the stream, inside `out`, and their offsets are counted from it. EffectCraft sizes `out` for the frames the encoder still holds: at least `(delay + 1)` times the length of a slot's `out` region. If the encoder's output still does not fit, the helper answers `error` with code `packet_too_large`. | | `{"op":"encode.close","job":1}` | none | Free everything for the job. EffectCraft sends it after `encode.flushed` or `cancelled`, and frees or reuses the job's regions only then. If the helper was stopped first, there is no reply to wait for: the exchange file is dropped and its regions are never reused (see [stopping](#timeouts-and-errors)). | | `{"op":"cancel","job":1}` | `{"op":"cancelled","job":1}` | Stop now. After it sends `cancel`, EffectCraft ignores every reply for the job except `cancelled`, so replies for frames still in flight are not protocol breaks. The helper stops using the job's regions before it replies `cancelled`, and `cancelled` ends every frame of the job that is still outstanding. | @@ -99,6 +99,25 @@ encode.open → encode.opened → (encode.frame → encode.packets)… → encod - **Replies are in frame order,** `error` replies included. - **Control lines** are at most 1 MiB. Pictures and packets never go through the pipe. +### A normal job + +An encoder that holds back one frame (`delay` 1), two frames. `E` is EffectCraft, `H` the helper: + +``` +E encode.open job 1 H encode.opened delay 1 +E encode.frame job 1, frame 0, slot 0 H encode.packets frame 0, packets [] +E encode.frame job 1, frame 1, slot 1 H encode.packets frame 1, 1 packet (pts 0) +E encode.flush job 1, out {…} (sent once both frame replies are in) + H encode.packets frame null, 1 packet (pts 1) + H encode.flushed +E encode.close job 1 +``` + +Out of order: after frames 0 and 1 are sent, a reply for frame 1 before the reply for frame 0 is a +protocol break, and so is `encode.flushed` before the `encode.packets` with `"frame":null`. +Anything the helper sends for job 1 after `encode.flushed` arrives for an ended job (EffectCraft +sends `encode.close` as soon as it reads `encode.flushed`) and is dropped. + ### Job and frame ids `job` is a positive whole number that EffectCraft takes from a counter that only goes up, so an id @@ -114,9 +133,15 @@ and the helper carries on; it does not count. | Reply | EffectCraft | |---|---| +| `encode.opened` for an open job with an `encode.open` outstanding | Accepts it; the job can take frames. | | `encode.packets` or `error` for an open job, for the oldest outstanding frame, with every packet inside its region | Accepts it. | +| After `encode.flush`: the first `encode.packets` with `"frame":null`, every packet inside the `out` region of that `encode.flush` | Accepts it. | +| After that batch: `encode.flushed` | Accepts it; the job is complete and EffectCraft sends `encode.close`. | +| `encode.packets` with `"frame":null` or `encode.flushed` when no `encode.flush` is outstanding; a second `encode.packets` with `"frame":null`; `encode.flushed` before the batch; `encode.opened` when no `encode.open` is outstanding | Protocol break. | +| No reply to `encode.open`, `encode.frame`, or `encode.flush` (the batch and `encode.flushed` both count) in time | Protocol break: EffectCraft stops the helper ([timeouts](#timeouts-and-errors)). | | `encode.packets` or `error` for an open job with a `frame` that was never sent, already answered, or not the oldest outstanding; or `error` without `frame` when no `encode.open` or `encode.flush` is outstanding | Protocol break. | | `encode.packets` with a packet whose `offset + len` is outside its region | Protocol break. | +| `error` without `frame` while an `encode.open` or `encode.flush` is outstanding (for a flush, instead of the batch or of `encode.flushed`) | Job error: EffectCraft sends `cancel`, then `encode.close`. | | `error` with `packet_too_large`: the helper says the encoder's output does not fit the `out` region it was given, and it did not write past it | Job error. | | `cancelled` for a job EffectCraft sent `cancel` for | Accepts it; the job's frames are over. | | `cancelled` for an open job | Protocol break. | @@ -127,13 +152,13 @@ and the helper carries on; it does not count. ## Timeouts and errors - **Per frame, not per export.** A frame is outstanding from `encode.frame` until its reply, until - `cancelled`, or until the helper has exited. If the oldest outstanding frame waits longer than - the timeout (30 s by default, set with `EFFECTCRAFT_HELPER_VIDEO_TIMEOUT`, as + `cancelled`, or until the helper has exited. If the oldest outstanding frame waits longer than the + timeout (30 s by default, set with `EFFECTCRAFT_HELPER_VIDEO_TIMEOUT`, as `EFFECTCRAFT_HELPER_TIMEOUT` is for effects), EffectCraft stops (kills) the helper and waits for it to exit. A GPU that hangs without exiting ends the helper instead of making the export look - busy. `encode.open` and `encode.flush` use the load timeout (600 s). After `cancel` the frames of - that job have no timeout; `cancelled` is due within the same 30 s, or EffectCraft stops the - helper. + busy. `encode.open` and `encode.flush` use the load timeout (600 s); for a flush it covers the + `encode.packets` and the `encode.flushed` together. After `cancel` the frames of that job have no + timeout; `cancelled` is due within the same 30 s, or EffectCraft stops the helper. - **`{"op":"error","job":1,"frame":3,"code":"…","message":"…"}`** answers one request. `frame` is there when it answers an `encode.frame` (it ends that frame's timeout) and absent for `encode.open` and `encode.flush`. The helper process carries on, but the job is over: EffectCraft From 74ba361444deb70832bd2369b662eac8bc213b36 Mon Sep 17 00:00:00 2001 From: aiongg Date: Tue, 24 Nov 2026 19:17:33 +0000 Subject: [PATCH 418/451] 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). --- crates/ui-egui/Cargo.toml | 2 +- crates/ui-egui/src/app.rs | 1 + crates/ui-egui/src/app/frame.rs | 2 +- crates/ui-egui/src/app/window.rs | 19 +- crates/ui-egui/src/dock.rs | 214 +---- crates/ui-egui/src/dock_command.rs | 466 ++++++++++ crates/ui-egui/src/dock_ui.rs | 823 +++++++++--------- crates/ui-egui/src/lib.rs | 5 +- crates/ui-egui/src/menus/entries.rs | 2 +- crates/ui-egui/src/menus/frontend.rs | 4 - crates/ui-egui/src/menus/invoke.rs | 18 +- crates/ui-egui/src/menus/tests.rs | 34 +- crates/ui-egui/src/native_menu.rs | 39 +- crates/ui-egui/src/panels.rs | 4 +- .../ui-egui/src/panels/viewer_text/tests.rs | 10 +- crates/ui-egui/src/panels/viewers.rs | 2 +- crates/ui-egui/src/state.rs | 10 +- crates/ui-egui/src/workspace_state.rs | 40 +- crates/ui-egui/src/workspace_state/legacy.rs | 68 +- crates/ui-egui/src/workspace_state/tests.rs | 121 ++- crates/ui-egui/tests/it/main.rs | 1 - crates/ui-egui/tests/it/shared_docking_ui.rs | 97 ++- crates/ui-egui/tests/it/ui_dock_resize.rs | 85 -- crates/ui-egui/tests/it/ui_effect_controls.rs | 137 ++- crates/ui-egui/tests/it/ui_panel_focus.rs | 9 +- crates/ui-egui/tests/it/ui_panel_windows.rs | 39 +- crates/ui-egui/tests/it/ui_scrolling.rs | 6 +- crates/ui-egui/tests/it/ui_tabs.rs | 16 +- crates/ui-egui/tests/it/ui_viewers.rs | 39 +- crates/ui-egui/tests/it/ui_workspace_focus.rs | 76 +- docs/control-protocol.md | 22 +- 31 files changed, 1304 insertions(+), 1107 deletions(-) create mode 100644 crates/ui-egui/src/dock_command.rs delete mode 100644 crates/ui-egui/tests/it/ui_dock_resize.rs diff --git a/crates/ui-egui/Cargo.toml b/crates/ui-egui/Cargo.toml index 2f3d940b0..d370a85c1 100644 --- a/crates/ui-egui/Cargo.toml +++ b/crates/ui-egui/Cargo.toml @@ -14,7 +14,7 @@ craft-mime = { workspace = true } craft-ui = { workspace = true } craft-behavior = { workspace = true } craft-host = { workspace = true } -craft-keymap = { workspace = true } +craft-keymap = { workspace = true, features = ["egui"] } craft-theme = { workspace = true } craft-window = { workspace = true } effectcraft-time = { workspace = true } diff --git a/crates/ui-egui/src/app.rs b/crates/ui-egui/src/app.rs index 3fc3803ad..d4925756c 100644 --- a/crates/ui-egui/src/app.rs +++ b/crates/ui-egui/src/app.rs @@ -122,6 +122,7 @@ impl EffectcraftApp { native_viewports: vec![], unpublished_viewports: vec![], pending_panel_raise: None, + live_dock: Default::default(), home_thumbs: Default::default(), home_thumb_saved: None, window_title: String::new(), diff --git a/crates/ui-egui/src/app/frame.rs b/crates/ui-egui/src/app/frame.rs index cca733c7c..d93b5673b 100644 --- a/crates/ui-egui/src/app/frame.rs +++ b/crates/ui-egui/src/app/frame.rs @@ -309,7 +309,7 @@ impl EffectcraftApp { // A hidden window paints when work needs a UI pass: queued input and waits, a settled // screenshot, or playback into a child viewport. let focused = self.focused; - let child_viewports = !self.ui.dock.layout.floating.is_empty() || prefs_live::video_preview_active(self, focused); + let child_viewports = !self.ui.dock.layout().floating.is_empty() || prefs_live::video_preview_active(self, focused); let paint = self.want_paint || !self.synthetic.is_empty() || !self.input_waiters.is_empty() diff --git a/crates/ui-egui/src/app/window.rs b/crates/ui-egui/src/app/window.rs index e741932f4..4dabd6192 100644 --- a/crates/ui-egui/src/app/window.rs +++ b/crates/ui-egui/src/app/window.rs @@ -101,22 +101,23 @@ impl EffectcraftApp { } .filter(|q| self.ui.dock.is_open(*q)); let mut workspace = self.ui.dock.clone(); - let known = workspace.hidden.iter().any(|(q, _)| *q == p); + let known = workspace.hidden().iter().any(|(q, _)| *q == p); let opened = if p == PanelKind::Composition && near.is_none() && !known && self.ui.dock.is_docked(PanelKind::Timeline) { workspace .apply( - craft_behavior::dock::Action::OpenAt { - panel: p, - anchor: PanelKind::Timeline, - placement: craft_behavior::dock::DockPlacement::Split(craft_ui::docking::Zone::Top), - }, + craft_behavior::dock::Action::open_at( + p, + PanelKind::Timeline, + craft_behavior::dock::DockPlacement::Split(craft_behavior::DockSide::Top), + ), + self.ui.dock_locked, dock::permissions, ) .map(|_| ()) } else if known { - workspace.set_visible(p, true, near, dock::permissions) + workspace.set_visible(p, true, near, self.ui.dock_locked, dock::permissions) } else { - workspace.apply(craft_behavior::dock::Action::Open { panel: p, anchor: near }, dock::permissions).map(|_| ()) + workspace.apply(craft_behavior::dock::Action::open(p, near), self.ui.dock_locked, dock::permissions).map(|_| ()) }; match opened { Ok(()) => self.ui.dock = workspace, @@ -126,7 +127,7 @@ impl EffectcraftApp { } } } - let _ = self.ui.dock.apply(craft_behavior::dock::Action::Activate { panel: p }, dock::permissions); + let _ = self.ui.dock.apply(craft_behavior::dock::Action::activate(p), self.ui.dock_locked, dock::permissions); if self.ui.dock.is_floating(p) { self.pending_panel_raise = Some(p); } diff --git a/crates/ui-egui/src/dock.rs b/crates/ui-egui/src/dock.rs index 1a4e59783..c9f7d7275 100644 --- a/crates/ui-egui/src/dock.rs +++ b/crates/ui-egui/src/dock.rs @@ -1,15 +1,14 @@ //! EffectCraft's panels and built-in workspaces in craft-ui's shared docking model //! ([`craft_ui::docking`]): splits, tab groups, After Effects' stacked panels and floating //! windows. craft-ui owns the layout model, its validation and every transaction; EffectCraft -//! owns the panel ids, the built-in workspaces and the decorations of its tabs (the comp tabs of -//! the Timeline, label swatches and viewer locks). +//! owns the panel ids, the built-in workspaces and the viewer locks in its group headers. -use egui::{Align2, Rect, Sense, Stroke, pos2, vec2}; +use egui::{Align2, Rect, Sense, pos2, vec2}; use serde::{Deserialize, Serialize}; +pub use craft_behavior::dock::SplitSize; pub use craft_behavior::dock::{Floating, Node, PanelState, Permissions, StackEntry}; pub use craft_behavior::flow::Axis; -pub use craft_behavior::dock::SplitSize; use crate::icons::{self, Icon}; use crate::theme::Tokens; @@ -189,7 +188,7 @@ pub fn tabs(p: &[PanelKind], active: usize) -> Node { Node::tabs(p.to_vec(), active) } /// Stacked panels: (panel, open, height). Open entries share the stack's height in proportion to -/// their heights; an entry without one counts as craft-ui's `DockStyle::min_pane` (40). +/// their heights; an entry without one shares the stack's height with the others. pub fn stack(e: &[(PanelKind, bool, Option)]) -> Node { Node::stack( e.iter() @@ -243,9 +242,7 @@ pub const WORKSPACES: &[&str] = &[ /// id, so a built-in layout built again is the same set of windows. fn workspace_floating(name: &str) -> Vec> { use PanelKind::*; - let f = |id: u64, panels: &[PanelKind], [x, y, w, h]: [f32; 4]| { - Floating::single(id, panels.to_vec(), 0, Rect::from_min_size(pos2(x, y), vec2(w, h))) - }; + let f = |id: u64, panels: &[PanelKind], [x, y, w, h]: [f32; 4]| Floating::single(id, panels.to_vec(), 0, Rect::from_min_size(pos2(x, y), vec2(w, h))); match name { "Undocked Panels" => vec![ f(1, &[Project, EffectControls], [24.0, 110.0, 320.0, 420.0]), @@ -442,7 +439,7 @@ pub(crate) fn node_panels(node: &Node, out: &mut Vec) { node_panels(second, out); } Node::Tabs { panels, .. } => out.extend(panels.iter().copied()), - Node::Stack { entries } => out.extend(entries.iter().map(|e| e.panel)), + Node::Stack { entries, .. } => out.extend(entries.iter().map(|e| e.panel)), Node::Dock { columns, .. } => { for group in columns.iter().flat_map(|c| c.groups.iter()) { out.extend(group.panels.iter().copied()); @@ -456,7 +453,7 @@ fn node_group(node: &Node, p: PanelKind) -> Option> { match node { Node::Split { first, second, .. } => node_group(first, p).or_else(|| node_group(second, p)), Node::Tabs { panels, .. } => panels.contains(&p).then(|| panels.clone()), - Node::Stack { entries } => entries.iter().any(|e| e.panel == p).then(|| vec![p]), + Node::Stack { entries, .. } => entries.iter().any(|e| e.panel == p).then(|| vec![p]), Node::Dock { columns, .. } => columns.iter().flat_map(|c| c.groups.iter()).find(|g| g.panels.contains(&p)).map(|g| g.panels.clone()), _ => None, } @@ -521,176 +518,13 @@ pub fn stack_gutter_id(layout: &Layout, p: PanelKind) -> Option { path.pop(); found } - Node::Stack { entries } => entries.iter().position(|e| e.panel == p).map(|i| format!("dock.gutter.{path}s{i}")), + Node::Stack { entries, .. } => entries.iter().position(|e| e.panel == p).map(|i| format!("dock.gutter.{path}s{i}")), _ => None, } } rec(layout.root.as_ref()?, p, &mut String::new(), 0) } -/// One document a panel shows as a tab of its own (the Timeline: one tab per open comp, as in -/// After Effects). -#[derive(Debug, Clone, PartialEq)] -pub struct DocTab { - pub id: u64, - pub title: String, - /// The comp's label colour. - pub swatch: egui::Color32, - /// The document the panel shows now. - pub active: bool, -} - -/// What the Timeline's comp tabs did this frame. -#[derive(Debug, Clone, PartialEq)] -pub enum DocAction { - /// Show comp `id`. - Activate(u64), - /// Close comp `id`'s Timeline (its ×, or a middle click). - Close(u64), -} - -/// Room around a tab's label, as craft-ui gives its dock tabs. -const TAB_PADDING: f32 = 24.0; -/// Width of the » button that lists the comp tabs with no room in the strip. -const DOC_OVERFLOW: f32 = 22.0; -/// Room for the × after a comp's name. Every comp tab keeps it, so a tab keeps its width when it -/// is shown or hovered. -const DOC_CLOSE: f32 = 16.0; - -/// A comp tab's text: the label swatch, then the name, as the panel tabs with a swatch show it. -fn doc_job(doc: &DocTab, font: &egui::FontId, color: egui::Color32) -> egui::text::LayoutJob { - let mut job = egui::text::LayoutJob::default(); - job.append("\u{25a0} ", 0.0, egui::TextFormat::simple(font.clone(), doc.swatch)); - job.append(&doc.title, 0.0, egui::TextFormat::simple(font.clone(), color)); - job -} - -/// The width of one line of `job` at the fonts' current size. -fn text_width(ctx: &egui::Context, job: egui::text::LayoutJob) -> f32 { - ctx.fonts_mut(|f| f.layout_job(job)).size().x -} - -/// The width each comp tab asks for in the Timeline group's tab row. -pub fn doc_widths(ctx: &egui::Context, docs: &[DocTab], font: &egui::FontId) -> Vec { - docs.iter().map(|d| text_width(ctx, doc_job(d, font, egui::Color32::WHITE)) + TAB_PADDING + DOC_CLOSE).collect() -} - -/// The × of comp tab `doc` at `rect`, clipped to `clip`; true when clicked. `shown` is the comp -/// the Timeline shows while it is the group's shown panel. Automation: -/// `panel.tab.Timeline..close`, and `panel.tab.Timeline.close` for the shown comp's. -fn doc_close( - ui: &mut egui::Ui, - rect: Rect, - clip: Rect, - doc: &DocTab, - shown: bool, - style: &craft_ui::docking::DockStyle, - reg: &mut crate::automation::Registry, -) -> bool { - let timeline = PanelKind::Timeline.id(); - let hit = ui.interact(rect.expand(2.0), egui::Id::unique(("comp-tab-close", doc.id)), Sense::click()); - hit.widget_info(|| egui::WidgetInfo::labeled(egui::Role::Button, hit.enabled(), "Close")); - let cc = if hit.hovered() { style.text } else { style.inactive_text }; - let k = 3.5; - let painter = ui.painter().with_clip_rect(clip); - painter.line_segment([rect.center() + vec2(-k, -k), rect.center() + vec2(k, k)], Stroke::new(1.2, cc)); - painter.line_segment([rect.center() + vec2(-k, k), rect.center() + vec2(k, -k)], Stroke::new(1.2, cc)); - reg.add_response(&format!("panel.tab.{timeline}.{}.close", doc.id), &hit, "Close"); - if shown { - reg.add_response(&format!("panel.tab.{timeline}.close"), &hit, "Close"); - } - hit.clicked() -} - -/// Draw the Timeline's comp tabs into `strip`, the part of the Timeline group's tab row after its -/// panel tabs. Each is a tab like the panel tabs: the comp's label swatch and name, then a × -/// that closes the comp's Timeline: always on the shown comp while the Timeline is the group's -/// shown panel (`selected`), on the other comp tabs while the pointer is over them. Tabs that do -/// not fit go to a » menu at the end; the shown comp's tab always stays in the row. Shift+, and -/// Shift+. step through every open comp. Automation: `panel.tab.Timeline.`, the ×s (see -/// [`doc_close`]), `panel.tab.Timeline.more` for », and `panel.tab.Timeline.more.` for its -/// items. -pub fn doc_tabs( - ui: &mut egui::Ui, - strip: Rect, - docs: &[DocTab], - selected: bool, - style: &craft_ui::docking::DockStyle, - reg: &mut crate::automation::Registry, -) -> Vec { - let mut out = Vec::new(); - let timeline = PanelKind::Timeline.id(); - let widths = doc_widths(ui.ctx(), docs, &style.font); - let active = docs.iter().position(|d| d.active).unwrap_or(0); - let fit = craft_ui::tabs::fit_whole(&widths, active, strip.width(), DOC_OVERFLOW); - let clip = strip.intersect(ui.clip_rect()); - let mid = strip.center().y; - let mut x = strip.min.x; - for (index, width) in &fit.shown { - let Some(doc) = docs.get(*index) else { continue }; - let tab = Rect::from_min_size(pos2(x, strip.min.y), vec2(*width, strip.height())); - x += width; - let on = selected && doc.active; - let color = if on { style.text } else { style.inactive_text }; - let mut job = doc_job(doc, &style.font, color); - job.wrap = egui::text::TextWrapping { - max_width: (tab.width() - TAB_PADDING - DOC_CLOSE).max(0.0), - max_rows: 1, - break_anywhere: true, - overflow_character: Some('\u{2026}'), - }; - let galley = ui.fonts_mut(|f| f.layout_job(job)); - let label_end = tab.min.x + TAB_PADDING * 0.5 + galley.size().x; - let resp = craft_ui::tabs::Tab::new(egui::Id::unique(("comp-tab", doc.id)), &doc.title, on).focus_stroke(Stroke::new(1.0, style.accent)).show_at( - ui, - tab, - |ui, response| { - let painter = ui.painter().with_clip_rect(tab.intersect(clip)); - painter.rect_filled(tab, 0.0, if on || response.hovered() { style.active_background } else { style.tab_background }); - painter.galley(pos2(tab.min.x + TAB_PADDING * 0.5, mid - galley.size().y * 0.5), galley.clone(), color); - }, - ); - let resp = if galley.elided { resp.on_hover_text(&doc.title) } else { resp }; - reg.add_response(&format!("panel.tab.{timeline}.{}", doc.id), &resp, &doc.title); - // After the tab, so the × takes the clicks over it. - if on || ui.rect_contains_pointer(tab.intersect(clip)) { - let cr = Rect::from_center_size(pos2(label_end + DOC_CLOSE / 2.0, mid), vec2(10.0, 10.0)); - if doc_close(ui, cr, tab.intersect(clip), doc, on, style, reg) { - out.push(DocAction::Close(doc.id)); - } - } - if resp.clicked() { - out.push(DocAction::Activate(doc.id)); - } - if resp.middle_clicked() { - out.push(DocAction::Close(doc.id)); - } - } - if !fit.overflow.is_empty() && fit.overflow_width > 0.0 { - let more = Rect::from_min_size(pos2(x, strip.min.y), vec2(fit.overflow_width, strip.height())); - let resp = ui.interact(more, egui::Id::unique("comp-tabs-more"), Sense::click()); - resp.widget_info(|| egui::WidgetInfo::labeled(egui::Role::Button, resp.enabled(), "More compositions")); - reg.add_response(&format!("panel.tab.{timeline}.more"), &resp, "More compositions"); - let color = if resp.hovered() { style.text } else { style.inactive_text }; - ui.painter().with_clip_rect(more.intersect(clip)).text(more.center(), Align2::CENTER_CENTER, "\u{bb}", style.font.clone(), color); - egui::Popup::menu(&resp).show(|ui| { - egui::ScrollArea::vertical().max_height(360.0).show(ui, |ui| { - for index in &fit.overflow { - let Some(doc) = docs.get(*index) else { continue }; - let item = ui.button(doc_job(doc, &style.font, style.text)); - item.widget_info(|| egui::WidgetInfo::labeled(egui::Role::Button, item.enabled(), &doc.title)); - reg.add_response(&format!("panel.tab.{timeline}.more.{}", doc.id), &item, &doc.title); - if item.clicked() { - out.push(DocAction::Activate(doc.id)); - ui.close(); - } - } - }); - }); - } - out -} - /// A panel lock button (Composition viewers and the Timeline keep their comp while locked, /// Effect Controls its layer): a closed padlock while locked, an open one while unlocked. /// Returns true when clicked. Automation: `panel.tab..lock`. @@ -718,11 +552,11 @@ pub fn placeholder(ui: &mut egui::Ui, rect: Rect, t: &Tokens, text: &str) { mod tests { use super::*; use PanelKind::*; + use craft_behavior::DockSide; use craft_behavior::dock::{Action, DockPlacement}; - use craft_ui::docking::Zone; fn apply(w: &mut Workspace, action: Action) { - w.apply(action, permissions).unwrap(); + w.apply(action, false, permissions).unwrap(); } /// Only the title changes: existing saved workspace layouts still deserialize. @@ -759,7 +593,7 @@ mod tests { } for name in WORKSPACES { let layout = workspace(name); - assert!(layout.root.iter().chain(layout.floating.iter().map(|f| &f.root)).all(no_stack), "{name}"); + assert!(layout.root.iter().all(no_stack), "{name}"); } } @@ -767,15 +601,13 @@ mod tests { fn default_right_column_is_a_short_preview_frame_over_the_properties_frame() { let default = workspace("Default"); let Some(Node::Split { second, size: SplitSize::FixedSecond(300.0), .. }) = &default.root else { panic!("{default:?}") }; - let Node::Split { axis: Axis::Y, size: SplitSize::FixedFirst(PREVIEW_FRAME), first, second } = second.as_ref() else { - panic!("{second:?}") - }; + let Node::Split { axis: Axis::Y, size: SplitSize::FixedFirst(PREVIEW_FRAME), first, second, .. } = second.as_ref() else { panic!("{second:?}") }; assert_eq!(**first, tabs(&[Preview], 0)); assert_eq!(**second, tabs(&[Properties, Align, Audio, EffectsPresets], 0)); let mut w = Workspace::new(default); assert!(w.is_visible(Preview) && w.is_visible(Properties) && !w.is_visible(Align)); // The Properties frame takes tabs; the Preview frame stays a frame of its own. - apply(&mut w, Action::Move { panel: Project, anchor: Properties, placement: DockPlacement::Tab { before: None } }); + apply(&mut w, Action::move_beside(Project, Properties, DockPlacement::tab(None))); assert_eq!(w.group_of(Project), vec![Properties, Align, Audio, EffectsPresets, Project]); assert_eq!(w.group_of(Preview), vec![Preview]); } @@ -783,35 +615,35 @@ mod tests { #[test] fn panels_split_off_and_join_tab_groups() { let mut w = docked(hsplit(SplitSize::FixedFirst(300.0), tabs(&[Project, EffectControls], 0), tabs(&[Composition, Layer], 0))); - apply(&mut w, Action::Move { panel: EffectControls, anchor: Composition, placement: DockPlacement::Split(Zone::Right) }); + apply(&mut w, Action::move_beside(EffectControls, Composition, DockPlacement::Split(DockSide::End))); assert_eq!(w.group_of(EffectControls), vec![EffectControls]); assert_eq!(w.group_of(Project), vec![Project]); - apply(&mut w, Action::Move { panel: EffectControls, anchor: Composition, placement: DockPlacement::Tab { before: Some(Layer) } }); + apply(&mut w, Action::move_beside(EffectControls, Composition, DockPlacement::tab(Some(Layer)))); assert_eq!(w.group_of(Composition), vec![Composition, EffectControls, Layer]); assert!(w.is_visible(EffectControls)); // A rejected move (onto itself, onto a closed panel) changes nothing. let before = w.clone(); - assert!(w.apply(Action::Move { panel: Project, anchor: Info, placement: DockPlacement::Split(Zone::Left) }, permissions).is_err()); + assert!(w.apply(Action::move_beside(Project, Info, DockPlacement::Split(DockSide::Start)), false, permissions).is_err()); assert_eq!(w, before); } #[test] fn closed_panels_reopen_where_they_were_docked_or_floating() { let mut w = Workspace::new(workspace("Standard")); - apply(&mut w, Action::Close { panel: Info }); + apply(&mut w, Action::close(Info)); assert!(!w.is_open(Info)); - w.set_visible(Info, true, None, permissions).unwrap(); + w.set_visible(Info, true, None, false, permissions).unwrap(); assert_eq!(w.group_of(Info), vec![Info, Audio]); - apply(&mut w, Action::Float { panel: Audio, rect: [40.0, 50.0, 300.0, 200.0] }); - apply(&mut w, Action::Close { panel: Audio }); - w.set_visible(Audio, true, None, permissions).unwrap(); + apply(&mut w, Action::float(Audio, Rect::from_min_size(pos2(40.0, 50.0), vec2(300.0, 200.0)))); + apply(&mut w, Action::close(Audio)); + w.set_visible(Audio, true, None, false, permissions).unwrap(); assert!(w.is_floating(Audio)); // Closing an earlier, inactive tab keeps the shown panel. let mut w = docked(tabs(&[Properties, Align, EffectsPresets], 2)); - apply(&mut w, Action::Close { panel: Properties }); + apply(&mut w, Action::close(Properties)); assert!(w.is_visible(EffectsPresets)); // A panel never laid out opens beside its anchor. - apply(&mut w, Action::Open { panel: History, anchor: Some(Align) }); + apply(&mut w, Action::open(History, Some(Align))); assert_eq!(w.group_of(History), vec![Align, EffectsPresets, History]); assert_eq!(referenced_panels(&w).iter().filter(|p| **p == Properties).count(), 1, "the closed panel is still known"); } diff --git a/crates/ui-egui/src/dock_command.rs b/crates/ui-egui/src/dock_command.rs new file mode 100644 index 000000000..35fd4fb7e --- /dev/null +++ b/crates/ui-egui/src/dock_command.rs @@ -0,0 +1,466 @@ +//! EffectCraft's docking command vocabulary: `window.panel.*` and `ui.dock`, as the control +//! channel, the menus and the dock area's own changes write them. Each command becomes the +//! craft-behavior layout actions it stands for on the current workspace. + +use craft_behavior::DockSide; +use craft_behavior::dock::{Action, DockEdge, DockError, DockPlacement, Layout, PanelPlace, SplitSize, Target, node_at}; +use craft_ui::docking::FloatSpace; +use egui::{Rect, pos2, vec2}; +use serde::{Deserialize, Deserializer}; + +use crate::dock::{Node, PanelKind, Workspace}; + +/// A drop zone by name. PascalCase names of the side zones also parse. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Deserialize)] +#[serde(rename_all = "lowercase")] +pub enum ZoneName { + Tab, + #[serde(alias = "Center")] + Center, + #[serde(alias = "Left")] + Left, + #[serde(alias = "Right")] + Right, + #[serde(alias = "Top")] + Top, + #[serde(alias = "Bottom")] + Bottom, + Above, + Below, +} + +/// A present field, `null` included: `Some(None)` for `null`, `None` when absent. +fn present<'de, D: Deserializer<'de>, T: Deserialize<'de>>(deserializer: D) -> Result, D::Error> { + T::deserialize(deserializer).map(Some) +} + +/// A required field that may be `null`. +fn required<'de, D: Deserializer<'de>, T: Deserialize<'de>>(deserializer: D) -> Result { + T::deserialize(deserializer) +} + +/// A `ui.dock` operation, tagged by `operation`. Rects are `[x, y, width, height]`. +#[derive(Clone, Debug, PartialEq, Deserialize)] +#[serde(tag = "operation", rename_all = "camelCase")] +pub enum DockOperation { + Open { + panel: PanelKind, + }, + Close { + panel: PanelKind, + }, + Activate { + panel: PanelKind, + }, + Float { + panel: PanelKind, + rect: [f32; 4], + }, + MoveFloating { + panel: PanelKind, + rect: [f32; 4], + }, + /// `zone` defaults to `center`; `before` only applies to a center or tab move. + Move { + panel: PanelKind, + target: PanelKind, + #[serde(default)] + zone: Option, + #[serde(default, deserialize_with = "present")] + before: Option>, + }, + SetStackOpen { + panel: PanelKind, + open: bool, + }, + /// `height` is required; `null` clears it. + ResizeStack { + panel: PanelKind, + #[serde(deserialize_with = "required")] + height: Option, + }, + ResizeSplit { + path: Vec, + size: SplitSize, + }, +} + +/// `ui.dock`: a raw layout action or an operation. +#[derive(Clone, Debug, PartialEq, Deserialize)] +#[serde(untagged)] +pub enum UiDock { + Action { action: Action }, + Operation(DockOperation), +} + +/// A docking command, tagged by `command` (its id). +#[derive(Clone, Debug, PartialEq, Deserialize)] +#[serde(tag = "command")] +pub enum DockCommand { + /// A raw layout action. + #[serde(rename = "window.panel.layout")] + Layout { action: Action }, + /// Move a panel (or its group, with `group`) next to `anchor`; `zone` defaults to `tab`. + #[serde(rename = "window.panel.move")] + Move { + panel: PanelKind, + anchor: PanelKind, + #[serde(default)] + zone: Option, + #[serde(default, deserialize_with = "present")] + before: Option>, + #[serde(default)] + group: bool, + #[serde(default)] + placement: Option>, + }, + /// Float a panel, its group or its column; given values replace the rect's. + #[serde(rename = "window.panel.float")] + Float { + panel: PanelKind, + #[serde(default)] + x: Option, + #[serde(default)] + y: Option, + #[serde(default)] + width: Option, + #[serde(default)] + height: Option, + #[serde(default)] + group: bool, + #[serde(default)] + column: bool, + }, + /// Dock a panel: beside `anchor` in `zone` (default `tab`), as the last column of the dock on + /// `side`, along an outer edge (a side `zone` alone), or back into the docked layout. + #[serde(rename = "window.panel.dock")] + Dock { + panel: PanelKind, + #[serde(default)] + anchor: Option, + #[serde(default)] + zone: Option, + #[serde(default, deserialize_with = "present")] + before: Option>, + #[serde(default)] + group: bool, + #[serde(default)] + column: bool, + #[serde(default)] + side: Option, + }, + #[serde(rename = "window.panel.activate")] + Activate { panel: PanelKind }, + #[serde(rename = "window.panel.close")] + Close { panel: PanelKind }, + #[serde(rename = "window.panel.closeGroup")] + CloseGroup { panel: PanelKind }, + #[serde(rename = "window.panel.closeOthers")] + CloseOthers { panel: PanelKind }, + /// Minimize or restore the panel's group; without `minimized` it toggles. + #[serde(rename = "window.panel.minimize")] + Minimize { + panel: PanelKind, + #[serde(default)] + minimized: Option, + }, + /// Collapse the panel's column to icons or expand it; without `iconic` it toggles. + #[serde(rename = "window.panel.iconic")] + Iconic { + panel: PanelKind, + #[serde(default)] + iconic: Option, + }, + /// The panel in a floating window of its own (`native` true, the default) or docked again. + #[serde(rename = "window.panel.window")] + Window { + panel: PanelKind, + #[serde(default)] + native: Option, + }, + #[serde(rename = "ui.dock")] + UiDock(UiDock), +} + +/// The size a command floats a panel at when the dock has drawn nothing yet. +const DEFAULT_FLOAT: egui::Vec2 = vec2(420.0, 320.0); + +/// `[x, y, width, height]` as a rect. +pub fn rect_of([x, y, width, height]: [f32; 4]) -> Rect { + Rect::from_min_size(pos2(x, y), vec2(width, height)) +} + +/// How much of the layout a command moves. +#[derive(Clone, Copy)] +enum Unit { + Panel, + Group, + Column, +} + +impl Unit { + fn of(group: bool, column: bool) -> Self { + if column { + Self::Column + } else if group { + Self::Group + } else { + Self::Panel + } + } + + /// The action that moves this unit of `panel` to `to`. A floating panel's column is its whole window. + fn to(self, layout: &Layout, panel: PanelKind, to: Target) -> Action { + let floating = matches!(layout.place(&panel), Some(PanelPlace::Floating { .. })); + match (self, to) { + (Self::Panel, Target::At { anchor, placement, .. }) => Action::move_beside(panel, anchor, placement), + (Self::Panel, to) => Action::move_panel(panel, to), + (Self::Group, to) => Action::move_group(panel, to), + (Self::Column, to) if floating => Action::move_window(panel, to), + (Self::Column, to) => Action::move_column(panel, to), + } + } + + /// The panels that move with `panel`. + fn members(self, layout: &Layout, panel: PanelKind) -> Vec { + let place = layout.place(&panel); + match self { + Self::Panel => vec![panel], + Self::Group => match place.as_ref() { + Some(PanelPlace::Node(_)) => match place.as_ref().and_then(|place| layout.node_of(place)) { + Some(Node::Tabs { panels, .. }) => panels.clone(), + _ => vec![panel], + }, + Some(place) => layout.group(place).map(|group| group.panels.clone()).unwrap_or_else(|| vec![panel]), + None => vec![panel], + }, + Self::Column => match place.as_ref() { + Some(place @ (PanelPlace::Dock { .. } | PanelPlace::Floating { .. })) => { + layout.column(place).map(|column| column.panels().copied().collect()).unwrap_or_else(|| vec![panel]) + } + _ => vec![panel], + }, + } + } +} + +/// Where a command puts what it moves relative to `anchor`: `zone` (default `default`) and +/// `before`, with side zones mapped onto the anchor's container by [`DockPlacement::for_zone`]. +fn placement( + layout: &Layout, + anchor: PanelKind, + zone: Option, + before: Option>, + default: ZoneName, +) -> Result, DockError> { + let side = |side| DockPlacement::for_zone(layout, &anchor, side); + Ok(match (zone.unwrap_or(default), before) { + (ZoneName::Tab | ZoneName::Center, Some(before)) => DockPlacement::tab(before), + (ZoneName::Tab, None) => DockPlacement::tab(None), + (ZoneName::Center, None) => DockPlacement::Split(DockSide::Center), + (_, Some(_)) => return Err(DockError::InvalidPlacement), + (ZoneName::Left, None) => side(DockSide::Start)?, + (ZoneName::Right, None) => side(DockSide::End)?, + (ZoneName::Top, None) => side(DockSide::Top)?, + (ZoneName::Bottom, None) => side(DockSide::Bottom)?, + (ZoneName::Above, None) => DockPlacement::group(false, None), + (ZoneName::Below, None) => DockPlacement::group(true, None), + }) +} + +/// The panels of the last column of the dock on `side`, or `None` without such a dock. +fn last_column(layout: &Layout, side: DockEdge) -> Option> { + let path = layout.dock_path(side)?; + match node_at(layout.root.as_ref()?, &path)? { + Node::Dock { columns, .. } => Some(columns.last()?.panels().copied().collect()), + _ => None, + } +} + +impl DockCommand { + /// Every `window.panel.*` command id. + pub const IDS: &'static [&'static str] = &[ + "window.panel.layout", + "window.panel.move", + "window.panel.float", + "window.panel.dock", + "window.panel.activate", + "window.panel.close", + "window.panel.closeGroup", + "window.panel.closeOthers", + "window.panel.minimize", + "window.panel.iconic", + "window.panel.window", + ]; + + /// The command `id` with `params`. Its own `command` key is set from `id`. + pub fn parse(id: &str, params: &serde_json::Value) -> Result { + let mut tagged = if params.is_object() { params.clone() } else { serde_json::json!({}) }; + if let Some(fields) = tagged.as_object_mut() { + fields.insert("command".into(), serde_json::json!(id)); + } + serde_json::from_value(tagged).map_err(|error| error.to_string()) + } + + /// The raw layout action the command carries, if it is one. + pub fn raw_action(&self) -> Option<&Action> { + match self { + Self::Layout { action } | Self::UiDock(UiDock::Action { action }) => Some(action), + _ => None, + } + } + + /// The panel the command shows: opening or activating it, or docking it back into the layout. + pub fn shown(&self) -> Option { + match self { + Self::Activate { panel } + | Self::Dock { panel, anchor: None, side: None, .. } + | Self::UiDock(UiDock::Operation(DockOperation::Open { panel } | DockOperation::Activate { panel })) => Some(*panel), + _ => None, + } + } + + /// The outer edge `window.panel.dock` goes to: a side zone without an anchor or side. + pub fn edge(&self) -> Option { + match self { + Self::Dock { anchor: None, side: None, zone: Some(zone), .. } => match zone { + ZoneName::Left => Some(DockSide::Start), + ZoneName::Right => Some(DockSide::End), + ZoneName::Top => Some(DockSide::Top), + ZoneName::Bottom => Some(DockSide::Bottom), + _ => None, + }, + _ => None, + } + } + + /// The layout actions this command makes on `workspace`, to apply all or none. A panel or + /// anchor that is not shown is [`DockError::MissingPanel`] or [`DockError::MissingTarget`]. + /// `space` is where a float without a rect goes: the dock's last [`FloatSpace`]. + pub fn to_actions(&self, workspace: &Workspace, space: Option<&FloatSpace>) -> Result>, DockError> { + let layout = workspace.layout(); + let shown = |panel: &PanelKind| if layout.contains(panel) { Ok(()) } else { Err(DockError::MissingPanel) }; + let one = |action: Action| Ok(vec![action]); + match self { + Self::Layout { action } | Self::UiDock(UiDock::Action { action }) => one(action.clone()), + Self::Move { panel, anchor, zone, before, group, placement: given } => { + shown(panel)?; + let placement = match given { + Some(placement) => placement.clone(), + None => placement(layout, *anchor, *zone, *before, ZoneName::Tab)?, + }; + one(Unit::of(*group, false).to(layout, *panel, Target::at(*anchor, placement))) + } + Self::Float { panel, x, y, width, height, group, column } => { + shown(panel)?; + let given = [*x, *y, *width, *height]; + let rect = |base: Rect| { + let mut values = [base.min.x, base.min.y, base.width(), base.height()]; + for (value, given) in values.iter_mut().zip(given) { + *value = given.unwrap_or(*value); + } + rect_of(values) + }; + let unit = Unit::of(*group, *column); + let window = layout.floating.iter().find(|window| window.contains(panel)); + let lone = window.is_some_and(|window| window.panels().count() == 1); + let whole = window.is_some_and(|window| window.groups().len() == 1); + let placed = || { + let size = space.and_then(|space| space.panel(panel)).or(space.map(|space| space.default_size)).unwrap_or(DEFAULT_FLOAT); + rect(space.map_or_else(|| Rect::from_center_size(pos2(840.0, 510.0), size), |space| space.place(size))) + }; + match (unit, window.map(|window| window.rect)) { + (Unit::Panel, Some(base)) if lone => one(Action::move_floating(*panel, rect(base))), + (Unit::Column, Some(base)) => one(Action::move_floating(*panel, rect(base))), + (Unit::Group, Some(base)) if whole => one(Action::move_floating(*panel, rect(base))), + (Unit::Panel, _) => one(Action::float(*panel, placed())), + (unit, _) => one(unit.to(layout, *panel, Target::float(placed()))), + } + } + Self::Dock { panel, anchor, zone, before, group, column, side } => { + shown(panel)?; + let unit = Unit::of(*group, *column); + if let Some(anchor) = anchor { + let placement = placement(layout, *anchor, *zone, *before, ZoneName::Tab)?; + return one(unit.to(layout, *panel, Target::at(*anchor, placement))); + } + let members = unit.members(layout, *panel); + if let Some(side) = side { + let to = match last_column(layout, *side) { + Some(column) => match column.into_iter().find(|p| !members.contains(p)) { + Some(anchor) => Target::at(anchor, DockPlacement::column(true)), + // What moves already is that dock's last column. + None => return Ok(Vec::new()), + }, + None => Target::new_dock(*side), + }; + let unit = match (unit, &to) { + (Unit::Panel, Target::NewDock { .. }) if Unit::Group.members(layout, *panel).len() == 1 => Unit::Group, + (unit, _) => unit, + }; + return one(unit.to(layout, *panel, to)); + } + if let Some(zone) = self.edge() { + if before.is_some() { + return Err(DockError::InvalidPlacement); + } + // Every EffectCraft panel moves and closes: no edge narrows to a protected canvas. + let anchor = layout.edge_anchor(false, &|_| false, &|p| members.contains(p)).ok_or(DockError::MissingTarget)?; + return one(unit.to(layout, *panel, Target::at(anchor, DockPlacement::Edge(zone)))); + } + if !matches!(layout.place(panel), Some(PanelPlace::Floating { .. })) { + return Ok(Vec::new()); + } + let anchor = layout + .panels() + .into_iter() + .copied() + .filter(|p| !members.contains(p)) + .find(|p| !matches!(layout.place(p), Some(PanelPlace::Floating { .. }))) + .ok_or(DockError::MissingTarget)?; + one(unit.to(layout, *panel, Target::at(anchor, DockPlacement::tab(None)))) + } + Self::Activate { panel } => { + shown(panel)?; + one(Action::activate(*panel)) + } + Self::Close { panel } => one(Action::close(*panel)), + Self::CloseGroup { panel } => one(Action::close_group(*panel)), + Self::CloseOthers { panel } => one(Action::close_others(*panel)), + Self::Minimize { panel, minimized } => { + let place = layout.place(panel).ok_or(DockError::MissingPanel)?; + // An accordion entry is minimized while it is closed. + let current = match &place { + PanelPlace::Node(path) => match layout.root.as_ref().and_then(|root| node_at(root, path)) { + Some(Node::Stack { entries, .. }) => entries.iter().any(|entry| entry.panel == *panel && !entry.open), + _ => false, + }, + place => layout.group(place).is_some_and(|group| group.minimized), + }; + one(Action::set_minimized(*panel, minimized.unwrap_or(!current))) + } + Self::Iconic { panel, iconic } => { + let place = layout.place(panel).ok_or(DockError::MissingPanel)?; + let current = layout.column(&place).is_some_and(|column| column.iconic); + one(Action::set_iconic(*panel, iconic.unwrap_or(!current))) + } + // A floating window of its own is the app's (`EffectcraftApp::set_panel_window`). + Self::Window { .. } => Err(DockError::NotAllowed), + Self::UiDock(UiDock::Operation(operation)) => match operation { + DockOperation::Open { panel } | DockOperation::Activate { panel } => { + shown(panel)?; + one(Action::activate(*panel)) + } + DockOperation::Close { panel } => one(Action::close(*panel)), + DockOperation::Float { panel, rect } => one(Action::float(*panel, rect_of(*rect))), + DockOperation::MoveFloating { panel, rect } => one(Action::move_floating(*panel, rect_of(*rect))), + DockOperation::Move { panel, target, zone, before } => { + one(Action::move_beside(*panel, *target, placement(layout, *target, *zone, *before, ZoneName::Center)?)) + } + DockOperation::SetStackOpen { panel, open } => one(Action::set_stack_open(*panel, *open)), + DockOperation::ResizeStack { panel, height } => one(Action::resize_stack(*panel, *height)), + DockOperation::ResizeSplit { path, size } => one(Action::resize_split(path.clone(), *size)), + }, + } + } +} diff --git a/crates/ui-egui/src/dock_ui.rs b/crates/ui-egui/src/dock_ui.rs index 6e98e11ee..4f7556728 100644 --- a/crates/ui-egui/src/dock_ui.rs +++ b/crates/ui-egui/src/dock_ui.rs @@ -1,79 +1,35 @@ -//! EffectCraft's panels in craft-ui's shared docking. craft-ui draws the frames, tab strips, -//! stacked panels, floating windows, dividers and drop previews and owns the gestures (drag a tab -//! onto a group to tab it there or split it off to a side; hold Cmd/Ctrl at the release, or drop -//! outside every group, to float it). EffectCraft draws the panel bodies, the ≡ panel menu, the -//! Timeline's comp tabs and the viewer locks in each group header, and runs every layout change -//! through its command path (`window.dockAction`), so pointer, menu and control-channel changes -//! share one route. +//! EffectCraft's panels in craft-ui's shared docking. craft-ui's `DockArea` draws the frames, +//! tab strips (the Timeline's comp tabs included, as its panel's documents), stacked panels, +//! floating windows, dividers and drop previews and owns the gestures (drag a tab onto a group to +//! tab it there or split it off to a side; hold Cmd/Ctrl at the release, or drop outside every +//! group, to float it). EffectCraft draws the panel bodies and the viewer lock and ≡ panel menu in +//! each group header, and runs every layout change through its command path +//! (`window.dockAction`), so pointer, menu and control-channel changes share one route. -use crate::state::UiState; -use craft_behavior::dock::{Action, DockError, Floating, Node}; -use craft_ui::docking::{Divider, DockArea, DockCommand, DockContent, DockEvent, DockStyle, FloatSpace, Hit, ResizeEdge, UiDock}; -use egui::{Rect, Sense, Stroke, StrokeKind, pos2, vec2}; +use std::sync::Arc; + +use craft_behavior::dock::{Action, Floating}; +use craft_ui::contract::{Bind, BodyCx, PlainData, Tracked}; +use craft_ui::docking::{DividerKind, DockConfig, DockEvent, DockPanels, DockSource, FloatSpace, PanelDocument, PanelSpec, PanelSpecs, SourceKind}; +use craft_ui::patterns::dock::{DockArea, DockAreaOutput, WindowFiles}; +use craft_ui::runtime::windows::ResizeEdge; +use egui::{Rect, Sense, Stroke, StrokeKind, Ui, vec2}; use serde_json::{Value, json}; -use crate::dock::{self, DocAction, DocTab, PanelKind, Workspace, WorkspaceExt as _}; +use crate::dock::{self, PanelKind, Permissions, Workspace, WorkspaceExt as _}; +use crate::dock_command::DockCommand; use crate::icons::{self, Icon}; use crate::theme::Tokens; use crate::{EffectcraftApp, panels}; -/// The dock area's egui id; `DockArea::hit_rects` and `float_space` read by it. -pub fn area_id() -> egui::Id { - egui::Id::unique("effectcraft-docking") -} - -/// Width of the ≡ panel menu button at the end of each tab strip. +/// Width of the ≡ panel menu button in each group header. const MENU_W: f32 = 26.0; /// Width of the viewer lock before it. const LOCK_W: f32 = 18.0; -/// The smallest and largest native panel window, in points. -pub const PANEL_WINDOW_MIN: [f32; 2] = [160.0, 100.0]; -pub const PANEL_WINDOW_MAX: f32 = 16_384.0; -/// The farthest a native panel window may sit from the desktop origin, in points. -pub const PANEL_WINDOW_MAX_POS: f32 = 100_000.0; - -/// A native panel window's desktop rect made safe to hand to the windowing system: finite, with -/// a size within [`PANEL_WINDOW_MIN`]..=[`PANEL_WINDOW_MAX`] and a position within -/// ±[`PANEL_WINDOW_MAX_POS`] (hostile workspace files and bad monitor reports included). -pub fn sanitized_window_rect(rect: [f32; 4]) -> [f32; 4] { - let finite = |v: f32, fallback: f32| if v.is_finite() { v } else { fallback }; - let [x, y, w, h] = rect; - [ - finite(x, 0.0).clamp(-PANEL_WINDOW_MAX_POS, PANEL_WINDOW_MAX_POS), - finite(y, 0.0).clamp(-PANEL_WINDOW_MAX_POS, PANEL_WINDOW_MAX_POS), - finite(w, 420.0).clamp(PANEL_WINDOW_MIN[0], PANEL_WINDOW_MAX), - finite(h, 320.0).clamp(PANEL_WINDOW_MIN[1], PANEL_WINDOW_MAX), - ] -} - -/// How long to wait for the main window to report its frame before migrated native windows -/// keep their places as they are, in seconds. -const FRAME_REPORT_WAIT: f64 = 2.0; - -/// Moves the native rects of [`UiState::native_outer`]'s windows from the OS window's outer -/// position to its content position, by the main window's frame offset (`inner` less `outer`, -/// the main window's desktop rects): the earlier version's windows had the same OS title bar. -/// Without a report by [`FRAME_REPORT_WAIT`] (a backend without window positions), the places -/// stay as they are. -pub(crate) fn native_outer_to_content(ui: &mut UiState, outer: Option, inner: Option, now: f64) { - let offset = match (outer, inner) { - (Some(outer), Some(inner)) if outer.min.is_finite() && inner.min.is_finite() => inner.min - outer.min, - _ if now < FRAME_REPORT_WAIT => return, - _ => egui::Vec2::ZERO, - }; - let ids = std::mem::take(&mut ui.native_outer); - for window in ui.dock.layout.floating.iter_mut().filter(|w| ids.contains(&w.id)) { - if let Some([x, y, w, h]) = window.native { - window.native = Some(sanitized_window_rect([x + offset.x, y + offset.y, w, h])); - } - } -} - /// A new floating group's default rect near the centre of `screen`. -pub fn default_float_rect(screen: Rect) -> [f32; 4] { - let c = screen.center(); - [c.x - 210.0, c.y - 160.0, 420.0, 320.0] +pub fn default_float_rect(screen: Rect) -> Rect { + Rect::from_center_size(screen.center(), vec2(420.0, 320.0)) } /// A panel named by its title or id ("Effect Controls", "EffectControls") or its serialized @@ -92,8 +48,8 @@ fn check_raw_action(action: &Action) -> Result<(), String> { Ok(()) } -/// The docking commands: `window.dockAction {action}`, craft-ui's `window.panel.*` commands, -/// `ui.dock` and `ui.dock.reset`. `None` for any other id. +/// The docking commands: `window.dockAction {action}`, the `window.panel.*` commands, `ui.dock` +/// and `ui.dock.reset`. `None` for any other id. pub(crate) fn route(app: &mut EffectcraftApp, ctx: &egui::Context, id: &str, params: &Value) -> Option> { match id { "window.dockAction" => Some((|| { @@ -109,19 +65,14 @@ pub(crate) fn route(app: &mut EffectcraftApp, ctx: &egui::Context, id: &str, par Some(Ok(json!({"docking": app.ui.dock}))) } "ui.dock" => Some((|| { - let mut tagged = if params.is_object() { params.clone() } else { json!({}) }; - if let Some(fields) = tagged.as_object_mut() { - fields.insert("command".into(), json!("ui.dock")); - } - let command: DockCommand = serde_json::from_value(tagged).map_err(|error| format!("invalid ui.dock params: {error}"))?; + let command = DockCommand::parse("ui.dock", params).map_err(|error| format!("invalid ui.dock params: {error}"))?; app.run_dock_command(ctx, command)?; Ok(json!({"docking": app.ui.dock})) })()), - _ if id.starts_with("window.panel.") && DockCommand::::IDS.contains(&id) => Some((|| { - let mut tagged = if params.is_object() { params.clone() } else { json!({}) }; - if let Some(fields) = tagged.as_object_mut() { - fields.insert("command".into(), json!(id)); - // EffectCraft's panel names ("Effect Controls") as well as craft-ui's ids. + _ if DockCommand::IDS.contains(&id) => Some((|| { + let mut params = if params.is_object() { params.clone() } else { json!({}) }; + if let Some(fields) = params.as_object_mut() { + // EffectCraft's panel names ("Effect Controls") as well as the serialized ids. for key in ["panel", "anchor", "before"] { if let Some(name) = fields.get(key).and_then(Value::as_str) { let panel = PanelKind::from_name(name).ok_or(format!("unknown panel `{name}`"))?; @@ -129,7 +80,7 @@ pub(crate) fn route(app: &mut EffectcraftApp, ctx: &egui::Context, id: &str, par } } } - let command: DockCommand = serde_json::from_value(tagged).map_err(|error| format!("invalid docking command: {error}"))?; + let command = DockCommand::parse(id, ¶ms).map_err(|error| format!("invalid docking command: {error}"))?; app.run_dock_command(ctx, command)?; Ok(Value::Null) })()), @@ -154,43 +105,25 @@ impl EffectcraftApp { crate::menus::invoke(self, ctx, "window.dockAction", json!({"action": value})).map(|_| ()) } - /// Run a craft-ui docking command on the current workspace, all or nothing. Named - /// workspaces and Reset are EffectCraft's own (`window.workspace`, `window.resetWorkspace`). - pub(crate) fn run_dock_command(&mut self, ctx: &egui::Context, command: DockCommand) -> Result<(), String> { - if let DockCommand::Layout { action } | DockCommand::UiDock(UiDock::Action { action }) = &command { + /// Run a docking command on the current workspace, all or nothing. Named workspaces and + /// Reset are EffectCraft's own (`window.workspace`, `window.resetWorkspace`). + pub(crate) fn run_dock_command(&mut self, ctx: &egui::Context, command: DockCommand) -> Result<(), String> { + if let Some(action) = command.raw_action() { check_raw_action(action)?; } - if command.is_app_owned() { - if matches!(command, DockCommand::ResetWorkspace {}) { - let name = self.ui.workspace.clone(); - self.set_workspace(&name); - return Ok(()); - } - return Err("use the window.workspace commands for named workspaces".into()); + if let DockCommand::Window { panel, native } = command { + return self.set_panel_window(ctx, panel, native.or(Some(true))).map(drop); } // A closed panel opens through EffectCraft's own path, which puts it in its usual place // and runs the viewer and ScriptUI lifecycles. - let shown = match &command { - DockCommand::Activate { panel } | DockCommand::UiDock(UiDock::Operation(craft_ui::docking::DockOperation::Open { panel })) => Some(*panel), - DockCommand::UiDock(UiDock::Operation(craft_ui::docking::DockOperation::Activate { panel })) => Some(*panel), - _ => None, - }; - if let Some(panel) = shown.filter(|panel| !self.ui.dock.is_open(*panel)) { + if let Some(panel) = command.shown().filter(|panel| !self.ui.dock.is_open(*panel)) { self.show_panel(panel); - return Ok(()); - } - let space = craft_ui::docking::float_space(ctx, area_id()).unwrap_or_else(|| FloatSpace::new(ctx.content_rect())); - match command.to_actions(&self.ui.dock, false, &space) { - Ok(actions) => self.apply_dock_all(actions), - // Showing a hidden panel at an edge, and Lock, change more than the layout. - Err(DockError::NotAllowed) => { - let mut workspace = self.ui.dock.clone(); - let closed = command.apply(&mut workspace, false, &space, dock::permissions).map_err(|error| error.to_string())?; - self.commit_workspace(workspace, &closed, true); - Ok(()) + if command.edge().is_none() { + return Ok(()); } - Err(error) => Err(error.to_string()), } + let actions = command.to_actions(&self.ui.dock, self.live_dock.float_space.as_ref()).map_err(|error| error.to_string())?; + self.apply_dock_all(actions) } pub fn apply_dock(&mut self, action: Action) -> Result<(), String> { @@ -214,9 +147,9 @@ impl EffectcraftApp { | Action::MoveColumn { .. } ); let closing = matches!(&action, Action::Close { .. } | Action::CloseGroup { .. } | Action::CloseWindow { .. } | Action::CloseOthers { .. }); - let docked = workspace.layout.root.is_some(); - closed.extend(workspace.apply(action, dock::permissions).map_err(|error| error.to_string())?); - if !closing && docked && workspace.layout.root.is_none() { + let docked = workspace.layout().root.is_some(); + closed.extend(workspace.apply(action, self.ui.dock_locked, dock::permissions).map_err(|error| error.to_string())?); + if !closing && docked && workspace.layout().root.is_none() { return Err("the last docked panel must remain in the workspace".into()); } } @@ -245,7 +178,7 @@ impl EffectcraftApp { /// Close a panel wherever it is (docked or floating). A rejected close changes nothing. pub fn close_panel(&mut self, p: PanelKind) { if self.ui.dock.is_open(p) { - let _ = self.apply_dock(Action::Close { panel: p }); + let _ = self.apply_dock(Action::close(p)); } } @@ -259,18 +192,16 @@ impl EffectcraftApp { pos.and_then(|p| self.dock_rects.iter().rev().find(|(_, r)| r.contains(p)).map(|(k, _)| *k)).unwrap_or(self.ui.focused) } - /// Whether panel `p` is in a floating window with a desktop place: its own OS window on - /// desktop (craft-ui `native-windows`); on the web and in embedded viewports the window - /// stays in the page and the place is kept for a desktop session. + /// Whether panel `p` is in a floating window: on desktop each is an OS window of its own + /// (`DockConfig::native_windows`), which can go on another monitor; on the web and in + /// embedded viewports it stays in the page. pub fn in_panel_window(&self, p: PanelKind) -> bool { - self.ui.dock.layout.floating.iter().any(|w| w.contains(&p) && w.native.is_some()) + self.ui.dock.is_floating(p) } - /// Move panel `p` into a floating window of its own, which on desktop is an OS window that - /// can go on another monitor, or back into the main window (`window` false), where it joins - /// the first docked group. `None` toggles. A docked panel is undocked first, and its window - /// opens over the panel's place in the main window. Returns whether `p` is now in a window - /// of its own. + /// Move panel `p` into a floating window of its own, or back into the main window + /// (`window` false), where it joins the first docked group. `None` toggles. A docked panel + /// floats over its place in the main window. Returns whether `p` is now in a window. pub fn set_panel_window(&mut self, ctx: &egui::Context, p: PanelKind, window: Option) -> Result { let current = self.in_panel_window(p); let window = window.unwrap_or(!current); @@ -278,36 +209,28 @@ impl EffectcraftApp { return Ok(current); } if !window { - // On desktop every floating window is an OS window, so the way back is docking. - let anchor = self.ui.dock.layout.root.as_ref().and_then(|root| { + let anchor = self.ui.dock.layout().root.as_ref().and_then(|root| { let mut panels = Vec::new(); dock::node_panels(root, &mut panels); panels.into_iter().find(|panel| *panel != p) }); let actions = match anchor { - Some(anchor) => vec![Action::Move { panel: p, anchor, placement: craft_behavior::dock::DockPlacement::Tab { before: None } }], + Some(anchor) => vec![Action::move_beside(p, anchor, craft_behavior::dock::DockPlacement::tab(None))], // Nothing is docked: the panel becomes the docked layout. - None => vec![Action::Close { panel: p }, Action::Open { panel: p, anchor: None }], + None => vec![Action::close(p), Action::open(p, None)], }; let mut workspace = self.ui.dock.clone(); // One transaction, so the panel is never reported closed and keeps its state. - let closed = workspace.apply_all(actions, dock::permissions).map_err(|_| format!("can't dock {}", p.title()))?; + let closed = workspace.apply_all(actions, self.ui.dock_locked, dock::permissions).map_err(|_| format!("can't dock {}", p.title()))?; self.commit_workspace(workspace, &closed, true); return Ok(false); } - if !self.ui.dock.is_floating(p) { - if !self.ui.dock.is_docked(p) { - return Err(format!("{} is not open", p.title())); - } - let rect = default_float_rect(ctx.input_for(egui::ViewportId::ROOT, |i| i.content_rect())); - self.apply_dock(Action::Float { panel: p, rect }).map_err(|_| format!("can't undock {}", p.title()))?; + if !self.ui.dock.is_docked(p) { + return Err(format!("{} is not open", p.title())); } - let Some([x, y, w, h]) = self.ui.dock.layout.floating.iter().find(|f| f.contains(&p)).map(|f| f.rect) else { - return Err(format!("can't undock {}", p.title())); - }; - let origin = ctx.input_for(egui::ViewportId::ROOT, |i| i.viewport().inner_rect.map(|r| r.min)).unwrap_or(pos2(0.0, 0.0)); - let rect = sanitized_window_rect([origin.x + x, origin.y + y, w, h]); - self.apply_dock(Action::SetNative { panel: p, rect: Some(rect) })?; + let place = self.dock_rects.iter().find(|(panel, _)| *panel == p).map(|(_, rect)| *rect); + let rect = place.unwrap_or_else(|| default_float_rect(ctx.input_for(egui::ViewportId::ROOT, |i| i.content_rect()))); + self.apply_dock(Action::float(p, rect)).map_err(|_| format!("can't undock {}", p.title()))?; if self.ui.maximized == Some(p) { self.ui.maximized = None; } @@ -342,46 +265,77 @@ impl EffectcraftApp { out } - /// A comp's label colour as a tab swatch (faint without a label). - fn comp_swatch(&self, cid: effectcraft_engine::project::ItemId) -> egui::Color32 { + /// A comp's label colour as a tab swatch; `None` without a label (the theme's empty swatch). + fn comp_swatch(&self, cid: effectcraft_engine::project::ItemId) -> Option { match self.session.project.item(cid).map(|i| i.label) { - Some(l) if l != effectcraft_engine::color::Label::None => self.tokens.label(l), - _ => self.tokens.text_faint, + Some(l) if l != effectcraft_engine::color::Label::None => Some(self.tokens.label(l)), + _ => None, } } /// The Timeline's comp tabs: one per open comp, as in After Effects (opening a precomp adds a /// tab next to its parent's instead of replacing it). - fn tab_docs(&self) -> Vec { + fn tab_docs(&self) -> Vec { let st = &self.session.state; st.open_comps .iter() .filter_map(|id| { let it = self.session.project.item(*id).filter(|i| i.as_comp().is_some())?; - Some(DocTab { id: id.0, title: it.name.clone(), swatch: self.comp_swatch(*id), active: st.active_comp == Some(*id) }) + Some(DocRow { id: id.0, label: it.name.clone(), swatch: self.comp_swatch(*id).map(rgba), shown: st.active_comp == Some(*id) }) }) .collect() } /// The label-colour swatch before a tab's name: each Composition viewer's comp, and Effect /// Controls' (and with Use Label Color for Related Tabs, Properties') selected layer. - fn tab_swatches(&self) -> Vec<(PanelKind, egui::Color32)> { + fn tab_swatches(&self) -> Vec<(PanelKind, Option)> { let mut v = Vec::new(); for id in std::iter::once(0).chain(self.ui.viewers.keys().copied().filter(|v| *v != 0)) { - let swatch = panels::viewers::comp_of(self, id).map_or(self.tokens.text_faint, |c| self.comp_swatch(c)); + let swatch = panels::viewers::comp_of(self, id).and_then(|c| self.comp_swatch(c)); v.push((panels::viewers::panel(id), swatch)); } if let Some(l) = self.session.active_comp().and_then(|c| self.session.state.selected_layers.first().and_then(|id| c.layer(*id))) && l.label != effectcraft_engine::color::Label::None { - v.push((PanelKind::EffectControls, self.tokens.label(l.label))); + v.push((PanelKind::EffectControls, Some(self.tokens.label(l.label)))); if self.session.prefs.appearance.use_label_color_for_tabs { - v.push((PanelKind::Properties, self.tokens.label(l.label))); + v.push((PanelKind::Properties, Some(self.tokens.label(l.label)))); } } v } + /// The panel name the Window menu uses; `Markers` is only in the panel catalog, and the two + /// panels in neither (`History`, `ScriptUI Panel`) keep their English names. + fn logical_label(panel: PanelKind) -> String { + let title = panel.title(); + let listed = crate::i18n::command_label("window.panel", title); + if listed == title { crate::i18n::tr(title).to_string() } else { listed.to_string() } + } + + /// Read the panels' tab names, swatches and the Timeline's comps into the dock's spec model, + /// moving its revision only when one changed. + fn refresh_dock_specs(&mut self) { + let titles = self.tab_titles(); + let swatches = self.tab_swatches(); + let docs = self.tab_docs(); + let rows: Vec = self + .ui + .dock + .panels() + .into_iter() + .map(|panel| SpecRow { + panel: panel.id(), + label: titles.iter().find(|(p, _)| *p == panel).map_or_else(|| Self::logical_label(panel), |(_, t)| t.clone()), + swatch: swatches.iter().find(|(p, _)| *p == panel).map(|(_, swatch)| swatch.map(rgba)), + documents: if panel == PanelKind::Timeline { docs.clone() } else { Vec::new() }, + }) + .collect(); + if self.live_dock.specs.rows != rows { + self.live_dock.specs.rows = rows; + } + } + /// Draw panel `p`'s body in `rect`: register its automation region, put the Composition Navigator above an active /// viewer when a nested-comp flow exists, then call the panel's `show` and (for a viewer) the sketch overlay. fn panel_body(&mut self, ui: &mut egui::Ui, p: PanelKind, rect: Rect) { @@ -424,16 +378,12 @@ impl EffectcraftApp { self.dialog.is_some() || panels::dialogs::modal_open(ctx) || file_dialog } - /// Draw the Home screen or workspace in `body`. Shared craft-ui docking owns the dock tree, - /// group chrome, tab dragging and floating native windows; this adapter draws panel bodies, - /// applies the returned events/actions and shows the panel menu. + /// Draw the Home screen or workspace in `body`. craft-ui's `DockArea` owns the dock tree, + /// group chrome, tab dragging and floating native windows; this adapter keeps the panels' + /// specs, draws their bodies and headers, and applies the returned actions and events. pub(crate) fn dock_area(&mut self, ui: &mut egui::Ui, body: Rect) { let t = self.tokens; let ctx = ui.ctx().clone(); - if !self.ui.native_outer.is_empty() { - let (outer, inner, now) = ctx.input_for(egui::ViewportId::ROOT, |i| (i.viewport().outer_rect, i.viewport().inner_rect, i.time)); - native_outer_to_content(&mut self.ui, outer, inner, now); - } if self.ui.start_screen { // Home covers the whole workspace, as in After Effects (the panels wait behind it). let mut child = ui.new_child(egui::UiBuilder::new().max_rect(body).id_salt("home")); @@ -441,33 +391,33 @@ impl EffectcraftApp { panels::home::show(self, &mut child, body); return; } - let style = dock_style(ui, &t); + self.refresh_dock_specs(); + let shown = self.live_dock.shown(&self.ui.dock); + // The specs leave the app while its panels borrow it, and come back with their revision. + let specs = std::mem::take(&mut self.live_dock.specs); let maximized = self.ui.maximized.filter(|m| self.ui.dock.is_docked(*m)); - let mut area = DockArea::new(area_id()).float_bounds(body).maximized(maximized).locked(self.ui.dock.locked).input_blocked(self.floats_blocked(&ctx)); - if let Some(panel) = self.pending_panel_raise.take() { - area = area.raise_panel(panel); - } - let layout = self.ui.dock.layout.clone(); + let locked = self.ui.dock_locked; + let raise = self.pending_panel_raise.take(); + let ime = NativeIme::new(&shown.layout().floating, &self.live_dock.windows, &self.unpublished_viewports); let mut child = ui.new_child(egui::UiBuilder::new().max_rect(body).id_salt("effectcraft-dock-area")); child.set_clip_rect(body.intersect(ui.clip_rect())); - let docs = self.tab_docs(); - let ime = NativeIme::new(&layout.floating, &self.unpublished_viewports); - let mut content = EffectContent { - titles: self.tab_titles(), - swatches: self.tab_swatches(), - docs, - ctx: ctx.clone(), - style: style.clone(), - app: self, - tokens: t, - doc_actions: Vec::new(), - locks: Vec::new(), - menu: None, - bodies: Vec::new(), - ime, + let mut panels = EffectPanels { app: &mut *self, tokens: t, locks: Vec::new(), menu: None, bodies: Vec::new(), ime }; + let output = { + let mut area = DockArea::new("Panels", Bind::given(Arc::clone(&shown)), &specs, &mut panels, dock_config()); + if let Some(panel) = maximized { + area = area.maximized(panel); + } + if locked { + area = area.locked(); + } + if let Some(panel) = raise { + area = area.raise(panel); + } + area.show(&mut child) }; - let mut output = area.show_content(&mut child, &layout, &style, &mut content); - let EffectContent { doc_actions, locks, menu, bodies, ime, .. } = content; + let EffectPanels { locks, menu, bodies, ime, .. } = panels; + self.live_dock.specs = specs; + let DockAreaOutput { actions, requested, events, focused, picked, error, float_space, windows, window_files, sources, .. } = output; self.dock_rects = bodies; self.unpublished_viewports = ime.unpublished(); // A window that closed or docked takes its composition with it. @@ -476,22 +426,49 @@ impl EffectcraftApp { for viewport in gone { panels::viewer_text::end_viewport(self, &ctx, viewport); } - self.forward_window_input(&ctx, std::mem::take(&mut output.forwarded_events), std::mem::take(&mut output.window_files)); - if let Some(panel) = output.focused { + if float_space.is_some() { + self.live_dock.float_space = float_space; + } + self.forward_window_input(&ctx, &windows, window_files); + self.live_dock.windows = windows; + // Key focus moving to a group, or a tab picked, focuses that panel. + let moved = focused != self.live_dock.focused; + self.live_dock.focused = focused; + if let Some(panel) = picked.or(focused.filter(|_| moved)) { self.focus_panel(&ctx, panel); } - if let Some(error) = output.error { - self.ui.status = error.to_string(); + if let Some(error) = error { + self.ui.status = error.error.to_string(); } - for event in output.events { - if let DockEvent::ToggleMaximize { panel } = event { - self.toggle_maximize(panel); + for event in events { + match event { + DockEvent::ToggleMaximize { panel, .. } => self.toggle_maximize(panel), + // The Timeline's comp tabs: show that comp / close its Timeline. + DockEvent::DocumentPicked { panel: PanelKind::Timeline, document, .. } => { + self.focus_panel(&ctx, PanelKind::Timeline); + if self.session.state.active_comp.map(|c| c.0) != Some(document) + && let Err(error) = crate::menus::invoke(self, &ctx, "comp.open", json!({"comp": document})) + { + self.ui.status = error; + } + } + DockEvent::DocumentClosed { panel: PanelKind::Timeline, document, .. } => { + if let Err(error) = crate::menus::invoke(self, &ctx, "comp.close", json!({"comp": document})) { + self.ui.status = error; + } + } + _ => {} } } - for action in output.actions { - if let Err(error) = self.dock_command(&ctx, action) { - self.ui.status = error; + // A layout a panel changed during the pass takes priority over the gestures of the one shown. + if self.ui.dock == *shown { + for action in actions.into_iter().chain(requested) { + if let Err(error) = self.dock_command(&ctx, action) { + self.ui.status = error; + } } + } else { + craft_ui::runtime::drag::cancel(&ctx, craft_behavior::CancelReason::HostChanged); } for p in locks { if p == PanelKind::EffectControls { @@ -504,108 +481,77 @@ impl EffectcraftApp { self.ui.locked_tabs.insert(p.id().to_string()); } } - for action in doc_actions { - let result = match action { - // The Timeline's comp tabs: show that comp / close its Timeline. - DocAction::Activate(id) => { - let _ = self.apply_dock(Action::Activate { panel: PanelKind::Timeline }); - self.focus_panel(&ctx, PanelKind::Timeline); - if self.session.state.active_comp.map(|c| c.0) == Some(id) { - Ok(Value::Null) - } else { - crate::menus::invoke(self, &ctx, "comp.open", json!({"comp": id})) - } - } - DocAction::Close(id) => crate::menus::invoke(self, &ctx, "comp.close", json!({"comp": id})), - }; - if let Err(error) = result { - self.ui.status = error; - } - } if let Some(open) = menu { ctx.data_mut(|d| d.insert_temp::(egui::Id::unique("panel-menu"), open)); // the owner window draws it on its next pass ctx.request_repaint(); } drop_menu_of_closed_window(&ctx, &self.native_viewports); - let hits = DockArea::::hit_rects(&ctx, area_id()); - self.register_dock_hits(&hits); + self.register_dock_hits(&sources); panels::panel_menu_popup(self, ui); } /// Keys and dropped files that reach a floating panel's own OS window go to the main /// window's next frame ([`crate::EffectcraftApp::raw_input_hook`]), so its shortcuts and - /// file import handle them. Text is not forwarded, and nothing is while a text field in - /// the main window has the keyboard. - fn forward_window_input(&mut self, ctx: &egui::Context, events: Vec, files: Vec>) { - let typing = ctx.egui_wants_keyboard_input(); - let events = events.into_iter().filter(|event| !typing && !matches!(event, egui::Event::Text(_) | egui::Event::Ime(_))); - self.forwarded.events.extend(events); - if handed_over_to_the_timeline(files.iter().map(|window| (window.panel, !window.dropped.is_empty()))) { + /// file import handle them. Text is not forwarded, and no key is while a text field has the + /// keyboard. + fn forward_window_input(&mut self, ctx: &egui::Context, windows: &[(PanelKind, egui::ViewportId)], files: Vec>) { + let typing = crate::native_menu::text_field_window(ctx).is_some(); + for (_, viewport) in windows { + let events = ctx.input_for(*viewport, |i| i.events.clone()); + self.forwarded.events.extend(events.into_iter().filter(|event| !typing && !matches!(event, egui::Event::Text(_) | egui::Event::Ime(_)))); + } + if handed_over_to_the_timeline(files.iter().map(|drop| (drop.panel, !drop.files.is_empty()))) { self.forwarded.dropped_on_timeline = true; } - self.forwarded.files.extend(files.into_iter().flat_map(|window| window.dropped)); + #[cfg(not(target_arch = "wasm32"))] + self.forwarded.files.extend(files.into_iter().flat_map(|drop| drop.files).map(|file| Arc::new(WindowFile(file)) as egui::DroppedFileHandle)); + #[cfg(target_arch = "wasm32")] + let _ = files; if !self.forwarded.events.is_empty() || !self.forwarded.files.is_empty() { ctx.request_repaint(); } } - /// Automation ids for craft-ui's gesture sources: `panel.tab.`, `panel.drag.` - /// (the group's drag bar), `panel.border.` (the top border above its tabs), - /// `panel.tabs.more.`, `panel.header.` (a stacked panel's open/close button), - /// `panel.float..move`, `.close`, `.resize` (bottom-right - /// corner) and `.resize.`, `dock.gutter.` (`a`/`b` per split level; a stack's gap - /// below entry `i` adds `s`), `dock.corner..` where two dividers meet, and - /// the same inside floating window `n` as `panel.float..gutter.…` and `.corner.…`. - fn register_dock_hits(&mut self, hits: &[(Hit, Rect)]) { - let window = |panel: &PanelKind| self.ui.dock.layout.floating.iter().position(|window| window.contains(panel)); + /// Automation ids for the dock's gesture sources: `panel.tab.`, `panel.drag.` + /// (the group's drag bar), `panel.float..move` and `.resize` (bottom-right corner) and + /// `.resize.` for floating window `n`, `dock.gutter.` (`a`/`b` per split level; a + /// stack's gap below entry `i` adds `s`), `dock.gutter.group.` under a dock + /// column's group and `dock.column.` at a dock column's inner edge. + fn register_dock_hits(&mut self, sources: &[DockSource]) { + let window = |panel: &PanelKind| self.ui.dock.layout().floating.iter().position(|window| window.contains(panel)); // Tabs are labelled as drawn: "Composition Intro", not "Composition". let titles = self.tab_titles(); let title = |panel: &PanelKind| titles.iter().find(|(p, _)| p == panel).map_or_else(|| panel.title().to_string(), |(_, t)| t.clone()); let mut found = Vec::new(); - for (hit, rect) in hits { - let entry = match hit { - Hit::Tab(panel) => (format!("panel.tab.{}", panel.id()), title(panel)), - Hit::DragBar(panel) => (format!("panel.drag.{}", panel.id()), "Move panel group".into()), - Hit::Border(panel) => (format!("panel.border.{}", panel.id()), "Move panel group".into()), - Hit::Overflow(panel) => (format!("panel.tabs.more.{}", panel.id()), "More tabs".into()), - Hit::StackToggle(panel) => (format!("panel.header.{}", panel.id()), title(panel)), - Hit::Title(panel) => match window(panel) { + for source in sources { + let entry = match &source.kind { + SourceKind::Tab(panel) => (format!("panel.tab.{}", panel.id()), title(panel)), + SourceKind::GroupBar(panel) => (format!("panel.drag.{}", panel.id()), "Move panel group".into()), + SourceKind::WindowGrip(panel) => match window(panel) { Some(index) => (format!("panel.float.{index}.move"), "Move floating panel".into()), None => continue, }, - Hit::Close(panel) => match window(panel) { - Some(index) => (format!("panel.float.{index}.close"), "Close floating panel".into()), - None => continue, - }, - Hit::Resize(panel, edge) => match window(panel) { + SourceKind::WindowResize(panel, edge) => match window(panel) { Some(index) if *edge == ResizeEdge::BottomRight => (format!("panel.float.{index}.resize"), "Resize floating panel".into()), Some(index) => (format!("panel.float.{index}.resize.{edge:?}"), "Resize floating panel".into()), None => continue, }, - Hit::Divider(Divider::Split(path)) => (format!("dock.gutter.{}", path_id(path)), "gutter".into()), - Hit::Divider(Divider::Stack(panel)) => match dock::stack_gutter_id(&self.ui.dock.layout, *panel) { - Some(id) => (id, "gutter".into()), - None => continue, - }, - Hit::Divider(Divider::Intersection(outer, inner)) => (format!("dock.corner.{}.{}", path_id(outer), path_id(inner)), "gutter corner".into()), - Hit::Divider(Divider::WindowSplit(panel, path)) => match window(panel) { - Some(index) => (format!("panel.float.{index}.gutter.{}", path_id(path)), "gutter".into()), - None => continue, - }, - Hit::Divider(Divider::WindowIntersection(panel, outer, inner)) => match window(panel) { - Some(index) => (format!("panel.float.{index}.corner.{}.{}", path_id(outer), path_id(inner)), "gutter corner".into()), - None => continue, - }, + SourceKind::Divider(DividerKind::Split(path)) => (format!("dock.gutter.{}", path_id(path)), "gutter".into()), + SourceKind::Divider(DividerKind::Groups(panel)) => { + let id = dock::stack_gutter_id(self.ui.dock.layout(), *panel).unwrap_or_else(|| format!("dock.gutter.group.{}", panel.id())); + (id, "gutter".into()) + } + SourceKind::Divider(DividerKind::ColumnEdge(panel)) => (format!("dock.column.{}", panel.id()), "gutter".into()), _ => continue, }; - found.push((entry, *rect, DockArea::hit_id(area_id(), hit))); + found.push((entry, source.rect, source.id)); } - // The widget id lets keyboard focus on a divider or grip map to its element. - for ((id, label), rect, widget) in found { + // The node id lets keyboard focus on a divider or grip map to its element. + for ((id, label), rect, node) in found { self.auto.add(&id, rect, &label); if let Some(element) = self.auto.elements.last_mut() { - element.response_id = Some(widget); + element.response_id = Some(node); } } } @@ -617,33 +563,107 @@ fn path_id(path: &[bool]) -> String { } /// After Effects' window is all frames: drops on all four window edges, Ctrl/Cmd-drag undocks, -/// a release over no target floats, and a floating window's title bar only moves it. -fn dock_style(ui: &egui::Ui, t: &Tokens) -> DockStyle { - let mut style = DockStyle::from_ui(ui); - style.side_edge_zones = true; - style.new_dock_zones = false; - style.maximize_item = true; - style.close_others_item = true; - style.command_press_floats = true; - style.float_on_empty_drop = true; - style.title_bar_docks = false; - style.float_hint = true; - style.wheel_selects_tabs = true; - style.middle_click_closes_tabs = true; - style.float_label = "Undock Panel".into(); - style.float_group_label = "Undock Frame".into(); - style.close_group_label = "Close Frame".into(); - style.tab_height = t.tab_h; - style.gap = t.gap; - style.background = t.panel_bg; - style.tab_background = t.panel_bg; - style.active_background = t.panel_bg; - style.floating_background = t.panel_bg; - style.text = t.tab_text_active; - style.inactive_text = t.tab_text; - style.accent = t.focus; - style.font = Tokens::ui(12.0); - style +/// a release over no target floats, a floating window's title bar only moves it, and the tabs +/// close with their ×, a middle click, or the group menu's Close Other Panels in Group. +fn dock_config() -> DockConfig { + DockConfig::default() + .side_edge_zones(true) + .new_dock_zones(false) + .maximize_item(true) + .close_others_item(true) + .float_on_empty_drop(true) + .title_bar_docks(false) + .wheel_selects_tabs(true) + .tab_close_buttons(true) + .native_windows(true) +} + +/// A colour as the spec model keeps it. +fn rgba(color: egui::Color32) -> [u8; 4] { + color.to_srgba_unmultiplied() +} + +/// A kept colour as a tab swatch. +fn srgba([r, g, b, a]: [u8; 4]) -> craft_theme::Srgba { + craft_theme::Srgba::from(egui::Color32::from_rgba_unmultiplied(r, g, b, a)) +} + +/// What the dock area keeps between frames: the workspace it shows, the panels' specs, and what +/// its last pass reported that the next one or a command needs. +#[derive(Default)] +pub(crate) struct LiveDock { + shown: Option>, + specs: Tracked, + /// Where a command floats a panel without a rect. + float_space: Option>, + /// The OS windows the floating windows showed in, named by their first panel. + windows: Vec<(PanelKind, egui::ViewportId)>, + /// The panel whose group held key focus. + focused: Option, +} + +impl LiveDock { + /// The `Arc` the dock shows for `workspace`: the last one while the arrangement is the same, + /// so an idle pass keeps the workspace's revision and the dock reads no spec. + fn shown(&mut self, workspace: &Workspace) -> Arc { + if let Some(shown) = self.shown.as_ref().filter(|shown| ***shown == *workspace) { + return Arc::clone(shown); + } + let shown = Arc::new(workspace.clone()); + self.shown = Some(Arc::clone(&shown)); + shown + } +} + +/// What the dock reads of the open panels: tab names, label swatches and the Timeline's comps. +#[derive(Clone, Debug, Default, PartialEq, PlainData)] +struct DockSpecs { + rows: Vec, +} + +/// One open panel's spec, by panel id. +#[derive(Clone, Debug, PartialEq, PlainData)] +struct SpecRow { + panel: String, + label: String, + /// The label swatch before the name; `Some(None)` is the theme's empty swatch. + swatch: Option>, + documents: Vec, +} + +/// One of the Timeline's comp tabs. +#[derive(Clone, Debug, PartialEq, PlainData)] +struct DocRow { + id: u64, + label: String, + swatch: Option<[u8; 4]>, + /// The comp the Timeline shows. + shown: bool, +} + +impl PanelSpecs for DockSpecs { + fn spec(&self, panel: &PanelKind) -> PanelSpec { + let id = panel.id(); + let Some(row) = self.rows.iter().find(|row| row.panel == id) else { return PanelSpec::new(panel.title()).host_body() }; + // Every panel body is EffectCraft's own egui code: the dock runs it with the window's style. + let mut spec = PanelSpec::new(row.label.clone()).host_body(); + if let Some(swatch) = row.swatch { + spec = spec.swatch(swatch.map(srgba)); + } + if !row.documents.is_empty() { + let documents = row + .documents + .iter() + .map(|doc| PanelDocument::new(doc.id, doc.label.clone()).swatch(doc.swatch.map(srgba)).closable(true).shown(doc.shown)) + .collect(); + spec = spec.documents(documents); + } + spec + } + + fn permissions(&self, panel: &PanelKind) -> Permissions { + dock::permissions(panel) + } } /// Panels with a lock: the Composition viewers and the Timeline keep their comp while locked, @@ -662,16 +682,9 @@ fn is_locked(app: &EffectcraftApp, panel: PanelKind) -> bool { } /// EffectCraft's side of the dock area for one frame. -struct EffectContent<'a> { +struct EffectPanels<'a> { app: &'a mut EffectcraftApp, tokens: Tokens, - titles: Vec<(PanelKind, String)>, - swatches: Vec<(PanelKind, egui::Color32)>, - docs: Vec, - /// Measures the comp tabs for their width in the tab row. - ctx: egui::Context, - style: DockStyle, - doc_actions: Vec, /// Viewer locks clicked. locks: Vec, /// The ≡ button clicked: its panel, where its menu opens and the viewport it was clicked in. @@ -682,6 +695,84 @@ struct EffectContent<'a> { ime: NativeIme, } +impl DockPanels for EffectPanels<'_> { + fn body(&mut self, panel: &PanelKind, ui: &mut Ui, _: &mut BodyCx<'_>) { + let t = self.tokens; + let rect = ui.max_rect(); + self.bodies.push((*panel, rect)); + // A floating panel's OS window is a pass of its own: its text IME descriptor is set up + // before its first body and published after its bodies (the main window does both in + // `draw`). + let viewport = ui.ctx().viewport_id(); + let native = viewport != egui::ViewportId::ROOT && !ui.ctx().embed_viewports(); + if native && self.ime.begin_body(viewport) { + panels::viewer_text::begin_ui(ui.ctx()); + } + self.app.panel_body(ui, *panel, rect); + if native && self.ime.publishes(viewport, panels::viewer_text::ime_recorded(ui.ctx())) { + panels::viewer_text::finish_ime(self.app, ui); + } + // The ≡ menu of a panel in its own OS window is drawn by that window's pass, after its + // last body, at that window's coordinates. + if native && self.ime.menu_turn(viewport) { + panels::panel_menu_area(self.app, ui); + } + // The body fills its frame; allocating it lets a floated panel keep its full size. + ui.allocate_rect(rect, Sense::hover()); + // Painted after the body so child backgrounds cannot hide the focus outline. + if self.app.ui.focused == *panel { + ui.painter().rect_stroke(rect, 0.0, Stroke::new(1.0, t.focus), StrokeKind::Inside); + } + } + + /// The viewer lock and the ≡ panel menu of the shown panel, before the tabs. + fn group_header(&mut self, panels: &[PanelKind], active: usize, ui: &mut Ui, _: &mut BodyCx<'_>) { + let Some(active) = panels.get(active).copied() else { return }; + let t = self.tokens; + let height = ui.available_height().max(18.0); + if has_lock(active) { + let (slot, _) = ui.allocate_exact_size(vec2(LOCK_W, height), Sense::hover()); + let lock = Rect::from_center_size(slot.center(), vec2(14.0, 14.0)); + let locked = is_locked(self.app, active); + if dock::lock_button(ui, lock, active, locked, &t, &mut self.app.auto) { + self.locks.push(active); + } + } + let (slot, _) = ui.allocate_exact_size(vec2(MENU_W, height), Sense::hover()); + let rect = Rect::from_center_size(slot.center(), vec2(18.0, 18.0)); + let response = ui.interact(rect, egui::Id::unique(("panel-menu-button", active.id())), Sense::click()); + response.widget_info(|| egui::WidgetInfo::labeled(egui::Role::Button, response.enabled(), "panel menu")); + self.app.auto.add_response(&format!("panel.menu.{}", active.id()), &response, "panel menu"); + let color = if response.hovered() { t.tab_text_active } else { t.tab_text }; + icons::paint(ui.painter(), Rect::from_center_size(rect.center(), vec2(16.0, 16.0)), Icon::Hamburger, color); + crate::widgets::focus_outline(ui, &response, &t); + if response.clicked() { + self.app.ui.focused = active; + self.menu = Some((active, rect.left_bottom(), ui.ctx().viewport_id())); + } + } +} + +/// A file dropped on a floating panel's OS window, handed to the main window's file import. +#[cfg(not(target_arch = "wasm32"))] +#[derive(Debug)] +struct WindowFile(craft_ui::runtime::drag::OsFile); + +#[cfg(not(target_arch = "wasm32"))] +impl egui::DroppedFile for WindowFile { + fn path(&self) -> &std::path::Path { + self.0.path.as_deref().unwrap_or_else(|| std::path::Path::new(&self.0.name)) + } + + fn bytes(&self) -> Result, String> { + match (&self.0.bytes, &self.0.path) { + (Some(bytes), _) => Ok(bytes.to_vec()), + (None, Some(path)) => std::fs::read(path).map_err(|error| error.to_string()), + (None, None) => Err(format!("{}: no path or contents", self.0.name)), + } + } +} + /// Which body of a native floating window publishes its IME descriptor. /// /// Each OS window is an egui pass of its own. `viewer_text::finish_ime` publishes what the pass's @@ -702,13 +793,15 @@ pub(crate) struct NativeIme { } impl NativeIme { + /// `viewports` are the OS windows the dock reported last pass, each named by a panel of its + /// window. A window not among them yet (it opens this pass) publishes after every body. /// `unpublished` are the windows that drew last pass but never published: the layout's count /// was too high for them, so they publish after every body this pass. - pub(crate) fn new(floating: &[Floating], unpublished: &[egui::ViewportId]) -> Self { + pub(crate) fn new(floating: &[Floating], viewports: &[(PanelKind, egui::ViewportId)], unpublished: &[egui::ViewportId]) -> Self { let expected = floating .iter() .filter_map(|window| { - let viewport = window_viewport(window.id)?; + let viewport = viewports.iter().find(|(panel, _)| window.contains(panel)).map(|(_, viewport)| *viewport)?; let count = if unpublished.contains(&viewport) { 0 } else { window_bodies(window) }; Some((viewport, count)) }) @@ -778,148 +871,18 @@ pub(crate) fn drop_menu_of_closed_window(ctx: &egui::Context, windows: &[egui::V }); } -/// The OS window craft-ui opens for the floating window `id`. -#[cfg(not(target_arch = "wasm32"))] -fn window_viewport(id: u64) -> Option { - Some(DockArea::::window_viewport(area_id(), id)) -} - -/// The web keeps floating windows in the page. -#[cfg(target_arch = "wasm32")] -fn window_viewport(_id: u64) -> Option { - None -} - -/// The panel bodies craft-ui draws in a floating window: the active panel of each group and each -/// open stack entry. A minimized window shows its bar only. +/// The panel bodies the dock draws in a floating window: the shown panel of each group that is +/// not minimized. A window collapsed to icons shows none. fn window_bodies(window: &Floating) -> usize { - if window.minimized { + if window.column.iconic { return 0; } - let mut count = 0usize; - let mut nodes = vec![&window.root]; - while let Some(node) = nodes.pop() { - match node { - Node::Split { first, second, .. } => nodes.extend([&**first, &**second]), - Node::Tabs { panels, active } => count = count.saturating_add(usize::from(panels.get(*active).is_some())), - Node::Stack { entries } => count = count.saturating_add(entries.iter().filter(|e| e.open).count()), - _ => {} - } - } - count + window.groups().iter().filter(|group| !group.minimized && group.active_panel().is_some()).count() } -impl EffectContent<'_> { - fn header_width(&self, active: PanelKind, strip_width: f32) -> f32 { - let lock = if has_lock(active) { LOCK_W } else { 0.0 }; - (lock + MENU_W).min(strip_width * 2.0 / 3.0).max(MENU_W) - } - - /// Whether the group of `panels` shows comp tabs: it holds the Timeline and comps are open. - fn has_doc_tabs(&self, panels: &[PanelKind]) -> bool { - panels.contains(&PanelKind::Timeline) && !self.docs.is_empty() - } -} - -impl DockContent for EffectContent<'_> { - fn body(&mut self, ui: &mut egui::Ui, panel: &PanelKind) { - let t = self.tokens; - let rect = ui.max_rect(); - self.bodies.push((*panel, rect)); - // A floating panel's OS window is a pass of its own: its text IME descriptor is set up - // before its first body and published after its bodies (the main window does both in - // `draw`). - let viewport = ui.ctx().viewport_id(); - let native = viewport != egui::ViewportId::ROOT && !ui.ctx().embed_viewports(); - if native && self.ime.begin_body(viewport) { - panels::viewer_text::begin_ui(ui.ctx()); - } - self.app.panel_body(ui, *panel, rect); - if native && self.ime.publishes(viewport, panels::viewer_text::ime_recorded(ui.ctx())) { - panels::viewer_text::finish_ime(self.app, ui); - } - // The ≡ menu of a panel in its own OS window is drawn by that window's pass, after its - // last body, at that window's coordinates. - if native && self.ime.menu_turn(viewport) { - panels::panel_menu_area(self.app, ui); - } - // The body fills its frame; allocating it lets a floated panel keep its full size. - ui.allocate_rect(rect, Sense::hover()); - // Painted after the body so child backgrounds cannot hide the focus outline. - if self.app.ui.focused == *panel { - ui.painter().rect_stroke(rect, 0.0, Stroke::new(1.0, t.focus), StrokeKind::Inside); - } - } - - fn logical_label(&self, panel: &PanelKind) -> String { - let title = panel.title(); - // The Window menu names most panels; `Markers` is only in the panel catalog, and the two - // panels in neither (`History`, `ScriptUI Panel`) keep their English names. - let listed = crate::i18n::command_label("window.panel", title); - if listed == title { crate::i18n::tr(title).to_string() } else { listed.to_string() } - } - - /// The tab names what the panel shows ("Composition Intro"), after the label swatch of its - /// comp or layer. With comps open, the Timeline's own tab is just "Timeline"; each comp has a - /// tab of its own after the group's panel tabs. - fn label(&mut self, _ui: &egui::Ui, panel: &PanelKind, logical: &str, font: &egui::FontId, color: egui::Color32) -> egui::WidgetText { - let title = self.titles.iter().find(|(p, _)| p == panel).map_or(logical, |(_, s)| s.as_str()); - let Some((_, swatch)) = self.swatches.iter().find(|(p, _)| p == panel) else { return title.into() }; - let mut job = egui::text::LayoutJob::default(); - job.append("■ ", 0.0, egui::TextFormat::simple(font.clone(), *swatch)); - job.append(title, 0.0, egui::TextFormat::simple(font.clone(), color)); - job.into() - } - - fn group_header_width(&self, _panels: &[PanelKind], active: &PanelKind, _floating: bool, strip_width: f32) -> f32 { - self.header_width(*active, strip_width) - } - - /// The viewer lock and the ≡ panel menu of the shown panel. - fn group_header(&mut self, ui: &mut egui::Ui, _panels: &[PanelKind], active: &PanelKind, _floating: bool) { - let t = self.tokens; - let header = ui.max_rect(); - let menu = Rect::from_min_max(pos2((header.max.x - MENU_W).max(header.min.x), header.min.y), header.max); - if has_lock(*active) { - let lock = Rect::from_center_size(pos2(menu.min.x - LOCK_W / 2.0, header.center().y), vec2(14.0, 14.0)); - let locked = is_locked(self.app, *active); - if dock::lock_button(ui, lock, *active, locked, &t, &mut self.app.auto) { - self.locks.push(*active); - } - } - let rect = Rect::from_center_size(menu.center(), vec2(18.0, 18.0)); - let response = ui.interact(rect, egui::Id::unique(("panel-menu-button", active.id())), Sense::click()); - response.widget_info(|| egui::WidgetInfo::labeled(egui::Role::Button, response.enabled(), "panel menu")); - self.app.auto.add_response(&format!("panel.menu.{}", active.id()), &response, "panel menu"); - let color = if response.hovered() { t.tab_text_active } else { t.tab_text }; - icons::paint(ui.painter(), Rect::from_center_size(rect.center(), vec2(16.0, 16.0)), Icon::Hamburger, color); - crate::widgets::focus_outline(ui, &response, &t); - if response.clicked() { - self.app.ui.focused = *active; - self.menu = Some((*active, rect.left_bottom(), ui.ctx().viewport_id())); - } - } - - fn group_extra_tabs_width(&self, panels: &[PanelKind], _active: &PanelKind, _floating: bool) -> f32 { - if !self.has_doc_tabs(panels) { - return 0.0; - } - dock::doc_widths(&self.ctx, &self.docs, &self.style.font).iter().sum() - } - - /// The Timeline's comp tabs, after its group's panel tabs whichever panel is shown. - fn group_extra_tabs(&mut self, ui: &mut egui::Ui, panels: &[PanelKind], active: &PanelKind, _floating: bool) { - if self.has_doc_tabs(panels) { - let selected = *active == PanelKind::Timeline; - self.doc_actions.extend(dock::doc_tabs(ui, ui.max_rect(), &self.docs, selected, &self.style, &mut self.app.auto)); - } - } -} - -/// Whether a handed-over *drop* named the Timeline. A floating window reports its hovered files -/// too, so a drag that only passes over the Timeline window must not count: its flag would survive -/// and send the next drop somewhere else. The panel comes from the window, which the main window's -/// pointer can never reach (#2661). +/// Whether a handed-over *drop* named the Timeline. Only a drop with files counts, so a window +/// that only saw a file pass over it never sends the next drop somewhere else. The panel comes +/// from the window, which the main window's pointer can never reach (#2661). fn handed_over_to_the_timeline(drops: impl Iterator) -> bool { drops.into_iter().any(|(panel, has_files)| has_files && matches!(panel, PanelKind::Timeline)) } @@ -929,8 +892,8 @@ mod tests { use super::*; /// A drop handed over by a floating window says which panel it landed on; only the Timeline - /// turns it into a layer instead of a project item. A window that only saw the file hover over - /// it carries no files and must not count, or its flag would outlive the drag (#2661). + /// turns it into a layer instead of a project item. A drop without files must not count, or + /// its flag would outlive the drag (#2661). #[test] fn only_a_timeline_drop_is_handed_over_to_the_timeline() { let cases = [ diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 8f5030fcb..7ec994d60 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -27,10 +27,11 @@ pub mod control; pub mod credits; pub mod display_gpu; pub mod dock; +pub mod dock_command; pub mod dock_ui; mod expression_diagnostics; -pub mod framework; pub mod frames; +pub mod framework; pub mod gpu_failure; pub mod header; pub mod i18n; @@ -500,6 +501,8 @@ pub struct EffectcraftApp { pub(crate) unpublished_viewports: Vec, /// A floating panel shown by a command: its window comes to the front next frame. pub(crate) pending_panel_raise: Option, + /// What the dock area keeps between frames. + pub(crate) live_dock: dock_ui::LiveDock, /// Home screen: recent-project thumbnail textures by path (None = no thumbnail). pub(crate) home_thumbs: std::collections::HashMap>, /// The (project path, saved revision) whose thumbnail was stored last. diff --git a/crates/ui-egui/src/menus/entries.rs b/crates/ui-egui/src/menus/entries.rs index c3641196f..2a1434f78 100644 --- a/crates/ui-egui/src/menus/entries.rs +++ b/crates/ui-egui/src/menus/entries.rs @@ -132,7 +132,7 @@ pub(crate) fn entry_enabled(app: &EffectcraftApp, e: &MenuEntry) -> bool { return !app.session.is_rendering() && !app.session.project.render_queue.is_empty(); } if e.command == "file.close" && super::invoke::no_params(&e.params) && app.ui.focused == PanelKind::RenderQueue { - return !app.ui.dock.locked; + return !app.ui.dock_locked; } if e.command == "window.panel" { return true; diff --git a/crates/ui-egui/src/menus/frontend.rs b/crates/ui-egui/src/menus/frontend.rs index d03aa77cf..9f2590db0 100644 --- a/crates/ui-egui/src/menus/frontend.rs +++ b/crates/ui-egui/src/menus/frontend.rs @@ -363,7 +363,6 @@ pub fn frontend(app: &mut EffectcraftApp, ctx: &egui::Context, id: &str, p: Valu Value::Null } "window.saveWorkspace" => { - crate::workspace_state::ensure_positions_ready(&app.ui)?; let name = app.ui.workspace.clone(); app.ui.saved_workspaces.insert(name.clone(), app.ui.dock.clone()); app.store_saved_workspaces()?; @@ -380,7 +379,6 @@ pub fn frontend(app: &mut EffectcraftApp, ctx: &egui::Context, id: &str, p: Valu ); return Ok(Value::Null); }; - crate::workspace_state::ensure_positions_ready(&app.ui)?; app.ui.saved_workspaces.insert(name.clone(), app.ui.dock.clone()); app.ui.workspace = name.clone(); app.store_saved_workspaces()?; @@ -404,7 +402,6 @@ pub fn frontend(app: &mut EffectcraftApp, ctx: &egui::Context, id: &str, p: Valu }; let builtin = crate::dock::WORKSPACES.contains(&name.as_str()); if p.get("delete").and_then(Value::as_bool) == Some(true) { - crate::workspace_state::ensure_positions_ready(&app.ui)?; if app.ui.saved_workspaces.remove(&name).is_none() && !builtin { return Err(format!("no workspace `{name}`")); } @@ -419,7 +416,6 @@ pub fn frontend(app: &mut EffectcraftApp, ctx: &egui::Context, id: &str, p: Valu if builtin { return Err(format!("`{name}` is a built-in workspace: save it as a new workspace instead")); } - crate::workspace_state::ensure_positions_ready(&app.ui)?; let dock = app.ui.saved_workspaces.remove(&name).ok_or_else(|| format!("no workspace `{name}`"))?; app.ui.saved_workspaces.insert(new.to_string(), dock); if app.ui.workspace == name { diff --git a/crates/ui-egui/src/menus/invoke.rs b/crates/ui-egui/src/menus/invoke.rs index 4bb7fae7c..bcd0f7481 100644 --- a/crates/ui-egui/src/menus/invoke.rs +++ b/crates/ui-egui/src/menus/invoke.rs @@ -243,7 +243,7 @@ pub fn invoke(app: &mut EffectcraftApp, ctx: &egui::Context, id: &str, params: V // Close follows panel focus too: with the Render Queue active, Cmd+W closes that panel and // leaves the active composition open (it used to close the composition next to it). if id == "file.close" && no_params(¶ms) && app.ui.focused == PanelKind::RenderQueue { - app.apply_dock(craft_behavior::dock::Action::Close { panel: PanelKind::RenderQueue })?; + app.apply_dock(craft_behavior::dock::Action::close(PanelKind::RenderQueue))?; // The focus goes to a panel that is still there, so the next Close acts on the composition // instead of on the queue that is gone. let next = [PanelKind::Timeline, PanelKind::Composition, PanelKind::Project].into_iter().find(|p| panel_shown(app, *p)).unwrap_or(PanelKind::Project); @@ -443,17 +443,23 @@ pub fn invoke(app: &mut EffectcraftApp, ctx: &egui::Context, id: &str, params: V "closePanel" => { let p = panel_of("panel").ok_or("closePanel: need `panel`")??; if app.ui.dock.is_open(p) { - app.apply_dock(craft_behavior::dock::Action::Close { panel: p })?; + app.apply_dock(craft_behavior::dock::Action::close(p))?; } return Ok(Value::Null); } "floatPanel" => { let p = panel_of("panel").ok_or("floatPanel: need `panel`")??; let r = match params.get("rect") { - Some(value) => serde_json::from_value::<[f32; 4]>(value.clone()).map_err(|_| "rect must contain four finite numbers")?, + Some(value) => { + let rect = serde_json::from_value::<[f32; 4]>(value.clone()).map_err(|_| "rect must contain four finite numbers")?; + if !rect.iter().all(|v| v.is_finite()) { + return Err("rect must contain four finite numbers".into()); + } + crate::dock_command::rect_of(rect) + } None => crate::dock_ui::default_float_rect(ctx.content_rect()), }; - app.apply_dock(craft_behavior::dock::Action::Float { panel: p, rect: r }).map_err(|e| format!("can't undock {}: {e}", p.title()))?; + app.apply_dock(craft_behavior::dock::Action::float(p, r)).map_err(|e| format!("can't undock {}: {e}", p.title()))?; return Ok(Value::Null); } _ => { @@ -475,8 +481,8 @@ pub fn invoke(app: &mut EffectcraftApp, ctx: &egui::Context, id: &str, params: V if let Some(before) = panel_of("before") { command["before"] = json!(before?); } - let command: craft_ui::docking::DockCommand = - serde_json::from_value(command).map_err(|e| format!("dockPanel: zone: center|tab|left|right|top|bottom|above|below ({e})"))?; + let command = crate::dock_command::DockCommand::parse("window.panel.dock", &command) + .map_err(|e| format!("dockPanel: zone: center|tab|left|right|top|bottom|above|below ({e})"))?; app.run_dock_command(ctx, command).map_err(|e| format!("can't dock {}: {e}", p.title()))?; app.show_panel(p); return Ok(Value::Null); diff --git a/crates/ui-egui/src/menus/tests.rs b/crates/ui-egui/src/menus/tests.rs index 97b678c61..5abae7e5a 100644 --- a/crates/ui-egui/src/menus/tests.rs +++ b/crates/ui-egui/src/menus/tests.rs @@ -685,7 +685,7 @@ fn closing_the_render_queue_reveals_the_panel_receiving_focus() { assert!(!app.ui.dock.is_visible(PanelKind::Project)); app.show_panel(PanelKind::RenderQueue); if maximized { - app.apply_dock(craft_behavior::dock::Action::Float { panel: PanelKind::RenderQueue, rect: [50.0, 60.0, 400.0, 200.0] }).unwrap(); + app.apply_dock(craft_behavior::dock::Action::float(PanelKind::RenderQueue, crate::dock_command::rect_of([50.0, 60.0, 400.0, 200.0]))).unwrap(); app.toggle_maximize(PanelKind::EffectControls); app.ui.focused = PanelKind::RenderQueue; assert!(app.ui.dock.is_floating(PanelKind::RenderQueue)); @@ -702,13 +702,16 @@ fn closing_the_render_queue_reveals_the_panel_receiving_focus() { fn closing_a_floating_queue_preserves_the_maximized_composition() { let mut session = effectcraft_engine::Session::default(); session.execute("comp.new", json!({"name": "A", "width": 32, "height": 32, "duration": 2})).unwrap(); - let mut h = egui_kittest::Harness::builder().with_size(egui::vec2(1200.0, 800.0)).with_context_setup(crate::framework::install_headless).build_eframe(|_| EffectcraftApp::new(session)); + let mut h = egui_kittest::Harness::builder() + .with_size(egui::vec2(1200.0, 800.0)) + .with_context_setup(crate::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(session)); h.run_steps(3); let ctx = h.ctx.clone(); let app = h.state_mut(); app.show_panel(PanelKind::Composition); app.show_panel(PanelKind::RenderQueue); - app.apply_dock(craft_behavior::dock::Action::Float { panel: PanelKind::RenderQueue, rect: [50.0, 60.0, 400.0, 200.0] }).unwrap(); + app.apply_dock(craft_behavior::dock::Action::float(PanelKind::RenderQueue, crate::dock_command::rect_of([50.0, 60.0, 400.0, 200.0]))).unwrap(); app.toggle_maximize(PanelKind::Composition); app.ui.focused = PanelKind::RenderQueue; assert!(app.ui.dock.is_visible(PanelKind::Timeline), "the hidden underlying tab triggers the regression"); @@ -727,7 +730,7 @@ fn queue_close_preserves_state_when_workspace_is_locked() { let mut app = EffectcraftApp::new(effectcraft_engine::Session::default()); app.session.execute("comp.new", json!({"name": "A", "duration": 2})).unwrap(); app.show_panel(PanelKind::RenderQueue); - app.ui.dock.locked = true; + app.ui.dock_locked = true; let workspace = app.ui.dock.clone(); let comp = app.session.active_comp_id(); for _ in 0..2 { @@ -737,7 +740,7 @@ fn queue_close_preserves_state_when_workspace_is_locked() { assert_eq!(app.session.active_comp_id(), comp); } assert!(!menu_items(&app).iter().find(|item| item.id == "file.close").unwrap().enabled); - app.ui.dock.locked = false; + app.ui.dock_locked = false; invoke(&mut app, &ctx, "file.close", Value::Null).unwrap(); assert!(!app.ui.dock.is_open(PanelKind::RenderQueue)); } @@ -752,12 +755,8 @@ fn queue_close_preserves_viewer_command_target() { app.ui.viewers.insert(0, Some(a)); app.ui.viewers.insert(1, Some(b)); app.ui.active_viewer = 1; - app.apply_dock(craft_behavior::dock::Action::Move { - panel: PanelKind::Timeline, - anchor: PanelKind::Composition, - placement: craft_behavior::dock::DockPlacement::Tab { before: None }, - }) - .unwrap(); + app.apply_dock(craft_behavior::dock::Action::move_beside(PanelKind::Timeline, PanelKind::Composition, craft_behavior::dock::DockPlacement::tab(None))) + .unwrap(); app.close_panel(PanelKind::Timeline); app.show_panel(PanelKind::Composition); app.show_panel(PanelKind::RenderQueue); @@ -776,7 +775,10 @@ fn queue_close_keeps_passive_viewer_focus_across_frames() { let mut session = effectcraft_engine::Session::default(); let a = session.execute("comp.new", json!({"name": "A", "width": 32, "height": 32, "duration": 2})).unwrap()["comp"].as_u64().unwrap(); let b = session.execute("comp.new", json!({"name": "B", "width": 32, "height": 32, "duration": 2})).unwrap()["comp"].as_u64().unwrap(); - let mut h = egui_kittest::Harness::builder().with_size(egui::vec2(1200.0, 800.0)).with_context_setup(crate::framework::install_headless).build_eframe(|_| EffectcraftApp::new(session)); + let mut h = egui_kittest::Harness::builder() + .with_size(egui::vec2(1200.0, 800.0)) + .with_context_setup(crate::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(session)); h.run_steps(3); let ctx = h.ctx.clone(); let app = h.state_mut(); @@ -784,12 +786,8 @@ fn queue_close_keeps_passive_viewer_focus_across_frames() { app.ui.viewers.insert(0, Some(a)); app.ui.viewers.insert(1, Some(b)); app.ui.active_viewer = 1; - app.apply_dock(craft_behavior::dock::Action::Move { - panel: PanelKind::Timeline, - anchor: PanelKind::Composition, - placement: craft_behavior::dock::DockPlacement::Tab { before: None }, - }) - .unwrap(); + app.apply_dock(craft_behavior::dock::Action::move_beside(PanelKind::Timeline, PanelKind::Composition, craft_behavior::dock::DockPlacement::tab(None))) + .unwrap(); app.close_panel(PanelKind::Timeline); app.show_panel(PanelKind::Composition); app.show_panel(PanelKind::RenderQueue); diff --git a/crates/ui-egui/src/native_menu.rs b/crates/ui-egui/src/native_menu.rs index a905fc7a0..5197481b3 100644 --- a/crates/ui-egui/src/native_menu.rs +++ b/crates/ui-egui/src/native_menu.rs @@ -443,7 +443,10 @@ impl MenuSync { /// window, where any widget that holds the keyboard counts (the Viewer's text editor is not an /// egui text field). pub fn text_field_window(ctx: &egui::Context) -> Option { - craft_ui::docking::typing_window(ctx).or_else(|| ctx.egui_wants_keyboard_input().then_some(egui::ViewportId::ROOT)) + let host = craft_ui::runtime::windows::WindowHost::of(ctx); + let window = host.key_window(); + let floating = (window != egui::ViewportId::ROOT && host.typing()).then_some(window); + floating.or_else(|| ctx.egui_wants_keyboard_input().then_some(egui::ViewportId::ROOT)) } /// Whether a focused text field takes the menu command `command` ([`activate`]): the native menu @@ -476,8 +479,8 @@ fn text_field_event(command: &str) -> Option> { /// Hand a text field's Edit command to the window `window` whose field has the keyboard. The /// main window gets the clipboard text itself and the events through the synthetic queue; a -/// floating panel's OS window gets each key pressed and released, and asks for the clipboard -/// text on Cmd+V (`craft_ui::docking::send_keys`). +/// floating panel's OS window gets each key pressed and released through the window host, and +/// the clipboard text as typed text on Cmd+V. fn send_to_text_field(app: &mut EffectcraftApp, ctx: &egui::Context, window: egui::ViewportId, events: Vec) { if window == egui::ViewportId::ROOT { for event in events { @@ -493,19 +496,25 @@ fn send_to_text_field(app: &mut EffectcraftApp, ctx: &egui::Context, window: egu ctx.request_repaint(); return; } - let events = events - .into_iter() - .flat_map(|event| { - let release = match &event { - egui::Event::Key { key, physical_key, modifiers, .. } => { - Some(egui::Event::Key { key: *key, physical_key: *physical_key, pressed: false, repeat: false, modifiers: *modifiers }) + let host = craft_ui::runtime::windows::WindowHost::of(ctx); + let platform = craft_keymap::egui::platform(ctx); + for event in events { + let (key, modifiers) = match event { + egui::Event::Key { key: egui::Key::V, .. } => { + if let Some(text) = app.hooks.clipboard_text.as_ref().and_then(|f| f()) { + host.inject_text(window, &text); } - _ => None, - }; - std::iter::once(event).chain(release) - }) - .collect(); - craft_ui::docking::send_keys(ctx, window, events); + continue; + } + egui::Event::Key { key, modifiers, .. } => (key, modifiers), + egui::Event::Copy => (egui::Key::C, egui::Modifiers::COMMAND), + egui::Event::Cut => (egui::Key::X, egui::Modifiers::COMMAND), + _ => continue, + }; + if let Some(key) = craft_keymap::Key::from_egui(key) { + host.inject_key(window, key, craft_keymap::Mods::from_egui(&modifiers, platform), false); + } + } } /// Run a native menu item (by id) the way the in-window menu bar does. While a text field has diff --git a/crates/ui-egui/src/panels.rs b/crates/ui-egui/src/panels.rs index e0be9a80d..b47492f53 100644 --- a/crates/ui-egui/src/panels.rs +++ b/crates/ui-egui/src/panels.rs @@ -344,13 +344,13 @@ pub(crate) fn panel_menu_area(app: &mut EffectcraftApp, ui: &mut egui::Ui) { // only ever narrows what the area measured: the separator fills whatever width it is given ui.set_max_width(ui.max_rect().width().min(width)); if ui.button(tr("Close Panel")).clicked() { - let _ = app.dock_command(ui.ctx(), craft_behavior::dock::Action::Close { panel }); + let _ = app.dock_command(ui.ctx(), craft_behavior::dock::Action::close(panel)); close = true; } let floating = crate::dock::WorkspaceExt::is_floating(&app.ui.dock, panel); if !floating && ui.button(tr("Undock Panel")).clicked() { let r = crate::dock_ui::default_float_rect(ui.ctx().content_rect()); - let _ = app.dock_command(ui.ctx(), craft_behavior::dock::Action::Float { panel, rect: r }); + let _ = app.dock_command(ui.ctx(), craft_behavior::dock::Action::float(panel, r)); close = true; } // Multiple monitors: an OS window of its own, which can go on another screen. Where diff --git a/crates/ui-egui/src/panels/viewer_text/tests.rs b/crates/ui-egui/src/panels/viewer_text/tests.rs index 3017fb632..639373038 100644 --- a/crates/ui-egui/src/panels/viewer_text/tests.rs +++ b/crates/ui-egui/src/panels/viewer_text/tests.rs @@ -147,7 +147,7 @@ impl ImePass { /// One native floating window holding the Timeline's group and then the Viewer's. fn two_group_window() -> craft_behavior::dock::Floating { let groups = vec![craft_behavior::dock::Group::new(vec![PanelKind::Timeline], 0), craft_behavior::dock::Group::new(vec![PanelKind::Viewer(1)], 0)]; - craft_behavior::dock::Floating::stack(groups, [0.0, 0.0, 320.0, 360.0]).expect("two groups make a window") + craft_behavior::dock::Floating::stack(1, groups, egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(320.0, 360.0))).expect("two groups make a window") } impl ImePass { @@ -169,7 +169,7 @@ impl ImePass { let raw = egui::RawInput { viewport_id: viewport, viewports, screen_rect: Some(rect), events, ..Default::default() }; let mut preedit = None; let mut out = ctx.run_ui(raw, |ui| { - let mut ime = crate::dock_ui::NativeIme::new(std::slice::from_ref(window), &[]); + let mut ime = crate::dock_ui::NativeIme::new(std::slice::from_ref(window), &[(PanelKind::Timeline, viewport)], &[]); let order = if viewer_first { [true, false] } else { [false, true] }; for viewer in order { if ime.begin_body(viewport) { @@ -198,7 +198,7 @@ impl ImePass { #[test] fn native_window_with_a_group_before_the_viewer_keeps_the_composition() { let window = two_group_window(); - let viewport = craft_ui::docking::DockArea::::window_viewport(crate::dock_ui::area_id(), window.id); + let viewport = egui::ViewportId::from_hash_of(("native panel window", window.id)); let preview = || egui::Event::Ime(egui::ImeEvent::Preedit { text: "é".into(), active_range_chars: None }); for viewer_first in [false, true] { let (mut app, _) = editor("abcd", 4, 4); @@ -223,12 +223,12 @@ fn native_window_with_a_group_before_the_viewer_keeps_the_composition() { assert_eq!(preedit, None); // A window that drew fewer bodies than its layout counts publishes after every body in // its next pass. - let mut ime = crate::dock_ui::NativeIme::new(std::slice::from_ref(&window), &[]); + let mut ime = crate::dock_ui::NativeIme::new(std::slice::from_ref(&window), &[(PanelKind::Timeline, viewport)], &[]); ime.begin_body(viewport); assert!(!ime.publishes(viewport, false)); let unpublished = ime.unpublished(); assert_eq!(unpublished, vec![viewport]); - let mut ime = crate::dock_ui::NativeIme::new(std::slice::from_ref(&window), &unpublished); + let mut ime = crate::dock_ui::NativeIme::new(std::slice::from_ref(&window), &[(PanelKind::Timeline, viewport)], &unpublished); ime.begin_body(viewport); assert!(ime.publishes(viewport, false)); } diff --git a/crates/ui-egui/src/panels/viewers.rs b/crates/ui-egui/src/panels/viewers.rs index 2959cded0..4fe287262 100644 --- a/crates/ui-egui/src/panels/viewers.rs +++ b/crates/ui-egui/src/panels/viewers.rs @@ -327,7 +327,7 @@ fn add_viewer(app: &mut EffectcraftApp, near: u32) -> u32 { app.ui.viewers.insert(id, None); let p = panel(id); let anchor = [panel(near), PanelKind::Composition].into_iter().find(|q| app.ui.dock.is_open(*q)); - let _ = app.ui.dock.apply(craft_behavior::dock::Action::Open { panel: p, anchor }, crate::dock::permissions); + let _ = app.ui.dock.apply(craft_behavior::dock::Action::open(p, anchor), app.ui.dock_locked, crate::dock::permissions); id } diff --git a/crates/ui-egui/src/state.rs b/crates/ui-egui/src/state.rs index 0f7d97bc0..5a7df800b 100644 --- a/crates/ui-egui/src/state.rs +++ b/crates/ui-egui/src/state.rs @@ -653,11 +653,9 @@ pub struct UiState { /// The panel maximized to fill the dock area (`~`), if any. #[serde(default)] pub maximized: Option, - /// Floating windows of [`Self::dock`] whose native rect holds the OS window's outer - /// position, from a workspace file of an earlier version (see - /// `crate::dock_ui::native_outer_to_content`). Workspaces are not saved while any remain. - #[serde(skip)] - pub native_outer: Vec, + /// Lock Workspace: no panel of [`Self::dock`] moves, floats or closes. + #[serde(default)] + pub dock_locked: bool, /// Locked Composition / Timeline tabs (panel ids): opening another composition does not /// bring a locked panel forward (the tab's lock icon, as After Effects' viewer lock). #[serde(default)] @@ -792,7 +790,7 @@ impl Default for UiState { workspace: "Default".into(), dock: crate::dock::Workspace::new(crate::dock::workspace("Default")), saved_workspaces: Default::default(), - native_outer: Vec::new(), + dock_locked: false, maximized: None, locked_tabs: BTreeSet::new(), effect_controls_lock: None, diff --git a/crates/ui-egui/src/workspace_state.rs b/crates/ui-egui/src/workspace_state.rs index de2e99ce7..1005fb029 100644 --- a/crates/ui-egui/src/workspace_state.rs +++ b/crates/ui-egui/src/workspace_state.rs @@ -28,6 +28,10 @@ struct Snapshot { focused: PanelKind, maximized: Option, saved_workspaces: BTreeMap, + /// Lock Workspace. A file without it loads unlocked, unless its workspace carries the + /// earlier format's own `locked` ([`WorkspaceStore::load`]). + #[serde(default)] + locked: bool, } impl Snapshot { @@ -39,6 +43,7 @@ impl Snapshot { focused: ui.focused, maximized: ui.maximized, saved_workspaces: ui.saved_workspaces.clone(), + locked: ui.dock_locked, } } @@ -48,12 +53,7 @@ impl Snapshot { ui.focused = self.focused; ui.maximized = self.maximized; ui.saved_workspaces = self.saved_workspaces; - // A native window's place is made safe to hand to the windowing system. - for workspace in std::iter::once(&mut ui.dock).chain(ui.saved_workspaces.values_mut()) { - for window in &mut workspace.layout.floating { - window.native = window.native.map(crate::dock_ui::sanitized_window_rect); - } - } + ui.dock_locked = self.locked; // Reserve restored viewer slots without restoring any project-specific composition // links. New Viewer allocates from this map, including after switching named layouts. for workspace in std::iter::once(&ui.dock).chain(ui.saved_workspaces.values()) { @@ -107,19 +107,23 @@ pub(crate) struct WorkspaceStore { impl WorkspaceStore { pub(crate) fn load(config: Option<&dyn ConfigStore>, ui: &mut UiState) -> Self { let mut original = None; - let mut outer = Vec::new(); let loaded = config.map_or(Ok(None), |c| c.read_bounded(FILE, MAX_BYTES)).map_err(|e| e.to_string()).and_then(|text| { text.map(|text| { let value: serde_json::Value = serde_json::from_str(&text).map_err(|e| e.to_string())?; let snapshot = if legacy::is_legacy(&value) { - let (snapshot, windows) = legacy::migrate(value, ui)?; + let snapshot = legacy::migrate(value, ui)?; original = Some(text); - outer = windows; snapshot } else if value.get("version").is_none() { return Err("not a workspace file".to_string()); } else { - serde_json::from_value::(value).map_err(|e| e.to_string())? + // A file written before the lock moved out of the workspace keeps its lock once. + let earlier_lock = value.get("locked").is_none().then(|| value.pointer("/dock/locked").and_then(serde_json::Value::as_bool)).flatten(); + let mut snapshot = serde_json::from_value::(value).map_err(|e| e.to_string())?; + if let Some(locked) = earlier_lock { + snapshot.locked = locked; + } + snapshot }; snapshot.validate()?; Ok(snapshot) @@ -129,7 +133,6 @@ impl WorkspaceStore { let error = match loaded { Ok(Some(snapshot)) => { snapshot.apply(ui); - ui.native_outer = outer; None } Ok(None) => None, @@ -163,12 +166,12 @@ impl WorkspaceStore { || self.saved.focused != ui.focused || self.saved.maximized != ui.maximized || self.saved.saved_workspaces != ui.saved_workspaces + || self.saved.locked != ui.dock_locked } pub(crate) fn save(&mut self, config: Option<&dyn ConfigStore>, ui: &UiState) -> Result { let Some(config) = config else { return Ok(false) }; - // A window still at its outer position would be saved as if that were its content's. - if !self.has_changes(ui) || !ui.native_outer.is_empty() { + if !self.has_changes(ui) { return Ok(false); } let snapshot = Snapshot::capture(ui); @@ -197,20 +200,9 @@ impl WorkspaceStore { let path = config.dir().map_or_else(|| FILE.to_string(), |dir| dir.join(FILE).display().to_string()); return Err(format!("{path} couldn't be loaded at startup, so it is left untouched; fix or move it and restart")); } - ensure_positions_ready(ui)?; self.save(Some(config), ui).map(|_| ()) } } -/// Explicit saves must wait until migrated native-window positions refer to their content. -/// Check before capturing a named layout too, so a later background save cannot persist -/// a snapshot made with the old outer-window positions. -pub(crate) fn ensure_positions_ready(ui: &UiState) -> Result<(), String> { - if !ui.native_outer.is_empty() { - return Err("workspace window positions are still being restored; try saving again in a moment".into()); - } - Ok(()) -} - #[cfg(test)] mod tests; diff --git a/crates/ui-egui/src/workspace_state/legacy.rs b/crates/ui-egui/src/workspace_state/legacy.rs index 73b30bbf5..b3609477a 100644 --- a/crates/ui-egui/src/workspace_state/legacy.rs +++ b/crates/ui-egui/src/workspace_state/legacy.rs @@ -9,17 +9,16 @@ //! group with all its tabs; a frame with a height keeps it as a fixed size (its tab strip //! added), and the others share the rest. A closed frame's tabs join the open frame above it //! (below it, at the top of the column), as a split has no collapsed frames. -//! - A floating group in its own native window (`panel_windows`) keeps that place as the -//! window's native rect. The earlier version stored the OS window's outer position, so the -//! window's id is returned for [`crate::dock_ui::native_outer_to_content`] to move it to its -//! content position once the main window reports its frame. +//! - A floating group in its own native window (`panel_windows`) floats where it was in the +//! main window; the dock places its OS window again. //! - Closed panels had no recorded place: they stay closed and reopen at their default place. use std::collections::BTreeMap; +use craft_behavior::dock::SplitSize; use craft_behavior::dock::{Floating, Node}; use craft_behavior::flow::Axis; -use craft_behavior::dock::SplitSize; +use egui::{Rect, pos2, vec2}; use serde::Deserialize; use super::{Snapshot, VERSION}; @@ -64,13 +63,6 @@ struct OldFloating { rect: [f32; 4], } -/// The floating group holding `panel` shows in its own native window at `rect`. -#[derive(Deserialize)] -struct OldPanelWindow { - panel: PanelKind, - rect: [f32; 4], -} - #[derive(Deserialize)] struct OldSnapshot { workspace: String, @@ -80,8 +72,6 @@ struct OldSnapshot { maximized: Option, saved_workspaces: BTreeMap, saved_floating: BTreeMap>, - #[serde(default)] - panel_windows: Vec, } #[derive(Deserialize)] @@ -100,28 +90,25 @@ pub(super) fn is_legacy(value: &serde_json::Value) -> bool { } } -/// The snapshot an earlier version's file describes, and the ids of its floating windows whose -/// native rect holds the OS window's outer position. `ui` supplies what an unversioned record +/// The snapshot an earlier version's file describes. `ui` supplies what an unversioned record /// leaves out (the current arrangement). The caller validates the result. -pub(super) fn migrate(value: serde_json::Value, ui: &UiState) -> Result<(Snapshot, Vec), String> { +pub(super) fn migrate(value: serde_json::Value, ui: &UiState) -> Result { if value.get("version").is_none() { let record: OldRecord = serde_json::from_value(value).map_err(|e| e.to_string())?; let mut snapshot = Snapshot::capture(ui); snapshot.saved_workspaces = named(record.workspaces, record.floating)?; - return Ok((snapshot, Vec::new())); + return Ok(snapshot); } let old: OldSnapshot = serde_json::from_value(value).map_err(|e| e.to_string())?; - let dock = workspace(old.dock, old.floating, &old.panel_windows)?; - let outer = dock.layout.floating.iter().filter(|window| window.native.is_some()).map(|window| window.id).collect(); - let snapshot = Snapshot { + Ok(Snapshot { version: VERSION, workspace: old.workspace, - dock, + dock: workspace(old.dock, old.floating)?, focused: old.focused, maximized: old.maximized, saved_workspaces: named(old.saved_workspaces, old.saved_floating)?, - }; - Ok((snapshot, outer)) + locked: false, + }) } /// Named workspaces with their floating groups; floating groups of no named workspace are @@ -131,12 +118,12 @@ fn named(roots: BTreeMap, mut floating: BTreeMap, windows: &[OldPanelWindow]) -> Result { +fn workspace(root: OldNode, floating: Vec) -> Result { // Closing the last docked panel left an empty tab group as the root. let root = match root { OldNode::Tabs { panels, .. } if panels.is_empty() => None, @@ -144,14 +131,13 @@ fn workspace(root: OldNode, floating: Vec, windows: &[OldPanelWindo }; let floating = floating .into_iter() - .map(|group| { - let native = windows.iter().find(|window| group.panels.contains(&window.panel)).map(|window| window.rect); - let mut window = Floating::single(group.panels, group.active, group.rect); - window.native = native.map(crate::dock_ui::sanitized_window_rect); - window + .zip(1_u64..) + .map(|(group, id)| { + let [x, y, w, h] = group.rect; + Floating::single(id, group.panels, group.active, Rect::from_min_size(pos2(x, y), vec2(w, h))) }) .collect(); - Ok(Workspace::new(Layout { root, floating })) + Ok(Workspace::new(Layout::new(root, floating))) } fn node(old: OldNode, depth: usize) -> Result, String> { @@ -159,17 +145,17 @@ fn node(old: OldNode, depth: usize) -> Result, String> { return Err("workspace dock tree exceeds supported limits".into()); } Ok(match old { - OldNode::Tabs { panels, active } => Node::Tabs { panels, active }, - OldNode::Split { vertical, size, a, b } => Node::Split { - axis: if vertical { Axis::Y } else { Axis::X }, - size: match size { + OldNode::Tabs { panels, active } => Node::tabs(panels, active), + OldNode::Split { vertical, size, a, b } => Node::split( + if vertical { Axis::Y } else { Axis::X }, + match size { OldSplitSize::Ratio(value) => SplitSize::Ratio(value), OldSplitSize::FixedA(value) => SplitSize::FixedFirst(value), OldSplitSize::FixedB(value) => SplitSize::FixedSecond(value), }, - first: Box::new(node(*a, depth.saturating_add(1))?), - second: Box::new(node(*b, depth.saturating_add(1))?), - }, + node(*a, depth.saturating_add(1))?, + node(*b, depth.saturating_add(1))?, + ), OldNode::Stack { entries } => column(entries, depth)?, }) } @@ -227,7 +213,7 @@ fn column(entries: Vec, depth: usize) -> Result, for frame in frames.into_iter().rev() { let own = frame_size(&frame); let gap = if node.is_some() { FRAME_GAP } else { 0.0 }; - let tabs = Node::Tabs { panels: frame.panels, active: frame.active }; + let tabs = Node::tabs(frame.panels, frame.active); node = Some(match node { None => tabs, Some(rest) => { @@ -237,7 +223,7 @@ fn column(entries: Vec, depth: usize) -> Result, // Shares the rest with the flexible frames below. (None, None) => SplitSize::Ratio(1.0 / (below_flexible as f32 + 1.0)), }; - Node::Split { axis: Axis::Y, size, first: Box::new(tabs), second: Box::new(rest) } + Node::split(Axis::Y, size, tabs, rest) } }); below_fixed = match (own, below_fixed) { diff --git a/crates/ui-egui/src/workspace_state/tests.rs b/crates/ui-egui/src/workspace_state/tests.rs index 98a42fa65..04856b7f8 100644 --- a/crates/ui-egui/src/workspace_state/tests.rs +++ b/crates/ui-egui/src/workspace_state/tests.rs @@ -1,8 +1,8 @@ use super::*; use crate::dock::{Floating, Layout, Node, StackEntry, WorkspaceExt as _}; use craft_behavior::dock::Action; -use craft_behavior::flow::Axis; use craft_behavior::dock::SplitSize; +use craft_behavior::flow::Axis; use effectcraft_engine::config::MemoryConfig; fn minimal() -> Workspace { @@ -10,7 +10,11 @@ fn minimal() -> Workspace { } fn tabs(panels: &[PanelKind]) -> Node { - Node::Tabs { panels: panels.to_vec(), active: 0 } + Node::tabs(panels.to_vec(), 0) +} + +fn rect(x: f32, y: f32, w: f32, h: f32) -> egui::Rect { + egui::Rect::from_min_size(egui::pos2(x, y), egui::vec2(w, h)) } #[test] @@ -67,20 +71,12 @@ fn corrupt_future_or_unknown_workspace_keeps_defaults_and_original_file() { const V1: &str = include_str!("../../tests/fixtures/workspaces-v1.json"); #[test] -fn explicit_save_reports_pending_migration_and_can_be_retried() { +fn explicit_save_rewrites_an_earlier_file_and_keeps_a_backup() { let config = MemoryConfig::default(); config.write(FILE, V1).unwrap(); let mut ui = UiState::default(); let mut store = WorkspaceStore::load(Some(&config), &mut ui); - assert!(!ui.native_outer.is_empty()); - assert!(!store.save(Some(&config), &ui).unwrap(), "background saves defer quietly"); - let error = store.save_now(Some(&config), &ui).unwrap_err(); - assert!(error.contains("positions") && error.contains("try saving again"), "{error}"); - assert_eq!(config.read(FILE).as_deref(), Some(V1)); - assert_eq!(config.read(BACKUP), None); assert!(store.has_changes(&ui)); - - crate::dock_ui::native_outer_to_content(&mut ui, None, None, 3.0); store.save_now(Some(&config), &ui).unwrap(); assert_eq!(config.read(BACKUP).as_deref(), Some(V1)); let mut restored = UiState::default(); @@ -108,34 +104,26 @@ fn version_one_file_loads_with_every_panel_in_place() { ), tabs(&[Properties]), ); - assert_eq!(ui.dock.layout.root, Some(root)); - let floating: Vec<_> = ui.dock.layout.floating.iter().map(|w| (w.panels().copied().collect::>(), w.rect, w.native)).collect(); + assert_eq!(ui.dock.layout().root, Some(root)); + let floating: Vec<_> = ui.dock.layout().floating.iter().map(|w| (w.panels().copied().collect::>(), w.rect, w.native)).collect(); assert_eq!( floating, [ - (vec![Preview], [900.0, 120.0, 300.0, 260.0], None), - (vec![RenderQueue], [200.0, 500.0, 520.0, 240.0], Some(crate::dock_ui::sanitized_window_rect([200.0, 500.0, 520.0, 240.0]))), + (vec![Preview], rect(900.0, 120.0, 300.0, 260.0), None), + // Its native window's place goes: the dock places the OS window again. + (vec![RenderQueue], rect(200.0, 500.0, 520.0, 240.0), None), ] ); // Closed panels stay closed. for panel in [Align, Layer] { assert!(!ui.dock.is_open(panel), "{panel:?}"); } - // The native window's place is its outer position until the main window reports its - // frame (here a 28-point title bar); the file is not rewritten before. - let id = ui.dock.layout.floating[1].id; - assert_eq!(ui.native_outer, [id]); let mut store = store; - assert!(!store.save(Some(&config), &ui).unwrap()); - let outer = egui::Rect::from_min_size(egui::pos2(10.0, 20.0), egui::vec2(1600.0, 1000.0)); - crate::dock_ui::native_outer_to_content(&mut ui, Some(outer), Some(outer.translate(egui::vec2(0.0, 28.0))), 0.1); - assert_eq!(ui.dock.layout.floating[1].native, Some([200.0, 528.0, 520.0, 240.0])); - assert!(ui.native_outer.is_empty()); assert!(store.save(Some(&config), &ui).unwrap()); // The named workspace still has Layer, closed only after it was saved. let saved = ui.saved_workspaces.get("My Layout").unwrap(); assert!(saved.is_docked(Layer) && saved.is_floating(Preview) && !saved.is_open(Align)); - assert_eq!(saved.layout.floating.iter().filter_map(|w| w.native).count(), 0); + assert_eq!(saved.layout().floating.iter().filter(|w| w.native.is_some()).count(), 0); } #[test] @@ -144,13 +132,6 @@ fn version_one_file_is_rewritten_once_in_the_current_format_and_kept_as_a_backup config.write(FILE, V1).unwrap(); let mut ui = UiState::default(); let mut store = WorkspaceStore::load(Some(&config), &mut ui); - // A backend that reports no window positions: the native place stays as it was. - let native = ui.dock.layout.floating[1].native; - crate::dock_ui::native_outer_to_content(&mut ui, None, None, 1.0); - assert!(!ui.native_outer.is_empty(), "waits for a report"); - crate::dock_ui::native_outer_to_content(&mut ui, None, None, 5.0); - assert!(ui.native_outer.is_empty()); - assert_eq!(ui.dock.layout.floating[1].native, native); let migrated = Snapshot::capture(&ui); assert!(store.has_changes(&ui), "the migrated layout is written without waiting for an edit"); assert!(store.save(Some(&config), &ui).unwrap()); @@ -178,16 +159,16 @@ fn stacked_frames_with_tabs_and_an_empty_root_migrate() { let mut ui = UiState::default(); let store = WorkspaceStore::load(Some(&config), &mut ui); assert_eq!(store.error, None); - assert_eq!(ui.dock.layout.root, None); + assert_eq!(ui.dock.layout().root, None); assert!(ui.dock.is_floating(PanelKind::Project)); use PanelKind::*; // Each open frame is a tab group with all its tabs; a frame's height is a fixed size // (with its tab strip), and the frame without one takes the rest. let column = crate::dock::vsplit(SplitSize::FixedSecond(80.0 + crate::dock::TAB_STRIP), tabs(&[Info]), crate::dock::tabs(&[Audio, Preview], 1)); - assert_eq!(ui.saved_workspaces.get("Mine").and_then(|w| w.layout.root.clone()), Some(column)); + assert_eq!(ui.saved_workspaces.get("Mine").and_then(|w| w.layout().root.clone()), Some(column)); // Closed frames' tabs join the open frame above them, or below at the top. let column = crate::dock::vsplit(SplitSize::FixedFirst(46.0 + crate::dock::TAB_STRIP), tabs(&[Preview, Properties, Paint, Align]), tabs(&[Info])); - assert_eq!(ui.saved_workspaces.get("Column").and_then(|w| w.layout.root.clone()), Some(column)); + assert_eq!(ui.saved_workspaces.get("Column").and_then(|w| w.layout().root.clone()), Some(column)); assert_eq!(ui.saved_workspaces.len(), 2, "floating groups of no named workspace are dropped"); } @@ -214,25 +195,21 @@ fn explicit_save_with_nothing_new_succeeds() { #[test] fn invalid_tabs_split_and_deep_tree_are_rejected() { let mut snapshot = Snapshot::capture(&UiState::default()); - snapshot.dock = Workspace::new(Layout { root: Some(Node::Tabs { panels: vec![PanelKind::Project], active: usize::MAX }), floating: vec![] }); + snapshot.dock = Workspace::new(Layout::new(Some(Node::tabs(vec![PanelKind::Project], usize::MAX)), vec![])); assert!(snapshot.validate().is_err()); - let split = |size, first, second| Node::Split { axis: Axis::X, size, first: Box::new(first), second: Box::new(second) }; - snapshot.dock = Workspace::new(Layout { - root: Some(split(SplitSize::FixedFirst(f32::NAN), tabs(&[PanelKind::Project]), tabs(&[PanelKind::Timeline]))), - floating: vec![], - }); + let split = |size, first, second| Node::split(Axis::X, size, first, second); + snapshot.dock = + Workspace::new(Layout::new(Some(split(SplitSize::FixedFirst(f32::NAN), tabs(&[PanelKind::Project]), tabs(&[PanelKind::Timeline]))), vec![])); assert!(snapshot.validate().is_err()); let mut root = tabs(&[PanelKind::Composition]); for _ in 0..=craft_behavior::dock::MAX_DEPTH { root = split(SplitSize::Ratio(0.5), root, tabs(&[])); } - snapshot.dock = Workspace::new(Layout { root: Some(root), floating: vec![] }); + snapshot.dock = Workspace::new(Layout::new(Some(root), vec![])); assert!(snapshot.validate().is_err()); // A panel in two places. - snapshot.dock = Workspace::new(Layout { - root: Some(tabs(&[PanelKind::Project])), - floating: vec![Floating::single(vec![PanelKind::Project], 0, [0.0, 0.0, 200.0, 100.0])], - }); + snapshot.dock = + Workspace::new(Layout::new(Some(tabs(&[PanelKind::Project])), vec![Floating::single(1, vec![PanelKind::Project], 0, rect(0.0, 0.0, 200.0, 100.0))])); assert!(snapshot.validate().is_err()); } @@ -242,9 +219,9 @@ fn closing_all_docked_panels_remains_a_persistable_layout() { let mut ui = UiState::default(); let mut store = WorkspaceStore::load(Some(&config), &mut ui); for panel in ui.dock.panels() { - ui.dock.apply(Action::Close { panel }, crate::dock::permissions).unwrap(); + ui.dock.apply(Action::close(panel), false, crate::dock::permissions).unwrap(); } - assert!(ui.dock.layout.root.is_none()); + assert!(ui.dock.layout().root.is_none()); assert!(store.save(Some(&config), &ui).unwrap()); let mut restored = UiState::default(); let loaded = WorkspaceStore::load(Some(&config), &mut restored); @@ -258,8 +235,8 @@ fn floating_groups_and_named_snapshots_roundtrip_without_document_state() { let mut ui = UiState::default(); let mut store = WorkspaceStore::load(Some(&config), &mut ui); ui.workspace = "Floating".into(); - ui.dock.apply(Action::Float { panel: PanelKind::Preview, rect: [50.0, 80.0, 200.0, 160.0] }, crate::dock::permissions).unwrap(); - ui.dock.apply(Action::Close { panel: PanelKind::Align }, crate::dock::permissions).unwrap(); + ui.dock.apply(Action::float(PanelKind::Preview, crate::dock_command::rect_of([50.0, 80.0, 200.0, 160.0])), false, crate::dock::permissions).unwrap(); + ui.dock.apply(Action::close(PanelKind::Align), false, crate::dock::permissions).unwrap(); ui.saved_workspaces.insert(ui.workspace.clone(), ui.dock.clone()); ui.maximized = Some(PanelKind::Composition); ui.project_search = "do not persist".into(); @@ -268,7 +245,7 @@ fn floating_groups_and_named_snapshots_roundtrip_without_document_state() { WorkspaceStore::load(Some(&config), &mut restored); assert_eq!(Snapshot::capture(&restored), Snapshot::capture(&ui)); // The closed panel's place comes back with it. - assert!(restored.dock.hidden.iter().any(|(p, _)| *p == PanelKind::Align)); + assert!(restored.dock.hidden().iter().any(|(p, _)| *p == PanelKind::Align)); assert!(restored.project_search.is_empty()); } @@ -277,7 +254,7 @@ fn restored_viewer_slots_do_not_reuse_ids_or_restore_document_links() { let config = MemoryConfig::default(); let mut ui = UiState::default(); let mut store = WorkspaceStore::load(Some(&config), &mut ui); - let two = |viewer| Workspace::new(Layout { root: Some(tabs(&[PanelKind::Composition, PanelKind::Viewer(viewer)])), floating: vec![] }); + let two = |viewer| Workspace::new(Layout::new(Some(tabs(&[PanelKind::Composition, PanelKind::Viewer(viewer)])), vec![])); ui.dock = two(2); ui.saved_workspaces.insert("Two views".into(), two(5)); ui.viewers.insert(2, Some(42)); @@ -296,15 +273,12 @@ fn invalid_viewer_ids_are_rejected_in_every_workspace_reference() { for location in 0..8 { let mut snapshot = Snapshot::capture(&UiState::default()); let panel = PanelKind::Viewer(id); - let docked = Workspace::new(Layout { root: Some(tabs(&[panel])), floating: vec![] }); - let stacked = - Workspace::new(Layout { root: Some(Node::Stack { entries: vec![StackEntry { panel, open: true, height: None }] }), floating: vec![] }); - let floating = Workspace::new(Layout { - root: Some(tabs(&[PanelKind::Composition])), - floating: vec![Floating::single(vec![panel], 0, [0.0, 0.0, 200.0, 100.0])], - }); - let mut hidden = Workspace::new(Layout { root: Some(tabs(&[PanelKind::Composition, panel])), floating: vec![] }); - hidden.apply(Action::Close { panel }, crate::dock::permissions).unwrap(); + let docked = Workspace::new(Layout::new(Some(tabs(&[panel])), vec![])); + let stacked = Workspace::new(Layout::new(Some(Node::stack(vec![StackEntry::new(panel)])), vec![])); + let floating = + Workspace::new(Layout::new(Some(tabs(&[PanelKind::Composition])), vec![Floating::single(1, vec![panel], 0, rect(0.0, 0.0, 200.0, 100.0))])); + let mut hidden = Workspace::new(Layout::new(Some(tabs(&[PanelKind::Composition, panel])), vec![])); + hidden.apply(Action::close(panel), false, crate::dock::permissions).unwrap(); match location { 0 => snapshot.focused = panel, 1 => snapshot.maximized = Some(panel), @@ -324,19 +298,32 @@ fn invalid_viewer_ids_are_rejected_in_every_workspace_reference() { } } +/// Lock Workspace persists with the workspaces; a file without it loads unlocked, and a file +/// whose workspace carries the earlier format's own lock keeps it once. #[test] -fn hostile_native_window_places_are_made_safe_on_load() { +fn the_workspace_lock_survives_a_save_and_an_earlier_files_lock_carries_over() { let config = MemoryConfig::default(); let mut ui = UiState::default(); let mut store = WorkspaceStore::load(Some(&config), &mut ui); - ui.dock.apply(Action::Float { panel: PanelKind::Project, rect: [10.0, 10.0, 300.0, 200.0] }, crate::dock::permissions).unwrap(); - ui.dock.apply(Action::SetNative { panel: PanelKind::Project, rect: Some([90_000.0, -90_000.0, 1.0e5, 0.5]) }, crate::dock::permissions).unwrap(); + ui.dock_locked = true; assert!(store.save(Some(&config), &ui).unwrap()); let mut restored = UiState::default(); WorkspaceStore::load(Some(&config), &mut restored); - let native = restored.dock.layout.floating.iter().find(|w| w.contains(&PanelKind::Project)).and_then(|w| w.native).unwrap(); - assert_eq!(native, crate::dock_ui::sanitized_window_rect(native)); - assert!(native[2] <= crate::dock_ui::PANEL_WINDOW_MAX && native[3] >= crate::dock_ui::PANEL_WINDOW_MIN[1]); + assert!(restored.dock_locked); + + let mut saved: serde_json::Value = serde_json::from_str(&config.read(FILE).unwrap()).unwrap(); + saved.as_object_mut().unwrap().remove("locked"); + config.write(FILE, &saved.to_string()).unwrap(); + let mut unlocked = UiState::default(); + WorkspaceStore::load(Some(&config), &mut unlocked); + assert!(!unlocked.dock_locked, "a file without the lock loads unlocked"); + + saved["dock"]["locked"] = serde_json::json!(true); + config.write(FILE, &saved.to_string()).unwrap(); + let mut earlier = UiState::default(); + let loaded = WorkspaceStore::load(Some(&config), &mut earlier); + assert_eq!(loaded.error, None); + assert!(earlier.dock_locked, "the earlier workspace's own lock carries over"); } #[test] diff --git a/crates/ui-egui/tests/it/main.rs b/crates/ui-egui/tests/it/main.rs index 4444fcc5e..5e6ce22f0 100644 --- a/crates/ui-egui/tests/it/main.rs +++ b/crates/ui-egui/tests/it/main.rs @@ -29,7 +29,6 @@ mod ui_crypto_pick; mod ui_crypto_pick_undo; mod ui_crypto_select; mod ui_dialog_preview; -mod ui_dock_resize; mod ui_drag_drop; mod ui_effect_controls; mod ui_effect_drop_highlight; diff --git a/crates/ui-egui/tests/it/shared_docking_ui.rs b/crates/ui-egui/tests/it/shared_docking_ui.rs index 12e598a19..052d4f8a4 100644 --- a/crates/ui-egui/tests/it/shared_docking_ui.rs +++ b/crates/ui-egui/tests/it/shared_docking_ui.rs @@ -1,7 +1,6 @@ //! EffectCraft's workspaces in craft-ui's shared docking: transactions, the command path, pointer //! gestures and persistence. -use craft_behavior::dock::{Action, DockPlacement, Node, StackEntry}; -use craft_ui::docking::Zone; +use craft_behavior::dock::{Action, DockPlacement, Node}; use effectcraft_engine::Session; use effectcraft_ui_egui::{ EffectcraftApp, @@ -17,7 +16,12 @@ fn invoke(app: &mut EffectcraftApp, id: &str, params: serde_json::Value) -> Resu } fn floating(app: &EffectcraftApp) -> &[dock::Floating] { - &app.ui.dock.layout.floating + &app.ui.dock.layout().floating +} + +/// A rect as `[x, y, width, height]`. +fn rect4(r: Rect) -> [f32; 4] { + [r.min.x, r.min.y, r.width(), r.height()] } #[test] @@ -27,28 +31,28 @@ fn shared_move_preserves_accordion_metadata_and_unrelated_active_tabs() { dock::tabs(&[PanelKind::Project, PanelKind::Composition, PanelKind::Layer], 1), dock::stack(&[(PanelKind::Preview, false, Some(73.0)), (PanelKind::Properties, true, Some(211.0)), (PanelKind::Align, false, None)]), )); - workspace.apply(Action::Close { panel: PanelKind::Project }, dock::permissions).unwrap(); + workspace.apply(Action::close(PanelKind::Project), false, dock::permissions).unwrap(); assert!(workspace.is_visible(PanelKind::Composition)); - workspace - .apply(Action::Move { panel: PanelKind::Preview, anchor: PanelKind::Layer, placement: DockPlacement::Tab { before: None } }, dock::permissions) - .unwrap(); - let Some(Node::Split { second, size, .. }) = &workspace.layout.root else { panic!("split was lost") }; + workspace.apply(Action::move_beside(PanelKind::Preview, PanelKind::Layer, DockPlacement::tab(None)), false, dock::permissions).unwrap(); + let Some(Node::Split { second, size, .. }) = &workspace.layout().root else { panic!("split was lost") }; assert_eq!(*size, SplitSize::FixedSecond(300.0)); - let Node::Stack { entries } = second.as_ref() else { panic!("stack was lost") }; + let Node::Stack { entries, .. } = second.as_ref() else { panic!("stack was lost") }; // The unrelated stacked panels keep their exact state. - assert_eq!( - entries, - &vec![StackEntry { panel: PanelKind::Properties, open: true, height: Some(211.0) }, StackEntry { panel: PanelKind::Align, open: false, height: None }] - ); + let entries: Vec<_> = entries.iter().map(|entry| (entry.panel, entry.open, entry.height)).collect(); + assert_eq!(entries, [(PanelKind::Properties, true, Some(211.0)), (PanelKind::Align, false, None)]); assert_eq!(workspace.group_of(PanelKind::Preview), vec![PanelKind::Composition, PanelKind::Layer, PanelKind::Preview]); // Rejected moves and geometry change nothing. let before = workspace.clone(); assert!( workspace - .apply(Action::Move { panel: PanelKind::Preview, anchor: PanelKind::Audio, placement: DockPlacement::Split(Zone::Left) }, dock::permissions) + .apply(Action::move_beside(PanelKind::Preview, PanelKind::Audio, DockPlacement::Split(craft_behavior::DockSide::Start)), false, dock::permissions) + .is_err() + ); + assert!( + workspace + .apply(Action::float(PanelKind::Preview, effectcraft_ui_egui::dock_command::rect_of([0.0, 0.0, f32::INFINITY, 200.0])), false, dock::permissions) .is_err() ); - assert!(workspace.apply(Action::Float { panel: PanelKind::Preview, rect: [0.0, 0.0, f32::INFINITY, 200.0] }, dock::permissions).is_err()); assert_eq!(workspace, before); } @@ -66,14 +70,14 @@ fn every_builtin_workspace_validates_and_roundtrips_with_dynamic_identities() { let ids = |layout: &Layout| layout.floating.iter().map(|w| w.id).collect::>(); assert_eq!(ids(&dock::workspace("Undocked Panels")), ids(&dock::workspace("Undocked Panels"))); let mut workspace = dock::docked(dock::tabs(&[PanelKind::Composition, PanelKind::Viewer(42), PanelKind::ScriptPanel(77)], 1)); - workspace.apply(Action::Float { panel: PanelKind::ScriptPanel(77), rect: [20.0, 30.0, 400.0, 300.0] }, dock::permissions).unwrap(); + workspace + .apply(Action::float(PanelKind::ScriptPanel(77), effectcraft_ui_egui::dock_command::rect_of([20.0, 30.0, 400.0, 300.0])), false, dock::permissions) + .unwrap(); let text = serde_json::to_string(&workspace).unwrap(); assert!(text.contains("\"ScriptPanel\":77") && text.contains("\"Viewer\":42"), "{text}"); assert_eq!(serde_json::from_str::(&text).unwrap(), workspace); - workspace - .apply(Action::Move { panel: PanelKind::ScriptPanel(77), anchor: PanelKind::Viewer(42), placement: DockPlacement::Tab { before: None } }, dock::permissions) - .unwrap(); - assert!(workspace.layout.floating.is_empty()); + workspace.apply(Action::move_beside(PanelKind::ScriptPanel(77), PanelKind::Viewer(42), DockPlacement::tab(None)), false, dock::permissions).unwrap(); + assert!(workspace.layout().floating.is_empty()); assert!(workspace.is_visible(PanelKind::ScriptPanel(77))); } @@ -114,7 +118,8 @@ fn pointer_drop_merges_floats_and_redocks_without_project_changes() { ), dock::tabs(&[PanelKind::Timeline], 0), )); - let mut h = Harness::builder().with_size(vec2(1200.0, 760.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| app); + let mut h = + Harness::builder().with_size(vec2(1200.0, 760.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| app); h.run_steps(4); let project = h.state().session.project.clone(); let times = h.state().session.state.times.clone(); @@ -132,14 +137,14 @@ fn pointer_drop_merges_floats_and_redocks_without_project_changes() { let grips: Vec<_> = h.query_all_by_label("Resize panel window").collect(); assert!(!grips.is_empty() && grips.iter().all(|grip| grip.accesskit_node().role() == egui::accesskit::Role::Button)); // Its corner resizes it and its title bar moves it. - let original = floating(h.state())[0].rect; + let original = rect4(floating(h.state())[0].rect); let grip = rect(&h, "panel.float.0.resize").center(); drag(&mut h, grip, grip - vec2(36.0, 24.0), Modifiers::NONE); - let resized = floating(h.state())[0].rect; + let resized = rect4(floating(h.state())[0].rect); assert!(resized[2] < original[2] - 25.0 && resized[3] < original[3] - 15.0, "{original:?} -> {resized:?}"); let bar = rect(&h, "panel.float.0.move"); drag(&mut h, bar.center(), bar.center() - vec2(24.0, 18.0), Modifiers::NONE); - let moved = floating(h.state())[0].rect; + let moved = rect4(floating(h.state())[0].rect); assert!(moved[0] < resized[0] - 15.0 && moved[1] < resized[1] - 10.0, "{resized:?} -> {moved:?}"); // Its tab dropped on a docked tab strip docks it again. let from = rect(&h, "panel.tab.Info").center(); @@ -157,10 +162,10 @@ fn current_and_named_floating_layouts_survive_restart() { use std::sync::Arc; let store = Arc::new(MemoryConfig::default()); let mut app = EffectcraftApp::new(Session { config: Some(store.clone()), ..Default::default() }); - app.apply_dock(Action::Float { panel: PanelKind::Project, rect: [45.0, 65.0, 430.0, 310.0] }).unwrap(); + app.apply_dock(Action::float(PanelKind::Project, effectcraft_ui_egui::dock_command::rect_of([45.0, 65.0, 430.0, 310.0]))).unwrap(); invoke(&mut app, "window.saveWorkspaceAs", json!({"name": "Shared float"})).unwrap(); let saved = app.ui.dock.clone(); - app.apply_dock(Action::MoveFloating { panel: PanelKind::Project, rect: [75.0, 95.0, 480.0, 360.0] }).unwrap(); + app.apply_dock(Action::move_floating(PanelKind::Project, effectcraft_ui_egui::dock_command::rect_of([75.0, 95.0, 480.0, 360.0]))).unwrap(); let current = app.ui.dock.clone(); eframe::App::on_exit(&mut app); let mut restarted = EffectcraftApp::new(Session { config: Some(store), ..Default::default() }); @@ -181,12 +186,12 @@ fn float_command_rejects_malformed_rectangles_and_keeps_one_docked_panel() { // The last docked panel stays docked, whether it moves alone, with its group or by command. app.ui.dock = dock::docked(dock::tabs(&[PanelKind::Project], 0)); let before = app.ui.dock.clone(); - assert!(app.apply_dock(Action::Float { panel: PanelKind::Project, rect: [1.0, 2.0, 300.0, 200.0] }).is_err()); + assert!(app.apply_dock(Action::float(PanelKind::Project, effectcraft_ui_egui::dock_command::rect_of([1.0, 2.0, 300.0, 200.0]))).is_err()); assert!(invoke(&mut app, "window.panel.float", json!({"panel": "Project", "group": true})).is_err()); assert_eq!(app.ui.dock, before); // Closing it is allowed. invoke(&mut app, "window.closePanel", json!({"panel": "Project"})).unwrap(); - assert!(app.ui.dock.layout.root.is_none()); + assert!(app.ui.dock.layout().root.is_none()); } /// A floating panel dragged towards the window's bottom edge moves there, and its title bar @@ -204,11 +209,11 @@ fn floating_panel_dragged_towards_the_window_edge_keeps_moving() { h.run_steps(3); let bar = rect(&h, "panel.float.0.move"); drag(&mut h, bar.center(), bar.center() + vec2(40.0, 420.0), Modifiers::NONE); - let moved = floating(h.state())[0].rect; + let moved = rect4(floating(h.state())[0].rect); assert!(moved[1] > 550.0, "the panel moved down: {moved:?}"); let bar = rect(&h, "panel.float.0.move"); drag(&mut h, bar.center(), bar.center() - vec2(30.0, 200.0), Modifiers::NONE); - let back = floating(h.state())[0].rect; + let back = rect4(floating(h.state())[0].rect); assert!(back[1] < moved[1] - 150.0, "{moved:?} -> {back:?}"); } @@ -221,15 +226,15 @@ fn catalog_docking_action_supports_resize_reorder_and_floating_geometry() { dock::tabs(&[PanelKind::Composition], 0), )); for action in [ - Action::ResizeSplit { path: vec![], size: SplitSize::FixedFirst(360.0) }, - Action::Move { panel: PanelKind::Info, anchor: PanelKind::Project, placement: DockPlacement::Tab { before: Some(PanelKind::Project) } }, - Action::Float { panel: PanelKind::Info, rect: [20.0, 40.0, 300.0, 200.0] }, - Action::MoveFloating { panel: PanelKind::Info, rect: [45.0, 65.0, 330.0, 240.0] }, + Action::resize_split(vec![], SplitSize::FixedFirst(360.0)), + Action::move_beside(PanelKind::Info, PanelKind::Project, DockPlacement::tab(Some(PanelKind::Project))), + Action::float(PanelKind::Info, effectcraft_ui_egui::dock_command::rect_of([20.0, 40.0, 300.0, 200.0])), + Action::move_floating(PanelKind::Info, effectcraft_ui_egui::dock_command::rect_of([45.0, 65.0, 330.0, 240.0])), ] { invoke(&mut app, "window.dockAction", json!({"action": action})).unwrap(); } - assert_eq!(floating(&app)[0].rect, [45.0, 65.0, 330.0, 240.0]); - let Some(Node::Split { size, .. }) = &app.ui.dock.layout.root else { panic!("split lost") }; + assert_eq!(rect4(floating(&app)[0].rect), [45.0, 65.0, 330.0, 240.0]); + let Some(Node::Split { size, .. }) = &app.ui.dock.layout().root else { panic!("split lost") }; assert_eq!(*size, SplitSize::FixedFirst(360.0)); let before = app.ui.dock.clone(); assert!(invoke(&mut app, "window.dockAction", json!({"action": {"ResizeSplit": {"path": [true, true], "size": {"Ratio": 0.5}}}})).is_err()); @@ -252,7 +257,7 @@ fn ui_dock_and_window_panel_commands_parse_craft_ui_commands() { invoke(&mut app, "ui.dock", json!({"action": {"Activate": {"panel": "Layer"}}})).unwrap(); assert!(app.ui.dock.is_visible(PanelKind::Layer)); invoke(&mut app, "ui.dock", json!({"operation": "float", "panel": "Info", "rect": [100, 100, 300, 200]})).unwrap(); - assert_eq!(floating(&app)[0].rect, [100.0, 100.0, 300.0, 200.0]); + assert_eq!(rect4(floating(&app)[0].rect), [100.0, 100.0, 300.0, 200.0]); // `window.panel.*` takes EffectCraft's panel names too. invoke(&mut app, "window.panel.dock", json!({"panel": "Info", "anchor": "Project", "zone": "right"})).unwrap(); assert!(floating(&app).is_empty() && app.ui.dock.is_docked(PanelKind::Info)); @@ -284,10 +289,7 @@ fn raw_open_actions_are_rejected_through_every_docking_route() { let mut app = EffectcraftApp::new(Session::default()); let before = app.ui.dock.clone(); for panel in [PanelKind::ScriptPanel(77), PanelKind::Viewer(42)] { - for action in [ - Action::Open { panel, anchor: Some(PanelKind::Project) }, - Action::OpenAt { panel, anchor: PanelKind::Project, placement: DockPlacement::Tab { before: None } }, - ] { + for action in [Action::open(panel, Some(PanelKind::Project)), Action::open_at(panel, PanelKind::Project, DockPlacement::tab(None))] { for id in ["ui.dock", "window.panel.layout", "window.dockAction"] { let error = invoke(&mut app, id, json!({"action": action})).unwrap_err(); assert!(error.contains("panel open commands"), "{id}: {error}"); @@ -311,9 +313,9 @@ fn catalog_close_keeps_dynamic_panel_identity_and_releases_viewers() { app.ui.viewers.insert(42, Some(7)); app.ui.maximized = Some(PanelKind::Viewer(42)); for panel in [PanelKind::Viewer(42), PanelKind::ScriptPanel(77)] { - invoke(&mut app, "window.dockAction", json!({"action": Action::Close { panel }})).unwrap(); + invoke(&mut app, "window.dockAction", json!({"action": Action::close(panel)})).unwrap(); assert!(!app.ui.dock.is_open(panel)); - assert!(app.ui.dock.hidden.iter().any(|(p, _)| *p == panel), "{panel:?} keeps its place"); + assert!(app.ui.dock.hidden().iter().any(|(p, _)| *p == panel), "{panel:?} keeps its place"); } assert!(app.ui.dock.is_docked(PanelKind::Composition)); assert_eq!(app.ui.maximized, None); @@ -326,7 +328,8 @@ fn stacked_panels_resize_by_pointer_without_changing_closed_entries() { session.execute("comp.new", json!({"width": 160, "height": 90, "duration": 1})).unwrap(); let mut app = EffectcraftApp::new(session); app.ui.start_screen = false; - let mut h = Harness::builder().with_size(vec2(1000.0, 720.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| app); + let mut h = + Harness::builder().with_size(vec2(1000.0, 720.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| app); h.run_steps(4); h.state_mut().ui.dock = dock::docked(dock::stack(&[(PanelKind::Preview, true, Some(100.0)), (PanelKind::Properties, true, None), (PanelKind::Align, false, Some(77.0))])); @@ -337,9 +340,9 @@ fn stacked_panels_resize_by_pointer_without_changing_closed_entries() { drag(&mut h, from, from + vec2(0.0, 16.0), Modifiers::NONE); let after = rect(&h, "panel.Preview").height(); assert!((after - before - 16.0).abs() < 2.0, "{before} -> {after}"); - let Some(Node::Stack { entries }) = &h.state().ui.dock.layout.root else { panic!("stack lost") }; + let Some(Node::Stack { entries, .. }) = &h.state().ui.dock.layout().root else { panic!("stack lost") }; assert!(entries[0].height.unwrap_or_default() > 100.0, "{entries:?}"); - assert_eq!(entries[2], StackEntry { panel: PanelKind::Align, open: false, height: Some(77.0) }); + assert_eq!((entries[2].panel, entries[2].open, entries[2].height), (PanelKind::Align, false, Some(77.0))); assert!(std::sync::Arc::ptr_eq(&project, &h.state().session.project)); } @@ -348,7 +351,7 @@ fn failed_close_preserves_viewer_lifecycle_and_maximize_state() { let mut app = EffectcraftApp::new(Session::default()); // A locked workspace refuses the close. app.ui.dock = dock::docked(dock::tabs(&[PanelKind::Composition, PanelKind::Viewer(42)], 1)); - app.ui.dock.locked = true; + app.ui.dock_locked = true; app.ui.maximized = Some(PanelKind::Viewer(42)); app.ui.viewers.insert(42, Some(3)); app.ui.active_viewer = 42; diff --git a/crates/ui-egui/tests/it/ui_dock_resize.rs b/crates/ui-egui/tests/it/ui_dock_resize.rs deleted file mode 100644 index 29af2cdce..000000000 --- a/crates/ui-egui/tests/it/ui_dock_resize.rs +++ /dev/null @@ -1,85 +0,0 @@ -//! Shared pane resizing in the full application, including application shortcut ownership. - -use crate::gpu_test::RenderSerial; -use craft_ui::docking::{Divider, DockArea, Hit}; -use effectcraft_engine::Session; -use effectcraft_ui_egui::EffectcraftApp; -use effectcraft_ui_egui::dock::{self, Node, PanelKind, SplitSize}; -use effectcraft_ui_egui::theme::ThemeKind; -use egui::{Event, Key, Modifiers, PointerButton, Rect, pos2, vec2}; -use egui_kittest::Harness; -use serde_json::json; - -fn snapshots(h: &mut Harness<'_, EffectcraftApp>, directory: Option<&std::path::Path>, phase: &str) { - let Some(directory) = directory else { return }; - std::fs::create_dir_all(directory).unwrap(); - for (name, theme) in [("dark", ThemeKind::Dark), ("darker", ThemeKind::Darker), ("light", ThemeKind::Light)] { - let ctx = h.ctx.clone(); - h.state_mut().set_theme(&ctx, theme); - h.run_steps(3); - h.render_serialized().unwrap().save(directory.join(format!("effectcraft-{phase}-{name}.png"))).unwrap(); - } - let ctx = h.ctx.clone(); - h.state_mut().set_theme(&ctx, ThemeKind::Dark); - h.run_steps(3); -} - -fn first_size(h: &Harness<'_, EffectcraftApp>) -> f32 { - match &h.state().ui.dock.layout.root { - Some(Node::Split { size: SplitSize::FixedFirst(value), .. }) => *value, - ref other => panic!("fixed-size mode changed: {other:?}"), - } -} - -#[test] -fn focused_dock_resize_owns_arrows_and_keeps_pointer_dragging() { - let _device = crate::gpu_test::lock(); - let mut session = Session::default(); - session.execute("comp.new", json!({"name": "Split test", "width": 160, "height": 90, "duration": 1})).unwrap(); - session.execute("layer.newSolid", json!({"name": "Selected", "color": [1.0, 0.0, 0.0, 1.0]})).unwrap(); - let mut app = EffectcraftApp::new(session); - app.ui.start_screen = false; - let directory = std::env::var_os("CRAFT_UI_PANES_SNAPSHOT_DIR").map(std::path::PathBuf::from); - let mut builder = Harness::builder().with_size(vec2(1400.0, 900.0)).with_max_steps(10_000); - if directory.is_some() { - builder = builder.wgpu(); - } - let mut h = builder.with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| app); - h.run_steps(4); - snapshots(&mut h, directory.as_deref(), "workspace"); - h.state_mut().ui.focused = PanelKind::Composition; - h.state_mut().ui.dock = - dock::docked(dock::hsplit(SplitSize::FixedFirst(400.0), dock::tabs(&[PanelKind::Project], 0), dock::tabs(&[PanelKind::Composition], 0))); - h.run_steps(3); - let before_project = h.state().session.project.clone(); - let before_times = h.state().session.state.times.clone(); - let id = DockArea::::hit_id(effectcraft_ui_egui::dock_ui::area_id(), &Hit::Divider(Divider::Split(Vec::new()))); - h.ctx.memory_mut(|memory| memory.request_focus(id)); - h.run_steps(2); - assert_eq!(h.ctx.memory(|memory| memory.focused()), Some(id)); - snapshots(&mut h, directory.as_deref(), "focused-resize"); - h.event(Event::Key { key: Key::ArrowRight, physical_key: None, pressed: true, repeat: false, modifiers: Modifiers::NONE }); - h.step(); - h.event(Event::Key { key: Key::ArrowRight, physical_key: None, pressed: false, repeat: false, modifiers: Modifiers::NONE }); - h.step(); - assert_eq!(first_size(&h), 408.0); - assert_eq!(h.state().session.state.times, before_times); - assert!(std::sync::Arc::ptr_eq(&h.state().session.project, &before_project), "the viewer shortcut must not nudge a selected layer"); - - h.run_steps(2); - let element = h.state().auto.find("dock.gutter.").unwrap(); - let from = Rect::from_min_size(pos2(element.rect[0], element.rect[1]), vec2(element.rect[2], element.rect[3])).center(); - h.event(Event::PointerMoved(from)); - h.step(); - h.event(Event::PointerButton { pos: from, button: PointerButton::Primary, pressed: true, modifiers: Modifiers::NONE }); - h.step(); - for offset in [5.0, 10.0, 15.0, 20.0] { - h.event(Event::PointerMoved(from + vec2(offset, 0.0))); - h.step(); - } - h.event(Event::PointerButton { pos: from + vec2(20.0, 0.0), button: PointerButton::Primary, pressed: false, modifiers: Modifiers::NONE }); - h.step(); - assert_eq!(first_size(&h), 428.0); - assert_eq!(h.state().session.state.times, before_times); - assert!(std::sync::Arc::ptr_eq(&h.state().session.project, &before_project)); -} diff --git a/crates/ui-egui/tests/it/ui_effect_controls.rs b/crates/ui-egui/tests/it/ui_effect_controls.rs index 0a8a5095b..b51490176 100644 --- a/crates/ui-egui/tests/it/ui_effect_controls.rs +++ b/crates/ui-egui/tests/it/ui_effect_controls.rs @@ -104,7 +104,11 @@ fn header_arrow_harness() -> (Harness<'static, EffectcraftApp>, LayerId, [(u64, let mut app = EffectcraftApp::new(s); app.show_panel(PanelKind::EffectControls); app.toggle_maximize(PanelKind::EffectControls); - let mut h = Harness::builder().with_size(egui::vec2(1000.0, 700.0)).with_step_dt(1.0 / 60.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = Harness::builder() + .with_size(egui::vec2(1000.0, 700.0)) + .with_step_dt(1.0 / 60.0) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| app); h.run_steps(4); (h, LayerId(lid), effects) } @@ -165,7 +169,12 @@ fn effect_header_arrows_ignore_hidden_panels_with_stale_focus() { "closed" => h.state_mut().close_panel(PanelKind::EffectControls), "maximized" => h.state_mut().toggle_maximize(PanelKind::Composition), "floating under maximized" => { - h.state_mut().apply_dock(craft_behavior::dock::Action::Float { panel: PanelKind::EffectControls, rect: [40.0, 40.0, 600.0, 400.0] }).unwrap(); + h.state_mut() + .apply_dock(craft_behavior::dock::Action::float( + PanelKind::EffectControls, + effectcraft_ui_egui::dock_command::rect_of([40.0, 40.0, 600.0, 400.0]), + )) + .unwrap(); h.state_mut().toggle_maximize(PanelKind::Composition); } _ => h.state_mut().ui.start_screen = true, @@ -187,10 +196,15 @@ fn effect_header_arrows_work_wherever_effect_controls_is_on_screen() { let (mut h, lid, [(fx, prop), _, _]) = header_arrow_harness(); h.state_mut().toggle_maximize(PanelKind::EffectControls); if place == "floating" { - h.state_mut().apply_dock(craft_behavior::dock::Action::Float { panel: PanelKind::EffectControls, rect: [40.0, 40.0, 600.0, 400.0] }).unwrap(); + h.state_mut() + .apply_dock(craft_behavior::dock::Action::float( + PanelKind::EffectControls, + effectcraft_ui_egui::dock_command::rect_of([40.0, 40.0, 600.0, 400.0]), + )) + .unwrap(); } else { - let placement = craft_behavior::dock::DockPlacement::Tab { before: None }; - h.state_mut().apply_dock(craft_behavior::dock::Action::Move { panel: PanelKind::EffectControls, anchor: PanelKind::Composition, placement }).unwrap(); + let placement = craft_behavior::dock::DockPlacement::tab(None); + h.state_mut().apply_dock(craft_behavior::dock::Action::move_beside(PanelKind::EffectControls, PanelKind::Composition, placement)).unwrap(); h.state_mut().toggle_maximize(PanelKind::Composition); assert_eq!(h.state().ui.maximized, Some(PanelKind::Composition), "the frame was maximized from its Composition tab"); } @@ -439,7 +453,11 @@ fn effect_header_down_and_up_scroll_the_picked_effect_into_view() { app.show_panel(PanelKind::EffectControls); app.toggle_maximize(PanelKind::EffectControls); app.ui.focused = PanelKind::EffectControls; - let mut h = Harness::builder().with_size(egui::vec2(800.0, 300.0)).with_step_dt(1.0 / 60.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = Harness::builder() + .with_size(egui::vec2(800.0, 300.0)) + .with_step_dt(1.0 / 60.0) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| app); h.run_steps(4); let panel = rect_of(&h, "panel.EffectControls"); let last = fx[fx.len() - 1]; @@ -463,7 +481,8 @@ fn effect_header_down_and_up_scroll_the_picked_effect_into_view() { #[test] fn effect_controls_widgets_register_automation_ids() { let (app, x) = app(); - let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = + Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); settle(&mut h); let have = ids(&h); let want = [ @@ -515,7 +534,8 @@ fn tint_swap_button_targets_its_instance_and_undoes_both_colors() { let blur = s.execute("effect.apply", json!({"effect": "Gaussian Blur"})).unwrap()["effects"][0].as_u64().unwrap(); let mut app = EffectcraftApp::new(s); app.show_panel(PanelKind::EffectControls); - let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = + Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.run_steps(4); let id = format!("effectControls.effect.{target}.swapColors"); let rect = h.state().auto.find(&id).unwrap().rect; @@ -542,7 +562,8 @@ fn tint_swap_button_targets_its_instance_and_undoes_both_colors() { #[test] fn crosshair_and_eyedropper_pick_from_the_viewer() { let (app, x) = app(); - let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = + Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); settle(&mut h); // Crosshair: a click at comp (330, 190) is layer (105, 55) on the 200%-scaled layer // (anchor (100, 50) at position (320, 180)). @@ -580,7 +601,8 @@ fn the_eyedropper_samples_under_the_pointer_in_a_region_of_interest() { app.session.execute("view.setRegionOfInterest", json!({"rect": [0.0, 0.0, 320.0, 180.0]})).unwrap(); // (Not the red it will pick.) app.session.execute("prop.set", json!({"layer": x.small, "prop": x.color, "value": [0.0, 0.0, 1.0, 1.0]})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = + Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); settle(&mut h); h.state_mut().ui.fx_pick = Some(FxPick { kind: "color".into(), layer: x.small, prop: x.color, name: "Color".into() }); h.step(); @@ -611,7 +633,10 @@ fn the_eyedropper_stays_armed_until_the_viewer_has_a_frame() { let KV::Color(c) = v else { panic!("{v:?}") }; c }; - let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1700.0, 1100.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.state_mut().ui.fx_pick = Some(FxPick { kind: "color".into(), layer: top, prop, name: "Color".into() }); h.step(); let pos = effectcraft_ui_egui::panels::viewer::comp_to_screen(&h.ctx, [100.0, 100.0]).unwrap(); @@ -642,7 +667,8 @@ fn keyer_eyedropper_picks_the_screen_from_the_effect_input() { s.state.selected_layers = vec![LayerId(screen)]; let mut app = EffectcraftApp::new(s); app.show_panel(PanelKind::EffectControls); - let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = + Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); settle(&mut h); h.state_mut().ui.fx_pick = Some(FxPick { kind: "color".into(), layer: screen, prop, name: "Screen Colour".into() }); h.step(); @@ -664,7 +690,8 @@ fn keyer_eyedropper_picks_the_screen_from_the_effect_input() { #[test] fn command_clicking_an_effect_twirl_closes_and_opens_its_groups() { let (app, x) = app(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = + Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); let fx = h.state_mut().session.execute("effect.apply", json!({"layers": [x.small], "effect": "Color Grading"})).unwrap()["effects"][0].as_u64().unwrap(); // Only this effect open, so its header is on screen. let l = layer(&h.state().session, x.small); @@ -694,7 +721,8 @@ fn command_clicking_an_effect_twirl_closes_and_opens_its_groups() { #[test] fn shift_click_on_effect_headers_selects_a_range_and_command_toggles() { let (app, x) = app(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = + Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); let fx: Vec = layer(&h.state().session, x.small).effects().unwrap().groups().map(|g| g.uid).collect(); // All twirled closed, so every header is on screen. h.state_mut().ui.fx_closed.extend(fx.iter().copied()); @@ -756,7 +784,8 @@ fn type_into(h: &mut Harness<'_, EffectcraftApp>, id: &str, text: &str) { #[test] fn angle_revolutions_scrub_and_take_typing() { let (app, x) = app(); - let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = + Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); settle(&mut h); let angle = |h: &Harness<'_, EffectcraftApp>| layer(&h.state().session, x.small).effects().unwrap().find(x.angle).unwrap().value.as_f64(); h.state_mut().session.execute("prop.set", json!({"layer": x.small, "prop": x.angle, "value": 45.0})).unwrap(); @@ -820,7 +849,8 @@ fn right_click_in_effect_controls_shows_the_effect_menu() { s.state.selected_layers = vec![LayerId(b), LayerId(a)]; let mut app = EffectcraftApp::new(s); app.show_panel(PanelKind::EffectControls); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = + Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.run_steps(3); let category = " Blur & Sharpen"; // An effect's header: its own menu. @@ -883,7 +913,8 @@ fn extractor_offers_the_exr_layers_and_channels() { s.state.selected_layers = vec![LayerId(l)]; let mut app = EffectcraftApp::new(s); app.show_panel(PanelKind::EffectControls); - let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = + Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); settle(&mut h); let values = |h: &Harness<'_, EffectcraftApp>| -> Vec { let l = layer(&h.state().session, l); @@ -956,7 +987,8 @@ fn cryptomatte_layer_popup_follows_the_footage() { s.state.selected_layers = vec![LayerId(l)]; let mut app = EffectcraftApp::new(s); app.show_panel(PanelKind::EffectControls); - let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = + Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); settle(&mut h); // The file has only CryptoMaterial, so that is what the closed popup shows, and all it lists. assert!(h.query_by_label("CryptoMaterial").is_some() && h.query_by_label("CryptoObject").is_none()); @@ -996,7 +1028,8 @@ fn point_picker_handle_follows_hover_then_commits_once_across_effects() { app.show_panel(PanelKind::EffectControls); app.ui.viewer.zoom = Some(0.85); app.ui.viewer.pan = [25.0, -10.0]; - let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = + Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); settle(&mut h); let id = format!("viewer.effectPoint.{point}"); let original = rect_of(&h, &id).center(); @@ -1027,7 +1060,8 @@ fn point_picker_handle_follows_hover_then_commits_once_across_effects() { #[test] fn point_picker_preview_cancels_and_works_with_layer_controls_hidden() { let (app, x) = app(); - let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = + Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); settle(&mut h); let value = layer(&h.state().session, x.small).props.find(x.point).unwrap().value.clone(); let undo = h.state().session.history.undo.len(); @@ -1058,7 +1092,8 @@ fn radial_center_stays_draggable_when_its_property_is_selected() { let effect = l.effects().unwrap().groups().find(|g| g.match_id == "ec.blur.ccradialfast").unwrap(); let point = effect.get("center").unwrap().uid; app.session.state.selected_props = vec![(LayerId(x.small), point)]; - let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = + Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); settle(&mut h); let id = format!("viewer.effectPoint.{point}"); assert!(ids(&h).contains(&id), "selected point must keep its handle"); @@ -1085,7 +1120,11 @@ fn radial_center_stays_draggable_when_its_property_is_selected() { #[test] fn clicking_an_effect_parameter_activates_its_header_and_handles() { let (app, x) = app(); - let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_step_dt(1.0 / 60.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = Harness::builder() + .with_size(egui::vec2(1700.0, 1100.0)) + .with_step_dt(1.0 / 60.0) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| app); settle(&mut h); let name = rect_of(&h, &format!("effectControls.prop.{}.name", x.point)).center(); click(&mut h, name); @@ -1111,7 +1150,8 @@ fn non_point_parameters_activate_handles_across_effect_families() { s.state.selected_props.clear(); let mut app = EffectcraftApp::new(s); app.show_panel(PanelKind::EffectControls); - let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = + Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); settle(&mut h); let name = rect_of(&h, &format!("effectControls.prop.{prop}.name")).center(); click(&mut h, name); @@ -1125,7 +1165,8 @@ fn non_point_parameters_activate_handles_across_effect_families() { #[test] fn custom_effect_editors_activate_their_owner() { let (app, x) = app(); - let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = + Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); settle(&mut h); let graph = rect_of(&h, &format!("effectControls.effect.{}.curves.graph", x.curves)).center(); click(&mut h, graph); @@ -1167,7 +1208,8 @@ fn file_and_text_parameters_have_widgets() { assert_eq!(exts, ["cube"]); vec![pick.lock().unwrap().clone()] })); - let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = + Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); settle(&mut h); let ctx = h.ctx.clone(); let r = effectcraft_ui_egui::menus::invoke(h.state_mut(), &ctx, "effect.apply", json!({"effect": "Apply Color LUT"})).unwrap(); @@ -1217,7 +1259,11 @@ fn file_and_text_parameters_have_widgets() { #[test] fn effect_control_name_can_be_renamed_from_its_header() { let (app, x) = app(); - let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_step_dt(1.0 / 60.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = Harness::builder() + .with_size(egui::vec2(1700.0, 1100.0)) + .with_step_dt(1.0 / 60.0) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| app); settle(&mut h); let name = format!("effectControls.effect.{}.name", x.point_fx); let point = rect_of(&h, &name).center(); @@ -1242,7 +1288,11 @@ fn effect_control_name_can_be_renamed_from_its_header() { #[test] fn effect_rename_opens_with_the_name_selected() { let (app, x) = app(); - let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_step_dt(1.0 / 60.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = Harness::builder() + .with_size(egui::vec2(1700.0, 1100.0)) + .with_step_dt(1.0 / 60.0) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| app); settle(&mut h); let edit = format!("effectControls.effect.{}.nameEdit", x.point_fx); let current_name = @@ -1294,7 +1344,11 @@ fn effect_rename_opens_with_the_name_selected() { #[test] fn double_clicking_an_effect_property_name_reveals_it_in_the_timeline() { let (app, x) = app(); - let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_step_dt(1.0 / 60.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = Harness::builder() + .with_size(egui::vec2(1700.0, 1100.0)) + .with_step_dt(1.0 / 60.0) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| app); settle(&mut h); let row = format!("timeline.prop.{}.name", x.point); assert!(!ids(&h).contains(&row), "the effect's property is not in the Timeline before the double-click"); @@ -1309,7 +1363,11 @@ fn double_clicking_an_effect_property_name_reveals_it_in_the_timeline() { #[test] fn effect_rename_escape_keeps_the_name() { let (app, x) = app(); - let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_step_dt(1.0 / 60.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = Harness::builder() + .with_size(egui::vec2(1700.0, 1100.0)) + .with_step_dt(1.0 / 60.0) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| app); settle(&mut h); let point = rect_of(&h, &format!("effectControls.effect.{}.name", x.point_fx)).center(); double_click(&mut h, point); @@ -1371,7 +1429,8 @@ fn select_layer(h: &mut Harness<'_, EffectcraftApp>, layer: u64) { #[test] fn locked_effect_controls_keep_their_layer_until_it_is_deleted() { let (app, a, b, fa, fb) = two_layers(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = + Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.run_steps(4); assert!(shows_effect(&h, fa) && !shows_effect(&h, fb), "A is shown before locking"); let comp = h.state().session.active_comp_id().unwrap().0; @@ -1424,7 +1483,8 @@ fn locked_effect_controls_keep_their_layer_until_it_is_deleted() { #[test] fn replacing_the_project_unlocks_effect_controls() { let (app, a, b, _, _) = two_layers(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = + Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.run_steps(4); let lock = rect_of(&h, "panel.tab.EffectControls.lock").center(); click(&mut h, lock); @@ -1453,7 +1513,8 @@ fn a_lock_request_with_no_layer_shown_fails_and_keeps_the_other_comps_lock() { } } let (app, a, _, _, _) = two_layers(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = + Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.run_steps(4); assert_eq!(send(&mut h)["ok"], true); let kept = h.state().ui.effect_controls_lock; @@ -1484,7 +1545,8 @@ fn a_lock_request_while_locked_in_another_comp_fails() { } } let (app, a, _, _, _) = two_layers(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = + Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.run_steps(4); assert_eq!(send(&mut h)["ok"], true); let kept = h.state().ui.effect_controls_lock; @@ -1516,7 +1578,8 @@ fn a_lock_request_after_a_project_replacement_does_not_report_the_old_lock() { } } let (app, a, _, _, _) = two_layers(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = + Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.run_steps(4); assert_eq!(send(&mut h)["ok"], true); assert_eq!(h.state().ui.effect_controls_lock.map(|l| l.layer), Some(a)); @@ -1532,7 +1595,8 @@ fn a_lock_request_after_a_project_replacement_does_not_report_the_old_lock() { #[test] fn applying_an_effect_while_locked_keeps_the_selection() { let (app, a, b, fa, _) = two_layers(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = + Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.run_steps(4); let lock = rect_of(&h, "panel.tab.EffectControls.lock").center(); click(&mut h, lock); @@ -1567,7 +1631,8 @@ fn effect_controls_lock_over_the_control_channel() { } } let (app, a, b, fa, fb) = two_layers(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = + Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.run_steps(4); assert_eq!(send(&mut h, json!({"effectControlsLocked": true}))["ok"], true); assert_eq!(h.state().ui.effect_controls_lock.map(|l| l.layer), Some(a)); diff --git a/crates/ui-egui/tests/it/ui_panel_focus.rs b/crates/ui-egui/tests/it/ui_panel_focus.rs index 99d687379..04fa5ee57 100644 --- a/crates/ui-egui/tests/it/ui_panel_focus.rs +++ b/crates/ui-egui/tests/it/ui_panel_focus.rs @@ -19,7 +19,10 @@ fn harness() -> (Harness<'static, EffectcraftApp>, u64, u64) { s.execute("layer.newSolid", json!({"name": "Red", "color": [1.0, 0.0, 0.0, 1.0]})).unwrap(); s.state.open_comps = vec![ItemId(main)]; s.state.active_comp = Some(ItemId(main)); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); (h, other, main) } @@ -93,9 +96,9 @@ fn opening_a_comp_in_the_minimal_workspace_docks_the_viewer_above_the_timeline() invoke(&mut h, "window.closePanel", json!({"panel": "Composition"})); assert!(!h.state().ui.dock.is_docked(PanelKind::Composition)); invoke(&mut h, "comp.open", json!({"comp": other})); - match &h.state().ui.dock.layout.root { + match &h.state().ui.dock.layout().root { Some(Node::Split { axis: effectcraft_ui_egui::dock::SplitAxis::Vertical, first, second, .. }) => { - assert_eq!(**first, Node::Tabs { panels: vec![PanelKind::Composition], active: 0 }, "the viewer is on top"); + assert_eq!(**first, Node::tabs(vec![PanelKind::Composition], 0), "the viewer is on top"); assert!(matches!(&**second, Node::Tabs { panels, .. } if panels.contains(&PanelKind::Timeline))); } other => panic!("expected the viewer above the Timeline, got {other:?}"), diff --git a/crates/ui-egui/tests/it/ui_panel_windows.rs b/crates/ui-egui/tests/it/ui_panel_windows.rs index 9f9dec821..b4dee1600 100644 --- a/crates/ui-egui/tests/it/ui_panel_windows.rs +++ b/crates/ui-egui/tests/it/ui_panel_windows.rs @@ -5,17 +5,12 @@ use effectcraft_engine::Session; use effectcraft_ui_egui::EffectcraftApp; use effectcraft_ui_egui::dock::{PanelKind, WorkspaceExt as _}; -use effectcraft_ui_egui::dock_ui::sanitized_window_rect; use serde_json::json; fn invoke(app: &mut EffectcraftApp, ctx: &egui::Context, params: serde_json::Value) -> Result { effectcraft_ui_egui::menus::invoke(app, ctx, "window.panelWindow", params) } -fn native(app: &EffectcraftApp, panel: PanelKind) -> Option<[f32; 4]> { - app.ui.dock.layout.floating.iter().find(|w| w.contains(&panel)).and_then(|w| w.native) -} - #[test] fn panel_window_command_moves_a_docked_panel_into_its_own_window_and_back() { let mut app = EffectcraftApp::new(Session::default()); @@ -24,10 +19,8 @@ fn panel_window_command_moves_a_docked_panel_into_its_own_window_and_back() { assert_eq!(invoke(&mut app, &ctx, json!({"panel": "Project", "window": true})).unwrap(), json!({"window": true})); // Undocked first, then given a window of its own. assert!(!app.ui.dock.is_docked(PanelKind::Project)); - assert!(app.ui.dock.layout.floating.iter().any(|w| w.panels().copied().collect::>() == [PanelKind::Project])); + assert!(app.ui.dock.layout().floating.iter().any(|w| w.panels().copied().collect::>() == [PanelKind::Project])); assert!(app.in_panel_window(PanelKind::Project)); - let rect = native(&app, PanelKind::Project).unwrap(); - assert_eq!(rect, sanitized_window_rect(rect)); // Asking again changes nothing; no `window` toggles. assert_eq!(invoke(&mut app, &ctx, json!({"panel": "Project", "window": true})).unwrap(), json!({"window": true})); assert_eq!(invoke(&mut app, &ctx, json!({"panel": "Project"})).unwrap(), json!({"window": false})); @@ -49,36 +42,20 @@ fn panel_window_command_moves_a_docked_panel_into_its_own_window_and_back() { assert!(app.ui.dock.is_docked(PanelKind::Project)); } -#[test] -fn panel_windows_survive_restart_with_hostile_places_made_safe() { - use effectcraft_engine::config::MemoryConfig; - use std::sync::Arc; - let store = Arc::new(MemoryConfig::default()); - let mut app = EffectcraftApp::new(Session { config: Some(store.clone()), ..Default::default() }); - let ctx = egui::Context::default(); - invoke(&mut app, &ctx, json!({"panel": "Project", "window": true})).unwrap(); - let hostile = [90_000.0, -99_000.0, 99_000.0, 0.5]; - app.apply_dock(craft_behavior::dock::Action::SetNative { panel: PanelKind::Project, rect: Some(hostile) }).unwrap(); - eframe::App::on_exit(&mut app); - let restarted = EffectcraftApp::new(Session { config: Some(store), ..Default::default() }); - assert_eq!(native(&restarted, PanelKind::Project), Some(sanitized_window_rect(hostile))); - let [x, y, w, h] = sanitized_window_rect(hostile); - assert!(x <= 100_000.0 && y >= -100_000.0 && (160.0..=16_384.0).contains(&w) && (100.0..=16_384.0).contains(&h)); - assert!(sanitized_window_rect([f32::NAN, f32::INFINITY, f32::NAN, f32::NEG_INFINITY]).iter().all(|v| v.is_finite())); -} - #[test] fn a_click_on_a_floating_panel_does_nothing_while_a_dialog_is_open() { - use egui::{Event, Modifiers, PointerButton, pos2, vec2}; + use egui::{Event, Modifiers, PointerButton, vec2}; use egui_kittest::Harness; let mut app = EffectcraftApp::new(Session::default()); app.ui.start_screen = false; - app.apply_dock(craft_behavior::dock::Action::Float { panel: PanelKind::Project, rect: [80.0, 120.0, 320.0, 240.0] }).unwrap(); - let mut h = Harness::builder().with_size(vec2(1400.0, 900.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| app); + app.apply_dock(craft_behavior::dock::Action::float(PanelKind::Project, effectcraft_ui_egui::dock_command::rect_of([80.0, 120.0, 320.0, 240.0]))).unwrap(); + let mut h = + Harness::builder().with_size(vec2(1400.0, 900.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| app); h.run_steps(3); + // The floating window's ×, by its accessible name. let close = |h: &Harness<'_, EffectcraftApp>| { - let e = h.state().auto.elements.iter().find(|e| e.id.starts_with("panel.float.") && e.id.ends_with(".close")).expect("the floating window's ×"); - pos2(e.rect[0] + e.rect[2] / 2.0, e.rect[1] + e.rect[3] / 2.0) + use egui_kittest::kittest::Queryable; + h.get_by_label("Close panel window").rect().center() }; let click = |h: &mut Harness<'_, EffectcraftApp>, pos| { h.event(Event::PointerMoved(pos)); diff --git a/crates/ui-egui/tests/it/ui_scrolling.rs b/crates/ui-egui/tests/it/ui_scrolling.rs index bec6fc244..af994d8e1 100644 --- a/crates/ui-egui/tests/it/ui_scrolling.rs +++ b/crates/ui-egui/tests/it/ui_scrolling.rs @@ -17,7 +17,8 @@ use super::ui_tail::drag; fn harness(w: f32, h: f32) -> Harness<'static, EffectcraftApp> { let mut s = Session::default(); s.execute("file.openDemoProject", json!({})).unwrap(); - let mut h = Harness::builder().with_size(vec2(w, h)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = + Harness::builder().with_size(vec2(w, h)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); h } @@ -462,7 +463,8 @@ fn effect_values_stay_clear_of_the_keyframe_navigator() { app.session.execute("prop.toggleAnimation", json!({"layer": lid, "path": path})).unwrap(); app.session.execute("prop.set", json!({"layer": lid, "path": path, "value": [123456.7, 123456.7]})).unwrap(); let uid = app.session.active_comp().unwrap().layer(effectcraft_engine::project::LayerId(lid)).unwrap().props.prop(path).unwrap().uid; - app.apply_dock(craft_behavior::dock::Action::Float { panel: PanelKind::EffectControls, rect: [300.0, 150.0, 330.0, 500.0] }).unwrap(); + app.apply_dock(craft_behavior::dock::Action::float(PanelKind::EffectControls, effectcraft_ui_egui::dock_command::rect_of([300.0, 150.0, 330.0, 500.0]))) + .unwrap(); h.run_steps(3); let value = rect(&h, &format!("effectControls.prop.{uid}.value.1")); let nav = rect(&h, &format!("effectControls.prop.{uid}.prevKey")); diff --git a/crates/ui-egui/tests/it/ui_tabs.rs b/crates/ui-egui/tests/it/ui_tabs.rs index fe40ca05f..0b8fd2fcd 100644 --- a/crates/ui-egui/tests/it/ui_tabs.rs +++ b/crates/ui-egui/tests/it/ui_tabs.rs @@ -20,7 +20,10 @@ fn harness() -> (Harness<'static, EffectcraftApp>, u64, u64) { s.execute("layer.addItem", json!({"item": pre})).unwrap(); s.state.open_comps = vec![ItemId(main)]; s.state.active_comp = Some(ItemId(main)); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); (h, pre, main) } @@ -181,8 +184,8 @@ fn panels_dock_beside_others_and_gutters_resize_them() { let dock = |h: &Harness<'_, EffectcraftApp>| h.state().ui.dock.clone(); let tab = rect(&h, "panel.tab.EffectControls"); let tl = rect(&h, "panel.Timeline"); - // Inside the Timeline body's left drop zone. - let depth = craft_ui::docking::SIDE_EDGE_ZONE_DEPTH.min(tl.width().min(tl.height()) / 4.0); + // Inside the Timeline body's left drop zone, a few points in from its edge. + let depth = 16.0_f32.min(tl.width().min(tl.height()) / 4.0); drag(&mut h, tab.center(), pos2(tl.min.x + depth / 2.0, tl.center().y)); assert_eq!(group_of(&dock(&h), PanelKind::EffectControls), Some(vec![PanelKind::EffectControls])); assert!(!group_of(&dock(&h), PanelKind::Timeline).unwrap().contains(&PanelKind::EffectControls)); @@ -251,7 +254,7 @@ fn the_preview_frame_divider_resizes_it() { _ => None, } } - rec(w.layout.root.as_ref()?) + rec(w.layout().root.as_ref()?) } let (preview, props) = (rect(&h, "panel.Preview"), rect(&h, "panel.Properties")); let gap = preview_divider(&h); @@ -440,7 +443,10 @@ fn open_comps_are_tabs_in_the_timeline_row_and_the_rest_are_in_its_overflow_menu .collect(); s.state.open_comps = vec![ItemId(comps[0])]; s.state.active_comp = Some(ItemId(comps[0])); - let mut h = Harness::builder().with_size(egui::vec2(1000.0, 800.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1000.0, 800.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); let alone = rect(&h, "panel.tab.RenderQueue"); h.state_mut().session.state.open_comps = comps.iter().map(|c| ItemId(*c)).collect(); diff --git a/crates/ui-egui/tests/it/ui_viewers.rs b/crates/ui-egui/tests/it/ui_viewers.rs index 122f29a3d..038b0884e 100644 --- a/crates/ui-egui/tests/it/ui_viewers.rs +++ b/crates/ui-egui/tests/it/ui_viewers.rs @@ -65,7 +65,10 @@ fn new_viewers_lock_route_comps_and_activate_on_click() { let c = new_comp(&mut s, "C"); let b = new_comp(&mut s, "B"); let a = new_comp(&mut s, "A"); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); // View ▸ New Viewer: viewer 1 shows A too, viewer 0 (the Composition panel) is locked. invoke(&mut h, "view.newViewer", json!({})); @@ -74,13 +77,13 @@ fn new_viewers_lock_route_comps_and_activate_on_click() { assert_eq!((h.state().ui.active_viewer, shows(&h, 0), shows(&h, 1)), (1, Some(a), Some(a))); // Side by side, so both draw. h.state_mut() - .apply_dock(craft_behavior::dock::Action::Move { - panel: PanelKind::Viewer(1), - anchor: PanelKind::Composition, - placement: craft_behavior::dock::DockPlacement::Split(craft_ui::docking::Zone::Right), - }) + .apply_dock(craft_behavior::dock::Action::move_beside( + PanelKind::Viewer(1), + PanelKind::Composition, + craft_behavior::dock::DockPlacement::Split(craft_behavior::DockSide::End), + )) .unwrap(); - h.state_mut().apply_dock(craft_behavior::dock::Action::Activate { panel: PanelKind::Composition }).unwrap(); + h.state_mut().apply_dock(craft_behavior::dock::Action::activate(PanelKind::Composition)).unwrap(); h.run_steps(3); // Opening B shows it in the active (unlocked) viewer; the locked one keeps A. invoke(&mut h, "comp.open", json!({"comp": b})); @@ -127,7 +130,10 @@ fn a_locked_viewer_keeps_its_comp_when_the_project_panel_opens_another() { let mut s = Session::default(); let b = new_comp(&mut s, "B"); let a = new_comp(&mut s, "A"); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); // Viewer 0 locked to A, and B in viewer 1 (a tab next to it). invoke(&mut h, "view.newViewer", json!({})); @@ -150,17 +156,20 @@ fn viewers_snapshot() { let mut s = Session::default(); s.execute("file.openDemoProject", json!({})).unwrap(); let other = s.project.items.values().filter(|i| i.as_comp().is_some()).map(|i| i.id).find(|id| Some(*id) != s.active_comp_id()).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); invoke(&mut h, "view.newViewer", json!({})); h.state_mut() - .apply_dock(craft_behavior::dock::Action::Move { - panel: PanelKind::Viewer(1), - anchor: PanelKind::Composition, - placement: craft_behavior::dock::DockPlacement::Split(craft_ui::docking::Zone::Right), - }) + .apply_dock(craft_behavior::dock::Action::move_beside( + PanelKind::Viewer(1), + PanelKind::Composition, + craft_behavior::dock::DockPlacement::Split(craft_behavior::DockSide::End), + )) .unwrap(); - h.state_mut().apply_dock(craft_behavior::dock::Action::Activate { panel: PanelKind::Composition }).unwrap(); + h.state_mut().apply_dock(craft_behavior::dock::Action::activate(PanelKind::Composition)).unwrap(); invoke(&mut h, "comp.open", json!({"comp": other.0})); for _ in 0..300 { h.step(); diff --git a/crates/ui-egui/tests/it/ui_workspace_focus.rs b/crates/ui-egui/tests/it/ui_workspace_focus.rs index 62a5498b2..c527379ff 100644 --- a/crates/ui-egui/tests/it/ui_workspace_focus.rs +++ b/crates/ui-egui/tests/it/ui_workspace_focus.rs @@ -11,32 +11,13 @@ use egui::{Event, Id, Key, Modifiers, vec2}; use egui_kittest::Harness; use serde_json::json; -/// The egui id of panel `p`'s dock tab. -fn tab_id(p: PanelKind) -> Id { - craft_ui::docking::DockArea::::hit_id(effectcraft_ui_egui::dock_ui::area_id(), &craft_ui::docking::Hit::Tab(p)) -} - -#[test] -fn workspace_commands_wait_for_migration_without_changing_named_layouts() { - let store = Arc::new(MemoryConfig::default()); - let original = include_str!("../fixtures/workspaces-v1.json"); - store.write("workspaces.json", original).unwrap(); - let mut app = EffectcraftApp::new(Session { config: Some(store.clone()), ..Default::default() }); - assert!(!app.ui.native_outer.is_empty()); - let ctx = egui::Context::default(); - let before = (app.ui.workspace.clone(), app.ui.saved_workspaces.clone(), app.ui.dock.clone()); - for (id, params) in [ - ("window.saveWorkspace", json!({})), - ("window.saveWorkspaceAs", json!({"name": "Too soon"})), - ("window.editWorkspaces", json!({"name": "My Layout", "delete": true})), - ("window.editWorkspaces", json!({"name": "My Layout", "rename": "Too soon"})), - ] { - let error = effectcraft_ui_egui::menus::invoke(&mut app, &ctx, id, params).unwrap_err(); - assert!(error.contains("positions"), "{id}: {error}"); - assert_eq!((app.ui.workspace.clone(), app.ui.saved_workspaces.clone(), app.ui.dock.clone()), before); - assert_eq!(store.read("workspaces.json").as_deref(), Some(original)); - assert_eq!(store.read("workspaces.old.json"), None); - } +/// Whether key focus is on the dock tab whose name starts with `name` (a tab names what its panel +/// shows: "Effect Controls Selected"), as the accessibility tree reports it. +fn tab_focused(h: &Harness<'_, EffectcraftApp>, name: &str) -> bool { + use egui_kittest::kittest::{NodeT, Queryable}; + h.root().children_recursive().any(|n| { + n.is_focused() && n.accesskit_node().role() == egui::accesskit::Role::Tab && n.accesskit_node().label().is_some_and(|label| label.starts_with(name)) + }) } #[test] @@ -51,7 +32,7 @@ fn named_and_current_workspaces_survive_frontend_restart() { let ctx = egui::Context::default(); effectcraft_ui_egui::menus::invoke(&mut app, &ctx, "window.saveWorkspaceAs", json!({"name": "Restart layout"})).unwrap(); let saved = app.ui.dock.clone(); - if let Some(Node::Split { size, .. }) = &mut app.ui.dock.layout.root { + if let Some(Node::Split { size, .. }) = &mut app.ui.dock.layout().root { *size = SplitSize::FixedFirst(390.0); } app.ui.focused = PanelKind::Layer; @@ -154,7 +135,8 @@ fn tab_and_shift_tab_traverse_toolbar_and_space_activates_only_focused_tool() { let mut app = EffectcraftApp::new(session); app.ui.start_screen = false; app.ui.show_menu_bar = false; - let mut h = Harness::builder().with_size(vec2(1400.0, 900.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| app); + let mut h = + Harness::builder().with_size(vec2(1400.0, 900.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| app); h.run_steps(3); for _ in 0..8 { key(&mut h, Key::Tab, Modifiers::NONE); @@ -196,40 +178,32 @@ fn tab_traversal_activates_an_inactive_dock_tab_without_editing_the_project() { app.ui.start_screen = false; app.ui.show_menu_bar = false; // Leave the inactive, layer-named tab visible instead of behind the overflow control. - if let Some(Node::Split { first, .. }) = &mut app.ui.dock.layout.root + if let Some(Node::Split { first, .. }) = &mut app.ui.dock.layout().root && let Node::Split { first, .. } = first.as_mut() && let Node::Split { size, .. } = first.as_mut() { *size = SplitSize::FixedFirst(420.0); } - let mut h = Harness::builder().with_size(vec2(1200.0, 760.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| app); + let mut h = + Harness::builder().with_size(vec2(1200.0, 760.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| app); h.run_steps(3); assert!(h.state().auto.find("panel.tab.EffectControls").is_some(), "the inactive tab must be visible in this fixture"); let before = h.state().ui.dock.clone(); - let target = tab_id(PanelKind::EffectControls); + let target = "Effect Controls"; let mut tabs = 0; for _ in 0..200 { key(&mut h, Key::Tab, Modifiers::NONE); tabs += 1; - if h.ctx.memory(|m| m.focused()) == Some(target) { + if tab_focused(&h, target) { break; } } - assert_eq!(h.ctx.memory(|m| m.focused()), Some(target)); + assert!(tab_focused(&h, target)); println!("Tab presses from no focus to Effect Controls: {tabs}"); assert_eq!(h.state().ui.dock, before, "traversal alone must not activate a tab"); - // craft-ui outlines the keyboard-focused tab, inset 2 pt, in the dock's accent (EffectCraft's - // focus colour). - let response = h.ctx.read_response(target).unwrap(); - assert!( - h.output().shapes.iter().any(|shape| { - matches!(&shape.shape, egui::Shape::Rect(r) if r.rect == response.rect.shrink(2.0) && r.stroke.color == h.state().tokens.focus && r.stroke.width > 0.0) - }), - "the dock tab must visibly show keyboard focus" - ); key(&mut h, Key::Space, Modifiers::NONE); let mut activated = before; - activated.apply(craft_behavior::dock::Action::Activate { panel: PanelKind::EffectControls }, dock::permissions).unwrap(); + activated.apply(craft_behavior::dock::Action::activate(PanelKind::EffectControls), false, dock::permissions).unwrap(); assert_eq!(h.state().ui.dock, activated); assert_eq!(h.state().ui.focused, PanelKind::EffectControls); assert!(!h.state().playback.playing); @@ -237,7 +211,7 @@ fn tab_traversal_activates_an_inactive_dock_tab_without_editing_the_project() { let inspected = effectcraft_ui_egui::control::inspect(h.state(), &h.ctx); assert_eq!(inspected["keyboardFocus"]["automationId"], "panel.tab.EffectControls"); key(&mut h, Key::Tab, Modifiers::SHIFT); - assert_eq!(h.ctx.memory(|m| m.focused()), Some(tab_id(PanelKind::Project))); + assert!(tab_focused(&h, "Project")); key(&mut h, Key::Enter, Modifiers::NONE); assert_eq!(h.state().ui.focused, PanelKind::Project); assert!(!h.state().playback.playing); @@ -255,7 +229,13 @@ impl ControlDriver { let mut app = EffectcraftApp::new(Session::default()).with_control(rx); app.ui.start_screen = false; app.ui.show_menu_bar = false; - let mut driver = Self { h: Harness::builder().with_size(vec2(1200.0, 760.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| app), tx }; + let mut driver = Self { + h: Harness::builder() + .with_size(vec2(1200.0, 760.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(move |_| app), + tx, + }; driver.frames(4, true); driver.ok("engine.execute", json!({"command":"comp.new", "params":{"name":"Native Validation", "width":160,"height":90,"duration":1}}), true); driver.ok("engine.execute", json!({"command":"layer.newSolid", "params":{"name":"Validation Red","color":"#ff0000"}}), true); @@ -316,16 +296,16 @@ fn control_root_divider_drag_after_toolbar_and_dock_tab_keyboard_activation() { d.ok("ui.click", json!({"id":"tools.Selection"}), true); // The toolbar can grow as upstream adds controls. Traverse to the actual response // identity rather than assuming a fixed number of focus stops. - let target = tab_id(PanelKind::EffectControls); + let target = "Effect Controls"; for tabs in 1..=200 { d.ok("ui.key", json!({"key":"Tab"}), true); assert!(d.h.state().ui.mini_flowchart.is_none(), "dock-tab traversal must not open a foreground popup"); - if d.h.ctx.memory(|memory| memory.focused()) == Some(target) { + if tab_focused(&d.h, target) { println!("control Tab presses to Effect Controls: {tabs}"); break; } } - assert_eq!(d.h.ctx.memory(|memory| memory.focused()), Some(target), "Effect Controls must remain reachable by control-channel Tab traversal"); + assert!(tab_focused(&d.h, target), "Effect Controls must remain reachable by control-channel Tab traversal"); d.ok("ui.key", json!({"key":"Space"}), true); assert_eq!(d.h.state().ui.focused, PanelKind::EffectControls); d.ok("ui.key", json!({"key":"Tab","shift":true}), true); diff --git a/docs/control-protocol.md b/docs/control-protocol.md index d83c811f9..dc54b05a1 100644 --- a/docs/control-protocol.md +++ b/docs/control-protocol.md @@ -156,8 +156,7 @@ frames and can be assigned through `shortcuts.set`. | `ui.screenshot` | `{path?, panel?, id?}` | `{path, width, height}`: a PNG of the window, or cropped to one panel or element. The panel or element rectangle is resolved when the capture is issued (after the UI settles), so it follows a panel that moved; a panel or id that is not on screen is retried and then reported, never replaced by a whole-window shot. | Element ids are stable, for example `tools.Selection`, `panel.Timeline`, `panel.tab.EffectControls`, -`panel.tab.Timeline.` (one Timeline tab per open comp; `panel.tab.Timeline` is the shown -one), `panel.tab.Viewer()` and `viewers.` (View ▸ New Viewer's other Composition viewers; +`panel.tab.Viewer()` and `viewers.` (View ▸ New Viewer's other Composition viewers; `viewers.0` is the Composition panel while another viewer is active), `header.workspace.Animation`, `project.item.` (a double-click opens the item, Enter renames it), `viewer.comp`, `viewer.handle..`, `timeline.layer..bar`, `timeline.layer..nestedMarker.` (a precomp's comp markers), `timeline.layer..twirl`, `timeline.layer..row` (click selects, @@ -231,12 +230,14 @@ takes a name, or as `{"Viewer":42}` and `{"ScriptPanel":77}` for viewers and Scr floating window holding Info. `Open` and `OpenAt` are refused: panels open through the panel commands (`window.panel`, `ui.panel.show`), which run the viewer and ScriptUI lifecycles. Closing runs them too. Pointer gestures dispatch through this command. -- craft-ui's commands: `window.panel.move`, `.float`, `.dock`, `.activate`, `.close`, - `.closeGroup`, `.closeOthers`, `.minimize`, `.iconic`, `.window` and `.layout`, with the params - of craft-ui's `DockCommand` (`docs/ui-docking.md` in craft-libs). `window.panel.` +- The panel commands `window.panel.move {panel, anchor, zone?, before?, group?}`, + `.float {panel, x?, y?, width?, height?, group?, column?}`, + `.dock {panel, anchor?, zone?, before?, group?, column?, side?}`, `.activate`, `.close`, + `.closeGroup`, `.closeOthers`, `.minimize {minimized?}`, `.iconic {iconic?}`, + `.window {native?}` (as `window.panelWindow`) and `.layout {action}`. `window.panel.` (`window.panel.Align`) opens and shows that panel. `window.panel.activate` on a closed panel reopens it where it was. -- `ui.dock {operation, panel, …}` or `ui.dock {action}`: craft-ui's `ui.dock` operations +- `ui.dock {operation, panel, …}` or `ui.dock {action}`: the operations (`open`, `close`, `activate`, `float {rect}`, `moveFloating {rect}`, `move {target, zone?, before?}`, `setStackOpen {open}`, `resizeStack {height}`, `resizeSplit {path, size}`; `rect` is `[x, y, width, height]`). It returns @@ -261,12 +262,11 @@ run the main window's shortcuts, and files dropped on one import as on the main modal dialog is open, floating windows take no input. The automation ids of the docking chrome are `panel.tab.`, `panel.drag.` (a -group's drag bar), `panel.tabs.more.`, `panel.menu.` (≡), `panel.header.` -(a stacked panel's open and close button), `panel.tab..lock` (viewer lock), -`panel.tab.Timeline.` and `panel.tab.Timeline.close` (the Timeline's comp tabs), -`panel.float..move`, `.close`, `.resize` and `.resize.` for floating window `n`, +group's drag bar), `panel.menu.` (≡), `panel.tab..lock` (viewer lock), +`panel.float..move`, `.resize` and `.resize.` for floating window `n`, and `dock.gutter.` for dividers (`a`/`b` per split level; a stack's gap below entry `i` adds -`s`) and `dock.corner..` where two dividers meet. +`s`). The other parts (the Timeline's comp tabs, a floating window's close button, the tab +overflow menu) are found by their accessible names. Saved workspaces (`workspaces.json`, version 2) hold craft-ui `Workspace`s: the layout, the closed panels with where each goes back, the lock, and each floating window's desktop place. A From bce6460d3c5bd66e22e63c577f4090b3e91f9538 Mon Sep 17 00:00:00 2001 From: aiongg Date: Tue, 24 Nov 2026 19:17:33 +0000 Subject: [PATCH 419/451] rustfmt: test harness lines over the line width --- crates/ui-egui/src/app/viewer_frames.rs | 10 ++- crates/ui-egui/src/color_picker.rs | 10 ++- crates/ui-egui/src/panels/text_panels.rs | 1 - .../ui-egui/tests/it/render_queue_snapshot.rs | 10 ++- crates/ui-egui/tests/it/ui_3d.rs | 34 ++++++-- crates/ui-egui/tests/it/ui_accessibility.rs | 5 +- .../tests/it/ui_accessibility_audit.rs | 5 +- crates/ui-egui/tests/it/ui_agent_audit.rs | 5 +- .../ui-egui/tests/it/ui_alt_drag_duplicate.rs | 10 ++- .../ui-egui/tests/it/ui_audio_panel_levels.rs | 5 +- crates/ui-egui/tests/it/ui_audio_scrub.rs | 81 +++++++++++++---- crates/ui-egui/tests/it/ui_batch_links.rs | 5 +- crates/ui-egui/tests/it/ui_batch_switches.rs | 10 ++- .../tests/it/ui_blank_context_menus.rs | 5 +- crates/ui-egui/tests/it/ui_camera_tracker.rs | 19 ++-- .../tests/it/ui_character_eyedropper.rs | 12 ++- .../tests/it/ui_character_stroke_order.rs | 6 +- crates/ui-egui/tests/it/ui_checkbox_drag.rs | 5 +- crates/ui-egui/tests/it/ui_comp_presets.rs | 29 +++++-- crates/ui-egui/tests/it/ui_crypto_pick.rs | 14 ++- .../ui-egui/tests/it/ui_crypto_pick_undo.rs | 7 +- crates/ui-egui/tests/it/ui_crypto_select.rs | 7 +- crates/ui-egui/tests/it/ui_dialog_preview.rs | 5 +- crates/ui-egui/tests/it/ui_drag_drop.rs | 35 ++++++-- .../tests/it/ui_effect_drop_highlight.rs | 5 +- crates/ui-egui/tests/it/ui_effect_names.rs | 6 +- .../tests/it/ui_effects_presets_keyboard.rs | 5 +- crates/ui-egui/tests/it/ui_env_light_gpu.rs | 3 +- .../ui-egui/tests/it/ui_export_overwrite.rs | 5 +- .../ui-egui/tests/it/ui_flowchart_keyboard.rs | 11 ++- crates/ui-egui/tests/it/ui_font_search.rs | 25 ++++-- crates/ui-egui/tests/it/ui_form_fit.rs | 5 +- crates/ui-egui/tests/it/ui_frame_step.rs | 20 ++++- crates/ui-egui/tests/it/ui_fx_editors.rs | 8 +- crates/ui-egui/tests/it/ui_gpu.rs | 50 +++++++---- crates/ui-egui/tests/it/ui_gradient_editor.rs | 5 +- .../ui-egui/tests/it/ui_gradient_handles.rs | 5 +- crates/ui-egui/tests/it/ui_gradient_value.rs | 5 +- crates/ui-egui/tests/it/ui_graph_fit.rs | 5 +- crates/ui-egui/tests/it/ui_graph_theme.rs | 5 +- crates/ui-egui/tests/it/ui_group_rename.rs | 6 +- crates/ui-egui/tests/it/ui_guide_layers.rs | 5 +- .../ui-egui/tests/it/ui_info_tracker_a11y.rs | 5 +- crates/ui-egui/tests/it/ui_inline_edit.rs | 6 +- crates/ui-egui/tests/it/ui_keyframes.rs | 15 +++- crates/ui-egui/tests/it/ui_large_project.rs | 5 +- .../ui-egui/tests/it/ui_layer_panel_zoom.rs | 3 +- .../tests/it/ui_layer_source_picker.rs | 7 +- crates/ui-egui/tests/it/ui_light_settings.rs | 5 +- crates/ui-egui/tests/it/ui_live_preview.rs | 18 +++- crates/ui-egui/tests/it/ui_locked_color.rs | 6 +- crates/ui-egui/tests/it/ui_marker_names.rs | 15 +++- .../tests/it/ui_media_browser_cache.rs | 18 ++-- .../tests/it/ui_media_browser_copy_path.rs | 19 ++-- crates/ui-egui/tests/it/ui_menus.rs | 5 +- crates/ui-egui/tests/it/ui_new_primitive.rs | 5 +- crates/ui-egui/tests/it/ui_object_matte.rs | 5 +- crates/ui-egui/tests/it/ui_panels.rs | 25 ++++-- crates/ui-egui/tests/it/ui_presets_folder.rs | 34 +++++--- crates/ui-egui/tests/it/ui_preview_align.rs | 5 +- crates/ui-egui/tests/it/ui_project_delete.rs | 5 +- .../ui-egui/tests/it/ui_project_duplicate.rs | 5 +- .../ui-egui/tests/it/ui_project_keyboard.rs | 5 +- .../ui-egui/tests/it/ui_project_new_folder.rs | 5 +- crates/ui-egui/tests/it/ui_project_rows.rs | 10 ++- crates/ui-egui/tests/it/ui_quick_offset.rs | 10 ++- crates/ui-egui/tests/it/ui_ram_preview.rs | 21 ++++- crates/ui-egui/tests/it/ui_render_queue.rs | 10 ++- .../tests/it/ui_render_queue_keyboard.rs | 5 +- crates/ui-egui/tests/it/ui_roto_objects.rs | 5 +- .../tests/it/ui_roto_span_confidence.rs | 5 +- crates/ui-egui/tests/it/ui_script_console.rs | 10 ++- .../tests/it/ui_script_console_keyboard.rs | 5 +- crates/ui-egui/tests/it/ui_script_render.rs | 5 +- crates/ui-egui/tests/it/ui_scriptui.rs | 32 +++++-- crates/ui-egui/tests/it/ui_self_drop.rs | 5 +- crates/ui-egui/tests/it/ui_settings_info.rs | 20 ++++- .../ui-egui/tests/it/ui_settings_keyboard.rs | 5 +- crates/ui-egui/tests/it/ui_tail.rs | 3 +- crates/ui-egui/tests/it/ui_text_edit.rs | 86 +++++++++++++++---- .../ui-egui/tests/it/ui_text_range_handles.rs | 5 +- crates/ui-egui/tests/it/ui_theme_favorites.rs | 5 +- .../ui-egui/tests/it/ui_time_zoom_controls.rs | 3 +- .../tests/it/ui_timeline_audio_levels.rs | 15 +++- .../tests/it/ui_timeline_interacting.rs | 5 +- .../ui-egui/tests/it/ui_timeline_marquee.rs | 15 +++- crates/ui-egui/tests/it/ui_timeline_shapes.rs | 5 +- .../ui-egui/tests/it/ui_timeline_switches.rs | 10 ++- .../ui-egui/tests/it/ui_toolbar_gradient.rs | 5 +- crates/ui-egui/tests/it/ui_tracker.rs | 8 +- .../ui-egui/tests/it/ui_unreadable_footage.rs | 5 +- .../ui-egui/tests/it/ui_video_preview_off.rs | 6 +- crates/ui-egui/tests/it/ui_view_layout.rs | 5 +- crates/ui-egui/tests/it/ui_viewer.rs | 45 +++++++--- crates/ui-egui/tests/it/ui_viewer_trackpad.rs | 5 +- crates/ui-egui/tests/it/ui_visual_review.rs | 3 +- crates/ui-egui/tests/it/ui_web_gpu_storage.rs | 10 ++- crates/ui-egui/tests/it/ui_web_offload.rs | 5 +- crates/ui-egui/tests/it/ui_window_title.rs | 5 +- .../ui-egui/tests/it/ui_workflow_selection.rs | 20 ++++- 100 files changed, 900 insertions(+), 257 deletions(-) diff --git a/crates/ui-egui/src/app/viewer_frames.rs b/crates/ui-egui/src/app/viewer_frames.rs index 80eb84af6..96dc4d28d 100644 --- a/crates/ui-egui/src/app/viewer_frames.rs +++ b/crates/ui-egui/src/app/viewer_frames.rs @@ -273,7 +273,10 @@ mod tests { session.execute("layer.newSolid", serde_json::json!({"color": "#808080"})).unwrap(); session.execute("effect.apply", serde_json::json!({"layer": 1, "effect": "Apply Color LUT"})).unwrap(); session.execute("prop.set", serde_json::json!({"layer": 1, "path": "effects/#1/lut", "value": lut.to_string_lossy()})).unwrap(); - let mut harness = egui_kittest::Harness::builder().with_size(egui::vec2(1200.0, 800.0)).with_context_setup(crate::framework::install_headless).build_eframe(|_| crate::EffectcraftApp::new(session)); + let mut harness = egui_kittest::Harness::builder() + .with_size(egui::vec2(1200.0, 800.0)) + .with_context_setup(crate::framework::install_headless) + .build_eframe(|_| crate::EffectcraftApp::new(session)); let centre = |h: &egui_kittest::Harness<'_, crate::EffectcraftApp>| { h.state().viewer_image.as_ref().map(|img| img.pixels[img.pixels.len() / 2 + img.size[0] / 2].r()) }; @@ -308,7 +311,10 @@ mod tests { let cid = session.active_comp_id().unwrap(); let item = session.execute("file.import", serde_json::json!({"paths": [png.to_string_lossy()]})).unwrap()["items"][0].clone(); session.execute("layer.addItem", serde_json::json!({"item": item})).unwrap(); - let mut harness = egui_kittest::Harness::builder().with_size(egui::vec2(1200.0, 800.0)).with_context_setup(crate::framework::install_headless).build_eframe(|_| crate::EffectcraftApp::new(session)); + let mut harness = egui_kittest::Harness::builder() + .with_size(egui::vec2(1200.0, 800.0)) + .with_context_setup(crate::framework::install_headless) + .build_eframe(|_| crate::EffectcraftApp::new(session)); let centre = |h: &egui_kittest::Harness<'_, crate::EffectcraftApp>| { h.state().viewer_image.as_ref().map(|img| img.pixels[img.pixels.len() / 2 + img.size[0] / 2].r()) }; diff --git a/crates/ui-egui/src/color_picker.rs b/crates/ui-egui/src/color_picker.rs index 7c8812957..34cd8d97e 100644 --- a/crates/ui-egui/src/color_picker.rs +++ b/crates/ui-egui/src/color_picker.rs @@ -674,7 +674,10 @@ mod tests { let mut session = effectcraft_engine::Session::default(); session.execute("comp.new", serde_json::json!({"width": 320, "height": 180, "duration": 2})).unwrap(); session.execute("layer.newSolid", serde_json::json!({"color": "#204060"})).unwrap(); - let mut harness = egui_kittest::Harness::builder().with_size(vec2(1200.0, 800.0)).with_context_setup(crate::framework::install_headless).build_eframe(|_| crate::EffectcraftApp::new(session)); + let mut harness = egui_kittest::Harness::builder() + .with_size(vec2(1200.0, 800.0)) + .with_context_setup(crate::framework::install_headless) + .build_eframe(|_| crate::EffectcraftApp::new(session)); settle_sampling_viewer(&mut harness); harness } @@ -751,7 +754,10 @@ mod tests { let lid = s.execute("layer.newSolid", serde_json::json!({"color": "#ffffff"})).unwrap()["layer"].as_u64().unwrap(); s.execute("effect.apply", serde_json::json!({"layers": [lid], "effect": "Exposure"})).unwrap(); s.execute("prop.set", serde_json::json!({"layer": lid, "path": "effects/#1/master/exposure", "value": 2.0})).unwrap(); - let mut harness = egui_kittest::Harness::builder().with_size(vec2(1200.0, 800.0)).with_context_setup(crate::framework::install_headless).build_eframe(|_| crate::EffectcraftApp::new(s)); + let mut harness = egui_kittest::Harness::builder() + .with_size(vec2(1200.0, 800.0)) + .with_context_setup(crate::framework::install_headless) + .build_eframe(|_| crate::EffectcraftApp::new(s)); for _ in 0..400 { harness.step(); if harness.state().frames.inflight() == 0 && harness.state().viewer_f16.is_some() { diff --git a/crates/ui-egui/src/panels/text_panels.rs b/crates/ui-egui/src/panels/text_panels.rs index b206acf54..e80f20bfc 100644 --- a/crates/ui-egui/src/panels/text_panels.rs +++ b/crates/ui-egui/src/panels/text_panels.rs @@ -1090,7 +1090,6 @@ fn fit_preview(lines: &[Vec<[f32; 2]>], room: Rect, baseline: f32) -> Option<(f3 Some((k, o)) } - /// The tallest the font menu gets, its header included. const FONT_MENU_HEIGHT: f32 = 380.0; diff --git a/crates/ui-egui/tests/it/render_queue_snapshot.rs b/crates/ui-egui/tests/it/render_queue_snapshot.rs index 164a4daf0..46bbc1e89 100644 --- a/crates/ui-egui/tests/it/render_queue_snapshot.rs +++ b/crates/ui-egui/tests/it/render_queue_snapshot.rs @@ -31,7 +31,10 @@ fn render_queue_panel_snapshot() { } let ids: Vec = s.project.render_queue.iter().take(3).map(|i| i.id).collect(); let mut app = Some(EffectcraftApp::new(s)); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app.take().expect("app")); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| app.take().expect("app")); h.ctx.data_mut(|d| d.insert_temp(egui::Id::unique("rq-ui"), (ids, None::))); h.state_mut().show_panel(effectcraft_ui_egui::dock::PanelKind::RenderQueue); h.run_steps(4); @@ -55,7 +58,10 @@ fn templates_dialog_snapshot() { let kind = std::env::var("RQ_TEMPLATES_KIND").unwrap_or_else(|_| "outputModule".into()); s.execute("app.templates", json!({"kind": kind})).unwrap(); let mut app = Some(EffectcraftApp::new(s)); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app.take().expect("app")); + let mut h = Harness::builder() + .with_size(egui::vec2(1400.0, 900.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| app.take().expect("app")); h.run_steps(4); assert!(h.state().dialog.is_some(), "the Templates dialog is open"); let img = h.render_serialized().expect("render"); diff --git a/crates/ui-egui/tests/it/ui_3d.rs b/crates/ui-egui/tests/it/ui_3d.rs index f2c61a64b..63c19f1e4 100644 --- a/crates/ui-egui/tests/it/ui_3d.rs +++ b/crates/ui-egui/tests/it/ui_3d.rs @@ -33,7 +33,8 @@ fn settle(h: &mut Harness<'_, EffectcraftApp>) { #[test] fn viewer_registers_3d_controls() { - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app()); + let mut h = + Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app()); settle(&mut h); h.step(); let ids: Vec = h.state().auto.previous.iter().chain(h.state().auto.elements.iter()).map(|e| e.id.clone()).collect(); @@ -64,7 +65,8 @@ fn click_id(h: &mut Harness<'_, EffectcraftApp>, id: &str) { /// and switches it, as After Effects' Composition panel does. #[test] fn renderer_menu_shows_and_switches_the_comp_renderer() { - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app()); + let mut h = + Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app()); h.state_mut().session.execute("comp.settings", json!({"renderer": "classic3D"})).unwrap(); h.run_steps(3); let label = |h: &Harness<'_, EffectcraftApp>| h.state().auto.find("viewer.renderer3d").map(|e| e.label.clone()); @@ -82,7 +84,8 @@ fn renderer_menu_shows_and_switches_the_comp_renderer() { #[test] fn camera_and_light_dialogs_create_layers() { - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app()); + let mut h = + Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app()); h.step(); let ctx = h.ctx.clone(); let n0 = h.state().session.active_comp().unwrap().layers.len(); @@ -112,7 +115,12 @@ fn camera_and_light_dialogs_create_layers() { fn snapshot() { let _device = crate::gpu_test::lock(); let dir = std::env::var("EC_SNAPSHOT_DIR").ok(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_pixels_per_point(1.0).wgpu().with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app()); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_pixels_per_point(1.0) + .wgpu() + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| app()); let shots: [(&str, Option<&str>); 4] = [("active", None), ("custom1", Some("view.3d.custom1")), ("top", Some("view.3d.top")), ("left", Some("view.3d.left"))]; for (name, cmd) in shots { @@ -155,7 +163,8 @@ fn snapshot() { /// frame, and 3D layers reaching past the frame draw pixels there. #[test] fn extended_viewer_renders_past_the_comp_frame() { - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app()); + let mut h = + Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app()); h.state_mut().session.execute("view.3d.custom1", json!({})).unwrap(); // Zoom out so the viewer shows plenty of pasteboard. h.state_mut().ui.viewer.zoom = Some(0.15); @@ -209,7 +218,10 @@ fn layout_views_draw_the_camera_and_follow_its_position() { s.execute("layer.setSwitch", json!({"layer": solid, "switch": "threeD", "value": true})).unwrap(); let cam = s.execute("layer.newCamera", json!({"position": [320, 180, -300], "poi": [320, 180, 0]})).unwrap()["layer"].as_u64().unwrap(); s.execute("view.layout", json!({"views": 4})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); settle(&mut h); let centre = |h: &Harness<'_, EffectcraftApp>, view: &str| { let id = format!("viewer.view.{view}.camera.{cam}"); @@ -235,7 +247,10 @@ fn four_views() -> Harness<'static, EffectcraftApp> { s.execute("layer.setSwitch", json!({"layer": solid, "switch": "threeD", "value": true})).unwrap(); s.execute("layer.newCamera", json!({"position": [320, 180, -300], "poi": [320, 180, 0]})).unwrap(); s.execute("view.layout", json!({"views": 4})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); settle(&mut h); h } @@ -288,7 +303,10 @@ fn gizmo_harness(w: u32, h: u32) -> (Harness<'static, EffectcraftApp>, u64) { let solid = s.execute("layer.newSolid", json!({"color": "#ff0000", "width": w, "height": h})).unwrap()["layer"].as_u64().unwrap(); s.execute("layer.setSwitch", json!({"layer": solid, "switch": "threeD", "value": true})).unwrap(); s.execute("layer.select", json!({"layers": [solid]})).unwrap(); - let mut harness = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut harness = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); settle(&mut harness); (harness, solid) } diff --git a/crates/ui-egui/tests/it/ui_accessibility.rs b/crates/ui-egui/tests/it/ui_accessibility.rs index 12803dd00..dcbae3c14 100644 --- a/crates/ui-egui/tests/it/ui_accessibility.rs +++ b/crates/ui-egui/tests/it/ui_accessibility.rs @@ -22,7 +22,10 @@ fn harness() -> Harness<'static, EffectcraftApp> { s.execute("file.openDemoProject", json!({})).unwrap(); // A text layer under edit gives the Character / Paragraph panels their controls. let _ = s.execute("layer.select", json!({"layers": ["EFFECTCRAFT"]})); - Harness::builder().with_size(egui::vec2(1680.0, 1020.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)) + Harness::builder() + .with_size(egui::vec2(1680.0, 1020.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)) } #[test] diff --git a/crates/ui-egui/tests/it/ui_accessibility_audit.rs b/crates/ui-egui/tests/it/ui_accessibility_audit.rs index 0ef4f0872..52e475316 100644 --- a/crates/ui-egui/tests/it/ui_accessibility_audit.rs +++ b/crates/ui-egui/tests/it/ui_accessibility_audit.rs @@ -142,7 +142,10 @@ fn app_session() -> Session { } fn harness() -> Harness<'static, EffectcraftApp> { - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(app_session())); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(app_session())); // The default workspace gives Preview a short frame at the top of the right column; its // controls below that frame stay in the tree and would be counted against the panel under it. // The per-panel pass opens Preview again for its own scenario. diff --git a/crates/ui-egui/tests/it/ui_agent_audit.rs b/crates/ui-egui/tests/it/ui_agent_audit.rs index 59e4bd0a8..477850e87 100644 --- a/crates/ui-egui/tests/it/ui_agent_audit.rs +++ b/crates/ui-egui/tests/it/ui_agent_audit.rs @@ -21,7 +21,10 @@ fn session() -> Session { } fn harness(s: Session) -> Harness<'static, EffectcraftApp> { - let mut h = Harness::builder().with_size(egui::vec2(1680.0, 1020.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1680.0, 1020.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); h } diff --git a/crates/ui-egui/tests/it/ui_alt_drag_duplicate.rs b/crates/ui-egui/tests/it/ui_alt_drag_duplicate.rs index f9ec80d92..c834fb0cd 100644 --- a/crates/ui-egui/tests/it/ui_alt_drag_duplicate.rs +++ b/crates/ui-egui/tests/it/ui_alt_drag_duplicate.rs @@ -18,7 +18,10 @@ fn harness() -> (Harness<'static, EffectcraftApp>, u64, u64) { s.execute("prop.set", json!({"layer": a, "path": "transform/position", "value": [150.0, 180.0]})).unwrap(); s.execute("prop.set", json!({"layer": b, "path": "transform/position", "value": [450.0, 180.0]})).unwrap(); s.execute("layer.select", json!({"layers": [a, b]})).unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(4); (h, a, b) } @@ -139,7 +142,10 @@ fn alt_dragging_a_gizmo_arrow_moves_a_copy() { let solid = s.execute("layer.newSolid", json!({"color": "#ff0000", "width": 200, "height": 200})).unwrap()["layer"].as_u64().unwrap(); s.execute("layer.setSwitch", json!({"layer": solid, "switch": "threeD", "value": true})).unwrap(); s.execute("layer.select", json!({"layers": [solid]})).unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(6); let p0 = pos(&h, LayerId(solid)); let [x, y, w, hh] = h.state().auto.find(&format!("viewer.gizmo.{solid}.x")).expect("x arrow registered").rect; diff --git a/crates/ui-egui/tests/it/ui_audio_panel_levels.rs b/crates/ui-egui/tests/it/ui_audio_panel_levels.rs index fd58cf514..518da1794 100644 --- a/crates/ui-egui/tests/it/ui_audio_panel_levels.rs +++ b/crates/ui-egui/tests/it/ui_audio_panel_levels.rs @@ -54,7 +54,10 @@ fn sound_layer(s: &mut Session, levels: [f64; 2]) -> u64 { /// The harness with layer `l` selected and the Audio panel up. fn harness(mut s: Session, l: u64) -> Harness<'static, EffectcraftApp> { s.execute("layer.select", json!({"layers": [l]})).unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.state_mut().show_panel(PanelKind::Audio); h.run_steps(4); h diff --git a/crates/ui-egui/tests/it/ui_audio_scrub.rs b/crates/ui-egui/tests/it/ui_audio_scrub.rs index c14476d0f..9e2333897 100644 --- a/crates/ui-egui/tests/it/ui_audio_scrub.rs +++ b/crates/ui-egui/tests/it/ui_audio_scrub.rs @@ -135,7 +135,8 @@ fn scrubbing_plays_one_frame_per_new_frame() { fn cmd_dragging_the_current_time_scrubs_and_an_idle_scrub_closes() { let fake = Fake::default(); let (app, _) = setup(true, &fake); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = + Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.run_steps(3); let cti = h.state().auto.find("timeline.cti").expect("current time indicator").clone(); let from = pos2(cti.rect[0] + cti.rect[2] / 2.0, cti.rect[1] + cti.rect[3] / 2.0); @@ -217,7 +218,11 @@ fn preview_with_audio_holds_the_first_frame_and_sounds_from_it() { app.frames.set_remote(Some(renderer)); let ahead = (app.frames.lanes() * 2).max(4) as i64; app.session.execute("comp.settings", json!({"comp": cid.0, "duration": (4 * ahead) as f64 / 30.0})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(1.0 / 30.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = Harness::builder() + .with_size(egui::vec2(1400.0, 900.0)) + .with_step_dt(1.0 / 30.0) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| app); h.state_mut().use_manual_clock(); h.run_steps(2); gate.discard(&mut h); @@ -254,7 +259,11 @@ fn preview_with_audio_sounds_without_caching_the_work_area() { let gate = GatedFrames::default(); let renderer: Arc = Arc::new(gate.clone()); app.frames.set_remote(Some(renderer)); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(1.0 / 30.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = Harness::builder() + .with_size(egui::vec2(1400.0, 900.0)) + .with_step_dt(1.0 / 30.0) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| app); h.state_mut().use_manual_clock(); h.run_steps(2); gate.discard(&mut h); @@ -281,7 +290,11 @@ fn a_preview_behind_its_sound_drops_frames_and_keeps_the_sound() { let gate = GatedFrames::default(); let renderer: Arc = Arc::new(gate.clone()); app.frames.set_remote(Some(renderer)); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(1.0 / 30.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = Harness::builder() + .with_size(egui::vec2(1400.0, 900.0)) + .with_step_dt(1.0 / 30.0) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| app); h.state_mut().use_manual_clock(); h.run_steps(2); gate.discard(&mut h); @@ -346,7 +359,11 @@ fn a_sound_in_the_first_100_ms_is_heard() { app.session.execute("layer.timing", json!({"layers": [l], "in": start, "out": start + 0.1})).unwrap(); app.session.execute("time.set", json!({"time": start})).unwrap(); let first = (start * 30.0) as i64; - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(1.0 / 30.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = Harness::builder() + .with_size(egui::vec2(1400.0, 900.0)) + .with_step_dt(1.0 / 30.0) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| app); h.state_mut().use_manual_clock(); h.run_steps(2); let now = h.state().now(); @@ -366,7 +383,8 @@ fn a_sound_in_the_first_100_ms_is_heard() { fn audio_only_previews_start_at_once() { let fake = Fake::default(); let (app, cid) = setup(true, &fake); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = + Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.state_mut().use_manual_clock(); h.run_steps(2); let now = h.state().now(); @@ -382,7 +400,11 @@ fn no_device_plays_the_picture_and_stop_ends_the_wait() { let fake = Fake::default(); let (mut app, cid) = setup_long(true, &fake, 10.0); app.hooks.audio_device = Some(Box::new(|_| None)); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(1.0 / 30.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = Harness::builder() + .with_size(egui::vec2(1400.0, 900.0)) + .with_step_dt(1.0 / 30.0) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| app); h.state_mut().use_manual_clock(); h.run_steps(2); let now = h.state().now(); @@ -451,7 +473,11 @@ fn startup_finishes_at_any_ram_preview_budget() { if !device { app.hooks.audio_device = Some(Box::new(|_| None)); } - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(1.0 / 30.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = Harness::builder() + .with_size(egui::vec2(1400.0, 900.0)) + .with_step_dt(1.0 / 30.0) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| app); h.state_mut().use_manual_clock(); h.run_steps(2); let budget = ((fit as f64 + 0.5) * 9216.0 / 0.9) as usize; @@ -482,7 +508,11 @@ fn extended_viewer(fake: &Fake) -> (Harness<'static, EffectcraftApp>, ItemId, [u let mut app = EffectcraftApp::new(s); let f = fake.clone(); app.hooks.audio_device = Some(Box::new(move |_| Some(Box::new(f.clone()) as Box))); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(1.0 / 30.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = Harness::builder() + .with_size(egui::vec2(1400.0, 900.0)) + .with_step_dt(1.0 / 30.0) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| app); h.state_mut().use_manual_clock(); // The viewer shows the pasteboard: frames render the extended region. let deadline = std::time::Instant::now() + std::time::Duration::from_secs(30); @@ -591,7 +621,11 @@ fn a_device_that_fails_to_start_plays_the_picture() { let fake = Fake::default(); let (mut app, cid) = setup_long(true, &fake, 8.0); app.hooks.audio_device = Some(Box::new(|_| Some(Box::new(Broken) as Box))); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(1.0 / 30.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = Harness::builder() + .with_size(egui::vec2(1400.0, 900.0)) + .with_step_dt(1.0 / 30.0) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| app); h.state_mut().use_manual_clock(); h.run_steps(2); assert!(until_started(&mut h), "it left its startup"); @@ -644,7 +678,11 @@ fn a_started_preview_follows_its_sound() { let device = Playing::default(); let d = device.clone(); app.hooks.audio_device = Some(Box::new(move |_| Some(Box::new(d.clone()) as Box))); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(1.0 / 30.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = Harness::builder() + .with_size(egui::vec2(1400.0, 900.0)) + .with_step_dt(1.0 / 30.0) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| app); h.state_mut().use_manual_clock(); h.run_steps(2); assert!(until_started(&mut h) && h.state().audio.is_some(), "the sound started"); @@ -671,7 +709,11 @@ fn startup_does_not_wait_when_the_ram_preview_holds_no_frame() { for budget in [0, 9216 / 2] { let fake = Fake::default(); let (app, _) = setup_long(true, &fake, 8.0); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(1.0 / 30.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = Harness::builder() + .with_size(egui::vec2(1400.0, 900.0)) + .with_step_dt(1.0 / 30.0) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| app); h.state_mut().use_manual_clock(); h.run_steps(2); h.state().frames.set_budget(budget); @@ -720,7 +762,11 @@ fn adding_markers_does_not_stop_the_sound() { let fake = Fake::default(); let (app, cid) = setup(true, &fake); // Everything is cached before the preview starts, so the sound starts at once. - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(1.0 / 31.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = Harness::builder() + .with_size(egui::vec2(1400.0, 900.0)) + .with_step_dt(1.0 / 31.0) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| app); h.run_steps(2); let deadline = std::time::Instant::now() + std::time::Duration::from_secs(60); let now = h.ctx.input(|i| i.time); @@ -751,7 +797,11 @@ fn unmuting_a_silent_preview_starts_audio_at_its_current_frame() { app.session.execute("layer.setSwitch", json!({"layers": [layer], "switch": "audio", "value": false})).unwrap(); let gate = GatedFrames::default(); app.frames.set_remote(Some(Arc::new(gate.clone()))); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(1.0 / 30.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = Harness::builder() + .with_size(egui::vec2(1400.0, 900.0)) + .with_step_dt(1.0 / 30.0) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| app); h.state_mut().use_manual_clock(); h.run_steps(2); gate.render(&mut h, cid, &(0..60).collect::>()); @@ -871,7 +921,8 @@ fn preview_rate_audio_drives_video_at_half_speed_and_loops() { let gate = GatedFrames::default(); app.frames.set_remote(Some(Arc::new(gate.clone()))); let ahead = (app.frames.parallelism() * 2).max(4) as i64; - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = + Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.state_mut().use_manual_clock(); h.run_steps(2); gate.discard(&mut h); diff --git a/crates/ui-egui/tests/it/ui_batch_links.rs b/crates/ui-egui/tests/it/ui_batch_links.rs index bbbbf76ee..f9cc70c4c 100644 --- a/crates/ui-egui/tests/it/ui_batch_links.rs +++ b/crates/ui-egui/tests/it/ui_batch_links.rs @@ -20,7 +20,10 @@ fn harness() -> (Harness<'static, EffectcraftApp>, [u64; 6]) { s.execute("prop.set", json!({"layer": ids[3], "path": "transform/position", "value": [60, 40]})).unwrap(); s.execute("prop.set", json!({"layer": ids[3], "path": "transform/scale", "value": [50, 50]})).unwrap(); s.history.undo.clear(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.state_mut().ui.timeline.show_modes = true; h.state_mut().ui.timeline.columns_w = 900.0; h.run_steps(3); diff --git a/crates/ui-egui/tests/it/ui_batch_switches.rs b/crates/ui-egui/tests/it/ui_batch_switches.rs index da174138b..b496774d4 100644 --- a/crates/ui-egui/tests/it/ui_batch_switches.rs +++ b/crates/ui-egui/tests/it/ui_batch_switches.rs @@ -22,7 +22,10 @@ fn harness() -> (Harness<'static, EffectcraftApp>, Vec) { .collect(); ids.reverse(); s.execute("edit.deselectAll", json!({})).unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); (h, ids) } @@ -165,7 +168,10 @@ fn switch_targets_skip_the_layers_the_switch_does_not_apply_to() { let cam = s.execute("layer.newCamera", json!({})).unwrap()["layer"].as_u64().unwrap(); s.execute("effect.apply", json!({"effect": "ec.blur.gaussian", "layers": [solid]})).unwrap(); s.execute("edit.deselectAll", json!({})).unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); select(&mut h, &[solid, null, cam]); diff --git a/crates/ui-egui/tests/it/ui_blank_context_menus.rs b/crates/ui-egui/tests/it/ui_blank_context_menus.rs index 37f96f86e..bfa678673 100644 --- a/crates/ui-egui/tests/it/ui_blank_context_menus.rs +++ b/crates/ui-egui/tests/it/ui_blank_context_menus.rs @@ -12,7 +12,10 @@ use serde_json::json; fn harness() -> Harness<'static, EffectcraftApp> { let mut session = Session::default(); session.execute("comp.new", json!({"name":"Empty", "width":640,"height":360,"duration":4})).unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(session)); + let mut h = Harness::builder() + .with_size(vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(session)); // English whatever the system language: the menu items found below by label are translated. h.state_mut().session.prefs.general.language = "en".into(); h.run_steps(3); diff --git a/crates/ui-egui/tests/it/ui_camera_tracker.rs b/crates/ui-egui/tests/it/ui_camera_tracker.rs index 45e40c446..5838f2a0e 100644 --- a/crates/ui-egui/tests/it/ui_camera_tracker.rs +++ b/crates/ui-egui/tests/it/ui_camera_tracker.rs @@ -75,7 +75,8 @@ fn click(h: &mut Harness<'_, EffectcraftApp>, at: egui::Pos2, modifiers: egui::M #[test] fn deleting_viewer_track_points_preserves_the_effect_and_layer() { let (a, plate, uid) = app(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| a); + let mut h = + Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| a); h.state_mut().show_panel(PanelKind::Composition); h.run_steps(4); let point = rect(&h, "viewer.cameraTracker.point.7").center(); @@ -92,7 +93,8 @@ fn deleting_viewer_track_points_preserves_the_effect_and_layer() { #[test] fn viewer_points_selection_and_effect_controls() { let (a, plate, uid) = app(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| a); + let mut h = + Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| a); h.state_mut().show_panel(PanelKind::Composition); h.run_steps(4); let all = ids(&h); @@ -207,7 +209,8 @@ fn blender_export_button_opens_python_dialog_and_writes_scene() { #[test] fn effect_controls_show_how_many_frames_a_partial_solve_solved() { let (a, plate, uid) = app(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| a); + let mut h = + Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| a); h.state_mut().show_panel(PanelKind::EffectControls); h.run_steps(4); let line = format!("effectControls.cameraTracker.{uid}.partialSolve"); @@ -247,7 +250,8 @@ fn drag_with(h: &mut Harness<'_, EffectcraftApp>, button: egui::PointerButton, f #[test] fn viewer_zooms_and_pans_over_the_track_points() { let (a, ..) = app(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| a); + let mut h = + Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| a); h.state_mut().show_panel(PanelKind::Composition); h.run_steps(4); // Wheel over a point: zooms. @@ -310,7 +314,12 @@ fn snapshot_showcase_track() { s.execute("layer.select", json!({"layers": ["#1"]})).unwrap(); s.execute("track.camera", json!({"layer": "#1", "wait": true})).unwrap(); s.execute("time.set", json!({"time": 2.0})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_pixels_per_point(1.0).wgpu().with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_pixels_per_point(1.0) + .wgpu() + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.state_mut().show_panel(PanelKind::Composition); settle(&mut h); let pts: Vec = ids(&h).into_iter().filter(|i| i.starts_with("viewer.cameraTracker.point.")).collect(); diff --git a/crates/ui-egui/tests/it/ui_character_eyedropper.rs b/crates/ui-egui/tests/it/ui_character_eyedropper.rs index 205bd9937..0174d0b9d 100644 --- a/crates/ui-egui/tests/it/ui_character_eyedropper.rs +++ b/crates/ui-egui/tests/it/ui_character_eyedropper.rs @@ -48,7 +48,11 @@ fn character_fill_eyedropper_samples_viewer_and_keeps_text_selection() { let mut app = EffectcraftApp::new(s); app.set_workspace("Text"); let builder = Harness::builder().with_size(vec2(1600.0, 1400.0)); - let mut h = if std::env::var_os("EC_SNAPSHOT_DIR").is_some() { builder.wgpu().with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app) } else { builder.with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app) }; + let mut h = if std::env::var_os("EC_SNAPSHOT_DIR").is_some() { + builder.wgpu().with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app) + } else { + builder.with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app) + }; h.state_mut().show_panel(PanelKind::Character); settle(&mut h); click_auto(&mut h, "character.fill.eyedropper"); @@ -76,7 +80,11 @@ fn character_stroke_eyedropper_samples_viewer() { app.ui.viewer.show_layer_controls = false; app.ui.dock = dock::docked(dock::hsplit(SplitSize::FixedSecond(360.0), dock::tabs(&[PanelKind::Composition], 0), dock::tabs(&[PanelKind::Character], 0))); let builder = Harness::builder().with_size(vec2(1200.0, 760.0)); - let mut h = if std::env::var_os("EC_SNAPSHOT_DIR").is_some() { builder.wgpu().with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app) } else { builder.with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app) }; + let mut h = if std::env::var_os("EC_SNAPSHOT_DIR").is_some() { + builder.wgpu().with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app) + } else { + builder.with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app) + }; h.state_mut().show_panel(PanelKind::Character); h.state_mut().show_panel(PanelKind::Composition); settle(&mut h); diff --git a/crates/ui-egui/tests/it/ui_character_stroke_order.rs b/crates/ui-egui/tests/it/ui_character_stroke_order.rs index 80596a6ea..7a74901ef 100644 --- a/crates/ui-egui/tests/it/ui_character_stroke_order.rs +++ b/crates/ui-egui/tests/it/ui_character_stroke_order.rs @@ -49,7 +49,11 @@ fn character_stroke_order_menu_sets_layer_fill_and_stroke() { let mut app = EffectcraftApp::new(s); app.set_workspace("Text"); let builder = Harness::builder().with_size(vec2(1600.0, 1400.0)); - let mut h = if std::env::var_os("EC_SNAPSHOT_DIR").is_some() { builder.wgpu().with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app) } else { builder.with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app) }; + let mut h = if std::env::var_os("EC_SNAPSHOT_DIR").is_some() { + builder.wgpu().with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app) + } else { + builder.with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app) + }; h.state_mut().show_panel(PanelKind::Character); h.run_steps(4); diff --git a/crates/ui-egui/tests/it/ui_checkbox_drag.rs b/crates/ui-egui/tests/it/ui_checkbox_drag.rs index 263ace3da..5dc44abc0 100644 --- a/crates/ui-egui/tests/it/ui_checkbox_drag.rs +++ b/crates/ui-egui/tests/it/ui_checkbox_drag.rs @@ -20,7 +20,10 @@ fn view_options_drag_checks_and_unchecks_neighbours() { let mut session = Session::default(); session.prefs.disk.disk_cache_enabled = false; session.execute("comp.new", json!({"width":32,"height":32,"duration":1})).unwrap(); - let mut h = Harness::builder().with_size(vec2(1200.0, 900.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(session)); + let mut h = Harness::builder() + .with_size(vec2(1200.0, 900.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(session)); h.state_mut().ui.viewer.rulers = false; h.state_mut().ui.viewer.guides = true; h.state_mut().ui.viewer.grid = false; diff --git a/crates/ui-egui/tests/it/ui_comp_presets.rs b/crates/ui-egui/tests/it/ui_comp_presets.rs index a9b006df9..1af3b3748 100644 --- a/crates/ui-egui/tests/it/ui_comp_presets.rs +++ b/crates/ui-egui/tests/it/ui_comp_presets.rs @@ -9,7 +9,11 @@ use serde_json::json; fn harness() -> Harness<'static, EffectcraftApp> { let mut s = Session::default(); s.execute("comp.new", json!({"name": "Edit", "width": 2560, "height": 1440, "frameRate": 60, "duration": 4})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_step_dt(1.0 / 60.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_step_dt(1.0 / 60.0) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); h } @@ -114,8 +118,12 @@ fn composition_settings_buttons_fit_every_language() { let mut s = Session::default(); s.execute("comp.new", json!({"name": "Edit", "width": 2560, "height": 1440, "frameRate": 60, "duration": 4})).unwrap(); s.prefs.general.language = language.into(); - let mut h = - Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_step_dt(1.0 / 60.0).allow_missing_glyphs().with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_step_dt(1.0 / 60.0) + .allow_missing_glyphs() + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); open_settings(&mut h); let mut oks = vec![]; @@ -148,7 +156,11 @@ fn rect_of(h: &Harness<'_, EffectcraftApp>, id: &str) -> egui::Rect { fn composition_settings_view_stays_put_when_it_scrolls() { let mut s = Session::default(); s.execute("comp.new", json!({"name": "Edit", "width": 2560, "height": 1440, "frameRate": 60, "duration": 4})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 520.0)).with_step_dt(1.0 / 60.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 520.0)) + .with_step_dt(1.0 / 60.0) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); open_settings(&mut h); let (view, ok) = (rect_of(&h, "dialog.comp.view"), rect_of(&h, "dialog.comp.ok")); @@ -183,7 +195,8 @@ fn composition_settings_refits_when_the_language_changes() { .with_max_steps(30) // `run` checks accessibility after settling; that is not what this test is about. .with_accessibility_check(false) - .with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); open_settings(&mut h); click(&mut h, "dialog.comp.tab.advanced"); @@ -203,7 +216,11 @@ fn composition_settings_refits_when_the_language_changes() { /// leaves the Home screen for the new composition; Cancel keeps it. #[test] fn new_composition_dialog_ok_leaves_the_home_screen() { - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_step_dt(1.0 / 60.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(Session::default())); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_step_dt(1.0 / 60.0) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(Session::default())); h.run_steps(3); h.state_mut().ui.start_screen = true; h.state_mut().dialog = Some(Dialog::NewComp); diff --git a/crates/ui-egui/tests/it/ui_crypto_pick.rs b/crates/ui-egui/tests/it/ui_crypto_pick.rs index 6c84a6331..2ed3c5f31 100644 --- a/crates/ui-egui/tests/it/ui_crypto_pick.rs +++ b/crates/ui-egui/tests/it/ui_crypto_pick.rs @@ -92,7 +92,12 @@ fn harness(s: Session, size: egui::Vec2, ppp: f32, ec: f32) -> Harness<'static, /// [`harness`] whose steps advance the clock by `dt` seconds. fn harness_dt(s: Session, size: egui::Vec2, ppp: f32, ec: f32, dt: f32) -> Harness<'static, EffectcraftApp> { let app = app(s, ec); - let mut h = Harness::builder().with_size(size).with_pixels_per_point(ppp).with_step_dt(dt).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = Harness::builder() + .with_size(size) + .with_pixels_per_point(ppp) + .with_step_dt(dt) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| app); settle(&mut h); h } @@ -651,7 +656,12 @@ fn picks_on_the_gpu_viewer() { } let (s, ids) = crypto_session("gpu", 1919, 1079, false); let app = app(s, 420.0); - let mut h = Harness::builder().with_size(vec2(1400.0, 900.0)).with_pixels_per_point(1.0).wgpu_setup(setup).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = Harness::builder() + .with_size(vec2(1400.0, 900.0)) + .with_pixels_per_point(1.0) + .wgpu_setup(setup) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| app); settle(&mut h); if h.state().gpu_adapter().is_none() { eprintln!("the viewer stayed on the CPU ({adapter}): skipping"); diff --git a/crates/ui-egui/tests/it/ui_crypto_pick_undo.rs b/crates/ui-egui/tests/it/ui_crypto_pick_undo.rs index 8ed0426d2..d88a63356 100644 --- a/crates/ui-egui/tests/it/ui_crypto_pick_undo.rs +++ b/crates/ui-egui/tests/it/ui_crypto_pick_undo.rs @@ -94,7 +94,12 @@ fn harness(s: Session, size: egui::Vec2) -> Harness<'static, EffectcraftApp> { dock::hsplit(SplitSize::FixedSecond(420.0), dock::tabs(&[PanelKind::Composition], 0), dock::tabs(&[PanelKind::EffectControls], 0)), dock::hsplit(SplitSize::FixedSecond(300.0), dock::tabs(&[PanelKind::Timeline], 0), dock::tabs(&[PanelKind::History], 0)), )); - let mut h = Harness::builder().with_size(size).with_pixels_per_point(1.0).with_step_dt(0.25).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = Harness::builder() + .with_size(size) + .with_pixels_per_point(1.0) + .with_step_dt(0.25) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| app); settle(&mut h); h } diff --git a/crates/ui-egui/tests/it/ui_crypto_select.rs b/crates/ui-egui/tests/it/ui_crypto_select.rs index 35076cff0..1f25c594f 100644 --- a/crates/ui-egui/tests/it/ui_crypto_select.rs +++ b/crates/ui-egui/tests/it/ui_crypto_select.rs @@ -63,7 +63,12 @@ fn harness(s: Session) -> Harness<'static, EffectcraftApp> { dock::hsplit(SplitSize::FixedSecond(420.0), dock::tabs(&[PanelKind::Composition], 0), dock::tabs(&[PanelKind::EffectControls], 0)), dock::tabs(&[PanelKind::Timeline], 0), )); - let mut h = Harness::builder().with_size(vec2(1400.0, 800.0)).with_pixels_per_point(1.0).with_step_dt(0.25).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = Harness::builder() + .with_size(vec2(1400.0, 800.0)) + .with_pixels_per_point(1.0) + .with_step_dt(0.25) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| app); settle(&mut h); h } diff --git a/crates/ui-egui/tests/it/ui_dialog_preview.rs b/crates/ui-egui/tests/it/ui_dialog_preview.rs index e18827caa..c142eba79 100644 --- a/crates/ui-egui/tests/it/ui_dialog_preview.rs +++ b/crates/ui-egui/tests/it/ui_dialog_preview.rs @@ -17,7 +17,10 @@ fn harness(setup: impl FnOnce(&mut Session)) -> Harness<'static, EffectcraftApp> let mut s = Session::default(); s.execute("comp.new", json!({"name": "Main", "width": 320, "height": 180, "duration": 10})).unwrap(); setup(&mut s); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); h } diff --git a/crates/ui-egui/tests/it/ui_drag_drop.rs b/crates/ui-egui/tests/it/ui_drag_drop.rs index 631a9c220..839debce3 100644 --- a/crates/ui-egui/tests/it/ui_drag_drop.rs +++ b/crates/ui-egui/tests/it/ui_drag_drop.rs @@ -28,7 +28,10 @@ fn harness() -> (Harness<'static, EffectcraftApp>, u64) { s.execute("layer.newSolid", json!({"name": name, "color": "#406080"})).unwrap(); } s.execute("time.set", json!({"time": 1.0})).unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); (h, clip) } @@ -299,7 +302,10 @@ fn project_footage_dropped_on_empty_timeline_creates_first_comp() { s.execute("file.importPlaceholder", json!({"name": "Landscape.png", "width": 640, "height": 360, "frameRate": 24, "duration": 5})).unwrap()["item"] .as_u64() .unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); assert!(h.state().session.active_comp().is_none()); let from = rect(&h, &format!("project.item.{footage}.name")).center(); @@ -322,7 +328,10 @@ fn multiple_selected_footage_dropped_on_empty_timeline_asks_how_to_create_comps( let first = s.execute("file.importPlaceholder", json!({"name": "First.png", "width": 160, "height": 90})).unwrap()["item"].as_u64().unwrap(); let second = s.execute("file.importPlaceholder", json!({"name": "Second.png", "width": 300, "height": 200})).unwrap()["item"].as_u64().unwrap(); s.state.project_selection = vec![effectcraft_engine::project::ItemId(first), effectcraft_engine::project::ItemId(second)]; - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); let from = rect(&h, &format!("project.item.{first}.name")).center(); let to = rect(&h, "panel.Timeline").center(); @@ -341,7 +350,10 @@ fn project_footage_dropped_on_empty_viewer_creates_first_comp() { s.execute("file.importPlaceholder", json!({"name": "Landscape.png", "width": 640, "height": 360, "frameRate": 24, "duration": 5})).unwrap()["item"] .as_u64() .unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); assert!(h.state().session.active_comp().is_none()); let from = rect(&h, &format!("project.item.{footage}.name")).center(); @@ -364,7 +376,10 @@ fn multiple_selected_footage_dropped_on_empty_viewer_asks_how_to_create_comps() let first = s.execute("file.importPlaceholder", json!({"name": "First.png", "width": 160, "height": 90})).unwrap()["item"].as_u64().unwrap(); let second = s.execute("file.importPlaceholder", json!({"name": "Second.png", "width": 300, "height": 200})).unwrap()["item"].as_u64().unwrap(); s.state.project_selection = vec![effectcraft_engine::project::ItemId(first), effectcraft_engine::project::ItemId(second)]; - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); let from = rect(&h, &format!("project.item.{first}.name")).center(); let viewer = rect(&h, "panel.Composition"); @@ -650,7 +665,10 @@ fn import_dialog_offers_the_image_sequence_option() { /// of it, as in After Effects. #[test] fn new_composition_from_footage_makes_a_comp_of_the_picked_file() { - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(Session::default())); + let mut h = Harness::builder() + .with_size(vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(Session::default())); h.run_steps(3); let dir = frames("fromfootage", 2); let pick = dir.join("frame_0002.png").to_string_lossy().to_string(); @@ -702,7 +720,10 @@ fn a_dropped_folder_imports_as_one_sequence_with_sequence_interpretation() { fn illustrator_import_offers_and_applies_retain_layer_sizes() { let path = std::env::temp_dir().join(format!("effectcraft-retain-ui-{}.ai", std::process::id())); std::fs::write(&path, b"%PDF-1.4\n1 0 obj << /Type /Catalog /Pages 2 0 R >> endobj\n2 0 obj << /Type /Pages /Kids [3 0 R] /Count 1 >> endobj\n3 0 obj << /Type /Page /Parent 2 0 R /MediaBox [0 0 120 80] /Contents 4 0 R >> endobj\n4 0 obj << >> stream\n1 0 0 rg 20 15 30 20 re f\nendstream endobj\n%%EOF").unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(effectcraft_host::session())); + let mut h = Harness::builder() + .with_size(vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(effectcraft_host::session())); h.run_steps(3); let ctx = h.ctx.clone(); effectcraft_ui_egui::menus::invoke(h.state_mut(), &ctx, "file.import", json!({"paths": [path]})).unwrap(); diff --git a/crates/ui-egui/tests/it/ui_effect_drop_highlight.rs b/crates/ui-egui/tests/it/ui_effect_drop_highlight.rs index 48ad490d4..7bf2bf22a 100644 --- a/crates/ui-egui/tests/it/ui_effect_drop_highlight.rs +++ b/crates/ui-egui/tests/it/ui_effect_drop_highlight.rs @@ -23,7 +23,10 @@ fn effect_drag_highlights_the_layer_under_the_pointer() { s.execute("comp.new", json!({"name": "Main", "width": 640, "height": 360, "duration": 4})).unwrap(); let a = s.execute("layer.newNull", json!({})).unwrap()["layer"].as_u64().unwrap(); let b = s.execute("layer.newNull", json!({})).unwrap()["layer"].as_u64().unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); assert!(h.state().auto.find("timeline.dropTarget").is_none(), "nothing is lit without a drag"); let (row_a, row_b) = (rect(&h, &format!("timeline.layer.{a}.row")), rect(&h, &format!("timeline.layer.{b}.row"))); diff --git a/crates/ui-egui/tests/it/ui_effect_names.rs b/crates/ui-egui/tests/it/ui_effect_names.rs index 680b8dd2e..7ba774416 100644 --- a/crates/ui-egui/tests/it/ui_effect_names.rs +++ b/crates/ui-egui/tests/it/ui_effect_names.rs @@ -34,7 +34,11 @@ fn harness(language: &str) -> (Harness<'static, EffectcraftApp>, u64) { app.show_panel(PanelKind::Timeline); // The Chinese/Japanese names under test have no installed face on every host: draw tofu // instead of failing the missing-glyph gate (the glyph coverage test covers the bundled set). - let mut h = Harness::builder().with_size(vec2(1400.0, 900.0)).allow_missing_glyphs().with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = Harness::builder() + .with_size(vec2(1400.0, 900.0)) + .allow_missing_glyphs() + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| app); h.run_steps(4); (h, fx) } diff --git a/crates/ui-egui/tests/it/ui_effects_presets_keyboard.rs b/crates/ui-egui/tests/it/ui_effects_presets_keyboard.rs index 8e30181b9..e768a032a 100644 --- a/crates/ui-egui/tests/it/ui_effects_presets_keyboard.rs +++ b/crates/ui-egui/tests/it/ui_effects_presets_keyboard.rs @@ -16,7 +16,10 @@ fn harness() -> Harness<'static, EffectcraftApp> { let mut s = Session::default(); s.execute("comp.new", json!({"name": "Main", "width": 320, "height": 180, "duration": 4})).unwrap(); s.execute("layer.newSolid", json!({"name": "Red", "color": "#c04040"})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.state_mut().show_panel(PanelKind::EffectsPresets); h.run_steps(4); h diff --git a/crates/ui-egui/tests/it/ui_env_light_gpu.rs b/crates/ui-egui/tests/it/ui_env_light_gpu.rs index a5b492ca0..7520fa3bb 100644 --- a/crates/ui-egui/tests/it/ui_env_light_gpu.rs +++ b/crates/ui-egui/tests/it/ui_env_light_gpu.rs @@ -57,7 +57,8 @@ fn environment_light_lights_the_scene_on_the_gpu() { .with_size(egui::vec2(1400.0, 900.0)) .with_pixels_per_point(1.0) .wgpu_setup(same_adapter(adapter)) - .with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(Session::default())); + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(Session::default())); // The project opens once the compositor (built on a worker thread) is attached, so the // frames compared below are GPU frames, not ones the CPU composited meanwhile (see ui_gpu.rs). wait_for_compositor(&mut h); diff --git a/crates/ui-egui/tests/it/ui_export_overwrite.rs b/crates/ui-egui/tests/it/ui_export_overwrite.rs index 402a82ae4..07f2f9475 100644 --- a/crates/ui-egui/tests/it/ui_export_overwrite.rs +++ b/crates/ui-egui/tests/it/ui_export_overwrite.rs @@ -38,7 +38,10 @@ impl Rig { }; std::sync::Arc::make_mut(&mut s.project).add_item("clip.png", Label::Aqua, None, ItemKind::Footage(clip)); let mut app = Some(EffectcraftApp::new(s)); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app.take().expect("app")); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| app.take().expect("app")); h.run_steps(2); Rig { h, dir } } diff --git a/crates/ui-egui/tests/it/ui_flowchart_keyboard.rs b/crates/ui-egui/tests/it/ui_flowchart_keyboard.rs index a03eaeafb..a3600c8f8 100644 --- a/crates/ui-egui/tests/it/ui_flowchart_keyboard.rs +++ b/crates/ui-egui/tests/it/ui_flowchart_keyboard.rs @@ -28,7 +28,10 @@ fn sized(w: f32, hh: f32) -> Harness<'static, EffectcraftApp> { id(s.execute("comp.new", json!({"name": "Main", "width": 100, "height": 100, "duration": 2})).unwrap()); s.execute("layer.addItem", json!({"item": mid})).unwrap(); s.execute("layer.addItem", json!({"item": inner})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(w, hh)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(w, hh)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.state_mut().show_panel(PanelKind::Flowchart); h.state_mut().ui.maximized = Some(PanelKind::Flowchart); h.run_steps(4); @@ -108,7 +111,11 @@ fn the_toolbar_automation_labels_stay_english_in_another_language() { let mut s = Session::default(); s.execute("comp.new", json!({"name": "Main", "width": 100, "height": 100, "duration": 2})).unwrap(); s.prefs.general.language = "fr".into(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).allow_missing_glyphs().with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .allow_missing_glyphs() + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.state_mut().show_panel(PanelKind::Flowchart); h.state_mut().ui.maximized = Some(PanelKind::Flowchart); h.run_steps(4); diff --git a/crates/ui-egui/tests/it/ui_font_search.rs b/crates/ui-egui/tests/it/ui_font_search.rs index d326646bc..6069dd5a2 100644 --- a/crates/ui-egui/tests/it/ui_font_search.rs +++ b/crates/ui-egui/tests/it/ui_font_search.rs @@ -94,7 +94,10 @@ fn font_search_preserves_edited_text_and_applies_only_to_selected_characters() { let lid = s.execute("layer.newText", json!({"text": "First second", "font": "Inter"})).unwrap()["layer"].as_u64().unwrap(); s.execute("text.edit", json!({"layer": lid})).unwrap(); s.execute("text.setSelection", json!({"start": 0, "end": 5})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(move |_| EffectcraftApp::new(s)); h.state_mut().show_panel(PanelKind::Character); h.run_steps(3); click(&mut h, "character.font"); @@ -143,7 +146,10 @@ fn font_menu_lists_a_name_the_interface_fonts_lack_in_english() { let mut s = Session::default(); s.execute("comp.new", json!({"width": 320, "height": 180})).unwrap(); let lid = s.execute("layer.newText", json!({"text": "Native", "font": "Inter"})).unwrap()["layer"].as_u64().unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(move |_| EffectcraftApp::new(s)); h.state_mut().show_panel(PanelKind::Character); h.run_steps(3); click(&mut h, "character.font"); @@ -192,7 +198,10 @@ fn font_menu_filters_variable_fonts() { let mut s = Session::default(); s.execute("comp.new", json!({"width": 320, "height": 180})).unwrap(); let lid = s.execute("layer.newText", json!({"text": "Var", "font": "Inter"})).unwrap()["layer"].as_u64().unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(move |_| EffectcraftApp::new(s)); h.state_mut().show_panel(PanelKind::Character); h.run_steps(3); let families = |h: &Harness<'_, EffectcraftApp>| -> Vec { @@ -232,7 +241,10 @@ fn font_menu_grows_back_after_an_empty_search() { let mut s = Session::default(); s.execute("comp.new", json!({"width": 320, "height": 180})).unwrap(); let lid = s.execute("layer.newText", json!({"text": "Grow", "font": "Inter"})).unwrap()["layer"].as_u64().unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(move |_| EffectcraftApp::new(s)); h.state_mut().show_panel(PanelKind::Character); h.run_steps(3); let rows = |h: &Harness<'_, EffectcraftApp>| h.state().auto.query("character.font.option.").len(); @@ -266,7 +278,10 @@ fn font_menu_rescan_button_adds_fonts_installed_later() { let mut s = Session::default(); s.execute("comp.new", json!({"width": 320, "height": 180})).unwrap(); s.execute("layer.newText", json!({"text": "Keep this text", "font": "Inter"})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(move |_| EffectcraftApp::new(s)); h.state_mut().show_panel(PanelKind::Character); h.run_steps(3); click(&mut h, "character.font"); diff --git a/crates/ui-egui/tests/it/ui_form_fit.rs b/crates/ui-egui/tests/it/ui_form_fit.rs index fec67e8f7..f4c5b235a 100644 --- a/crates/ui-egui/tests/it/ui_form_fit.rs +++ b/crates/ui-egui/tests/it/ui_form_fit.rs @@ -14,7 +14,10 @@ fn rect(h: &Harness<'_, EffectcraftApp>, id: &str) -> Rect { fn project_settings_fits_the_form_width() { let mut session = Session::default(); session.prefs.disk.disk_cache_enabled = false; - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(session)); + let mut h = Harness::builder() + .with_size(vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(session)); h.run_steps(4); let ctx = h.ctx.clone(); menus::invoke(h.state_mut(), &ctx, "file.projectSettings", json!({})).unwrap(); diff --git a/crates/ui-egui/tests/it/ui_frame_step.rs b/crates/ui-egui/tests/it/ui_frame_step.rs index 75d71887d..2950dfe0c 100644 --- a/crates/ui-egui/tests/it/ui_frame_step.rs +++ b/crates/ui-egui/tests/it/ui_frame_step.rs @@ -20,7 +20,10 @@ fn cmd_arrows_step_the_current_frame() { let mut session = Session::default(); session.execute("comp.new", json!({"name": "Main", "width": 320, "height": 180, "frameRate": 30.0, "duration": 4.0})).unwrap(); let cid = session.state.active_comp.unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(session)); + let mut h = Harness::builder() + .with_size(egui::vec2(1400.0, 900.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(session)); h.run_steps(2); let frame = |h: &Harness<'_, EffectcraftApp>| { let app = h.state(); @@ -53,7 +56,10 @@ fn plain_arrows_nudge_the_selected_layer() { session.execute("comp.new", json!({"name": "Main", "width": 320, "height": 180, "frameRate": 30.0, "duration": 4.0})).unwrap(); let lid = session.execute("layer.newSolid", json!({"name": "Box", "width": 40, "height": 40, "color": "#ff0000"})).unwrap()["layer"].as_u64().unwrap(); session.execute("layer.select", json!({"layers": [lid]})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(session)); + let mut h = Harness::builder() + .with_size(egui::vec2(1400.0, 900.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(session)); h.run_steps(2); let x = |h: &Harness<'_, EffectcraftApp>| { h.state().session.active_comp().unwrap().layer(LayerId(lid)).unwrap().props.prop("transform/position").unwrap().value.as_vec3()[0] @@ -83,7 +89,10 @@ fn clicking_a_timeline_row_then_arrows_nudge_the_layer() { session.execute("comp.new", json!({"name": "Main", "width": 320, "height": 180, "frameRate": 30.0, "duration": 4.0})).unwrap(); let lid = session.execute("layer.newSolid", json!({"name": "Box", "width": 40, "height": 40, "color": "#ff0000"})).unwrap()["layer"].as_u64().unwrap(); session.execute("edit.deselectAll", json!({})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(session)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(session)); h.run_steps(3); let row = { let e = h.state().auto.find(&format!("timeline.layer.{lid}.row")).expect("timeline row"); @@ -114,7 +123,10 @@ fn arrows_nudge_from_any_panel_but_project() { session.execute("comp.new", json!({"name": "Main", "width": 320, "height": 180, "frameRate": 30.0, "duration": 4.0})).unwrap(); let lid = session.execute("layer.newSolid", json!({"name": "Box", "width": 40, "height": 40, "color": "#ff0000"})).unwrap()["layer"].as_u64().unwrap(); session.execute("layer.select", json!({"layers": [lid]})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(session)); + let mut h = Harness::builder() + .with_size(egui::vec2(1400.0, 900.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(session)); h.run_steps(2); let x = |h: &Harness<'_, EffectcraftApp>| { h.state().session.active_comp().unwrap().layer(LayerId(lid)).unwrap().props.prop("transform/position").unwrap().value.as_vec3()[0] diff --git a/crates/ui-egui/tests/it/ui_fx_editors.rs b/crates/ui-egui/tests/it/ui_fx_editors.rs index bf2591541..4fd9ffc59 100644 --- a/crates/ui-egui/tests/it/ui_fx_editors.rs +++ b/crates/ui-egui/tests/it/ui_fx_editors.rs @@ -17,7 +17,8 @@ fn harness(s: Session) -> Harness<'static, EffectcraftApp> { let mut app = EffectcraftApp::new(s); app.show_panel(PanelKind::EffectControls); app.toggle_maximize(PanelKind::EffectControls); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1400.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = + Harness::builder().with_size(egui::vec2(1600.0, 1400.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.run_steps(4); h } @@ -287,7 +288,10 @@ fn mesh_warp_vertices_drag_on_the_viewer() { fn composition_tabs_and_scrolling_preview() { let mut s = Session::default(); s.execute("file.openDemoProject", json!({})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(4); rect(&h, "panel.tab.Timeline.close"); rect(&h, "preview.scroll"); diff --git a/crates/ui-egui/tests/it/ui_gpu.rs b/crates/ui-egui/tests/it/ui_gpu.rs index 24addb35a..e8912634c 100644 --- a/crates/ui-egui/tests/it/ui_gpu.rs +++ b/crates/ui-egui/tests/it/ui_gpu.rs @@ -60,16 +60,19 @@ fn the_interface_draws_and_composites_on_the_cpu_while_the_gpu_compositor_is_bui } let (release, gate) = std::sync::mpsc::channel::<()>(); let s = small_session(); - let mut h = Harness::builder().with_size(egui::vec2(1200.0, 800.0)).wgpu().with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| { - let mut app = EffectcraftApp::new(s); - // The status line's 5 s expiry reads the app clock: a manual one makes the steps below - // stand for a known span of time. - app.use_manual_clock(); - app.hooks.before_gpu_build = Some(Box::new(move || { - let _ = gate.recv(); - })); - app - }); + let mut h = + Harness::builder().with_size(egui::vec2(1200.0, 800.0)).wgpu().with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe( + move |_| { + let mut app = EffectcraftApp::new(s); + // The status line's 5 s expiry reads the app clock: a manual one makes the steps below + // stand for a known span of time. + app.use_manual_clock(); + app.hooks.before_gpu_build = Some(Box::new(move || { + let _ = gate.recv(); + })); + app + }, + ); // The first frames paint, and a CPU frame reaches the viewer, while the worker still waits. for _ in 0..600 { h.step(); @@ -118,11 +121,14 @@ fn a_compositor_build_that_panics_leaves_the_viewer_on_the_cpu() { return; } let s = small_session(); - let mut h = Harness::builder().with_size(egui::vec2(1200.0, 800.0)).wgpu().with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| { - let mut app = EffectcraftApp::new(s); - app.hooks.before_gpu_build = Some(Box::new(|| panic!("synthetic shader compiler panic"))); - app - }); + let mut h = + Harness::builder().with_size(egui::vec2(1200.0, 800.0)).wgpu().with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe( + move |_| { + let mut app = EffectcraftApp::new(s); + app.hooks.before_gpu_build = Some(Box::new(|| panic!("synthetic shader compiler panic"))); + app + }, + ); settle(&mut h); assert!(!h.state().gpu_initializing()); assert!(h.state().gpu_adapter().is_none()); @@ -169,7 +175,8 @@ fn viewer_draws_gpu_frames_that_match_the_cpu() { .with_size(egui::vec2(1400.0, 900.0)) .with_pixels_per_point(1.0) .wgpu_setup(same_adapter(adapter)) - .with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(Session::default())); + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(Session::default())); // The project opens once the compositor (built on a worker thread) is attached. A frame the // CPU composited while it was being built has the GPU frame's key, so the viewer would keep // showing it, and the comparison below would be the CPU against itself. @@ -215,7 +222,10 @@ fn a_lost_device_draws_nothing_autosaves_and_closes() { let mut s = Session { autosave_folder_override: Some(dir.clone()), ..Default::default() }; s.execute("comp.new", json!({"name": "Unsaved", "width": 64, "height": 64, "duration": 1})).unwrap(); assert!(s.is_dirty()); - let mut h = Harness::builder().with_size(egui::vec2(1200.0, 800.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1200.0, 800.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); let told = std::rc::Rc::new(std::cell::RefCell::new(Vec::new())); let log = told.clone(); h.state_mut().hooks.device_lost = Some(Box::new(move |saved| log.borrow_mut().push(saved))); @@ -259,7 +269,11 @@ fn the_viewer_exposes_32_bpc_frames_on_the_gpu() { let lid = s.execute("layer.newSolid", json!({"color": "#ffffff"})).unwrap()["layer"].as_u64().unwrap(); s.execute("effect.apply", json!({"layers": [lid], "effect": "Exposure"})).unwrap(); s.execute("prop.set", json!({"layer": lid, "path": "effects/#1/master/exposure", "value": 2.0})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1200.0, 800.0)).wgpu().with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1200.0, 800.0)) + .wgpu() + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(move |_| EffectcraftApp::new(s)); settle(&mut h); let p = h.state().viewer_f16().expect("a half-float viewer frame").pixel(0).unwrap(); let l = effectcraft_engine::color::srgb_to_linear(p[0] / p[3]); diff --git a/crates/ui-egui/tests/it/ui_gradient_editor.rs b/crates/ui-egui/tests/it/ui_gradient_editor.rs index 258bf5324..8195e9555 100644 --- a/crates/ui-egui/tests/it/ui_gradient_editor.rs +++ b/crates/ui-egui/tests/it/ui_gradient_editor.rs @@ -45,7 +45,10 @@ fn setup(timing: &[(&str, serde_json::Value)]) -> (Harness<'static, EffectcraftA s.execute(cmd, p).unwrap(); } let (groups, colors) = gradient_fill(&s.active_comp().unwrap().layer(LayerId(l)).unwrap().props).expect("a Gradient Fill"); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.state_mut().ui.timeline.open_layers.insert(l); h.state_mut().ui.timeline.open_groups.extend(groups); h.run_steps(3); diff --git a/crates/ui-egui/tests/it/ui_gradient_handles.rs b/crates/ui-egui/tests/it/ui_gradient_handles.rs index 02a242c59..7fac02ed5 100644 --- a/crates/ui-egui/tests/it/ui_gradient_handles.rs +++ b/crates/ui-egui/tests/it/ui_gradient_handles.rs @@ -53,7 +53,10 @@ fn setup(in_group: bool, prep: impl FnOnce(&mut Session, u64, u64)) -> (Session, } fn harness(s: Session) -> Harness<'static, EffectcraftApp> { - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(4); h } diff --git a/crates/ui-egui/tests/it/ui_gradient_value.rs b/crates/ui-egui/tests/it/ui_gradient_value.rs index 26ec7b328..5be67bbe6 100644 --- a/crates/ui-egui/tests/it/ui_gradient_value.rs +++ b/crates/ui-egui/tests/it/ui_gradient_value.rs @@ -31,7 +31,10 @@ fn the_timeline_gradient_value_opens_an_editor() { let l = s.execute("layer.newShape", json!({"kind": "rect"})).unwrap()["layer"].as_u64().unwrap(); s.execute("layer.addShapeItem", json!({"layer": l, "kind": "gfill"})).unwrap(); let (groups, colors) = gradient_fill(&s.active_comp().unwrap().layer(LayerId(l)).unwrap().props).expect("a Gradient Fill"); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.state_mut().ui.timeline.open_layers.insert(l); h.state_mut().ui.timeline.open_groups.extend(groups); h.run_steps(3); diff --git a/crates/ui-egui/tests/it/ui_graph_fit.rs b/crates/ui-egui/tests/it/ui_graph_fit.rs index 69ebb3737..8e4bf86c1 100644 --- a/crates/ui-egui/tests/it/ui_graph_fit.rs +++ b/crates/ui-egui/tests/it/ui_graph_fit.rs @@ -20,7 +20,10 @@ fn harness(select_layer: bool) -> (Harness<'static, EffectcraftApp>, u64, u64) { } let uid = s.active_comp().unwrap().layer(id).unwrap().props.prop("transform/rotation").unwrap().uid; s.execute("layer.select", json!({"layers": if select_layer { vec![id.0] } else { vec![] }})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.state_mut().ui.timeline.pps = Some(300.0); h.state_mut().ui.timeline.start = 0.0; h.run_steps(3); diff --git a/crates/ui-egui/tests/it/ui_graph_theme.rs b/crates/ui-egui/tests/it/ui_graph_theme.rs index 2f04e2a97..87ac73057 100644 --- a/crates/ui-egui/tests/it/ui_graph_theme.rs +++ b/crates/ui-egui/tests/it/ui_graph_theme.rs @@ -33,7 +33,10 @@ fn the_graph_editor_follows_the_theme() { } s.execute("layer.select", json!({"layers": [id.0]})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(move |_| EffectcraftApp::new(s)); h.state_mut().ui.timeline.graph_editor = true; h.run_steps(4); let ctx = h.ctx.clone(); diff --git a/crates/ui-egui/tests/it/ui_group_rename.rs b/crates/ui-egui/tests/it/ui_group_rename.rs index 4abb75063..632d403be 100644 --- a/crates/ui-egui/tests/it/ui_group_rename.rs +++ b/crates/ui-egui/tests/it/ui_group_rename.rs @@ -28,7 +28,11 @@ fn harness() -> (Harness<'static, EffectcraftApp>, Fx) { s.active_comp().unwrap().layer(effectcraft_engine::project::LayerId(l)).unwrap().props.group(path).unwrap().groups().next().unwrap().uid }; let (anim, mask, group) = (first(&s, text, "text/animators"), first(&s, shape, "masks"), first(&s, shape, "contents")); - let mut h = Harness::builder().with_size(egui::vec2(1700.0, 1100.0)).with_step_dt(1.0 / 60.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1700.0, 1100.0)) + .with_step_dt(1.0 / 60.0) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(6); (h, Fx { text, shape, effect, anim, mask, group }) } diff --git a/crates/ui-egui/tests/it/ui_guide_layers.rs b/crates/ui-egui/tests/it/ui_guide_layers.rs index e5b8b59f1..2206aa4e0 100644 --- a/crates/ui-egui/tests/it/ui_guide_layers.rs +++ b/crates/ui-egui/tests/it/ui_guide_layers.rs @@ -21,7 +21,10 @@ fn harness() -> (Harness<'static, EffectcraftApp>, LayerId, LayerId) { }; let left = solid("Left", 160.0); let right = solid("Right", 480.0); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(session)); + let mut h = Harness::builder() + .with_size(vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(session)); h.run_steps(3); (h, left, right) } diff --git a/crates/ui-egui/tests/it/ui_info_tracker_a11y.rs b/crates/ui-egui/tests/it/ui_info_tracker_a11y.rs index 623e7b043..17264b508 100644 --- a/crates/ui-egui/tests/it/ui_info_tracker_a11y.rs +++ b/crates/ui-egui/tests/it/ui_info_tracker_a11y.rs @@ -15,7 +15,10 @@ fn harness(panel: PanelKind) -> Harness<'static, EffectcraftApp> { let mut s = Session::default(); s.execute("comp.new", json!({"name": "Main", "width": 320, "height": 180, "duration": 4})).unwrap(); s.execute("layer.newSolid", json!({"name": "Red", "color": "#c04040"})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.state_mut().show_panel(panel); h.state_mut().ui.maximized = Some(panel); h.run_steps(4); diff --git a/crates/ui-egui/tests/it/ui_inline_edit.rs b/crates/ui-egui/tests/it/ui_inline_edit.rs index 0213cb943..eef6b3687 100644 --- a/crates/ui-egui/tests/it/ui_inline_edit.rs +++ b/crates/ui-egui/tests/it/ui_inline_edit.rs @@ -14,7 +14,11 @@ fn harness() -> (Harness<'static, EffectcraftApp>, u64) { let comp = s.active_comp_id().unwrap().0; // Arabic, Hebrew, Devanagari and Thai names typed below need installed system faces: draw // tofu on a host without them rather than failing the missing-glyph gate. - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).allow_missing_glyphs().with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .allow_missing_glyphs() + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(4); (h, comp) } diff --git a/crates/ui-egui/tests/it/ui_keyframes.rs b/crates/ui-egui/tests/it/ui_keyframes.rs index e79430f95..9770f3ec5 100644 --- a/crates/ui-egui/tests/it/ui_keyframes.rs +++ b/crates/ui-egui/tests/it/ui_keyframes.rs @@ -21,7 +21,10 @@ fn harness() -> (Harness<'static, EffectcraftApp>, LayerId, u64) { } let uid = s.active_comp().unwrap().layer(id).unwrap().props.prop("transform/opacity").unwrap().uid; s.execute("layer.select", json!({"layers": [id.0]})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); let ctx = h.ctx.clone(); effectcraft_ui_egui::menus::invoke(h.state_mut(), &ctx, "timeline.reveal.opacity", json!({})).unwrap(); @@ -518,7 +521,10 @@ fn properties_panel_edits_every_selected_layer() { s.execute("layer.select", json!({"layers": ids})).unwrap(); let first = s.state.selected_layers[0]; let uid = s.active_comp().unwrap().layer(first).unwrap().props.prop("transform/position").unwrap().uid; - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.state_mut().show_panel(effectcraft_ui_egui::dock::PanelKind::Properties); h.run_steps(4); assert_eq!(h.state().auto.find("properties.selectedObjects").map(|e| e.label.clone()), Some("(3) Selected Objects".into())); @@ -571,7 +577,10 @@ fn ctrl_alt_scrub_in_the_timeline_is_proportional() { } let middle = ids[1]; let uid = s.active_comp().unwrap().layer(LayerId(middle)).unwrap().props.prop("transform/position").unwrap().uid; - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); let ctx = h.ctx.clone(); effectcraft_ui_egui::menus::invoke(h.state_mut(), &ctx, "timeline.reveal.position", json!({})).unwrap(); diff --git a/crates/ui-egui/tests/it/ui_large_project.rs b/crates/ui-egui/tests/it/ui_large_project.rs index a2c0a3476..cd2bfec38 100644 --- a/crates/ui-egui/tests/it/ui_large_project.rs +++ b/crates/ui-egui/tests/it/ui_large_project.rs @@ -15,7 +15,10 @@ fn spec() -> LargeSpec { } fn harness(s: Session) -> Harness<'static, EffectcraftApp> { - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1400.0, 900.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); h } diff --git a/crates/ui-egui/tests/it/ui_layer_panel_zoom.rs b/crates/ui-egui/tests/it/ui_layer_panel_zoom.rs index 57e96cb1d..4fd00ea96 100644 --- a/crates/ui-egui/tests/it/ui_layer_panel_zoom.rs +++ b/crates/ui-egui/tests/it/ui_layer_panel_zoom.rs @@ -23,7 +23,8 @@ fn box_id(h: &Harness<'_, EffectcraftApp>) -> u64 { /// The harness with Box open in the Layer panel (focused). fn harness() -> Harness<'static, EffectcraftApp> { - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app()); + let mut h = + Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app()); h.run_steps(3); let id = box_id(&h); h.state_mut().session.execute("layer.select", json!({"layers": [id]})).unwrap(); diff --git a/crates/ui-egui/tests/it/ui_layer_source_picker.rs b/crates/ui-egui/tests/it/ui_layer_source_picker.rs index a34bc1938..96a01de34 100644 --- a/crates/ui-egui/tests/it/ui_layer_source_picker.rs +++ b/crates/ui-egui/tests/it/ui_layer_source_picker.rs @@ -221,7 +221,12 @@ fn snapshot_source_dropdown_open_and_chosen() { let mut app = EffectcraftApp::new(s); app.ui.timeline.open_layers.insert(light); app.ui.timeline.open_groups.insert(group); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_pixels_per_point(2.0).wgpu().with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = Harness::builder() + .with_size(vec2(1600.0, 1000.0)) + .with_pixels_per_point(2.0) + .wgpu() + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| app); h.run_steps(4); let save = |h: &mut Harness<'_, EffectcraftApp>, name: &str| { if let Ok(dir) = std::env::var("EC_SNAPSHOT_DIR") { diff --git a/crates/ui-egui/tests/it/ui_light_settings.rs b/crates/ui-egui/tests/it/ui_light_settings.rs index 7d310ee70..d1b233517 100644 --- a/crates/ui-egui/tests/it/ui_light_settings.rs +++ b/crates/ui-egui/tests/it/ui_light_settings.rs @@ -10,7 +10,10 @@ use serde_json::{Value, json}; fn harness() -> Harness<'static, EffectcraftApp> { let mut s = Session::default(); s.execute("comp.new", json!({"name": "Lights", "width": 640, "height": 360, "duration": 2})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.step(); h } diff --git a/crates/ui-egui/tests/it/ui_live_preview.rs b/crates/ui-egui/tests/it/ui_live_preview.rs index 6c5e0b1d8..2f8a2b408 100644 --- a/crates/ui-egui/tests/it/ui_live_preview.rs +++ b/crates/ui-egui/tests/it/ui_live_preview.rs @@ -45,7 +45,11 @@ fn opacity_edits_show_completed_intermediate_frames_before_the_drag_stops() { let renderer = Arc::new(HeldRenderer::default()); let mut app = EffectcraftApp::new(session); app.frames.set_remote(Some(renderer.clone())); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(0.016).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = Harness::builder() + .with_size(egui::vec2(1400.0, 900.0)) + .with_step_dt(0.016) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| app); h.run_steps(3); assert_eq!(h.state().frames.dispatch_remote(), 1); renderer.finish(); @@ -95,7 +99,11 @@ fn position_anchor_and_effect_edits_present_intermediate_pixels() { let renderer = Arc::new(HeldRenderer::default()); let mut app = EffectcraftApp::new(session); app.frames.set_remote(Some(renderer.clone())); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(0.016).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = Harness::builder() + .with_size(egui::vec2(1400.0, 900.0)) + .with_step_dt(0.016) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| app); h.run_steps(3); h.state().frames.dispatch_remote(); let initial = renderer.finish(); @@ -124,7 +132,11 @@ fn continuous_opacity_preview_probe() { let mut session = Session::default(); session.execute("comp.new", json!({"width":1920,"height":1080,"duration":1})).unwrap(); let layer = session.execute("layer.newSolid", json!({"color":"#ffffff"})).unwrap()["layer"].as_u64().unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(1.0 / 60.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(session)); + let mut h = Harness::builder() + .with_size(egui::vec2(1400.0, 900.0)) + .with_step_dt(1.0 / 60.0) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(session)); let ready = Instant::now(); while h.state_mut().viewer_pixels().is_none() && ready.elapsed() < Duration::from_secs(5) { h.step(); diff --git a/crates/ui-egui/tests/it/ui_locked_color.rs b/crates/ui-egui/tests/it/ui_locked_color.rs index 530940b45..e29b49031 100644 --- a/crates/ui-egui/tests/it/ui_locked_color.rs +++ b/crates/ui-egui/tests/it/ui_locked_color.rs @@ -63,7 +63,11 @@ fn locked_viewer_follows_display_profile_and_simulation() { s.execute("prefs.set", json!({"key": "previews.displayProfile", "value": "srgb"})).unwrap(); s.execute("view.displayColorManagement", json!({"value": true})).unwrap(); let images = Images::default(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).renderer(Capture(images.clone())).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .renderer(Capture(images.clone())) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); invoke(&mut h, "view.splitLockedViewer", json!({})); let first = expected_center(&mut h); diff --git a/crates/ui-egui/tests/it/ui_marker_names.rs b/crates/ui-egui/tests/it/ui_marker_names.rs index 66fe11688..fbb99a5cb 100644 --- a/crates/ui-egui/tests/it/ui_marker_names.rs +++ b/crates/ui-egui/tests/it/ui_marker_names.rs @@ -20,7 +20,10 @@ fn the_name_box_follows_the_theme() { s.execute("layer.newSolid", json!({"name": "Bed", "color": "#204060", "width": 640, "height": 360})).unwrap(); s.execute("markers.set", json!({"new": true, "time": 1.0, "comment": "Verse"})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(move |_| EffectcraftApp::new(s)); h.run_steps(4); let ctx = h.ctx.clone(); @@ -63,7 +66,10 @@ fn a_short_duration_stays_visible_beside_the_name_box() { // a second marker half a second later gives the timeline's scale (points per second) s.execute("markers.set", json!({"new": true, "time": 1.5})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(move |_| EffectcraftApp::new(s)); h.run_steps(5); let tokens = h.state().tokens; let centre = |id: &str| { @@ -100,7 +106,10 @@ fn a_later_name_box_does_not_hide_an_earlier_duration_cap() { s.execute("comp.new", json!({"width": 640, "height": 360, "duration": 4})).unwrap(); s.execute("markers.set", json!({"new": true, "time": 1.0, "duration": 0.5, "label": "Red"})).unwrap(); s.execute("markers.set", json!({"new": true, "time": 1.3, "comment": "This name overlaps the earlier endpoint", "label": "Blue"})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(move |_| EffectcraftApp::new(s)); h.run_steps(5); let a = h.state().auto.find("timeline.marker.0").unwrap().rect; let b = h.state().auto.find("timeline.marker.1").unwrap().rect; diff --git a/crates/ui-egui/tests/it/ui_media_browser_cache.rs b/crates/ui-egui/tests/it/ui_media_browser_cache.rs index 293c6ec2b..6dc0192eb 100644 --- a/crates/ui-egui/tests/it/ui_media_browser_cache.rs +++ b/crates/ui-egui/tests/it/ui_media_browser_cache.rs @@ -81,13 +81,17 @@ fn browser_cache_refreshes_filters_navigates_and_recovers_from_errors() { } let mut session = Session { browser: Some(browser.clone()), ..Default::default() }; session.prefs.general.language = "en".into(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_step_dt(1.0 / 60.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| { - let mut app = EffectcraftApp::new(session); - app.ui.start_screen = false; - app.show_panel(PanelKind::MediaBrowser); - app.ui.maximized = Some(PanelKind::MediaBrowser); - app - }); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_step_dt(1.0 / 60.0) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| { + let mut app = EffectcraftApp::new(session); + app.ui.start_screen = false; + app.show_panel(PanelKind::MediaBrowser); + app.ui.maximized = Some(PanelKind::MediaBrowser); + app + }); h.run_steps(3); let (time, first) = listing(&h, false); assert_eq!(names(&first), ["Sub", "Clip.csv", "notes.txt"]); diff --git a/crates/ui-egui/tests/it/ui_media_browser_copy_path.rs b/crates/ui-egui/tests/it/ui_media_browser_copy_path.rs index 3c612fcd9..3afe0fc55 100644 --- a/crates/ui-egui/tests/it/ui_media_browser_copy_path.rs +++ b/crates/ui-egui/tests/it/ui_media_browser_copy_path.rs @@ -54,13 +54,18 @@ fn file_folder_and_virtual_paths_copy_from_the_context_menu_without_document_cha session.prefs.general.language = "en".into(); session.execute("comp.new", json!({"width": 64, "height": 36, "duration": 2})).unwrap(); // The Chinese folder and file names need an installed CJK face. - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_step_dt(1.0 / 60.0).allow_missing_glyphs().with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| { - let mut app = EffectcraftApp::new(session); - app.ui.start_screen = false; - app.show_panel(PanelKind::MediaBrowser); - app.ui.maximized = Some(PanelKind::MediaBrowser); - app - }); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_step_dt(1.0 / 60.0) + .allow_missing_glyphs() + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| { + let mut app = EffectcraftApp::new(session); + app.ui.start_screen = false; + app.show_panel(PanelKind::MediaBrowser); + app.ui.maximized = Some(PanelKind::MediaBrowser); + app + }); h.run_steps(3); let project = h.state().session.project.clone(); let revision = h.state().session.revision; diff --git a/crates/ui-egui/tests/it/ui_menus.rs b/crates/ui-egui/tests/it/ui_menus.rs index 0d4376a44..35cddf7d6 100644 --- a/crates/ui-egui/tests/it/ui_menus.rs +++ b/crates/ui-egui/tests/it/ui_menus.rs @@ -12,7 +12,10 @@ use serde_json::json; fn harness() -> Harness<'static, EffectcraftApp> { let mut s = Session::default(); s.execute("file.openDemoProject", json!({})).unwrap(); - let mut h = Harness::builder().with_size(vec2(1400.0, 900.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(vec2(1400.0, 900.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); h } diff --git a/crates/ui-egui/tests/it/ui_new_primitive.rs b/crates/ui-egui/tests/it/ui_new_primitive.rs index 015fa03c2..777883811 100644 --- a/crates/ui-egui/tests/it/ui_new_primitive.rs +++ b/crates/ui-egui/tests/it/ui_new_primitive.rs @@ -11,7 +11,10 @@ use serde_json::json; fn harness() -> Harness<'static, EffectcraftApp> { let mut s = Session::default(); s.execute("comp.new", json!({"name": "Scene", "width": 640, "height": 360, "duration": 2})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.step(); h } diff --git a/crates/ui-egui/tests/it/ui_object_matte.rs b/crates/ui-egui/tests/it/ui_object_matte.rs index 1806fc640..c939d15d9 100644 --- a/crates/ui-egui/tests/it/ui_object_matte.rs +++ b/crates/ui-egui/tests/it/ui_object_matte.rs @@ -20,7 +20,10 @@ fn harness() -> Harness<'static, EffectcraftApp> { s.execute("layer.newSolid", json!({"name": "Plate", "color": "#406080", "width": 640, "height": 360})).unwrap(); s.execute("layer.newSolid", json!({"name": "Box", "color": "#e04020", "width": 80, "height": 80})).unwrap(); s.execute("edit.deselectAll", json!({})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(move |_| EffectcraftApp::new(s)); h.run_steps(3); h } diff --git a/crates/ui-egui/tests/it/ui_panels.rs b/crates/ui-egui/tests/it/ui_panels.rs index 5646f221b..c265e2ab7 100644 --- a/crates/ui-egui/tests/it/ui_panels.rs +++ b/crates/ui-egui/tests/it/ui_panels.rs @@ -18,7 +18,10 @@ fn harness() -> Harness<'static, EffectcraftApp> { let mut s = Session::default(); s.execute("comp.new", json!({"name": "Panels", "width": 320, "height": 180, "duration": 4})).unwrap(); s.execute("layer.newSolid", json!({"name": "Plate", "color": "#406080"})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); h } @@ -169,7 +172,10 @@ fn saved_workspaces_persist_across_sessions() { let store = std::sync::Arc::new(MemoryConfig::default()); let launch = || { let s = Session { config: Some(store.clone()), ..Default::default() }; - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(2); h }; @@ -338,7 +344,10 @@ fn ui_scale_setting_sizes_the_interface() { assert_eq!(ctx.zoom_factor(), 0.9); // A saved scale applies from the first frame. let s = Session { prefs: effectcraft_engine::prefs::Prefs::from_json(&h.state().session.prefs.to_json()), ..Default::default() }; - let mut h2 = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h2 = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h2.run_steps(3); assert_eq!(h2.ctx.zoom_factor(), 0.9); } @@ -359,7 +368,10 @@ fn settings_buttons_stay_in_view_at_200_percent() { s.prefs.disk.disk_cache_enabled = false; s.prefs.set("appearance.uiScale", json!(200)).unwrap(); s.save_prefs(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); assert_eq!(scale(&h), (200, 2.0)); let rect = |h: &Harness<'_, EffectcraftApp>, id: &str| { @@ -423,7 +435,10 @@ fn panels_snapshot() { s.execute("file.openDemoProject", json!({})).unwrap(); let solid = s.project.items.values().find(|i| matches!(i.kind, effectcraft_engine::project::ItemKind::Solid(_))).map(|i| i.id.0); let mut app = Some(EffectcraftApp::new(s)); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app.take().expect("app")); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| app.take().expect("app")); h.run_steps(3); let ctx = h.ctx.clone(); effectcraft_ui_egui::menus::invoke(h.state_mut(), &ctx, "window.workspace", json!({"name": "All Panels"})).unwrap(); diff --git a/crates/ui-egui/tests/it/ui_presets_folder.rs b/crates/ui-egui/tests/it/ui_presets_folder.rs index 842812974..427812f75 100644 --- a/crates/ui-egui/tests/it/ui_presets_folder.rs +++ b/crates/ui-egui/tests/it/ui_presets_folder.rs @@ -39,13 +39,17 @@ fn presets_menu_copies_the_configured_folder_without_editing_the_project() { let expected = expected_folder(); for language in ["en", "ja"] { // The `ja` run draws Japanese menu text, which needs an installed CJK face. - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).allow_missing_glyphs().with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| { - let mut app = EffectcraftApp::new(Session::default()); - app.session.prefs.general.language = language.into(); - app.ui.start_screen = false; - app.show_panel(PanelKind::EffectsPresets); - app - }); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .allow_missing_glyphs() + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| { + let mut app = EffectcraftApp::new(Session::default()); + app.session.prefs.general.language = language.into(); + app.ui.start_screen = false; + app.show_panel(PanelKind::EffectsPresets); + app + }); h.run_steps(3); let before = serde_json::to_value(&h.state().session.project).unwrap(); let revision = h.state().session.revision; @@ -123,12 +127,16 @@ fn shared_preset_rows_search_apply_and_undo_the_selected_definition() { session.prefs.general.language = "en".into(); session.execute("comp.new", json!({"width": 64, "height": 36, "duration": 2})).unwrap(); session.execute("layer.newText", json!({"text": "Cache"})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_step_dt(1.0 / 60.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| { - let mut app = EffectcraftApp::new(session); - app.ui.start_screen = false; - app.show_panel(PanelKind::EffectsPresets); - app - }); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_step_dt(1.0 / 60.0) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| { + let mut app = EffectcraftApp::new(session); + app.ui.start_screen = false; + app.show_panel(PanelKind::EffectsPresets); + app + }); h.run_steps(3); let shared = std::sync::Arc::new(entries); let now = h.ctx.input(|i| i.time); diff --git a/crates/ui-egui/tests/it/ui_preview_align.rs b/crates/ui-egui/tests/it/ui_preview_align.rs index 7588c56bf..a9b63d25b 100644 --- a/crates/ui-egui/tests/it/ui_preview_align.rs +++ b/crates/ui-egui/tests/it/ui_preview_align.rs @@ -16,7 +16,10 @@ fn harness() -> Harness<'static, EffectcraftApp> { s.execute("comp.new", json!({"name": "Preview", "width": 320, "height": 180, "frameRate": 24, "duration": 10})).unwrap(); s.execute("layer.newSolid", json!({"name": "A", "color": "#406080", "width": 40, "height": 30})).unwrap(); s.execute("layer.newSolid", json!({"name": "B", "color": "#806040", "width": 60, "height": 20})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); h } diff --git a/crates/ui-egui/tests/it/ui_project_delete.rs b/crates/ui-egui/tests/it/ui_project_delete.rs index ef66bd866..bbe6c39a0 100644 --- a/crates/ui-egui/tests/it/ui_project_delete.rs +++ b/crates/ui-egui/tests/it/ui_project_delete.rs @@ -24,7 +24,10 @@ fn harness() -> (Harness<'static, EffectcraftApp>, Vec, LayerId) { ); let folder = ItemId(s.execute("project.newFolder", json!({"name": "Folder"})).unwrap()["item"].as_u64().unwrap()); let keep = LayerId(s.execute("layer.newNull", json!({"name": "Keep this layer"})).unwrap()["layer"].as_u64().unwrap()); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); let folders: Vec = h.state().session.project.items.values().filter(|i| i.is_folder()).map(|i| i.id.0).collect(); h.state_mut().ui.project_open_folders.extend(folders); h.run_steps(3); diff --git a/crates/ui-egui/tests/it/ui_project_duplicate.rs b/crates/ui-egui/tests/it/ui_project_duplicate.rs index a83fa0cb7..9baa7b4ff 100644 --- a/crates/ui-egui/tests/it/ui_project_duplicate.rs +++ b/crates/ui-egui/tests/it/ui_project_duplicate.rs @@ -20,7 +20,10 @@ fn harness() -> (Harness<'static, EffectcraftApp>, ItemId, ItemId, ItemId) { let other = comp("Other"); let folder = ItemId(s.execute("project.newFolder", json!({"name": "Bin"})).unwrap()["item"].as_u64().unwrap()); s.execute("project.select", json!({"items": []})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); (h, main, other, folder) } diff --git a/crates/ui-egui/tests/it/ui_project_keyboard.rs b/crates/ui-egui/tests/it/ui_project_keyboard.rs index 5fff9657f..eb7c7bf43 100644 --- a/crates/ui-egui/tests/it/ui_project_keyboard.rs +++ b/crates/ui-egui/tests/it/ui_project_keyboard.rs @@ -23,7 +23,10 @@ fn harness() -> (Harness<'static, EffectcraftApp>, ItemId, ItemId, ItemId) { s.execute("project.move", json!({"items": [comp.0], "folder": folder.0})).unwrap(); s.execute("project.move", json!({"items": [solid.0], "folder": null})).unwrap(); s.execute("project.select", json!({"items": []})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); (h, folder, comp, solid) } diff --git a/crates/ui-egui/tests/it/ui_project_new_folder.rs b/crates/ui-egui/tests/it/ui_project_new_folder.rs index c19e56858..de6cc53f5 100644 --- a/crates/ui-egui/tests/it/ui_project_new_folder.rs +++ b/crates/ui-egui/tests/it/ui_project_new_folder.rs @@ -20,7 +20,10 @@ fn harness(comps: usize) -> (Harness<'static, EffectcraftApp>, ItemId) { } let folder = ItemId(s.execute("project.newFolder", json!({"name": "Bin"})).unwrap()["item"].as_u64().unwrap()); s.execute("project.select", json!({"items": []})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.state_mut().ui.project_open_folders.insert(folder.0); h.run_steps(3); (h, folder) diff --git a/crates/ui-egui/tests/it/ui_project_rows.rs b/crates/ui-egui/tests/it/ui_project_rows.rs index 58b2dc979..393107f04 100644 --- a/crates/ui-egui/tests/it/ui_project_rows.rs +++ b/crates/ui-egui/tests/it/ui_project_rows.rs @@ -20,7 +20,10 @@ fn harness() -> (Harness<'static, EffectcraftApp>, ItemId, ItemId, ItemId) { s.execute("project.move", json!({"items": [comp.0], "folder": folder.0})).unwrap(); s.execute("project.move", json!({"items": [solid.0], "folder": null})).unwrap(); s.execute("project.select", json!({"items": []})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); (h, folder, comp, solid) } @@ -234,7 +237,10 @@ fn dragging_in_the_empty_area_box_selects_items() { #[test] fn a_short_project_panel_draws() { for height in [400.0, 300.0] { - let mut h = Harness::builder().with_size(egui::vec2(640.0, height)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(Session::default())); + let mut h = Harness::builder() + .with_size(egui::vec2(640.0, height)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(Session::default())); h.run_steps(3); assert!(h.state().auto.find("project.empty").is_some(), "the Project panel drew at {height} points"); } diff --git a/crates/ui-egui/tests/it/ui_quick_offset.rs b/crates/ui-egui/tests/it/ui_quick_offset.rs index db975f7ab..87bfd6050 100644 --- a/crates/ui-egui/tests/it/ui_quick_offset.rs +++ b/crates/ui-egui/tests/it/ui_quick_offset.rs @@ -27,7 +27,10 @@ fn harness() -> (Harness<'static, EffectcraftApp>, Vec) { ids.push(id); } s.execute("layer.select", json!({"layers": ids})).unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); let ctx = h.ctx.clone(); effectcraft_ui_egui::menus::invoke(h.state_mut(), &ctx, "timeline.reveal.opacity", json!({})).unwrap(); @@ -210,7 +213,10 @@ fn a_quick_offset_released_off_screen_ends() { (0..40).map(|i| s.execute("layer.newSolid", json!({"name": format!("L{i}"), "color": "#e04020"})).unwrap()["layer"].as_u64().unwrap()).collect(); let (top, next) = (ids[39], ids[38]); s.execute("layer.select", json!({"layers": [top, next]})).unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); let from = center(&h, &format!("timeline.layer.{top}.bar")); h.input_mut().events.push(Event::PointerMoved(from)); diff --git a/crates/ui-egui/tests/it/ui_ram_preview.rs b/crates/ui-egui/tests/it/ui_ram_preview.rs index 5cfe808b7..8dc67efdd 100644 --- a/crates/ui-egui/tests/it/ui_ram_preview.rs +++ b/crates/ui-egui/tests/it/ui_ram_preview.rs @@ -30,7 +30,10 @@ fn an_edit_in_another_comp_keeps_the_cached_frames_and_undo_finds_them_again() { let b = s.execute("comp.new", json!({"name": "B", "width": 64, "height": 36, "duration": 1})).unwrap()["comp"].as_u64().unwrap(); let a = s.execute("comp.new", json!({"name": "A", "width": 64, "height": 36, "duration": 1})).unwrap()["comp"].as_u64().unwrap(); s.execute("layer.newSolid", json!({"color": "#3080ff"})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1400.0, 900.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); settle(&mut h); assert!(shown_cached(&h, a), "A's frame rendered"); // Edit B (open it, add a layer), then come back to A: its frame is still in RAM. @@ -59,7 +62,10 @@ fn the_timeline_shows_the_cached_frames_in_green() { let mut s = Session::default(); s.execute("comp.new", json!({"name": "Cache", "width": 64, "height": 36, "duration": 2})).unwrap(); s.execute("layer.newSolid", json!({"color": "#3080ff"})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1400.0, 900.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); settle(&mut h); h.run_steps(2); let green = h.state().tokens.cache_green; @@ -91,7 +97,11 @@ fn prefetch_waits_while_edits_keep_coming() { let c = s.execute("comp.new", json!({"name": "Drag", "width": 64, "height": 36, "duration": 2})).unwrap()["comp"].as_u64().unwrap(); let solid = s.execute("layer.newSolid", json!({"color": "#3080ff", "width": 16, "height": 16})).unwrap()["layer"].as_u64().unwrap(); // Short steps between edits; the app clock below is advanced explicitly. - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(0.05).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1400.0, 900.0)) + .with_step_dt(0.05) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); // Prefetch waits for EDIT_QUIET on the app clock; a manual clock makes the pause // deterministic instead of depending on how long the test host took to run the steps. h.state_mut().use_manual_clock(); @@ -145,7 +155,10 @@ fn cached_frames_are_counted_at_one_third_resolution() { if let Some(comp) = std::sync::Arc::make_mut(&mut s.project).comp_mut(ItemId(c)) { comp.resolution = res; } - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1400.0, 900.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); settle(&mut h); let series = h.state().shown_series(ItemId(c)); assert_eq!(series.scale, (res.scale(1.0, 1.0) * 1000.0).round() as u32, "{res:?}"); diff --git a/crates/ui-egui/tests/it/ui_render_queue.rs b/crates/ui-egui/tests/it/ui_render_queue.rs index 3e29c7cc8..71d7dd807 100644 --- a/crates/ui-egui/tests/it/ui_render_queue.rs +++ b/crates/ui-egui/tests/it/ui_render_queue.rs @@ -29,7 +29,10 @@ fn render_settings_template_applies_from_a_menu_moved_to_fit_the_window() { let id = s.project.render_queue[0].id; assert_eq!(s.project.render_queue[0].settings.name, "Best Settings"); let mut app = Some(EffectcraftApp::new(s)); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app.take().expect("app")); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| app.take().expect("app")); // Twirl the item open, as clicking its twirl does. h.ctx.data_mut(|d| d.insert_temp(egui::Id::unique("rq-ui"), (vec![id], None::))); h.state_mut().show_panel(PanelKind::RenderQueue); @@ -79,7 +82,10 @@ fn clicking_the_output_file_name_opens_the_save_dialog() { Some(answer.clone()) })); let mut app = Some(app); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app.take().expect("app")); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| app.take().expect("app")); h.ctx.data_mut(|d| d.insert_temp(egui::Id::unique("rq-ui"), (vec![id], None::))); h.state_mut().show_panel(PanelKind::RenderQueue); h.run_steps(4); diff --git a/crates/ui-egui/tests/it/ui_render_queue_keyboard.rs b/crates/ui-egui/tests/it/ui_render_queue_keyboard.rs index 7faeb515b..592e21801 100644 --- a/crates/ui-egui/tests/it/ui_render_queue_keyboard.rs +++ b/crates/ui-egui/tests/it/ui_render_queue_keyboard.rs @@ -19,7 +19,10 @@ fn harness() -> Harness<'static, EffectcraftApp> { let comp = s.execute("comp.new", json!({"name": name, "width": 320, "height": 180, "duration": 4})).unwrap()["comp"].as_u64().unwrap(); s.execute("renderQueue.add", json!({"comp": comp})).unwrap(); } - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.state_mut().show_panel(PanelKind::RenderQueue); h.run_steps(4); h diff --git a/crates/ui-egui/tests/it/ui_roto_objects.rs b/crates/ui-egui/tests/it/ui_roto_objects.rs index 53a10e83f..d5071400c 100644 --- a/crates/ui-egui/tests/it/ui_roto_objects.rs +++ b/crates/ui-egui/tests/it/ui_roto_objects.rs @@ -74,7 +74,10 @@ fn the_boundary_view_outlines_each_object_and_show_object_picks_one() { // object 0 keeps the boundary colour (pink by default), object 1 is the first palette colour (blue-green) let (pink, cyan) = ([255, 64, 191], [60, 200, 255]); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(move |_| EffectcraftApp::new(s)); h.run_steps(3); h.state_mut().session.execute("layer.select", json!({"layers": [id]})).unwrap(); let ctx = h.ctx.clone(); diff --git a/crates/ui-egui/tests/it/ui_roto_span_confidence.rs b/crates/ui-egui/tests/it/ui_roto_span_confidence.rs index 14437f1c0..b1c916a09 100644 --- a/crates/ui-egui/tests/it/ui_roto_span_confidence.rs +++ b/crates/ui-egui/tests/it/ui_roto_span_confidence.rs @@ -75,7 +75,10 @@ fn the_span_bar_shows_the_trackers_confidence() { // the model stays loaded while the panel draws (its id is part of the cache keys) s.execute("roto.propagate", json!({"layer": id, "direction": "both", "wait": true})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(move |_| EffectcraftApp::new(s)); h.run_steps(3); h.state_mut().session.execute("layer.select", json!({"layers": [id]})).unwrap(); let ctx = h.ctx.clone(); diff --git a/crates/ui-egui/tests/it/ui_script_console.rs b/crates/ui-egui/tests/it/ui_script_console.rs index 4367027dd..989d4f651 100644 --- a/crates/ui-egui/tests/it/ui_script_console.rs +++ b/crates/ui-egui/tests/it/ui_script_console.rs @@ -19,7 +19,10 @@ fn click(h: &mut Harness<'_, EffectcraftApp>, id: &str) { #[test] fn script_console_runs_scripts() { let s = effectcraft_host::session(); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1400.0, 900.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.state_mut().show_panel(PanelKind::ScriptConsole); h.run_steps(3); for id in ["scriptConsole.input", "scriptConsole.output", "scriptConsole.run", "scriptConsole.clear"] { @@ -50,7 +53,10 @@ fn script_console_runs_scripts() { #[ignore] fn script_console_snapshot() { let s = effectcraft_host::session(); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1400.0, 900.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.state_mut().show_panel(PanelKind::ScriptConsole); h.run_steps(2); for code in ["var c = app.project.items.addComp('Console', 320, 180, 1, 2, 24); writeLn('made ' + c.name); c.id", "c.layers.addText('Hi').name", "nope()"] { diff --git a/crates/ui-egui/tests/it/ui_script_console_keyboard.rs b/crates/ui-egui/tests/it/ui_script_console_keyboard.rs index b83953181..a901c7c17 100644 --- a/crates/ui-egui/tests/it/ui_script_console_keyboard.rs +++ b/crates/ui-egui/tests/it/ui_script_console_keyboard.rs @@ -16,7 +16,10 @@ const INPUT: &str = "Script… (⌘/Ctrl+Enter runs)"; fn harness() -> Harness<'static, EffectcraftApp> { let mut s = Session::default(); s.execute("comp.new", json!({"name": "Main", "width": 320, "height": 180, "duration": 4})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.state_mut().show_panel(PanelKind::ScriptConsole); h.state_mut().ui.maximized = Some(PanelKind::ScriptConsole); h.run_steps(4); diff --git a/crates/ui-egui/tests/it/ui_script_render.rs b/crates/ui-egui/tests/it/ui_script_render.rs index 9c2b78071..1273214cd 100644 --- a/crates/ui-egui/tests/it/ui_script_render.rs +++ b/crates/ui-egui/tests/it/ui_script_render.rs @@ -40,7 +40,10 @@ fn harness() -> (Harness<'static, EffectcraftApp>, Arc, std::sync::mpsc::S let path = std::env::temp_dir().join(format!("ec-ui-script-render-{}.mp4", std::process::id())); s.execute("renderQueue.add", json!({"output": path.to_string_lossy()})).unwrap(); let (tx, rx) = std::sync::mpsc::channel(); - let h = Harness::builder().with_size(egui::vec2(1000.0, 700.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s).with_control(rx)); + let h = Harness::builder() + .with_size(egui::vec2(1000.0, 700.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s).with_control(rx)); (h, gate, tx) } diff --git a/crates/ui-egui/tests/it/ui_scriptui.rs b/crates/ui-egui/tests/it/ui_scriptui.rs index ea5282a9d..04c2092f0 100644 --- a/crates/ui-egui/tests/it/ui_scriptui.rs +++ b/crates/ui-egui/tests/it/ui_scriptui.rs @@ -13,7 +13,10 @@ use serde_json::json; fn harness() -> Harness<'static, EffectcraftApp> { let mut s = effectcraft_host::session(); s.execute("comp.new", json!({"name": "Main", "width": 320, "height": 180, "duration": 4})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1400.0, 900.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); h } @@ -103,7 +106,10 @@ fn panels_open_at_quit_dock_again_at_launch() { let mut s = effectcraft_host::session(); s.config = Some(store.clone()); s.execute("window.restoreScriptPanels", json!({})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1400.0, 900.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); let panel = h.state().session.script_ui.windows.iter().find(|w| w.script == "Hello Panel.jsx").expect("the panel's window").id; assert!(h.state().ui.dock.is_docked(PanelKind::ScriptPanel(panel)), "the panel docks"); @@ -123,7 +129,10 @@ fn a_key_given_to_a_script_runs_it() { let store = std::sync::Arc::new(MemoryConfig::default()); let mut s = effectcraft_host::session(); s.config = Some(store.clone()); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1400.0, 900.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); assert!(h.state().session.shortcuts().find(r#"file.runScript {"name":"Rename Layers.jsx"}"#).is_some(), "the shortcut table is built"); store.write("Scripts/Add Comp.jsx", "app.project.items.addComp('From Key', 64, 64, 1, 1, 25);").unwrap(); @@ -219,7 +228,12 @@ fn on_draw_concave_fills_and_images_render() { let png = png.to_string_lossy().replace('\\', "/"); let mut s = effectcraft_host::session(); s.execute("comp.new", json!({"name": "Main", "width": 320, "height": 180, "duration": 4})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_pixels_per_point(1.0).wgpu().with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1400.0, 900.0)) + .with_pixels_per_point(1.0) + .wgpu() + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); let code = format!( r#" @@ -388,7 +402,10 @@ fn scheduled_import_reveals_its_composition_without_manual_clicks() { let mut s = effectcraft_host::session(); let result = s.execute("script.run", json!({"code": "var w=new Window('palette','Automatic import');var b=w.add('button',undefined,'Open');b.onClick=function(){app.scheduleTask(\"var c=app.project.items.addComp('Imported',64,64,1,1,25);c.openInViewer();\",0,false);};w.show();"})).unwrap(); assert_eq!(result["ok"], true, "{result}"); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1400.0, 900.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.state_mut().ui.start_screen = true; h.run_steps(2); h.state_mut().session.execute("scriptui.click", json!({"window":"Automatic import","widget":"Open"})).unwrap(); @@ -542,7 +559,10 @@ fn a_docked_panel_button_opens_the_file_dialog() { store.write("Scripts/ScriptUI Panels/Subtitles Panel.jsx", panel).unwrap(); let mut s = effectcraft_host::session(); s.config = Some(store.clone()); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1400.0, 900.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); let asked: Arc>>> = Arc::default(); let log = asked.clone(); diff --git a/crates/ui-egui/tests/it/ui_self_drop.rs b/crates/ui-egui/tests/it/ui_self_drop.rs index 2148d4312..43474bd57 100644 --- a/crates/ui-egui/tests/it/ui_self_drop.rs +++ b/crates/ui-egui/tests/it/ui_self_drop.rs @@ -14,7 +14,10 @@ fn harness() -> (Harness<'static, EffectcraftApp>, u64, u64) { let clip = s.execute("comp.new", json!({"name": "Clip", "width": 160, "height": 90, "frameRate": 30, "duration": 1})).unwrap()["comp"].as_u64().unwrap(); let main = s.execute("comp.new", json!({"name": "Main", "width": 320, "height": 180, "frameRate": 30, "duration": 4})).unwrap()["comp"].as_u64().unwrap(); s.execute("layer.newSolid", json!({"name": "Bottom", "color": "#406080"})).unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); (h, main, clip) } diff --git a/crates/ui-egui/tests/it/ui_settings_info.rs b/crates/ui-egui/tests/it/ui_settings_info.rs index fd6718002..7469072e1 100644 --- a/crates/ui-egui/tests/it/ui_settings_info.rs +++ b/crates/ui-egui/tests/it/ui_settings_info.rs @@ -37,7 +37,10 @@ fn check_info_transaction(via_escape: bool) { session.save_prefs(); session.execute("comp.new", json!({"width":32,"height":32,"duration":2})).unwrap(); let original_brightness = session.prefs.appearance.brightness; - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(session)); + let mut h = Harness::builder() + .with_size(vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(session)); h.run_steps(4); let ctx = h.ctx.clone(); menus::invoke(h.state_mut(), &ctx, "app.settings", json!({"page":"appearance"})).unwrap(); @@ -125,7 +128,10 @@ fn gpu_information_names_the_adapter_and_why_the_gpu_is_off() { window_adapter: Some("NVIDIA GeForce RTX 4070 (Dx12, DiscreteGpu)".into()), ..Default::default() }; - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(session)); + let mut h = Harness::builder() + .with_size(vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(session)); h.run_steps(4); let ctx = h.ctx.clone(); menus::invoke(h.state_mut(), &ctx, "app.gpuInfo", json!({})).unwrap(); @@ -140,7 +146,10 @@ fn gpu_information_dialog_stays_in_place() { let mut session = Session::default(); session.prefs.appearance.ui_scale = 125; session.execute("comp.new", json!({"width":32,"height":32,"duration":2})).unwrap(); - let mut h = Harness::builder().with_size(vec2(1280.0, 720.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(session)); + let mut h = Harness::builder() + .with_size(vec2(1280.0, 720.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(session)); h.run_steps(4); let ctx = h.ctx.clone(); menus::invoke(h.state_mut(), &ctx, "app.settings", json!({"page":"previews"})).unwrap(); @@ -161,7 +170,10 @@ fn gpu_information_dialog_stays_in_place() { fn gpu_information_enter_presses_ok() { let mut session = Session::default(); session.execute("comp.new", json!({"width":32,"height":32,"duration":2})).unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(session)); + let mut h = Harness::builder() + .with_size(vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(session)); h.run_steps(4); let enter = |h: &mut Harness<'_, EffectcraftApp>| { for pressed in [true, false] { diff --git a/crates/ui-egui/tests/it/ui_settings_keyboard.rs b/crates/ui-egui/tests/it/ui_settings_keyboard.rs index 041dcdf7b..48de873ad 100644 --- a/crates/ui-egui/tests/it/ui_settings_keyboard.rs +++ b/crates/ui-egui/tests/it/ui_settings_keyboard.rs @@ -11,7 +11,10 @@ use egui_kittest::kittest::{NodeT, Queryable}; use serde_json::json; fn harness(page: &str) -> Harness<'static, EffectcraftApp> { - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(Session::default())); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(Session::default())); h.run_steps(3); let ctx = h.ctx.clone(); effectcraft_ui_egui::menus::invoke(h.state_mut(), &ctx, "app.settings", json!({"page": page})).unwrap(); diff --git a/crates/ui-egui/tests/it/ui_tail.rs b/crates/ui-egui/tests/it/ui_tail.rs index e4684cf45..5f429936a 100644 --- a/crates/ui-egui/tests/it/ui_tail.rs +++ b/crates/ui-egui/tests/it/ui_tail.rs @@ -15,7 +15,8 @@ fn harness_at(size: egui::Vec2) -> Harness<'static, EffectcraftApp> { let mut s = Session::default(); s.execute("comp.new", json!({"name": "Tail", "width": 640, "height": 360, "duration": 4})).unwrap(); s.execute("layer.newSolid", json!({"name": "Plate", "color": "#406080", "width": 640, "height": 360})).unwrap(); - let mut h = Harness::builder().with_size(size).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = + Harness::builder().with_size(size).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); h } diff --git a/crates/ui-egui/tests/it/ui_text_edit.rs b/crates/ui-egui/tests/it/ui_text_edit.rs index 5b52c723d..bbd931feb 100644 --- a/crates/ui-egui/tests/it/ui_text_edit.rs +++ b/crates/ui-egui/tests/it/ui_text_edit.rs @@ -19,10 +19,14 @@ fn app() -> EffectcraftApp { /// A headless window at the size and frame step the viewer tests here are written for. fn harness(a: EffectcraftApp) -> Harness<'static, EffectcraftApp> { - Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_step_dt(1.0 / 60.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |cc| { - EffectcraftApp::install_ime_reset_hooks(&cc.egui_ctx); - a - }) + Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_step_dt(1.0 / 60.0) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(move |cc| { + EffectcraftApp::install_ime_reset_hooks(&cc.egui_ctx); + a + }) } fn rect(h: &Harness<'_, EffectcraftApp>, id: &str) -> egui::Rect { @@ -82,7 +86,10 @@ fn type_tool_skips_hidden_and_unsoloed_text_layers() { let (target, value) = if switch == "video" { (ids[1], false) } else { (ids[0], true) }; s.execute("layer.setSwitch", json!({"layers": [target], "switch": switch, "value": value})).unwrap(); s.execute("edit.deselectAll", json!({})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(move |_| EffectcraftApp::new(s)); h.state_mut().ui.tool = effectcraft_ui_egui::state::Tool::Type; h.run_steps(3); let comp = rect(&h, "viewer.comp"); @@ -94,7 +101,8 @@ fn type_tool_skips_hidden_and_unsoloed_text_layers() { #[test] fn modal_blocks_background_text_events() { - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app()); + let mut h = + Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app()); h.run_steps(3); h.state_mut().ui.tool = effectcraft_ui_egui::state::Tool::Type; h.run_steps(1); @@ -870,7 +878,11 @@ fn a_chord_bound_to_both_forwarded_commands_resolves_in_list_order() { fn ime_producer_follows_the_committed_text_and_cause() { // A Latin accent is multi-byte in UTF-8 (the byte offsets below) and Inter draws it, so the // harness keeps its strict missing-glyph check; no CJK fallback face is needed headlessly. - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_step_dt(1.0 / 60.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app()); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_step_dt(1.0 / 60.0) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| app()); h.state_mut().show_panel(PanelKind::Composition); h.run_steps(3); h.state_mut().ui.tool = effectcraft_ui_egui::state::Tool::Type; @@ -908,7 +920,11 @@ fn click_away_clears_the_canvas_ime_descriptor_in_the_final_pass() { s.execute("comp.new", json!({"name": "Type", "width": 640, "height": 360, "duration": 2})).unwrap(); let solid = s.execute("layer.newSolid", json!({"name": "Plate", "color": "#406080"})).unwrap()["layer"].as_u64().unwrap(); let title = s.execute("layer.newText", json!({"text": "Title", "size": 80, "position": [100, 120], "justify": "left"})).unwrap()["layer"].as_u64().unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_step_dt(1.0 / 60.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_step_dt(1.0 / 60.0) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(move |_| EffectcraftApp::new(s)); h.state_mut().show_panel(PanelKind::Composition); h.run_steps(3); h.state_mut().session.execute("text.edit", json!({"layer": title, "caret": 5})).unwrap(); @@ -930,7 +946,11 @@ fn switching_text_targets_interrupts_and_rejects_a_delayed_commit() { let second = s.execute("layer.newText", json!({"text": "B", "size": 80, "position": [80, 240], "justify": "left"})).unwrap()["layer"].as_u64().unwrap(); // The delayed commit carries a multi-byte accent Inter draws: no broad missing-glyph // allowance, and the stale-composition path is still exercised with real IME events. - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_step_dt(1.0 / 60.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_step_dt(1.0 / 60.0) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(move |_| EffectcraftApp::new(s)); h.state_mut().show_panel(PanelKind::Composition); h.run_steps(3); h.state_mut().session.execute("text.edit", json!({"layer": first, "caret": 1})).unwrap(); @@ -962,7 +982,11 @@ fn a_delayed_preedit_after_a_target_switch_cannot_rearm_the_stale_guard() { s.execute("comp.new", json!({"name": "Type", "width": 640, "height": 360, "duration": 2})).unwrap(); let first = s.execute("layer.newText", json!({"text": "A", "size": 80, "position": [80, 120], "justify": "left"})).unwrap()["layer"].as_u64().unwrap(); let second = s.execute("layer.newText", json!({"text": "B", "size": 80, "position": [80, 240], "justify": "left"})).unwrap()["layer"].as_u64().unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_step_dt(1.0 / 60.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_step_dt(1.0 / 60.0) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(move |_| EffectcraftApp::new(s)); h.state_mut().show_panel(PanelKind::Composition); h.run_steps(3); h.state_mut().session.execute("text.edit", json!({"layer": first, "caret": 1})).unwrap(); @@ -988,7 +1012,11 @@ fn late_preedit_and_commit_split_across_idle_frames_cannot_retarget() { s.execute("comp.new", json!({"name": "Type", "width": 640, "height": 360, "duration": 2})).unwrap(); let first = s.execute("layer.newText", json!({"text": "A", "size": 80, "position": [80, 120], "justify": "left"})).unwrap()["layer"].as_u64().unwrap(); let second = s.execute("layer.newText", json!({"text": "B", "size": 80, "position": [80, 240], "justify": "left"})).unwrap()["layer"].as_u64().unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_step_dt(1.0 / 60.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_step_dt(1.0 / 60.0) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(move |_| EffectcraftApp::new(s)); h.state_mut().show_panel(PanelKind::Composition); h.run_steps(3); h.state_mut().session.execute("text.edit", json!({"layer": first, "caret": 1})).unwrap(); @@ -1026,7 +1054,11 @@ fn late_preedit_and_delete_split_across_idle_frames_cannot_retarget() { s.execute("comp.new", json!({"name": "Type", "width": 640, "height": 360, "duration": 2})).unwrap(); let first = s.execute("layer.newText", json!({"text": "A", "size": 80, "position": [80, 120], "justify": "left"})).unwrap()["layer"].as_u64().unwrap(); let second = s.execute("layer.newText", json!({"text": "B", "size": 80, "position": [80, 240], "justify": "left"})).unwrap()["layer"].as_u64().unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_step_dt(1.0 / 60.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_step_dt(1.0 / 60.0) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(move |_| EffectcraftApp::new(s)); h.state_mut().show_panel(PanelKind::Composition); h.run_steps(3); h.state_mut().session.execute("text.edit", json!({"layer": first, "caret": 1})).unwrap(); @@ -1061,7 +1093,11 @@ fn empty_preedit_keeps_the_old_target_until_the_pending_commit_arrives() { s.execute("comp.new", json!({"name": "Type", "width": 640, "height": 360, "duration": 2})).unwrap(); let first = s.execute("layer.newText", json!({"text": "A", "size": 80, "position": [80, 120], "justify": "left"})).unwrap()["layer"].as_u64().unwrap(); let second = s.execute("layer.newText", json!({"text": "B", "size": 80, "position": [80, 240], "justify": "left"})).unwrap()["layer"].as_u64().unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_step_dt(1.0 / 60.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_step_dt(1.0 / 60.0) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(move |_| EffectcraftApp::new(s)); h.state_mut().show_panel(PanelKind::Composition); h.run_steps(3); h.state_mut().session.execute("text.edit", json!({"layer": first, "caret": 1})).unwrap(); @@ -1090,7 +1126,11 @@ fn a_matching_fence_after_old_terminals_admits_the_next_preedit_in_the_same_batc s.execute("comp.new", json!({"name": "Type", "width": 640, "height": 360, "duration": 2})).unwrap(); let first = s.execute("layer.newText", json!({"text": "A", "size": 80, "position": [80, 120], "justify": "left"})).unwrap()["layer"].as_u64().unwrap(); let second = s.execute("layer.newText", json!({"text": "B", "size": 80, "position": [80, 240], "justify": "left"})).unwrap()["layer"].as_u64().unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_step_dt(1.0 / 60.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_step_dt(1.0 / 60.0) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(move |_| EffectcraftApp::new(s)); h.state_mut().show_panel(PanelKind::Composition); h.run_steps(3); h.state_mut().session.execute("text.edit", json!({"layer": first, "caret": 1})).unwrap(); @@ -1121,7 +1161,11 @@ fn delete_surrounding_bytes_through_the_app_replaces_the_emoji() { let mut s = Session::default(); s.execute("comp.new", json!({"name": "Type", "width": 640, "height": 360, "duration": 2})).unwrap(); let lid = s.execute("layer.newText", json!({"text": "café😀", "size": 80, "position": [80, 120], "justify": "left"})).unwrap()["layer"].as_u64().unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_step_dt(1.0 / 60.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_step_dt(1.0 / 60.0) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(move |_| EffectcraftApp::new(s)); h.state_mut().show_panel(PanelKind::Composition); h.run_steps(3); h.state_mut().session.execute("text.edit", json!({"layer": lid, "caret": 5})).unwrap(); @@ -1140,10 +1184,14 @@ fn ime_interruption_editor() -> (Harness<'static, EffectcraftApp>, Pos2) { let mut s = Session::default(); s.execute("comp.new", json!({"name": "Type", "width": 640, "height": 360, "duration": 2})).unwrap(); let lid = s.execute("layer.newText", json!({"text": "abcd", "size": 80, "position": [80, 120], "justify": "left"})).unwrap()["layer"].as_u64().unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_step_dt(1.0 / 60.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |cc| { - EffectcraftApp::install_ime_reset_hooks(&cc.egui_ctx); - EffectcraftApp::new(s) - }); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_step_dt(1.0 / 60.0) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(move |cc| { + EffectcraftApp::install_ime_reset_hooks(&cc.egui_ctx); + EffectcraftApp::new(s) + }); h.state_mut().show_panel(PanelKind::Composition); h.state_mut().ui.tool = effectcraft_ui_egui::state::Tool::Type; h.run_steps(3); diff --git a/crates/ui-egui/tests/it/ui_text_range_handles.rs b/crates/ui-egui/tests/it/ui_text_range_handles.rs index a4458278a..a47cc0332 100644 --- a/crates/ui-egui/tests/it/ui_text_range_handles.rs +++ b/crates/ui-egui/tests/it/ui_text_range_handles.rs @@ -42,7 +42,10 @@ fn setup() -> (Session, Ids) { } fn harness(s: Session) -> Harness<'static, EffectcraftApp> { - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(4); h } diff --git a/crates/ui-egui/tests/it/ui_theme_favorites.rs b/crates/ui-egui/tests/it/ui_theme_favorites.rs index 811a970d5..ac38c03e2 100644 --- a/crates/ui-egui/tests/it/ui_theme_favorites.rs +++ b/crates/ui-egui/tests/it/ui_theme_favorites.rs @@ -37,7 +37,10 @@ fn star_controls_save_and_favorite_menu_selects_the_family() { let store = Arc::new(MemoryConfig::default()); let mut session = Session { config: Some(store.clone()), ..Default::default() }; session.execute("comp.new", json!({"width":32,"height":32,"duration":2})).unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(session)); + let mut h = Harness::builder() + .with_size(vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(session)); h.run_steps(4); let ctx = h.ctx.clone(); menus::invoke(h.state_mut(), &ctx, "app.settings", json!({"page":"appearance"})).unwrap(); diff --git a/crates/ui-egui/tests/it/ui_time_zoom_controls.rs b/crates/ui-egui/tests/it/ui_time_zoom_controls.rs index 7173c332e..0941afb67 100644 --- a/crates/ui-egui/tests/it/ui_time_zoom_controls.rs +++ b/crates/ui-egui/tests/it/ui_time_zoom_controls.rs @@ -24,7 +24,8 @@ fn harness(graph: bool) -> Harness<'static, EffectcraftApp> { let mut app = EffectcraftApp::new(s); // (Opening a comp may zoom; start from the whole comp.) app.ui.timeline.pps = None; - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let mut h = + Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); h.run_steps(3); h.state_mut().session.execute("time.set", json!({"time": 4.0})).unwrap(); h.state_mut().ui.timeline.pps = None; diff --git a/crates/ui-egui/tests/it/ui_timeline_audio_levels.rs b/crates/ui-egui/tests/it/ui_timeline_audio_levels.rs index b6129bd34..96cf85e97 100644 --- a/crates/ui-egui/tests/it/ui_timeline_audio_levels.rs +++ b/crates/ui-egui/tests/it/ui_timeline_audio_levels.rs @@ -72,7 +72,10 @@ fn linked_audio_levels_move_both_channels_by_the_same_db() { let mut s = Session::default(); comps(&mut s); let (l, uid) = add_sound_layer(&mut s, [-6.0, -12.0]); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); reveal(&mut h, l, uid); let levels = |h: &Harness<'_, EffectcraftApp>| h.state().session.active_comp().unwrap().layer(LayerId(l)).unwrap().props.prop("audio/levels").unwrap().clone(); @@ -135,7 +138,10 @@ fn linked_typing_keeps_each_selected_layers_own_balance() { let (a, uid) = add_sound_layer(&mut s, [-6.0, -12.0]); let (b, other) = add_sound_layer(&mut s, [-20.0, -30.0]); s.execute("layer.select", json!({"layers": [a, b]})).unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); reveal(&mut h, a, uid); reveal(&mut h, b, other); click(&mut h, &format!("timeline.prop.{uid}.link")); @@ -150,7 +156,10 @@ fn a_new_project_starts_with_its_audio_levels_unlinked() { let mut s = Session::default(); comps(&mut s); let (l, uid) = add_sound_layer(&mut s, [0.0, 0.0]); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); reveal(&mut h, l, uid); click(&mut h, &format!("timeline.prop.{uid}.link")); assert!(h.state().ui.timeline.is_linked(uid, false)); diff --git a/crates/ui-egui/tests/it/ui_timeline_interacting.rs b/crates/ui-egui/tests/it/ui_timeline_interacting.rs index 34daef19e..d6a53dda8 100644 --- a/crates/ui-egui/tests/it/ui_timeline_interacting.rs +++ b/crates/ui-egui/tests/it/ui_timeline_interacting.rs @@ -32,7 +32,10 @@ fn fixture(mode: &str) -> Fixture { let opacity = comp.layers.iter().find(|l| l.id.0 == solid).unwrap().props.prop("transform/opacity").unwrap().uid; s.execute("layer.select", json!({"layers": [solid]})).unwrap(); s.execute("view.fastPreviewMode", json!({"mode": mode})).unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); let ctx = h.ctx.clone(); effectcraft_ui_egui::menus::invoke(h.state_mut(), &ctx, "timeline.reveal.opacity", json!({})).unwrap(); diff --git a/crates/ui-egui/tests/it/ui_timeline_marquee.rs b/crates/ui-egui/tests/it/ui_timeline_marquee.rs index 6a7069f5b..db97a2509 100644 --- a/crates/ui-egui/tests/it/ui_timeline_marquee.rs +++ b/crates/ui-egui/tests/it/ui_timeline_marquee.rs @@ -21,7 +21,10 @@ fn harness_for(duration: f64) -> (Harness<'static, EffectcraftApp>, u64) { s.execute("prop.addKey", json!({"layer": id, "path": "transform/opacity", "time": t, "value": v})).unwrap(); } s.execute("layer.select", json!({"layers": [id]})).unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); let ctx = h.ctx.clone(); effectcraft_ui_egui::menus::invoke(h.state_mut(), &ctx, "timeline.reveal.opacity", json!({})).unwrap(); @@ -93,7 +96,10 @@ fn a_box_dragged_across_the_outline_and_the_graph_selects_rows_and_keys() { ids.push(id); } s.execute("layer.select", json!({"layers": ids})).unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); let ctx = h.ctx.clone(); effectcraft_ui_egui::menus::invoke(h.state_mut(), &ctx, "timeline.reveal.opacity", json!({})).unwrap(); @@ -138,7 +144,10 @@ fn rows_harness() -> (Harness<'static, EffectcraftApp>, Vec) { ids.push(id); } s.execute("layer.select", json!({"layers": ids})).unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); let ctx = h.ctx.clone(); effectcraft_ui_egui::menus::invoke(h.state_mut(), &ctx, "timeline.reveal.opacity", json!({})).unwrap(); diff --git a/crates/ui-egui/tests/it/ui_timeline_shapes.rs b/crates/ui-egui/tests/it/ui_timeline_shapes.rs index 05a814d87..5dcafad3a 100644 --- a/crates/ui-egui/tests/it/ui_timeline_shapes.rs +++ b/crates/ui-egui/tests/it/ui_timeline_shapes.rs @@ -13,7 +13,10 @@ use egui_kittest::kittest::Queryable; use serde_json::json; fn harness(s: Session) -> Harness<'static, EffectcraftApp> { - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); h } diff --git a/crates/ui-egui/tests/it/ui_timeline_switches.rs b/crates/ui-egui/tests/it/ui_timeline_switches.rs index 1b0877666..d56ed985a 100644 --- a/crates/ui-egui/tests/it/ui_timeline_switches.rs +++ b/crates/ui-egui/tests/it/ui_timeline_switches.rs @@ -22,7 +22,10 @@ fn harness() -> (Harness<'static, EffectcraftApp>, Vec) { .collect(); ids.reverse(); s.execute("edit.deselectAll", json!({})).unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); (h, ids) } @@ -219,7 +222,10 @@ fn the_bar_past_the_source_end_is_striped() { s.execute("comp.new", json!({"name": "Inner", "width": 64, "height": 64, "frameRate": 30, "duration": 2})).unwrap(); s.execute("comp.new", json!({"name": "Outer", "width": 64, "height": 64, "frameRate": 30, "duration": 4})).unwrap(); let l = s.execute("layer.addItem", json!({"item": "Inner"})).unwrap()["layer"].as_u64().unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); let past = format!("timeline.layer.{l}.bar.afterSource"); assert!(h.state().auto.find(&past).is_none(), "the source fills the whole bar"); diff --git a/crates/ui-egui/tests/it/ui_toolbar_gradient.rs b/crates/ui-egui/tests/it/ui_toolbar_gradient.rs index 047fdb863..73084e722 100644 --- a/crates/ui-egui/tests/it/ui_toolbar_gradient.rs +++ b/crates/ui-egui/tests/it/ui_toolbar_gradient.rs @@ -38,7 +38,10 @@ fn setup(items: &[&str], tool: serde_json::Value, select: bool) -> (Harness<'sta } s.state.selected_layers = if select { vec![LayerId(l)] } else { vec![] }; s.state.selected_props.clear(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); // With no shape layer selected, Fill / Stroke show while a shape tool is active. if !select { h.state_mut().ui.tool = Tool::Rectangle; diff --git a/crates/ui-egui/tests/it/ui_tracker.rs b/crates/ui-egui/tests/it/ui_tracker.rs index 2aab9d3e8..a8ce5e845 100644 --- a/crates/ui-egui/tests/it/ui_tracker.rs +++ b/crates/ui-egui/tests/it/ui_tracker.rs @@ -27,7 +27,8 @@ fn rect(h: &Harness<'_, EffectcraftApp>, id: &str) -> egui::Rect { #[test] fn tracker_panel_and_track_point_widgets() { - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app()); + let mut h = + Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app()); h.state_mut().show_panel(PanelKind::Tracker); h.run_steps(3); let all = ids(&h); @@ -140,7 +141,10 @@ fn zoomed_out_track_point_can_be_grabbed() { s.execute("layer.newSolid", json!({"name": "Plate", "color": "#406080"})).unwrap(); s.execute("layer.select", json!({"layers": ["Plate"]})).unwrap(); s.execute("track.motion", json!({})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(move |_| EffectcraftApp::new(s)); h.state_mut().show_panel(PanelKind::Composition); h.run_steps(3); h.state_mut().ui.viewer.zoom = Some(mag); diff --git a/crates/ui-egui/tests/it/ui_unreadable_footage.rs b/crates/ui-egui/tests/it/ui_unreadable_footage.rs index fd99cdd25..0090c7b7d 100644 --- a/crates/ui-egui/tests/it/ui_unreadable_footage.rs +++ b/crates/ui-egui/tests/it/ui_unreadable_footage.rs @@ -50,7 +50,10 @@ fn harness(broken: fn(&Footage) -> bool, proxy: Option) -> (Harness<'st fn open(mut s: Session) -> Harness<'static, EffectcraftApp> { s.execute("project.select", json!({"items": []})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(4); h } diff --git a/crates/ui-egui/tests/it/ui_video_preview_off.rs b/crates/ui-egui/tests/it/ui_video_preview_off.rs index 257885ab6..ca76a76ee 100644 --- a/crates/ui-egui/tests/it/ui_video_preview_off.rs +++ b/crates/ui-egui/tests/it/ui_video_preview_off.rs @@ -19,7 +19,11 @@ fn an_audio_only_preview_says_video_preview_is_off() { s.execute("comp.new", json!({"name": "Muted", "width": 320, "height": 180, "duration": 10})).unwrap(); let sc = s.prefs.preview.current; s.prefs.preview.get_mut(sc).include_video = false; - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(1.0 / 30.0).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1400.0, 900.0)) + .with_step_dt(1.0 / 30.0) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(4); let chip = |h: &Harness<'_, EffectcraftApp>| h.ctx.data(|d| d.get_temp::(egui::Id::unique("viewer-video-off-chip"))); assert!(chip(&h).is_none()); diff --git a/crates/ui-egui/tests/it/ui_view_layout.rs b/crates/ui-egui/tests/it/ui_view_layout.rs index 05222dd9f..08e71e685 100644 --- a/crates/ui-egui/tests/it/ui_view_layout.rs +++ b/crates/ui-egui/tests/it/ui_view_layout.rs @@ -11,7 +11,10 @@ fn harness(comp: Option<&str>) -> Harness<'static, EffectcraftApp> { if let Some(comp) = comp { s.execute("comp.open", json!({"comp": comp})).unwrap(); } - Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)) + Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)) } /// Click the centre of the automation element `id`. diff --git a/crates/ui-egui/tests/it/ui_viewer.rs b/crates/ui-egui/tests/it/ui_viewer.rs index 3a89c036d..e6c53fee9 100644 --- a/crates/ui-egui/tests/it/ui_viewer.rs +++ b/crates/ui-egui/tests/it/ui_viewer.rs @@ -23,7 +23,8 @@ fn app() -> EffectcraftApp { } fn harness() -> Harness<'static, EffectcraftApp> { - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app()); + let mut h = + Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app()); h.run_steps(3); h } @@ -127,7 +128,10 @@ fn selection_harness() -> Harness<'static, EffectcraftApp> { s.execute("layer.newSolid", json!({"name": name, "color": "#406080", "width": 80, "height": 80})).unwrap(); } s.execute("edit.deselectAll", json!({})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(move |_| EffectcraftApp::new(s)); h.run_steps(3); h } @@ -285,7 +289,10 @@ fn viewer_double_click_opens_the_topmost_layer_over_a_selected_one() { s.execute("layer.addItem", json!({"item": "Inner"})).unwrap(); let back = s.active_comp().unwrap().layers[1].id; s.execute("layer.select", json!({"layers": [back.0]})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(move |_| EffectcraftApp::new(s)); h.run_steps(40); let at = screen(&h, [320.0, 180.0]); h.input_mut().events.push(Event::PointerMoved(at)); @@ -3008,7 +3015,10 @@ fn full_resolution_frames_wider_than_the_texture_limit_fit() { let mut s = Session::default(); s.execute("comp.new", json!({"name": "Wide", "width": 2400, "height": 400, "duration": 1})).unwrap(); s.execute("layer.newSolid", json!({"name": "Plate", "color": "#406080"})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); // (egui's font atlas needs 1024.) h.input_mut().max_texture_side = Some(1024); h.state_mut().session.execute("view.res.full", json!({})).unwrap(); @@ -3115,7 +3125,11 @@ fn frame_sits_on_the_physical_pixel_grid() { for ppp in [1.0f32, 1.25, 1.5] { let mut s = Session::default(); s.execute("comp.new", json!({"name": "Grid", "width": 301, "height": 201, "duration": 1})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_pixels_per_point(ppp).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_pixels_per_point(ppp) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(move |_| EffectcraftApp::new(s)); h.run_steps(3); for (mag, pan) in [(1.0f32, [0.3f32, 0.37]), (2.0, [-0.45, 0.2])] { h.state_mut().ui.viewer.zoom = Some(mag / ppp); @@ -3145,11 +3159,12 @@ fn fit_up_to_100_follows_the_maximized_panel() { h.run_steps(2); }; // A comp larger than the panel: it fills the docked panel, then the maximized one. - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| { - let mut s = Session::default(); - s.execute("comp.new", json!({"name": "Big", "width": 3840, "height": 2160, "duration": 4})).unwrap(); - EffectcraftApp::new(s) - }); + let mut h = + Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| { + let mut s = Session::default(); + s.execute("comp.new", json!({"name": "Big", "width": 3840, "height": 2160, "duration": 4})).unwrap(); + EffectcraftApp::new(s) + }); h.run_steps(3); pick(&mut h); let docked = rect(&h, "viewer.comp").width(); @@ -3505,7 +3520,10 @@ fn null_eye_hides_it_in_the_viewer() { s.execute("comp.new", json!({"name": "Nulls", "width": 640, "height": 360, "duration": 4})).unwrap(); let n = s.execute("layer.newNull", json!({})).unwrap()["layer"].as_u64().unwrap(); s.execute("layer.select", json!({"layers": [n]})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(move |_| EffectcraftApp::new(s)); h.run_steps(3); let handle = format!("viewer.handle.{n}.0"); let eye = format!("timeline.layer.{n}.video"); @@ -3541,7 +3559,10 @@ fn unselected_null_keeps_its_outline() { s.execute("comp.new", json!({"name": "Nulls", "width": 640, "height": 360, "duration": 4})).unwrap(); let n = s.execute("layer.newNull", json!({})).unwrap()["layer"].as_u64().unwrap(); s.execute("layer.select", json!({"layers": [n]})).unwrap(); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(move |_| EffectcraftApp::new(s)); h.run_steps(3); // Use the selected box's actual geometry, so transformed nulls use the same outline. let corners: Vec = (0..4).map(|i| rect(&h, &format!("viewer.handle.{n}.{i}")).center()).collect(); diff --git a/crates/ui-egui/tests/it/ui_viewer_trackpad.rs b/crates/ui-egui/tests/it/ui_viewer_trackpad.rs index a45e2643d..3bdd6442d 100644 --- a/crates/ui-egui/tests/it/ui_viewer_trackpad.rs +++ b/crates/ui-egui/tests/it/ui_viewer_trackpad.rs @@ -11,7 +11,10 @@ use serde_json::json; fn harness() -> Harness<'static, EffectcraftApp> { let mut s = Session::default(); s.execute("comp.new", json!({"name": "View", "width": 640, "height": 360, "duration": 4})).unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.state_mut().show_panel(PanelKind::Composition); h.run_steps(4); h diff --git a/crates/ui-egui/tests/it/ui_visual_review.rs b/crates/ui-egui/tests/it/ui_visual_review.rs index 27f328b95..e395e5ae9 100644 --- a/crates/ui-egui/tests/it/ui_visual_review.rs +++ b/crates/ui-egui/tests/it/ui_visual_review.rs @@ -18,7 +18,8 @@ fn all_ui_review_captures() { s.execute("layer.newSolid", json!({"name":"Plate","color":"#406080","width":160,"height":120})).unwrap(); s.execute("renderQueue.add", json!({"format":"png","output":"review-[#####].png"})).unwrap(); std::sync::Arc::make_mut(&mut s.project).settings.gpu_acceleration = false; - let mut h = Harness::builder().with_size(size).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = + Harness::builder().with_size(size).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(4); h.render_serialized().unwrap().save(out.join(format!("{label}-workspace.png"))).unwrap(); let ctx = h.ctx.clone(); diff --git a/crates/ui-egui/tests/it/ui_web_gpu_storage.rs b/crates/ui-egui/tests/it/ui_web_gpu_storage.rs index 228d26a6c..322ddf452 100644 --- a/crates/ui-egui/tests/it/ui_web_gpu_storage.rs +++ b/crates/ui-egui/tests/it/ui_web_gpu_storage.rs @@ -231,7 +231,10 @@ fn settings_disk_page_shows_the_browser_storage_manager() { let mut s = Session::default(); let host = Arc::new(Storage::default()); s.storage = Some(host.clone()); - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(2); effectcraft_ui_egui::panels::settings::open(h.state_mut(), "disk"); h.run_steps(3); @@ -252,7 +255,10 @@ fn settings_disk_page_shows_the_browser_storage_manager() { assert_eq!(*host.cleared.lock().unwrap(), vec!["diskCache".to_string()]); assert!(*host.persist_asked.lock().unwrap()); // Without a host (the desktop) the section is not there. - let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(Session::default())); + let mut h = Harness::builder() + .with_size(egui::vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(Session::default())); h.run_steps(2); effectcraft_ui_egui::panels::settings::open(h.state_mut(), "disk"); h.run_steps(3); diff --git a/crates/ui-egui/tests/it/ui_web_offload.rs b/crates/ui-egui/tests/it/ui_web_offload.rs index a3456a355..62d4dd619 100644 --- a/crates/ui-egui/tests/it/ui_web_offload.rs +++ b/crates/ui-egui/tests/it/ui_web_offload.rs @@ -193,7 +193,10 @@ fn waiting_commands_reply_when_their_offloaded_job_ends() { s.execute("layer.newSolid", json!({"color": "#406080"})).unwrap(); s.execute("renderQueue.add", json!({"format": "gif", "output": "/w.gif"})).unwrap(); let (tx, rx) = std::sync::mpsc::channel(); - let mut h = Harness::builder().with_size(egui::vec2(1280.0, 800.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s).with_control(rx)); + let mut h = Harness::builder() + .with_size(egui::vec2(1280.0, 800.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s).with_control(rx)); h.run_steps(2); // `renderQueue.render` waits by default: the job goes to the worker, the reply waits. let (req, reply) = ControlRequest::new("engine.execute", json!({"command": "renderQueue.render", "params": {}})); diff --git a/crates/ui-egui/tests/it/ui_window_title.rs b/crates/ui-egui/tests/it/ui_window_title.rs index 66b0991b2..6ec126433 100644 --- a/crates/ui-egui/tests/it/ui_window_title.rs +++ b/crates/ui-egui/tests/it/ui_window_title.rs @@ -9,7 +9,10 @@ use serde_json::json; #[test] fn the_reported_title_follows_the_open_document() { - let mut h = Harness::builder().with_size(vec2(800.0, 600.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(Session::default())); + let mut h = Harness::builder() + .with_size(vec2(800.0, 600.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(Session::default())); h.run_steps(3); let clean = h.state().window_title().to_owned(); assert!(clean.starts_with("EffectCraft - ") && !clean.ends_with(" *"), "{clean}"); diff --git a/crates/ui-egui/tests/it/ui_workflow_selection.rs b/crates/ui-egui/tests/it/ui_workflow_selection.rs index 46fda276a..82b72e8d2 100644 --- a/crates/ui-egui/tests/it/ui_workflow_selection.rs +++ b/crates/ui-egui/tests/it/ui_workflow_selection.rs @@ -14,7 +14,10 @@ fn harness() -> Harness<'static, EffectcraftApp> { s.execute("layer.newSolid", json!({"name":format!("Tile {n}"),"width":80,"height":80,"color":"#406080"})).unwrap(); } s.execute("edit.deselectAll", json!({})).unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); h } @@ -389,7 +392,10 @@ fn project_edit_commands_do_not_target_timeline_layers() { #[test] fn compact_settings_keeps_confirmation_buttons_clickable() { - let mut h = Harness::builder().with_size(vec2(1024.0, 768.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(Session::default())); + let mut h = Harness::builder() + .with_size(vec2(1024.0, 768.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(Session::default())); h.state_mut().dialog = Some(effectcraft_ui_egui::Dialog::Settings); h.run_steps(4); h.get_by_label(" OK ").click(); @@ -607,7 +613,10 @@ fn timeline_context_menu_creates_shapes_and_masks_from_text() { s.execute("edit.deselectAll", json!({})).unwrap(); let text = s.active_comp().unwrap().layers.iter().find(|l| matches!(l.source, LayerSource::Text)).unwrap().id.0; let plate = s.active_comp().unwrap().layers.iter().find(|l| l.name == "Plate").unwrap().id.0; - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); let row = |h: &Harness<'_, EffectcraftApp>, id: u64| { let r = rect(h, &format!("timeline.layer.{id}.row")); @@ -663,7 +672,10 @@ fn layer_context_menus_offer_create_shapes_from_vector_layer_for_vector_footage( let logo = s.execute("layer.addItem", json!({"item": item})).unwrap()["layer"].as_u64().unwrap(); let plate = s.execute("layer.newSolid", json!({"name":"Plate","width":40,"height":40,"color":"#406080"})).unwrap()["layer"].as_u64().unwrap(); s.execute("edit.deselectAll", json!({})).unwrap(); - let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| EffectcraftApp::new(s)); + let mut h = Harness::builder() + .with_size(vec2(1600.0, 1000.0)) + .with_context_setup(effectcraft_ui_egui::framework::install_headless) + .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); let right_click = |h: &mut Harness<'_, EffectcraftApp>, p: Pos2| { for pressed in [true, false] { From b2faa3ebaa7985627013a31ffc08e57374b794f8 Mon Sep 17 00:00:00 2001 From: aiongg Date: Tue, 24 Nov 2026 19:30:34 +0000 Subject: [PATCH 420/451] Compile round 1: dock tests resize splits through actions, Axis::Y, Placement clone --- crates/ui-egui/src/workspace_state/tests.rs | 2 +- crates/ui-egui/tests/it/ui_panel_focus.rs | 2 +- crates/ui-egui/tests/it/ui_workspace_focus.rs | 15 +++++---------- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/crates/ui-egui/src/workspace_state/tests.rs b/crates/ui-egui/src/workspace_state/tests.rs index 04856b7f8..a825c2948 100644 --- a/crates/ui-egui/src/workspace_state/tests.rs +++ b/crates/ui-egui/src/workspace_state/tests.rs @@ -105,7 +105,7 @@ fn version_one_file_loads_with_every_panel_in_place() { tabs(&[Properties]), ); assert_eq!(ui.dock.layout().root, Some(root)); - let floating: Vec<_> = ui.dock.layout().floating.iter().map(|w| (w.panels().copied().collect::>(), w.rect, w.native)).collect(); + let floating: Vec<_> = ui.dock.layout().floating.iter().map(|w| (w.panels().copied().collect::>(), w.rect, w.native.clone())).collect(); assert_eq!( floating, [ diff --git a/crates/ui-egui/tests/it/ui_panel_focus.rs b/crates/ui-egui/tests/it/ui_panel_focus.rs index 04fa5ee57..81a43d0c9 100644 --- a/crates/ui-egui/tests/it/ui_panel_focus.rs +++ b/crates/ui-egui/tests/it/ui_panel_focus.rs @@ -97,7 +97,7 @@ fn opening_a_comp_in_the_minimal_workspace_docks_the_viewer_above_the_timeline() assert!(!h.state().ui.dock.is_docked(PanelKind::Composition)); invoke(&mut h, "comp.open", json!({"comp": other})); match &h.state().ui.dock.layout().root { - Some(Node::Split { axis: effectcraft_ui_egui::dock::SplitAxis::Vertical, first, second, .. }) => { + Some(Node::Split { axis: effectcraft_ui_egui::dock::Axis::Y, first, second, .. }) => { assert_eq!(**first, Node::tabs(vec![PanelKind::Composition], 0), "the viewer is on top"); assert!(matches!(&**second, Node::Tabs { panels, .. } if panels.contains(&PanelKind::Timeline))); } diff --git a/crates/ui-egui/tests/it/ui_workspace_focus.rs b/crates/ui-egui/tests/it/ui_workspace_focus.rs index c527379ff..a2f061fda 100644 --- a/crates/ui-egui/tests/it/ui_workspace_focus.rs +++ b/crates/ui-egui/tests/it/ui_workspace_focus.rs @@ -5,6 +5,7 @@ use std::sync::Arc; use effectcraft_engine::Session; use effectcraft_engine::config::{ConfigStore, DirConfig, MemoryConfig}; use effectcraft_ui_egui::EffectcraftApp; +use craft_behavior::dock::Action; use effectcraft_ui_egui::dock::{self, Node, PanelKind, SplitSize}; use effectcraft_ui_egui::state::Tool; use egui::{Event, Id, Key, Modifiers, vec2}; @@ -14,7 +15,7 @@ use serde_json::json; /// Whether key focus is on the dock tab whose name starts with `name` (a tab names what its panel /// shows: "Effect Controls Selected"), as the accessibility tree reports it. fn tab_focused(h: &Harness<'_, EffectcraftApp>, name: &str) -> bool { - use egui_kittest::kittest::{NodeT, Queryable}; + use egui_kittest::kittest::NodeT; h.root().children_recursive().any(|n| { n.is_focused() && n.accesskit_node().role() == egui::accesskit::Role::Tab && n.accesskit_node().label().is_some_and(|label| label.starts_with(name)) }) @@ -32,9 +33,8 @@ fn named_and_current_workspaces_survive_frontend_restart() { let ctx = egui::Context::default(); effectcraft_ui_egui::menus::invoke(&mut app, &ctx, "window.saveWorkspaceAs", json!({"name": "Restart layout"})).unwrap(); let saved = app.ui.dock.clone(); - if let Some(Node::Split { size, .. }) = &mut app.ui.dock.layout().root { - *size = SplitSize::FixedFirst(390.0); - } + assert!(matches!(app.ui.dock.layout().root, Some(Node::Split { .. }))); + app.apply_dock(Action::resize_split(vec![], SplitSize::FixedFirst(390.0))).unwrap(); app.ui.focused = PanelKind::Layer; let current = app.ui.dock.clone(); eframe::App::on_exit(&mut app); @@ -178,12 +178,7 @@ fn tab_traversal_activates_an_inactive_dock_tab_without_editing_the_project() { app.ui.start_screen = false; app.ui.show_menu_bar = false; // Leave the inactive, layer-named tab visible instead of behind the overflow control. - if let Some(Node::Split { first, .. }) = &mut app.ui.dock.layout().root - && let Node::Split { first, .. } = first.as_mut() - && let Node::Split { size, .. } = first.as_mut() - { - *size = SplitSize::FixedFirst(420.0); - } + app.apply_dock(Action::resize_split(vec![false, false], SplitSize::FixedFirst(420.0))).unwrap(); let mut h = Harness::builder().with_size(vec2(1200.0, 760.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| app); h.run_steps(3); From e061e0903efb29a2cd1935fa5bf8b440ebd973c6 Mon Sep 17 00:00:00 2001 From: aiongg Date: Tue, 24 Nov 2026 20:27:51 +0000 Subject: [PATCH 421/451] Test rounds: lib harnesses run the runtime, logic tick runs the close path, tests follow next's async update offer and font discard pass - bench::Driver installs the runtime and runs raw_input_hook as the shells do - lifecycle tests use a context with the runtime installed; the logic-only tick runs App::logic's body (logic_pass), so a hidden close request reaches the runtime's close path - the startup-prompt test ticks the updater until its offer's inspection thread answers - font-install tests: the install pass asks egui for a discard pass, which draws with the fonts in the same frame --- crates/ui-egui/src/app.rs | 6 +- crates/ui-egui/src/app/frame.rs | 9 +++ crates/ui-egui/src/bench.rs | 7 +- crates/ui-egui/src/lifecycle_tests.rs | 64 ++++++++++++------- .../ui-egui/src/panels/viewer_text/tests.rs | 17 ++--- crates/ui-egui/tests/it/ui_workspace_focus.rs | 2 +- 6 files changed, 62 insertions(+), 43 deletions(-) diff --git a/crates/ui-egui/src/app.rs b/crates/ui-egui/src/app.rs index d4925756c..549154ba7 100644 --- a/crates/ui-egui/src/app.rs +++ b/crates/ui-egui/src/app.rs @@ -188,11 +188,7 @@ impl eframe::App for EffectcraftApp { /// refreshed. A close request must be answered while hidden too; an answered file dialog can change the project, /// so the tick's dialog answers run first. fn logic(&mut self, ctx: &egui::Context, frame: &mut eframe::Frame) { - // Never `ctx.input(|i| i.time)` here: `Context::run_logic` leaves events, pointer state and - // time at the previous full pass's values (only the viewport information is refreshed). - self.tick(ctx, frame); - self.finish_ime_logic(ctx); - self.close_path(ctx); + self.logic_pass(ctx, frame); } /// Draw one UI pass through `draw`. diff --git a/crates/ui-egui/src/app/frame.rs b/crates/ui-egui/src/app/frame.rs index d93b5673b..065109b9f 100644 --- a/crates/ui-egui/src/app/frame.rs +++ b/crates/ui-egui/src/app/frame.rs @@ -167,6 +167,15 @@ impl EffectcraftApp { } } + /// The shared app's `App::logic`: `tick`, the IME pass's close and, last, the root window's close path. + pub(crate) fn logic_pass(&mut self, ctx: &egui::Context, frame: &eframe::Frame) { + // Never `ctx.input(|i| i.time)` here: `Context::run_logic` leaves events, pointer state and + // time at the previous full pass's values (only the viewport information is refreshed). + self.tick(ctx, frame); + self.finish_ime_logic(ctx); + self.close_path(ctx); + } + /// The app's only non-paint entry: one tick of background work. /// /// This runs for every eframe logic callback, including the logic-only ticks of a hidden diff --git a/crates/ui-egui/src/bench.rs b/crates/ui-egui/src/bench.rs index 567588de4..23054a863 100644 --- a/crates/ui-egui/src/bench.rs +++ b/crates/ui-egui/src/bench.rs @@ -20,7 +20,9 @@ pub struct Driver { impl Driver { pub fn new(app: EffectcraftApp, size: egui::Vec2) -> Driver { - Driver { ctx: egui::Context::default(), app, frame: eframe::Frame::_new_kittest(), time: 0.0, size } + let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); + Driver { ctx, app, frame: eframe::Frame::_new_kittest(), time: 0.0, size } } /// Run one frame (layout + paint + tessellation); its wall time in ms. @@ -30,10 +32,11 @@ impl Driver { pub fn step_with(&mut self, events: Vec) -> f64 { self.time += 1.0 / 60.0; - let input = + let mut input = egui::RawInput { screen_rect: Some(egui::Rect::from_min_size(egui::Pos2::ZERO, self.size)), time: Some(self.time), events, ..Default::default() }; let t0 = web_time::Instant::now(); let (app, frame) = (&mut self.app, &mut self.frame); + eframe::App::raw_input_hook(app, &self.ctx, &mut input); let mut out = self.ctx.run_ui(input, |ui| { eframe::App::logic(app, ui.ctx(), frame); eframe::App::ui(app, ui, frame); diff --git a/crates/ui-egui/src/lifecycle_tests.rs b/crates/ui-egui/src/lifecycle_tests.rs index ab02aff37..8ad7e902c 100644 --- a/crates/ui-egui/src/lifecycle_tests.rs +++ b/crates/ui-egui/src/lifecycle_tests.rs @@ -23,7 +23,14 @@ fn raw(size: egui::Vec2) -> egui::RawInput { } fn tick_with(app: &mut EffectcraftApp, ctx: &egui::Context, frame: &eframe::Frame, raw: &egui::RawInput) -> egui::LogicOutput { - ctx.run_logic(raw, |ctx| app.tick(ctx, frame)) + ctx.run_logic(raw, |ctx| app.logic_pass(ctx, frame)) +} + +/// A context with the runtime installed, as the app's window has it. +fn headless() -> egui::Context { + let ctx = egui::Context::default(); + crate::framework::install_headless(&ctx); + ctx } fn hidden_tick(app: &mut EffectcraftApp, ctx: &egui::Context, frame: &eframe::Frame) { @@ -58,7 +65,7 @@ fn send(app: &mut EffectcraftApp, method: &str, params: serde_json::Value) -> st #[test] fn a_logic_only_tick_installs_no_fonts_and_records_no_geometry() { - let ctx = egui::Context::default(); + let ctx = headless(); let frame = eframe::Frame::_new_kittest(); let mut app = app_with_comp(); hidden_tick(&mut app, &ctx, &frame); @@ -69,7 +76,7 @@ fn a_logic_only_tick_installs_no_fonts_and_records_no_geometry() { #[test] fn a_control_command_that_needs_no_ui_completes_without_a_pass() { - let ctx = egui::Context::default(); + let ctx = headless(); let frame = eframe::Frame::_new_kittest(); let mut app = app_with_comp(); let reply = send(&mut app, "engine.execute", json!({"command": "comp.new", "params": {"name": "Queued", "width": 32, "height": 18, "duration": 1}})); @@ -81,8 +88,7 @@ fn a_control_command_that_needs_no_ui_completes_without_a_pass() { #[test] fn a_pass_that_cannot_draw_receives_no_synthetic_input() { - let ctx = egui::Context::default(); - crate::framework::install_headless(&ctx); + let ctx = headless(); let frame = eframe::Frame::_new_kittest(); let mut app = app_with_comp(); assert!(!app.is_ready(), "a fresh app installs its fonts in its first pass"); @@ -98,7 +104,9 @@ fn a_pass_that_cannot_draw_receives_no_synthetic_input() { assert!(app.pending_synthetic_events().is_empty()); let mut setup_pass = ctx.run_ui(setup.take(), |ui| app.draw(ui, &frame)); setup_pass.textures_delta.clear(); - assert!(!app.is_ready(), "the pass that installs the fonts draws nothing"); + // The font install asks egui for a discard pass, which draws with the fonts and gets no input. + assert!(app.is_ready(), "the frame that installs the fonts draws in its discard pass"); + assert_eq!(app.synthetic.len(), 5, "the discard pass got no synthetic input: the whole gesture still waits"); // Once fonts are ready the click reaches the UI exactly once, one event per pass. let mut passes = 0; while reply.try_recv().is_err() { @@ -114,7 +122,7 @@ fn a_pass_that_cannot_draw_receives_no_synthetic_input() { #[test] fn one_pending_synthetic_batch_is_never_duplicated_while_hidden() { - let ctx = egui::Context::default(); + let ctx = headless(); let frame = eframe::Frame::_new_kittest(); let mut app = app_with_comp(); ready(&mut app, &ctx, &frame); @@ -148,7 +156,7 @@ fn one_pending_synthetic_batch_is_never_duplicated_while_hidden() { #[test] fn geometry_epoch_tracks_size_and_scale_but_not_window_position() { - let ctx = egui::Context::default(); + let ctx = headless(); let frame = eframe::Frame::_new_kittest(); let mut app = app_with_comp(); let first = ready(&mut app, &ctx, &frame); @@ -166,7 +174,7 @@ fn geometry_epoch_tracks_size_and_scale_but_not_window_position() { #[test] fn only_a_viewer_that_draws_records_a_prefetch_scale() { - let ctx = egui::Context::default(); + let ctx = headless(); let frame = eframe::Frame::_new_kittest(); let mut app = app_with_comp(); ready(&mut app, &ctx, &frame); @@ -185,7 +193,7 @@ fn only_a_viewer_that_draws_records_a_prefetch_scale() { #[test] fn playback_advances_on_a_logic_only_tick() { - let ctx = egui::Context::default(); + let ctx = headless(); let frame = eframe::Frame::_new_kittest(); let mut app = app_with_comp(); app.playback.playing = true; @@ -218,7 +226,7 @@ fn workspace_layout_autosave_writes_on_a_hidden_tick() { app.use_manual_clock(); app.ui.focused = PanelKind::Timeline; app.clock_mut().advance(2.0); - let ctx = egui::Context::default(); + let ctx = headless(); let frame = eframe::Frame::_new_kittest(); hidden_tick(&mut app, &ctx, &frame); assert!(store.read(WORKSPACES_FILE).is_some(), "the layout is saved while the window is hidden"); @@ -236,7 +244,7 @@ fn asks_to_close(ctx: &egui::Context, mut f: impl FnMut(&egui::Context)) -> bool #[test] #[cfg(not(target_arch = "wasm32"))] fn restart_to_update_with_unsaved_changes_opens_the_unsaved_changes_prompt() { - let ctx = egui::Context::default(); + let ctx = headless(); let frame = eframe::Frame::_new_kittest(); let mut app = app_with_comp(); assert!(app.session.is_dirty(), "creating a comp and a layer leaves unsaved changes"); @@ -253,7 +261,7 @@ fn restart_to_update_with_unsaved_changes_opens_the_unsaved_changes_prompt() { #[test] #[cfg(not(target_arch = "wasm32"))] fn restart_to_update_with_nothing_unsaved_leaves_the_close_to_the_updater() { - let ctx = egui::Context::default(); + let ctx = headless(); let mut app = app_with_comp(); app.updates_rt.manual_window_open = true; assert!(!asks_to_close(&ctx, |ctx| updates_ui::restart_to_update(&mut app.updates_rt, ctx, true))); @@ -263,7 +271,7 @@ fn restart_to_update_with_nothing_unsaved_leaves_the_close_to_the_updater() { #[test] #[cfg(not(target_arch = "wasm32"))] fn restart_to_update_with_the_startup_prompt_open_leaves_the_window_open() { - let ctx = egui::Context::default(); + let ctx = headless(); let mut app = app_with_comp(); app.updates_rt.updater.offer(craft_update::Release { tag: "v99.0.0".into(), @@ -272,6 +280,14 @@ fn restart_to_update_with_the_startup_prompt_open_leaves_the_window_open() { html_url: "https://github.com/storytold/effectcraft/releases/tag/v99.0.0".into(), ..Default::default() }); + // The offer reads on a thread whether this copy installs itself; a tick opens the prompt with its answer. + for _ in 0..400 { + if app.updates_rt.updater.prompt_open() { + break; + } + std::thread::sleep(std::time::Duration::from_millis(5)); + app.updates_rt.updater.tick(&ctx); + } assert!(app.updates_rt.updater.prompt_open()); app.updates_rt.manual_window_open = true; assert!(!asks_to_close(&ctx, |ctx| updates_ui::restart_to_update(&mut app.updates_rt, ctx, false)), "the prompt carries the restart"); @@ -281,7 +297,7 @@ fn restart_to_update_with_the_startup_prompt_open_leaves_the_window_open() { #[test] fn the_close_guard_answers_a_close_request_without_a_pass() { - let ctx = egui::Context::default(); + let ctx = headless(); let frame = eframe::Frame::_new_kittest(); let mut app = app_with_comp(); assert!(app.session.is_dirty(), "creating a comp and a layer leaves unsaved changes"); @@ -363,7 +379,7 @@ fn image(width: usize, height: usize) -> Arc { #[test] fn a_script_file_dialog_asks_for_a_pass_while_the_window_is_hidden() { use effectcraft_engine::scriptui::{FileDialogKind, ScriptFileDialog}; - let ctx = egui::Context::default(); + let ctx = headless(); let frame = eframe::Frame::_new_kittest(); let mut app = app_with_comp(); ready(&mut app, &ctx, &frame); @@ -392,7 +408,7 @@ fn a_script_file_dialog_asks_for_a_pass_while_the_window_is_hidden() { #[test] fn a_screenshot_is_issued_only_after_settled_passes_and_writes_from_the_tick() { - let ctx = egui::Context::default(); + let ctx = headless(); let frame = eframe::Frame::_new_kittest(); let mut app = app_with_comp(); ready(&mut app, &ctx, &frame); @@ -418,7 +434,7 @@ fn a_screenshot_is_issued_only_after_settled_passes_and_writes_from_the_tick() { #[test] fn a_resize_between_issue_and_completion_rejects_the_pixels_and_retries() { - let ctx = egui::Context::default(); + let ctx = headless(); let frame = eframe::Frame::_new_kittest(); let mut app = app_with_comp(); ready(&mut app, &ctx, &frame); @@ -445,7 +461,7 @@ fn a_resize_between_issue_and_completion_rejects_the_pixels_and_retries() { #[test] fn screenshot_admission_bounds_requests_and_a_timeout_releases_its_reservation() { - let ctx = egui::Context::default(); + let ctx = headless(); let frame = eframe::Frame::_new_kittest(); let mut app = app_with_comp(); ready(&mut app, &ctx, &frame); @@ -471,7 +487,7 @@ fn screenshot_admission_bounds_requests_and_a_timeout_releases_its_reservation() #[test] fn a_late_callback_after_cancellation_writes_nothing_and_replies_once() { - let ctx = egui::Context::default(); + let ctx = headless(); let frame = eframe::Frame::_new_kittest(); let mut app = app_with_comp(); ready(&mut app, &ctx, &frame); @@ -500,7 +516,7 @@ fn wake_requests(ctx: &egui::Context) -> Arc(reset_id(egui::ViewportId::ROOT))).expect("the waiting guard"); - assert!(guard.suspended && guard.request.is_none(), "the all-exit finalizer retired it without allocating"); - let second = draw_app_pass(&mut app, &ctx, &frame, vec![]) - .platform_output - .ime - .expect("returning to a drawing pass publishes the custom descriptor") - .reset_request - .expect("the deferred request"); + assert!(app.is_ready(), "the discard pass after the font install draws"); + let second = fonts.platform_output.ime.expect("the drawing discard pass publishes the custom descriptor").reset_request.expect("the deferred request"); assert_ne!(first, second); // The device-loss early return is the other all-exit path. Preset the close bookkeeping diff --git a/crates/ui-egui/tests/it/ui_workspace_focus.rs b/crates/ui-egui/tests/it/ui_workspace_focus.rs index a2f061fda..f273708b0 100644 --- a/crates/ui-egui/tests/it/ui_workspace_focus.rs +++ b/crates/ui-egui/tests/it/ui_workspace_focus.rs @@ -2,10 +2,10 @@ use std::sync::Arc; +use craft_behavior::dock::Action; use effectcraft_engine::Session; use effectcraft_engine::config::{ConfigStore, DirConfig, MemoryConfig}; use effectcraft_ui_egui::EffectcraftApp; -use craft_behavior::dock::Action; use effectcraft_ui_egui::dock::{self, Node, PanelKind, SplitSize}; use effectcraft_ui_egui::state::Tool; use egui::{Event, Id, Key, Modifiers, vec2}; From dbbf485774c7f4f55eb86c4f210400c76b1bb791 Mon Sep 17 00:00:00 2001 From: aiongg Date: Tue, 24 Nov 2026 21:09:54 +0000 Subject: [PATCH 422/451] Repin craft-libs to dock-gaps 4e806d57a5: panel focus on DockAreaOutput::pressed, document tab sources, tests on next's ids --- Cargo.lock | 204 +++++++++---------- Cargo.toml | 94 ++++----- crates/effects/Cargo.toml | 2 +- crates/ui-egui/src/dock.rs | 26 --- crates/ui-egui/src/dock_ui.rs | 23 ++- crates/ui-egui/src/native_menu.rs | 23 ++- crates/ui-egui/tests/it/shared_docking_ui.rs | 27 --- crates/ui-egui/tests/it/ui_agent_audit.rs | 7 + crates/ui-egui/tests/it/ui_fx_editors.rs | 26 ++- crates/ui-egui/tests/it/ui_panel_windows.rs | 39 ++-- crates/ui-egui/tests/it/ui_tabs.rs | 84 ++++---- docs/control-protocol.md | 13 +- 12 files changed, 273 insertions(+), 295 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3424e6e7e..81afa8ae1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1315,12 +1315,12 @@ dependencies = [ [[package]] name = "craft-aep" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" [[package]] name = "craft-appkit" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ "block2 0.6.2", "objc2-app-kit 0.3.2", @@ -1330,7 +1330,7 @@ dependencies = [ [[package]] name = "craft-atomic" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ "rustix 1.1.6", ] @@ -1351,10 +1351,10 @@ dependencies = [ [[package]] name = "craft-audio" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ - "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", - "craft-xml 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", + "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", + "craft-xml 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", "log", "thiserror 2.0.21", ] @@ -1362,7 +1362,7 @@ dependencies = [ [[package]] name = "craft-behavior" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ "accesskit", "bitflags 2.13.2", @@ -1385,7 +1385,7 @@ source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa3 [[package]] name = "craft-cloud-ui" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ "egui", ] @@ -1393,7 +1393,7 @@ dependencies = [ [[package]] name = "craft-cms" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ "md-5", "rayon", @@ -1402,7 +1402,7 @@ dependencies = [ [[package]] name = "craft-codepage" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" [[package]] name = "craft-color" @@ -1415,7 +1415,7 @@ dependencies = [ [[package]] name = "craft-color" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ "serde", ] @@ -1423,7 +1423,7 @@ dependencies = [ [[package]] name = "craft-doc" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ "craft-ecproj-format", "craft-pcraft-format", @@ -1437,7 +1437,7 @@ dependencies = [ [[package]] name = "craft-docpath" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ "serde", ] @@ -1453,7 +1453,7 @@ dependencies = [ [[package]] name = "craft-dpx" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ "thiserror 2.0.21", ] @@ -1461,7 +1461,7 @@ dependencies = [ [[package]] name = "craft-ecproj-format" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ "serde", "serde_json", @@ -1471,7 +1471,7 @@ dependencies = [ [[package]] name = "craft-eps" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" [[package]] name = "craft-exr" @@ -1485,7 +1485,7 @@ dependencies = [ [[package]] name = "craft-exr" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ "exr", "flate2", @@ -1497,7 +1497,7 @@ dependencies = [ [[package]] name = "craft-font-catalog" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ "harfrust 0.13.3", "kurbo", @@ -1511,7 +1511,7 @@ dependencies = [ [[package]] name = "craft-fonts-build" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" [[package]] name = "craft-frame" @@ -1527,10 +1527,10 @@ dependencies = [ [[package]] name = "craft-frame" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ - "craft-color 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", - "craft-time 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", + "craft-color 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", + "craft-time 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", "rayon", "serde", ] @@ -1538,7 +1538,7 @@ dependencies = [ [[package]] name = "craft-gif" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ "gif", "image", @@ -1555,7 +1555,7 @@ dependencies = [ [[package]] name = "craft-host" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ "bitflags 2.13.2", "craft-i18n", @@ -1568,7 +1568,7 @@ dependencies = [ [[package]] name = "craft-i18n" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ "chrono", "fixed_decimal", @@ -1604,7 +1604,7 @@ dependencies = [ [[package]] name = "craft-jsonrpc" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ "serde_json", ] @@ -1612,13 +1612,13 @@ dependencies = [ [[package]] name = "craft-keymap" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ "craft-host", "craft-i18n", "craft-tracked", "craft-ui-macros", - "craft-xml 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", + "craft-xml 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", "egui", "serde", "serde_json", @@ -1627,7 +1627,7 @@ dependencies = [ [[package]] name = "craft-lottie" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ "craft-zip", "serde_json", @@ -1646,7 +1646,7 @@ dependencies = [ [[package]] name = "craft-media" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ "chrono", "thiserror 2.0.21", @@ -1669,14 +1669,14 @@ dependencies = [ [[package]] name = "craft-media-source" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ - "craft-audio 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", - "craft-color 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", - "craft-frame 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", - "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", - "craft-time 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", - "craft-y4m 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", + "craft-audio 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", + "craft-color 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", + "craft-frame 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", + "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", + "craft-time 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", + "craft-y4m 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", "serde", "thiserror 2.0.21", ] @@ -1684,7 +1684,7 @@ dependencies = [ [[package]] name = "craft-mesh" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ "craft-zip", "miniz_oxide 0.9.1", @@ -1694,7 +1694,7 @@ dependencies = [ [[package]] name = "craft-mime" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ "chrono", "craft-codepage", @@ -1704,7 +1704,7 @@ dependencies = [ [[package]] name = "craft-pcraft-format" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ "flate2", "serde", @@ -1715,7 +1715,7 @@ dependencies = [ [[package]] name = "craft-pdf" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ "hayro-syntax", "serde", @@ -1725,7 +1725,7 @@ dependencies = [ [[package]] name = "craft-platform" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ "async-channel", "async-io", @@ -1756,7 +1756,7 @@ dependencies = [ [[package]] name = "craft-ps" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ "craft-eps", "kurbo", @@ -1780,7 +1780,7 @@ dependencies = [ [[package]] name = "craft-psd" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ "encoding_rs", "flate2", @@ -1791,7 +1791,7 @@ dependencies = [ [[package]] name = "craft-quit" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ "dispatch2", "objc2 0.6.5", @@ -1817,7 +1817,7 @@ dependencies = [ [[package]] name = "craft-settings" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ "craft-atomic", "craft-host", @@ -1839,9 +1839,9 @@ source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa3 [[package]] name = "craft-svg" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ - "craft-xml 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", + "craft-xml 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", "flate2", "kurbo", "quick-xml 0.41.0", @@ -1864,7 +1864,7 @@ dependencies = [ [[package]] name = "craft-tga" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ "thiserror 2.0.21", ] @@ -1872,7 +1872,7 @@ dependencies = [ [[package]] name = "craft-theme" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ "bitflags 2.13.2", "craft-tracked", @@ -1905,7 +1905,7 @@ dependencies = [ [[package]] name = "craft-time" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ "serde", "thiserror 2.0.21", @@ -1925,9 +1925,9 @@ dependencies = [ [[package]] name = "craft-timeline" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ - "craft-time 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", + "craft-time 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", "serde", "web-time", ] @@ -1935,12 +1935,12 @@ dependencies = [ [[package]] name = "craft-tracked" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" [[package]] name = "craft-ui" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ "craft-cloud-ui", "craft-ui-canvas", @@ -1954,7 +1954,7 @@ dependencies = [ [[package]] name = "craft-ui-canvas" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ "craft-behavior", "craft-i18n", @@ -1970,7 +1970,7 @@ dependencies = [ [[package]] name = "craft-ui-contract" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ "accesskit", "craft-behavior", @@ -2008,7 +2008,7 @@ dependencies = [ [[package]] name = "craft-ui-macros" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2019,7 +2019,7 @@ dependencies = [ [[package]] name = "craft-ui-panels" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ "craft-behavior", "craft-host", @@ -2037,7 +2037,7 @@ dependencies = [ [[package]] name = "craft-ui-patterns" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ "craft-behavior", "craft-host", @@ -2058,7 +2058,7 @@ dependencies = [ [[package]] name = "craft-ui-shell" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ "craft-behavior", "craft-host", @@ -2078,7 +2078,7 @@ dependencies = [ [[package]] name = "craft-ui-widgets" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ "craft-behavior", "craft-host", @@ -2097,7 +2097,7 @@ dependencies = [ [[package]] name = "craft-update" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ "chrono", "craft-host", @@ -2126,7 +2126,7 @@ dependencies = [ [[package]] name = "craft-vectorcraft-format" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ "flate2", "serde", @@ -2148,9 +2148,9 @@ dependencies = [ [[package]] name = "craft-video" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ - "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", + "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", "rav1e", "rayon", "thiserror 2.0.21", @@ -2159,7 +2159,7 @@ dependencies = [ [[package]] name = "craft-webp" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ "image", "thiserror 2.0.21", @@ -2168,7 +2168,7 @@ dependencies = [ [[package]] name = "craft-win32" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ "winsafe", ] @@ -2176,7 +2176,7 @@ dependencies = [ [[package]] name = "craft-window" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ "craft-appkit", "craft-atomic", @@ -2210,7 +2210,7 @@ dependencies = [ [[package]] name = "craft-xml" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ "quick-xml 0.41.0", "serde", @@ -2228,7 +2228,7 @@ dependencies = [ [[package]] name = "craft-y4m" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ "thiserror 2.0.21", ] @@ -2236,7 +2236,7 @@ dependencies = [ [[package]] name = "craft-zip" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ "flate2", "thiserror 2.0.21", @@ -2530,7 +2530,7 @@ dependencies = [ [[package]] name = "ecolor" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=f5025284445ea19c35f746d96fc0b75468b3f560#f5025284445ea19c35f746d96fc0b75468b3f560" +source = "git+https://github.com/storytold/egui.git?rev=a87d00caaec947ea781657c6ff410c9838016d18#a87d00caaec947ea781657c6ff410c9838016d18" dependencies = [ "bytemuck", "emath", @@ -2688,12 +2688,12 @@ dependencies = [ name = "effectcraft-export" version = "0.25.1" dependencies = [ - "craft-audio 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", - "craft-exr 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", + "craft-audio 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", + "craft-exr 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", "craft-gif", - "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", - "craft-tga 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", - "craft-video 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", + "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", + "craft-tga 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", + "craft-video 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", "effectcraft-color", "effectcraft-effects", "effectcraft-keyframe", @@ -2803,7 +2803,7 @@ dependencies = [ name = "effectcraft-interchange" version = "0.25.1" dependencies = [ - "craft-timeline 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", + "craft-timeline 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", "effectcraft-color", "effectcraft-keyframe", "effectcraft-project", @@ -2854,17 +2854,17 @@ dependencies = [ name = "effectcraft-media" version = "0.25.1" dependencies = [ - "craft-audio 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", - "craft-color 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", + "craft-audio 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", + "craft-color 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", "craft-docpath", - "craft-dpx 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", - "craft-exr 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", - "craft-frame 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", + "craft-dpx 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", + "craft-exr 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", + "craft-frame 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", "craft-gif", - "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", - "craft-media-source 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", - "craft-time 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", - "craft-video 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", + "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", + "craft-media-source 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", + "craft-time 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", + "craft-video 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", "craft-webp", "effectcraft-color", "effectcraft-effects", @@ -2969,7 +2969,7 @@ name = "effectcraft-psd" version = "0.25.1" dependencies = [ "craft-codepage", - "craft-psd 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", + "craft-psd 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", "miniz_oxide 0.9.1", ] @@ -2977,7 +2977,7 @@ dependencies = [ name = "effectcraft-raster" version = "0.25.1" dependencies = [ - "craft-exr 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107)", + "craft-exr 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", "effectcraft-color", "effectcraft-geom", "rayon", @@ -3170,7 +3170,7 @@ dependencies = [ [[package]] name = "eframe" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=f5025284445ea19c35f746d96fc0b75468b3f560#f5025284445ea19c35f746d96fc0b75468b3f560" +source = "git+https://github.com/storytold/egui.git?rev=a87d00caaec947ea781657c6ff410c9838016d18#a87d00caaec947ea781657c6ff410c9838016d18" dependencies = [ "ahash", "bytemuck", @@ -3205,7 +3205,7 @@ dependencies = [ [[package]] name = "egui" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=f5025284445ea19c35f746d96fc0b75468b3f560#f5025284445ea19c35f746d96fc0b75468b3f560" +source = "git+https://github.com/storytold/egui.git?rev=a87d00caaec947ea781657c6ff410c9838016d18#a87d00caaec947ea781657c6ff410c9838016d18" dependencies = [ "accesskit", "ahash", @@ -3224,7 +3224,7 @@ dependencies = [ [[package]] name = "egui-wgpu" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=f5025284445ea19c35f746d96fc0b75468b3f560#f5025284445ea19c35f746d96fc0b75468b3f560" +source = "git+https://github.com/storytold/egui.git?rev=a87d00caaec947ea781657c6ff410c9838016d18#a87d00caaec947ea781657c6ff410c9838016d18" dependencies = [ "ahash", "bytemuck", @@ -3243,7 +3243,7 @@ dependencies = [ [[package]] name = "egui-winit" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=f5025284445ea19c35f746d96fc0b75468b3f560#f5025284445ea19c35f746d96fc0b75468b3f560" +source = "git+https://github.com/storytold/egui.git?rev=a87d00caaec947ea781657c6ff410c9838016d18#a87d00caaec947ea781657c6ff410c9838016d18" dependencies = [ "accesskit_winit", "arboard", @@ -3269,7 +3269,7 @@ dependencies = [ [[package]] name = "egui_extras" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=f5025284445ea19c35f746d96fc0b75468b3f560#f5025284445ea19c35f746d96fc0b75468b3f560" +source = "git+https://github.com/storytold/egui.git?rev=a87d00caaec947ea781657c6ff410c9838016d18#a87d00caaec947ea781657c6ff410c9838016d18" dependencies = [ "ahash", "egui", @@ -3282,7 +3282,7 @@ dependencies = [ [[package]] name = "egui_glow" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=f5025284445ea19c35f746d96fc0b75468b3f560#f5025284445ea19c35f746d96fc0b75468b3f560" +source = "git+https://github.com/storytold/egui.git?rev=a87d00caaec947ea781657c6ff410c9838016d18#a87d00caaec947ea781657c6ff410c9838016d18" dependencies = [ "bytemuck", "egui", @@ -3295,7 +3295,7 @@ dependencies = [ [[package]] name = "egui_kittest" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=f5025284445ea19c35f746d96fc0b75468b3f560#f5025284445ea19c35f746d96fc0b75468b3f560" +source = "git+https://github.com/storytold/egui.git?rev=a87d00caaec947ea781657c6ff410c9838016d18#a87d00caaec947ea781657c6ff410c9838016d18" dependencies = [ "eframe", "egui", @@ -3318,7 +3318,7 @@ checksum = "252afb9ae5eaa683babdc6a068b3f5726eb19e05070c731f9b2a23a7c3e8ed34" [[package]] name = "emath" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=f5025284445ea19c35f746d96fc0b75468b3f560#f5025284445ea19c35f746d96fc0b75468b3f560" +source = "git+https://github.com/storytold/egui.git?rev=a87d00caaec947ea781657c6ff410c9838016d18#a87d00caaec947ea781657c6ff410c9838016d18" dependencies = [ "bytemuck", ] @@ -3411,7 +3411,7 @@ dependencies = [ [[package]] name = "epaint" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=f5025284445ea19c35f746d96fc0b75468b3f560#f5025284445ea19c35f746d96fc0b75468b3f560" +source = "git+https://github.com/storytold/egui.git?rev=a87d00caaec947ea781657c6ff410c9838016d18#a87d00caaec947ea781657c6ff410c9838016d18" dependencies = [ "ahash", "bytemuck", @@ -3437,7 +3437,7 @@ dependencies = [ [[package]] name = "epaint_default_fonts" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=f5025284445ea19c35f746d96fc0b75468b3f560#f5025284445ea19c35f746d96fc0b75468b3f560" +source = "git+https://github.com/storytold/egui.git?rev=a87d00caaec947ea781657c6ff410c9838016d18#a87d00caaec947ea781657c6ff410c9838016d18" [[package]] name = "equator" @@ -4374,7 +4374,7 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a" [[package]] name = "hayro-jbig2" version = "0.3.0" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ "hayro-ccitt", ] @@ -4388,7 +4388,7 @@ checksum = "c75ab947623ef4ccaa7acf0579edf7cbb5a73838e3839a7be73335e522f433a1" [[package]] name = "hayro-syntax" version = "0.7.2" -source = "git+https://github.com/aiongg/craft-libs?rev=9fd8b0cdaad2b5320090f5a5892ba90fb8dab107#9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" +source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" dependencies = [ "hayro-jbig2", "hayro-jpeg2000", diff --git a/Cargo.toml b/Cargo.toml index edc4ed8e3..61fbef6aa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,28 +11,28 @@ rust-version = "1.95" repository = "https://github.com/storytold/effectcraft" [workspace.dependencies] -craft-timeline = { git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107", default-features = false } -craft-mime = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } -craft-pdf = { git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107", version = "=0.1.0", default-features = false, features = ["read"] } -craft-docpath = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } -craft-jsonrpc = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } -craft-ecproj-format = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } -craft-dpx = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } -craft-ps = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107", default-features = false, features = ["read"] } -craft-exr = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } -craft-gif = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } -craft-tga = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } -craft-psd = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } -craft-codepage = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } -craft-svg = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } -craft-webp = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } -craft-lottie = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } -craft-mesh = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107", default-features = false, features = ["stl", "obj", "gltf", "fbx"] } -craft-aep = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } -craft-doc = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } -craft-vectorcraft-format = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } +craft-timeline = { git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b", default-features = false } +craft-mime = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } +craft-pdf = { git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b", version = "=0.1.0", default-features = false, features = ["read"] } +craft-docpath = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } +craft-jsonrpc = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } +craft-ecproj-format = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } +craft-dpx = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } +craft-ps = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b", default-features = false, features = ["read"] } +craft-exr = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } +craft-gif = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } +craft-tga = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } +craft-psd = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } +craft-codepage = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } +craft-svg = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } +craft-webp = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } +craft-lottie = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } +craft-mesh = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b", default-features = false, features = ["stl", "obj", "gltf", "fbx"] } +craft-aep = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } +craft-doc = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } +craft-vectorcraft-format = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } # craft-update: app-specific pretend versions apply to startup and manual checks. -craft-update = { git = "https://github.com/aiongg/craft-libs", version = "=0.1.0", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107", features = ["ui"] } +craft-update = { git = "https://github.com/aiongg/craft-libs", version = "=0.1.0", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b", features = ["ui"] } # internal effectcraft-time = { path = "crates/time" } effectcraft-geom = { path = "crates/geom" } @@ -97,13 +97,13 @@ same-file = "1.0" tempfile = "3.27" # codecs + containers shared by the Craft apps (crates/media, crates/export); keep all in sync. -craft-media = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107", default-features = false, features = ["isobmff", "matroska"] } -craft-media-source = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } -craft-frame = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } -craft-color = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } -craft-time = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } -craft-audio = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107", default-features = false, features = ["aac-decode", "aac-encode", "alac-decode", "opus-decode", "opus-encode", "ac3-decode", "mp3-decode", "mpa-decode"] } -craft-video = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107", features = ["h264-decode", "h264-encode", "prores", "hevc-encode", "vp9-encode", "av1", "threads"] } +craft-media = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b", default-features = false, features = ["isobmff", "matroska"] } +craft-media-source = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } +craft-frame = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } +craft-color = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } +craft-time = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } +craft-audio = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b", default-features = false, features = ["aac-decode", "aac-encode", "alac-decode", "opus-decode", "opus-encode", "ac3-decode", "mp3-decode", "mpa-decode"] } +craft-video = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b", features = ["h264-decode", "h264-encode", "prores", "hevc-encode", "vp9-encode", "av1", "threads"] } # footage decoding: FilmCraft's pure-Rust crates, pinned to a revision (plan/adr/0001). # Only `crates/media`, `crates/export` and `crates/interchange` may depend on these. @@ -126,12 +126,12 @@ half = "2.7" # ui # Shared frontend components; keep this dependency above the engine boundary. # Shared UI and the complete egui family select reviewed immutable commits below. -craft-ui = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } -craft-behavior = { git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } -craft-host = { git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } -craft-keymap = { git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } -craft-theme = { git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } -craft-window = { git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } +craft-ui = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } +craft-behavior = { git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } +craft-host = { git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } +craft-keymap = { git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } +craft-theme = { git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } +craft-window = { git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } # `default_fonts` and `monochrome_emoji_fonts` are explicit: the app's `FontDefinitions::default()` # and its `✔`/`▣` chrome glyphs need both, and kittest's own dev-dependencies do not propagate. egui = { version = "0.37", default-features = false, features = ["default_fonts", "monochrome_emoji_fonts"] } @@ -236,19 +236,19 @@ lto = "thin" codegen-units = 1 [patch.crates-io] -hayro-syntax = { git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107", version = "=0.7.2" } -hayro-jbig2 = { git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107", version = "=0.3.0" } -ecolor = { git = "https://github.com/storytold/egui.git", rev = "f5025284445ea19c35f746d96fc0b75468b3f560" } -emath = { git = "https://github.com/storytold/egui.git", rev = "f5025284445ea19c35f746d96fc0b75468b3f560" } -epaint = { git = "https://github.com/storytold/egui.git", rev = "f5025284445ea19c35f746d96fc0b75468b3f560" } -epaint_default_fonts = { git = "https://github.com/storytold/egui.git", rev = "f5025284445ea19c35f746d96fc0b75468b3f560" } -egui = { git = "https://github.com/storytold/egui.git", rev = "f5025284445ea19c35f746d96fc0b75468b3f560" } -egui-winit = { git = "https://github.com/storytold/egui.git", rev = "f5025284445ea19c35f746d96fc0b75468b3f560" } -egui-wgpu = { git = "https://github.com/storytold/egui.git", rev = "f5025284445ea19c35f746d96fc0b75468b3f560" } -egui_glow = { git = "https://github.com/storytold/egui.git", rev = "f5025284445ea19c35f746d96fc0b75468b3f560" } -egui_extras = { git = "https://github.com/storytold/egui.git", rev = "f5025284445ea19c35f746d96fc0b75468b3f560" } -egui_kittest = { git = "https://github.com/storytold/egui.git", rev = "f5025284445ea19c35f746d96fc0b75468b3f560" } -eframe = { git = "https://github.com/storytold/egui.git", rev = "f5025284445ea19c35f746d96fc0b75468b3f560" } +hayro-syntax = { git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b", version = "=0.7.2" } +hayro-jbig2 = { git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b", version = "=0.3.0" } +ecolor = { git = "https://github.com/storytold/egui.git", rev = "a87d00caaec947ea781657c6ff410c9838016d18" } +emath = { git = "https://github.com/storytold/egui.git", rev = "a87d00caaec947ea781657c6ff410c9838016d18" } +epaint = { git = "https://github.com/storytold/egui.git", rev = "a87d00caaec947ea781657c6ff410c9838016d18" } +epaint_default_fonts = { git = "https://github.com/storytold/egui.git", rev = "a87d00caaec947ea781657c6ff410c9838016d18" } +egui = { git = "https://github.com/storytold/egui.git", rev = "a87d00caaec947ea781657c6ff410c9838016d18" } +egui-winit = { git = "https://github.com/storytold/egui.git", rev = "a87d00caaec947ea781657c6ff410c9838016d18" } +egui-wgpu = { git = "https://github.com/storytold/egui.git", rev = "a87d00caaec947ea781657c6ff410c9838016d18" } +egui_glow = { git = "https://github.com/storytold/egui.git", rev = "a87d00caaec947ea781657c6ff410c9838016d18" } +egui_extras = { git = "https://github.com/storytold/egui.git", rev = "a87d00caaec947ea781657c6ff410c9838016d18" } +egui_kittest = { git = "https://github.com/storytold/egui.git", rev = "a87d00caaec947ea781657c6ff410c9838016d18" } +eframe = { git = "https://github.com/storytold/egui.git", rev = "a87d00caaec947ea781657c6ff410c9838016d18" } # Patch a crate only together with the dependency that needs it: an unused patch makes the Nix # build, which uses vendored sources, fail (`cargo xtask lock-patches`). winit = { git = "https://github.com/storytold/winit.git", rev = "a517b3846ee8457d84ee4975110bfda6797c44dc" } diff --git a/crates/effects/Cargo.toml b/crates/effects/Cargo.toml index a36022fb9..e07fbe292 100644 --- a/crates/effects/Cargo.toml +++ b/crates/effects/Cargo.toml @@ -10,7 +10,7 @@ rust-version.workspace = true workspace = true [dependencies] -craft-cms = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "9fd8b0cdaad2b5320090f5a5892ba90fb8dab107" } +craft-cms = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } effectcraft-geom = { workspace = true } effectcraft-color = { workspace = true } effectcraft-keyframe = { workspace = true } diff --git a/crates/ui-egui/src/dock.rs b/crates/ui-egui/src/dock.rs index c9f7d7275..1addcd88c 100644 --- a/crates/ui-egui/src/dock.rs +++ b/crates/ui-egui/src/dock.rs @@ -499,32 +499,6 @@ pub fn referenced_panels(workspace: &Workspace) -> Vec { out } -/// The automation id of the gap below stacked panel `p`: `dock.gutter.s`, with the -/// stack's split path (`a`/`b` per level) and the entry's index. -pub fn stack_gutter_id(layout: &Layout, p: PanelKind) -> Option { - fn rec(node: &Node, p: PanelKind, path: &mut String, depth: usize) -> Option { - if depth > craft_behavior::dock::MAX_DEPTH { - return None; - } - match node { - Node::Split { first, second, .. } => { - path.push('a'); - if let Some(id) = rec(first, p, path, depth + 1) { - return Some(id); - } - path.pop(); - path.push('b'); - let found = rec(second, p, path, depth + 1); - path.pop(); - found - } - Node::Stack { entries, .. } => entries.iter().position(|e| e.panel == p).map(|i| format!("dock.gutter.{path}s{i}")), - _ => None, - } - } - rec(layout.root.as_ref()?, p, &mut String::new(), 0) -} - /// A panel lock button (Composition viewers and the Timeline keep their comp while locked, /// Effect Controls its layer): a closed padlock while locked, an open one while unlocked. /// Returns true when clicked. Automation: `panel.tab..lock`. diff --git a/crates/ui-egui/src/dock_ui.rs b/crates/ui-egui/src/dock_ui.rs index 4f7556728..45d59ffef 100644 --- a/crates/ui-egui/src/dock_ui.rs +++ b/crates/ui-egui/src/dock_ui.rs @@ -417,7 +417,7 @@ impl EffectcraftApp { }; let EffectPanels { locks, menu, bodies, ime, .. } = panels; self.live_dock.specs = specs; - let DockAreaOutput { actions, requested, events, focused, picked, error, float_space, windows, window_files, sources, .. } = output; + let DockAreaOutput { actions, requested, events, focused, pressed, picked, error, float_space, windows, window_files, sources, .. } = output; self.dock_rects = bodies; self.unpublished_viewports = ime.unpublished(); // A window that closed or docked takes its composition with it. @@ -431,10 +431,10 @@ impl EffectcraftApp { } self.forward_window_input(&ctx, &windows, window_files); self.live_dock.windows = windows; - // Key focus moving to a group, or a tab picked, focuses that panel. + // A press in a panel's body, a tab picked, or key focus moving to a group focuses that panel. let moved = focused != self.live_dock.focused; self.live_dock.focused = focused; - if let Some(panel) = picked.or(focused.filter(|_| moved)) { + if let Some(panel) = pressed.or(picked).or(focused.filter(|_| moved)) { self.focus_panel(&ctx, panel); } if let Some(error) = error { @@ -513,10 +513,10 @@ impl EffectcraftApp { } } - /// Automation ids for the dock's gesture sources: `panel.tab.`, `panel.drag.` - /// (the group's drag bar), `panel.float..move` and `.resize` (bottom-right corner) and - /// `.resize.` for floating window `n`, `dock.gutter.` (`a`/`b` per split level; a - /// stack's gap below entry `i` adds `s`), `dock.gutter.group.` under a dock + /// Automation ids for the dock's gesture sources: `panel.tab.`, `panel.tab..` + /// (the Timeline's comp tabs), `panel.drag.` (the group's drag bar), `panel.float..move` + /// and `.resize` (bottom-right corner) and `.resize.` for floating window `n`, + /// `dock.gutter.` (`a`/`b` per split level), `dock.gutter.group.` under a dock /// column's group and `dock.column.` at a dock column's inner edge. fn register_dock_hits(&mut self, sources: &[DockSource]) { let window = |panel: &PanelKind| self.ui.dock.layout().floating.iter().position(|window| window.contains(panel)); @@ -527,6 +527,10 @@ impl EffectcraftApp { for source in sources { let entry = match &source.kind { SourceKind::Tab(panel) => (format!("panel.tab.{}", panel.id()), title(panel)), + SourceKind::Document(panel, document) => { + let name = self.session.project.item(effectcraft_engine::project::ItemId(*document)).map_or_else(String::new, |item| item.name.clone()); + (format!("panel.tab.{}.{document}", panel.id()), name) + } SourceKind::GroupBar(panel) => (format!("panel.drag.{}", panel.id()), "Move panel group".into()), SourceKind::WindowGrip(panel) => match window(panel) { Some(index) => (format!("panel.float.{index}.move"), "Move floating panel".into()), @@ -538,10 +542,7 @@ impl EffectcraftApp { None => continue, }, SourceKind::Divider(DividerKind::Split(path)) => (format!("dock.gutter.{}", path_id(path)), "gutter".into()), - SourceKind::Divider(DividerKind::Groups(panel)) => { - let id = dock::stack_gutter_id(self.ui.dock.layout(), *panel).unwrap_or_else(|| format!("dock.gutter.group.{}", panel.id())); - (id, "gutter".into()) - } + SourceKind::Divider(DividerKind::Groups(panel)) => (format!("dock.gutter.group.{}", panel.id()), "gutter".into()), SourceKind::Divider(DividerKind::ColumnEdge(panel)) => (format!("dock.column.{}", panel.id()), "gutter".into()), _ => continue, }; diff --git a/crates/ui-egui/src/native_menu.rs b/crates/ui-egui/src/native_menu.rs index 5197481b3..440a3a4cd 100644 --- a/crates/ui-egui/src/native_menu.rs +++ b/crates/ui-egui/src/native_menu.rs @@ -479,8 +479,9 @@ fn text_field_event(command: &str) -> Option> { /// Hand a text field's Edit command to the window `window` whose field has the keyboard. The /// main window gets the clipboard text itself and the events through the synthetic queue; a -/// floating panel's OS window gets each key pressed and released through the window host, and -/// the clipboard text as typed text on Cmd+V. +/// floating panel's OS window gets each command as the key equivalent the platform's menu took +/// from it (Copy and Cut as egui's copy and cut events, the rest as the key's tap), and the +/// clipboard text as typed text on Cmd+V. fn send_to_text_field(app: &mut EffectcraftApp, ctx: &egui::Context, window: egui::ViewportId, events: Vec) { if window == egui::ViewportId::ROOT { for event in events { @@ -496,24 +497,26 @@ fn send_to_text_field(app: &mut EffectcraftApp, ctx: &egui::Context, window: egu ctx.request_repaint(); return; } - let host = craft_ui::runtime::windows::WindowHost::of(ctx); + use craft_ui::runtime::windows::{KeyEquivalent, WindowHost}; + let host = WindowHost::of(ctx); let platform = craft_keymap::egui::platform(ctx); for event in events { - let (key, modifiers) = match event { + let equivalent = match event { egui::Event::Key { key: egui::Key::V, .. } => { if let Some(text) = app.hooks.clipboard_text.as_ref().and_then(|f| f()) { host.inject_text(window, &text); } continue; } - egui::Event::Key { key, modifiers, .. } => (key, modifiers), - egui::Event::Copy => (egui::Key::C, egui::Modifiers::COMMAND), - egui::Event::Cut => (egui::Key::X, egui::Modifiers::COMMAND), + egui::Event::Key { key, modifiers, .. } => match craft_keymap::Key::from_egui(key) { + Some(key) => KeyEquivalent::Tap(craft_keymap::Chord::new(craft_keymap::Mods::from_egui(&modifiers, platform), key)), + None => continue, + }, + egui::Event::Copy => KeyEquivalent::Copy, + egui::Event::Cut => KeyEquivalent::Cut, _ => continue, }; - if let Some(key) = craft_keymap::Key::from_egui(key) { - host.inject_key(window, key, craft_keymap::Mods::from_egui(&modifiers, platform), false); - } + host.key_equivalent(window, equivalent); } } diff --git a/crates/ui-egui/tests/it/shared_docking_ui.rs b/crates/ui-egui/tests/it/shared_docking_ui.rs index 052d4f8a4..48d8c5e75 100644 --- a/crates/ui-egui/tests/it/shared_docking_ui.rs +++ b/crates/ui-egui/tests/it/shared_docking_ui.rs @@ -8,7 +8,6 @@ use effectcraft_ui_egui::{ }; use egui::{Event, Modifiers, PointerButton, Rect, pos2, vec2}; use egui_kittest::Harness; -use egui_kittest::kittest::{NodeT, Queryable}; use serde_json::json; fn invoke(app: &mut EffectcraftApp, id: &str, params: serde_json::Value) -> Result { @@ -134,8 +133,6 @@ fn pointer_drop_merges_floats_and_redocks_without_project_changes() { drag(&mut h, from, pos2(700.0, 400.0), Modifiers::COMMAND); assert_eq!(floating(h.state()).len(), 1); assert!(h.state().ui.dock.is_floating(PanelKind::Info)); - let grips: Vec<_> = h.query_all_by_label("Resize panel window").collect(); - assert!(!grips.is_empty() && grips.iter().all(|grip| grip.accesskit_node().role() == egui::accesskit::Role::Button)); // Its corner resizes it and its title bar moves it. let original = rect4(floating(h.state())[0].rect); let grip = rect(&h, "panel.float.0.resize").center(); @@ -322,30 +319,6 @@ fn catalog_close_keeps_dynamic_panel_identity_and_releases_viewers() { assert!(!app.ui.viewers.get(&42).is_some_and(Option::is_some), "the closed viewer forgets its comp"); } -#[test] -fn stacked_panels_resize_by_pointer_without_changing_closed_entries() { - let mut session = Session::default(); - session.execute("comp.new", json!({"width": 160, "height": 90, "duration": 1})).unwrap(); - let mut app = EffectcraftApp::new(session); - app.ui.start_screen = false; - let mut h = - Harness::builder().with_size(vec2(1000.0, 720.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| app); - h.run_steps(4); - h.state_mut().ui.dock = - dock::docked(dock::stack(&[(PanelKind::Preview, true, Some(100.0)), (PanelKind::Properties, true, None), (PanelKind::Align, false, Some(77.0))])); - h.run_steps(3); - let project = h.state().session.project.clone(); - let before = rect(&h, "panel.Preview").height(); - let from = rect(&h, "dock.gutter.s0").center(); - drag(&mut h, from, from + vec2(0.0, 16.0), Modifiers::NONE); - let after = rect(&h, "panel.Preview").height(); - assert!((after - before - 16.0).abs() < 2.0, "{before} -> {after}"); - let Some(Node::Stack { entries, .. }) = &h.state().ui.dock.layout().root else { panic!("stack lost") }; - assert!(entries[0].height.unwrap_or_default() > 100.0, "{entries:?}"); - assert_eq!((entries[2].panel, entries[2].open, entries[2].height), (PanelKind::Align, false, Some(77.0))); - assert!(std::sync::Arc::ptr_eq(&project, &h.state().session.project)); -} - #[test] fn failed_close_preserves_viewer_lifecycle_and_maximize_state() { let mut app = EffectcraftApp::new(Session::default()); diff --git a/crates/ui-egui/tests/it/ui_agent_audit.rs b/crates/ui-egui/tests/it/ui_agent_audit.rs index 477850e87..325cf1331 100644 --- a/crates/ui-egui/tests/it/ui_agent_audit.rs +++ b/crates/ui-egui/tests/it/ui_agent_audit.rs @@ -170,6 +170,13 @@ fn every_panel_registers_automation_ids_for_its_widgets() { for (r, l) in widgets { if !panels.iter().any(|p| p.contains(r.center())) && !covered(r, &elements) { gaps.push(format!("chrome: [{:.0},{:.0} {:.0}x{:.0}] {l:?}", r.min.x, r.min.y, r.width(), r.height())); + // DIAG: the accessibility nodes at the gap. + { + use egui_kittest::kittest::{By, NodeT, Queryable}; + for node in h.query_all(By::new().predicate(|_| true)).filter(|n| n.rect().contains(r.center()) && n.rect().width() < 200.0) { + eprintln!("DIAG gap node {:?} {:?} {:?}", node.accesskit_node().role(), node.accesskit_node().label(), node.rect()); + } + } } } assert!(gaps.is_empty(), "{} interactive widgets without an automation id:\n{}", gaps.len(), gaps.join("\n")); diff --git a/crates/ui-egui/tests/it/ui_fx_editors.rs b/crates/ui-egui/tests/it/ui_fx_editors.rs index 4fd9ffc59..af207a078 100644 --- a/crates/ui-egui/tests/it/ui_fx_editors.rs +++ b/crates/ui-egui/tests/it/ui_fx_editors.rs @@ -93,14 +93,20 @@ fn at(r: egui::Rect, fx: f32, fy: f32) -> Pos2 { pos2(r.min.x + r.width() * fx, r.min.y + r.height() * fy) } +/// `n` clicks at `p`, one press per step as the runtime takes them (each press is its step's last +/// pointer event): the releases are one step apart, within egui's double-click interval. fn click_n(h: &mut Harness<'_, EffectcraftApp>, p: Pos2, n: u32) { h.event(Event::PointerMoved(p)); h.step(); - // (all in one frame: the harness' frame time is longer than a double-click's) - for _ in 0..n { - h.event(Event::PointerButton { pos: p, button: egui::PointerButton::Primary, pressed: true, modifiers: Default::default() }); - h.event(Event::PointerButton { pos: p, button: egui::PointerButton::Primary, pressed: false, modifiers: Default::default() }); + let button = |pressed| Event::PointerButton { pos: p, button: egui::PointerButton::Primary, pressed, modifiers: Default::default() }; + for i in 0..n { + if i > 0 { + h.input_mut().events.push(button(false)); + } + h.input_mut().events.push(button(true)); + h.step(); } + h.input_mut().events.push(button(false)); h.step(); h.run_steps(2); } @@ -293,15 +299,21 @@ fn composition_tabs_and_scrolling_preview() { .with_context_setup(effectcraft_ui_egui::framework::install_headless) .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(4); - rect(&h, "panel.tab.Timeline.close"); + let shown = h.state().session.state.active_comp.unwrap(); + // The Timeline's tab for the shown comp, and its × by its accessible name. + rect(&h, &format!("panel.tab.Timeline.{}", shown.0)); + let close = { + use egui_kittest::kittest::Queryable; + let name = h.state().session.project.item(shown).unwrap().name.clone(); + h.get_by_label(&format!("Close {name}")).rect().center() + }; rect(&h, "preview.scroll"); click_id(&mut h, "panel.tab.Composition.lock"); assert!(h.state().ui.locked_tabs.contains("Composition")); click_id(&mut h, "panel.tab.Composition.lock"); assert!(h.state().ui.locked_tabs.is_empty()); // The Timeline's × closes its comp's tab (the panel stays, as in After Effects). - let shown = h.state().session.state.active_comp.unwrap(); - click_id(&mut h, "panel.tab.Timeline.close"); + click_n(&mut h, close, 1); assert!(!h.state().session.state.open_comps.contains(&shown)); assert!(h.state().ui.dock.is_docked(PanelKind::Timeline)); } diff --git a/crates/ui-egui/tests/it/ui_panel_windows.rs b/crates/ui-egui/tests/it/ui_panel_windows.rs index b4dee1600..12cebe53e 100644 --- a/crates/ui-egui/tests/it/ui_panel_windows.rs +++ b/crates/ui-egui/tests/it/ui_panel_windows.rs @@ -43,7 +43,7 @@ fn panel_window_command_moves_a_docked_panel_into_its_own_window_and_back() { } #[test] -fn a_click_on_a_floating_panel_does_nothing_while_a_dialog_is_open() { +fn a_drag_on_a_floating_panel_does_nothing_while_a_dialog_is_open() { use egui::{Event, Modifiers, PointerButton, vec2}; use egui_kittest::Harness; let mut app = EffectcraftApp::new(Session::default()); @@ -52,32 +52,37 @@ fn a_click_on_a_floating_panel_does_nothing_while_a_dialog_is_open() { let mut h = Harness::builder().with_size(vec2(1400.0, 900.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(move |_| app); h.run_steps(3); - // The floating window's ×, by its accessible name. - let close = |h: &Harness<'_, EffectcraftApp>| { - use egui_kittest::kittest::Queryable; - h.get_by_label("Close panel window").rect().center() + // The floating window's move grip: a drag moves it only while no dialog is up. + let grip = |h: &Harness<'_, EffectcraftApp>| { + let e = h.state().auto.find("panel.float.0.move").expect("the floating window's move grip"); + egui::pos2(e.rect[0] + e.rect[2] / 2.0, e.rect[1] + e.rect[3] / 2.0) }; - let click = |h: &mut Harness<'_, EffectcraftApp>, pos| { - h.event(Event::PointerMoved(pos)); + let drag = |h: &mut Harness<'_, EffectcraftApp>, from: egui::Pos2| { + let to = from + vec2(-30.0, 20.0); + h.event(Event::PointerMoved(from)); h.step(); - for pressed in [true, false] { - h.event(Event::PointerButton { pos, button: PointerButton::Primary, pressed, modifiers: Modifiers::NONE }); + h.event(Event::PointerButton { pos: from, button: PointerButton::Primary, pressed: true, modifiers: Modifiers::NONE }); + h.step(); + for k in 1..=5 { + h.event(Event::PointerMoved(from + (to - from) * (k as f32 / 5.0))); h.step(); } + h.event(Event::PointerButton { pos: to, button: PointerButton::Primary, pressed: false, modifiers: Modifiers::NONE }); + h.step(); h.run_steps(2); }; - let at = close(&h); + let at = grip(&h); let ctx = h.ctx.clone(); effectcraft_ui_egui::menus::invoke(h.state_mut(), &ctx, "app.settings", json!({"page": "general"})).unwrap(); h.run_steps(3); let before = h.state().ui.dock.clone(); - click(&mut h, at); - assert_eq!(h.state().ui.dock, before, "the floating panel takes no click while Settings is open"); - assert!(h.state().ui.dock.is_floating(PanelKind::Project)); - // The same click closes the window once the dialog is gone. + drag(&mut h, at); + assert_eq!(h.state().ui.dock, before, "the floating panel takes no drag while Settings is open"); + // The same drag moves the window once the dialog is gone. h.state_mut().dialog = None; h.run_steps(3); - let at = close(&h); - click(&mut h, at); - assert!(!h.state().ui.dock.is_open(PanelKind::Project)); + let at = grip(&h); + drag(&mut h, at); + assert_ne!(h.state().ui.dock, before, "the drag moved the floating window"); + assert!(h.state().ui.dock.is_floating(PanelKind::Project)); } diff --git a/crates/ui-egui/tests/it/ui_tabs.rs b/crates/ui-egui/tests/it/ui_tabs.rs index 0b8fd2fcd..5829ceb4f 100644 --- a/crates/ui-egui/tests/it/ui_tabs.rs +++ b/crates/ui-egui/tests/it/ui_tabs.rs @@ -36,19 +36,31 @@ fn rect(h: &Harness<'_, EffectcraftApp>, id: &str) -> egui::Rect { egui::Rect::from_min_size(pos2(e.rect[0], e.rect[1]), egui::vec2(e.rect[2], e.rect[3])) } +/// `n` clicks at `p`, one press per step as the runtime takes them (each press is its step's last +/// pointer event): the releases are one step apart, within egui's double-click interval. fn click_n(h: &mut Harness<'_, EffectcraftApp>, p: Pos2, n: u32) { h.event(Event::PointerMoved(p)); h.step(); - // All in one frame, straight into the input (the harness' event queue spreads presses over - // frames, longer apart than a double-click). - for _ in 0..n { - h.input_mut().events.push(Event::PointerButton { pos: p, button: egui::PointerButton::Primary, pressed: true, modifiers: Default::default() }); - h.input_mut().events.push(Event::PointerButton { pos: p, button: egui::PointerButton::Primary, pressed: false, modifiers: Default::default() }); + let button = |pressed| Event::PointerButton { pos: p, button: egui::PointerButton::Primary, pressed, modifiers: Default::default() }; + for i in 0..n { + if i > 0 { + h.input_mut().events.push(button(false)); + } + h.input_mut().events.push(button(true)); + h.step(); } + h.input_mut().events.push(button(false)); h.step(); h.run_steps(2); } +/// The rect of the accessibility node named `label`, such as a tab's close button ("Close Main") +/// or the tab strip's overflow button ("More tabs"). +fn named(h: &Harness<'_, EffectcraftApp>, label: &str) -> egui::Rect { + use egui_kittest::kittest::Queryable; + h.get_by_label(label).rect() +} + fn drag(h: &mut Harness<'_, EffectcraftApp>, from: Pos2, to: Pos2) { h.event(Event::PointerMoved(from)); h.step(); @@ -87,7 +99,7 @@ fn project_double_click_opens_a_comp_as_its_own_timeline_tab() { assert_eq!(h.state().session.state.active_comp, Some(ItemId(main))); assert_eq!(open_comps(&h), vec![main, pre]); // × closes the shown comp's Timeline only: the panel stays with Pre. - let close = rect(&h, "panel.tab.Timeline.close"); + let close = named(&h, "Close Main"); click_n(&mut h, close.center(), 1); assert_eq!(open_comps(&h), vec![pre]); assert_eq!(h.state().session.state.active_comp, Some(ItemId(pre))); @@ -222,20 +234,20 @@ fn preview_divider(h: &Harness<'_, EffectcraftApp>) -> egui::Rect { .expect("a gutter between Preview and Properties") } -/// Default's right column: a short Preview frame (46 points of body) and the Properties frame +/// Default's right column: a short Preview frame (48 points of body under next's 28-point strip) and the Properties frame /// below it taking the rest of the column, at any window height. #[test] fn the_default_preview_frame_is_short_and_properties_takes_the_rest() { let (mut h, _, _) = harness(); let body = |h: &Harness<'_, EffectcraftApp>| rect(h, "panel.Preview").height(); - assert!((body(&h) - 46.0).abs() < 1.5, "Preview {}", body(&h)); + assert!((body(&h) - 48.0).abs() < 1.5, "Preview {}", body(&h)); let props = rect(&h, "panel.Properties"); assert!(props.height() > 300.0, "Properties {props:?}"); // A taller window gives the room to Properties. let size = h.ctx.content_rect().size(); h.set_size(size + egui::vec2(0.0, 200.0)); h.run_steps(3); - assert!((body(&h) - 46.0).abs() < 1.5, "Preview {}", body(&h)); + assert!((body(&h) - 48.0).abs() < 1.5, "Preview {}", body(&h)); assert!((rect(&h, "panel.Properties").height() - props.height() - 200.0).abs() < 2.0); } @@ -376,10 +388,10 @@ fn dragging_the_viewer_timeline_divider_far_up_does_not_crash() { h.run_steps(2); } -/// Issue #301: a stacked panel's header bar opens it with a click anywhere on it, and its −/+ -/// button at the bar's right end collapses and expands it. +/// Issue #301: a stacked panel's header bar collapses and expands it (next: a double click on +/// the section's bar). #[test] -fn a_stacked_panels_whole_header_bar_toggles_it() { +fn a_double_click_on_a_stacked_panels_bar_toggles_it() { let (mut h, _, _) = harness(); use effectcraft_ui_egui::dock; let stack = dock::stack(&[(PanelKind::Preview, true, Some(46.0)), (PanelKind::Properties, true, None)]); @@ -387,19 +399,12 @@ fn a_stacked_panels_whole_header_bar_toggles_it() { h.run_steps(3); let open = |h: &Harness<'_, EffectcraftApp>| h.state().ui.dock.is_visible(PanelKind::Preview); assert!(open(&h)); - let toggle = rect(&h, "panel.header.Preview"); - let bar = rect(&h, "panel.tab.Preview"); - assert!(toggle.max.x <= bar.max.x + 1.0 && toggle.min.x > bar.center().x, "{toggle:?} {bar:?}"); - click_n(&mut h, toggle.center(), 1); - assert!(!open(&h), "the button collapses Preview"); - let toggle = rect(&h, "panel.header.Preview"); - click_n(&mut h, toggle.center(), 1); + let bar = rect(&h, "panel.drag.Preview"); + click_n(&mut h, bar.center(), 2); + assert!(!open(&h), "a double click collapses Preview"); + let bar = rect(&h, "panel.drag.Preview"); + click_n(&mut h, bar.center(), 2); assert!(open(&h), "and expands it again"); - let toggle = rect(&h, "panel.header.Preview"); - click_n(&mut h, toggle.center(), 1); - assert!(!open(&h)); - click_n(&mut h, pos2(bar.min.x + bar.width() * 0.25, bar.center().y), 1); - assert!(open(&h), "a click on the bar away from the button opens it"); } /// #302: a panel dropped onto the Properties frame becomes a tab in that frame; its tabs switch @@ -415,6 +420,10 @@ fn a_tab_dropped_on_a_frame_joins_it() { assert!(group.starts_with(&[PanelKind::Properties]) && group.contains(&PanelKind::EffectControls), "{group:?}"); assert!(dock(&h).is_visible(PanelKind::EffectControls) && !dock(&h).is_visible(PanelKind::Properties)); assert!(dock(&h).is_visible(PanelKind::Preview)); + // DIAG: the right column's chrome after the drop. + for e in h.state().auto.elements.iter().filter(|e| e.id.starts_with("panel.tab") || e.id.starts_with("panel.drag") || e.id.starts_with("panel.menu")) { + eprintln!("DIAG {} {:?}", e.id, e.rect); + } // The frame's other tab shows Properties again, the frame stays open. let tab = rect(&h, "panel.tab.Properties"); click_n(&mut h, tab.center(), 1); @@ -444,16 +453,15 @@ fn open_comps_are_tabs_in_the_timeline_row_and_the_rest_are_in_its_overflow_menu s.state.open_comps = vec![ItemId(comps[0])]; s.state.active_comp = Some(ItemId(comps[0])); let mut h = Harness::builder() - .with_size(egui::vec2(1000.0, 800.0)) + .with_size(egui::vec2(700.0, 800.0)) .with_context_setup(effectcraft_ui_egui::framework::install_headless) .build_eframe(|_| EffectcraftApp::new(s)); h.run_steps(3); - let alone = rect(&h, "panel.tab.RenderQueue"); h.state_mut().session.state.open_comps = comps.iter().map(|c| ItemId(*c)).collect(); h.run_steps(3); - // The panel tabs keep their width; the comp tabs follow them in the same row, in order. + // The comp tabs follow the panel tabs in the same row, in order (tabs that do not fit clip to + // their first letters). let (tl, rq) = (rect(&h, "panel.tab.Timeline"), rect(&h, "panel.tab.RenderQueue")); - assert!((rq.width() - alone.width()).abs() < 0.5, "Render Queue {rq:?} was {alone:?}"); let shown: Vec = comps.iter().copied().filter(|c| has(&h, &format!("panel.tab.Timeline.{c}"))).collect(); assert!(shown.contains(&comps[0]) && shown.len() < comps.len(), "{shown:?}"); let mut x = rq.max.x; @@ -464,35 +472,29 @@ fn open_comps_are_tabs_in_the_timeline_row_and_the_rest_are_in_its_overflow_menu } // A comp with no room is in the » menu; picking it shows it, and its tab joins the row. let hidden = comps.iter().copied().find(|c| !shown.contains(c)).unwrap(); - let more = rect(&h, "panel.tab.Timeline.more"); + let more = named(&h, "More tabs"); assert!(more.min.x >= x - 0.5 && tl.y_range().contains(more.center().y), "{more:?}"); click_n(&mut h, more.center(), 1); - let item = rect(&h, &format!("panel.tab.Timeline.more.{hidden}")); + let name = names[comps.iter().position(|c| *c == hidden).unwrap()]; + let item = { + use egui_kittest::kittest::{NodeT, Queryable}; + h.query_all_by_label(name).find(|node| node.accesskit_node().role() == egui::accesskit::Role::MenuItem).expect("the comp in the overflow menu").rect() + }; click_n(&mut h, item.center(), 1); assert_eq!(h.state().session.state.active_comp, Some(ItemId(hidden))); assert_eq!(open_comps(&h), comps); assert!(has(&h, &format!("panel.tab.Timeline.{hidden}"))); } -/// Whether `id` was registered in the last frame (not the one before). -fn drawn(h: &Harness<'_, EffectcraftApp>, id: &str) -> bool { - h.state().auto.elements.iter().any(|e| e.id == id) -} - #[test] fn an_inactive_comp_tab_shows_its_close_button_on_hover_and_closes_without_showing_its_comp() { let (mut h, pre, main) = harness(); h.state_mut().session.state.open_comps = vec![ItemId(main), ItemId(pre)]; h.run_steps(3); let (tm, tp) = (rect(&h, &format!("panel.tab.Timeline.{main}")), rect(&h, &format!("panel.tab.Timeline.{pre}"))); - // The shown comp's × is always there; Pre's only while the pointer is over its tab. - h.event(Event::PointerMoved(pos2(800.0, 900.0))); - h.run_steps(2); - assert!(drawn(&h, "panel.tab.Timeline.close") && drawn(&h, &format!("panel.tab.Timeline.{main}.close"))); - assert!(!drawn(&h, &format!("panel.tab.Timeline.{pre}.close")), "no × on an inactive tab the pointer is not over"); h.event(Event::PointerMoved(tp.center())); h.run_steps(2); - let close = rect(&h, &format!("panel.tab.Timeline.{pre}.close")); + let close = named(&h, "Close Pre"); assert!(tp.contains_rect(close), "{close:?} inside {tp:?}"); // Every comp tab keeps the ×'s room: hovering changes no width. assert_eq!((rect(&h, &format!("panel.tab.Timeline.{main}")), rect(&h, &format!("panel.tab.Timeline.{pre}"))), (tm, tp)); diff --git a/docs/control-protocol.md b/docs/control-protocol.md index dc54b05a1..1505e268b 100644 --- a/docs/control-protocol.md +++ b/docs/control-protocol.md @@ -261,12 +261,13 @@ windows stay in the main window. Keys pressed in a floating window that none of run the main window's shortcuts, and files dropped on one import as on the main window. While a modal dialog is open, floating windows take no input. -The automation ids of the docking chrome are `panel.tab.`, `panel.drag.` (a -group's drag bar), `panel.menu.` (≡), `panel.tab..lock` (viewer lock), -`panel.float..move`, `.resize` and `.resize.` for floating window `n`, and -`dock.gutter.` for dividers (`a`/`b` per split level; a stack's gap below entry `i` adds -`s`). The other parts (the Timeline's comp tabs, a floating window's close button, the tab -overflow menu) are found by their accessible names. +The automation ids of the docking chrome are `panel.tab.`, `panel.tab.Timeline.` +(the Timeline's comp tabs), `panel.drag.` (a group's drag bar), `panel.menu.` (≡), +`panel.tab..lock` (viewer lock), `panel.float..move`, `.resize` and `.resize.` +for floating window `n`, `dock.gutter.` for split dividers (`a`/`b` per split level), +`dock.gutter.group.` below a dock column's group and `dock.column.` at a dock +column's inner edge. The other parts (a tab's close button, "Close ", and the tab +overflow button, "More tabs") are found by their accessible names. Saved workspaces (`workspaces.json`, version 2) hold craft-ui `Workspace`s: the layout, the closed panels with where each goes back, the lock, and each floating window's desktop place. A From 80d5e41d6db97be986528f3d49c91de49a93a05d Mon Sep 17 00:00:00 2001 From: aiongg Date: Tue, 24 Nov 2026 21:21:51 +0000 Subject: [PATCH 423/451] Tests send one press per step as next's runtime takes them; tab overflow cases follow next's clipping --- crates/ui-egui/tests/it/ui_agent_audit.rs | 6 +++- crates/ui-egui/tests/it/ui_inline_edit.rs | 11 +++++-- crates/ui-egui/tests/it/ui_panel_focus.rs | 8 +++-- crates/ui-egui/tests/it/ui_panels.rs | 5 +++ crates/ui-egui/tests/it/ui_tabs.rs | 37 +++++++++++++++-------- crates/ui-egui/tests/it/ui_tail.rs | 2 ++ crates/ui-egui/tests/it/ui_viewer.rs | 4 +++ crates/ui-egui/tests/it/ui_viewers.rs | 6 +++- 8 files changed, 60 insertions(+), 19 deletions(-) diff --git a/crates/ui-egui/tests/it/ui_agent_audit.rs b/crates/ui-egui/tests/it/ui_agent_audit.rs index 325cf1331..56b887bca 100644 --- a/crates/ui-egui/tests/it/ui_agent_audit.rs +++ b/crates/ui-egui/tests/it/ui_agent_audit.rs @@ -173,7 +173,11 @@ fn every_panel_registers_automation_ids_for_its_widgets() { // DIAG: the accessibility nodes at the gap. { use egui_kittest::kittest::{By, NodeT, Queryable}; - for node in h.query_all(By::new().predicate(|_| true)).filter(|n| n.rect().contains(r.center()) && n.rect().width() < 200.0) { + for node in h + .query_all(By::new().predicate(|_| true)) + .filter(|n| n.accesskit_node().bounding_box().is_some()) + .filter(|n| n.rect().contains(r.center()) && n.rect().width() < 200.0) + { eprintln!("DIAG gap node {:?} {:?} {:?}", node.accesskit_node().role(), node.accesskit_node().label(), node.rect()); } } diff --git a/crates/ui-egui/tests/it/ui_inline_edit.rs b/crates/ui-egui/tests/it/ui_inline_edit.rs index eef6b3687..4c3e3b27c 100644 --- a/crates/ui-egui/tests/it/ui_inline_edit.rs +++ b/crates/ui-egui/tests/it/ui_inline_edit.rs @@ -31,10 +31,13 @@ fn center(h: &Harness<'_, EffectcraftApp>, id: &str) -> Pos2 { fn click(h: &mut Harness<'_, EffectcraftApp>, p: Pos2, times: usize) { h.input_mut().events.push(Event::PointerMoved(p)); h.step(); - // All in one frame (the harness' frames are longer apart than a double-click). + // One press per step, as the runtime takes them: the releases are one step (0.25 s) apart, + // within egui's double-click interval (0.3 s). + let button = |pressed| Event::PointerButton { pos: p, button: PointerButton::Primary, pressed, modifiers: Modifiers::NONE }; for _ in 0..times { - h.input_mut().events.push(Event::PointerButton { pos: p, button: PointerButton::Primary, pressed: true, modifiers: Modifiers::NONE }); - h.input_mut().events.push(Event::PointerButton { pos: p, button: PointerButton::Primary, pressed: false, modifiers: Modifiers::NONE }); + h.input_mut().events.push(button(true)); + h.step(); + h.input_mut().events.push(button(false)); } h.run_steps(3); } @@ -501,7 +504,9 @@ fn click_with(h: &mut Harness<'_, EffectcraftApp>, p: Pos2, modifiers: Modifiers h.input_mut().events.push(Event::PointerMoved(p)); h.input_mut().events.push(Event::ModifiersChanged(modifiers)); h.step(); + // One press per step: the release comes a step later, still with the modifiers held. h.input_mut().events.push(Event::PointerButton { pos: p, button: PointerButton::Primary, pressed: true, modifiers }); + h.step(); h.input_mut().events.push(Event::PointerButton { pos: p, button: PointerButton::Primary, pressed: false, modifiers }); h.step(); h.input_mut().events.push(Event::ModifiersChanged(Modifiers::NONE)); diff --git a/crates/ui-egui/tests/it/ui_panel_focus.rs b/crates/ui-egui/tests/it/ui_panel_focus.rs index 81a43d0c9..ce054d84a 100644 --- a/crates/ui-egui/tests/it/ui_panel_focus.rs +++ b/crates/ui-egui/tests/it/ui_panel_focus.rs @@ -38,9 +38,13 @@ fn rect(h: &Harness<'_, EffectcraftApp>, id: &str) -> egui::Rect { fn click_n(h: &mut Harness<'_, EffectcraftApp>, p: Pos2, n: u32) { h.event(Event::PointerMoved(p)); h.step(); + // One press per step, as the runtime takes them: the releases are one step (0.25 s) apart, + // within egui's double-click interval (0.3 s). + let button = |pressed| Event::PointerButton { pos: p, button: egui::PointerButton::Primary, pressed, modifiers: Default::default() }; for _ in 0..n { - h.input_mut().events.push(Event::PointerButton { pos: p, button: egui::PointerButton::Primary, pressed: true, modifiers: Default::default() }); - h.input_mut().events.push(Event::PointerButton { pos: p, button: egui::PointerButton::Primary, pressed: false, modifiers: Default::default() }); + h.input_mut().events.push(button(true)); + h.step(); + h.input_mut().events.push(button(false)); } h.step(); h.run_steps(2); diff --git a/crates/ui-egui/tests/it/ui_panels.rs b/crates/ui-egui/tests/it/ui_panels.rs index c265e2ab7..48456a5d8 100644 --- a/crates/ui-egui/tests/it/ui_panels.rs +++ b/crates/ui-egui/tests/it/ui_panels.rs @@ -151,8 +151,13 @@ fn click_at(h: &mut Harness<'_, EffectcraftApp>, p: Pos2) { fn double_click_at(h: &mut Harness<'_, EffectcraftApp>, pos: Pos2) { h.input_mut().events.push(Event::PointerMoved(pos)); h.step(); + // One press per step, as the runtime takes them: the releases are one step (0.25 s) apart, + // within egui's double-click interval (0.3 s). for pressed in [true, false, true, false] { h.input_mut().events.push(Event::PointerButton { pos, button: egui::PointerButton::Primary, pressed, modifiers: Default::default() }); + if pressed { + h.step(); + } } h.run_steps(3); } diff --git a/crates/ui-egui/tests/it/ui_tabs.rs b/crates/ui-egui/tests/it/ui_tabs.rs index 5829ceb4f..6914f3be2 100644 --- a/crates/ui-egui/tests/it/ui_tabs.rs +++ b/crates/ui-egui/tests/it/ui_tabs.rs @@ -420,13 +420,23 @@ fn a_tab_dropped_on_a_frame_joins_it() { assert!(group.starts_with(&[PanelKind::Properties]) && group.contains(&PanelKind::EffectControls), "{group:?}"); assert!(dock(&h).is_visible(PanelKind::EffectControls) && !dock(&h).is_visible(PanelKind::Properties)); assert!(dock(&h).is_visible(PanelKind::Preview)); - // DIAG: the right column's chrome after the drop. - for e in h.state().auto.elements.iter().filter(|e| e.id.starts_with("panel.tab") || e.id.starts_with("panel.drag") || e.id.starts_with("panel.menu")) { - eprintln!("DIAG {} {:?}", e.id, e.rect); + // The frame's other tab shows Properties again, the frame stays open. The right column is + // narrow: the active tab keeps its whole title and a tab with no room for its first letters + // is in the » menu. + if has(&h, "panel.tab.Properties") { + let tab = rect(&h, "panel.tab.Properties"); + click_n(&mut h, tab.center(), 1); + } else { + use egui_kittest::kittest::{NodeT, Queryable}; + let more = h.query_all_by_label("More tabs").map(|node| node.rect()).find(|r| props.x_range().contains(r.center().x)).expect("the frame's » menu"); + click_n(&mut h, more.center(), 1); + let item = h + .query_all_by_label("Properties") + .find(|node| node.accesskit_node().role() == egui::accesskit::Role::MenuItem) + .expect("Properties in the » menu") + .rect(); + click_n(&mut h, item.center(), 1); } - // The frame's other tab shows Properties again, the frame stays open. - let tab = rect(&h, "panel.tab.Properties"); - click_n(&mut h, tab.center(), 1); assert!(dock(&h).is_visible(PanelKind::Properties) && !dock(&h).is_visible(PanelKind::EffectControls)); // The layout (saved workspaces) round-trips. let s = serde_json::to_string(&dock(&h)).unwrap(); @@ -459,12 +469,12 @@ fn open_comps_are_tabs_in_the_timeline_row_and_the_rest_are_in_its_overflow_menu h.run_steps(3); h.state_mut().session.state.open_comps = comps.iter().map(|c| ItemId(*c)).collect(); h.run_steps(3); - // The comp tabs follow the panel tabs in the same row, in order (tabs that do not fit clip to - // their first letters). - let (tl, rq) = (rect(&h, "panel.tab.Timeline"), rect(&h, "panel.tab.RenderQueue")); + // The comp tabs follow the Timeline's tab in the same row, in order (tabs that do not fit clip + // to their first letters; a panel tab with no room for them is in the » menu too). + let tl = rect(&h, "panel.tab.Timeline"); let shown: Vec = comps.iter().copied().filter(|c| has(&h, &format!("panel.tab.Timeline.{c}"))).collect(); assert!(shown.contains(&comps[0]) && shown.len() < comps.len(), "{shown:?}"); - let mut x = rq.max.x; + let mut x = tl.max.x; for c in &shown { let tab = rect(&h, &format!("panel.tab.Timeline.{c}")); assert!(tl.y_range().contains(tab.center().y) && tab.min.x >= x - 0.5, "comp {c} at {tab:?} after x {x}"); @@ -472,8 +482,11 @@ fn open_comps_are_tabs_in_the_timeline_row_and_the_rest_are_in_its_overflow_menu } // A comp with no room is in the » menu; picking it shows it, and its tab joins the row. let hidden = comps.iter().copied().find(|c| !shown.contains(c)).unwrap(); - let more = named(&h, "More tabs"); - assert!(more.min.x >= x - 0.5 && tl.y_range().contains(more.center().y), "{more:?}"); + let more = { + use egui_kittest::kittest::{NodeT, Queryable}; + h.query_all_by_label("More tabs").map(|node| node.rect()).find(|r| tl.y_range().contains(r.center().y)).expect("the Timeline row's » menu") + }; + assert!(more.min.x >= x - 0.5, "{more:?}"); click_n(&mut h, more.center(), 1); let name = names[comps.iter().position(|c| *c == hidden).unwrap()]; let item = { diff --git a/crates/ui-egui/tests/it/ui_tail.rs b/crates/ui-egui/tests/it/ui_tail.rs index 5f429936a..54b4b4473 100644 --- a/crates/ui-egui/tests/it/ui_tail.rs +++ b/crates/ui-egui/tests/it/ui_tail.rs @@ -365,8 +365,10 @@ fn project_name_column_edge_resizes_and_fits_again() { let edge = rect(&h, "project.nameColumn.edge").center(); assert!((edge.x - (before.x + 80.0)).abs() < 2.0, "{edge:?} after dragging from {before:?}"); h.input_mut().events.push(Event::PointerMoved(edge)); + // A double-click, one press per step as the runtime takes them. for _ in 0..2 { h.input_mut().events.push(Event::PointerButton { pos: edge, button: egui::PointerButton::Primary, pressed: true, modifiers: Default::default() }); + h.step(); h.input_mut().events.push(Event::PointerButton { pos: edge, button: egui::PointerButton::Primary, pressed: false, modifiers: Default::default() }); } h.run_steps(3); diff --git a/crates/ui-egui/tests/it/ui_viewer.rs b/crates/ui-egui/tests/it/ui_viewer.rs index e6c53fee9..fa896812d 100644 --- a/crates/ui-egui/tests/it/ui_viewer.rs +++ b/crates/ui-egui/tests/it/ui_viewer.rs @@ -1346,8 +1346,12 @@ fn pen_mask_undoes_step_by_step_and_double_click_moves_the_whole_mask() { let at = screen(&h, [100.0, 300.0]); h.input_mut().events.push(Event::PointerMoved(at)); h.step(); + // One press per step, as the runtime takes them. for pressed in [true, false, true, false] { h.input_mut().events.push(Event::PointerButton { pos: at, button: egui::PointerButton::Primary, pressed, modifiers: Default::default() }); + if pressed { + h.step(); + } } h.run_steps(3); assert_eq!(h.state().session.state.selected_vertices.len(), 4); diff --git a/crates/ui-egui/tests/it/ui_viewers.rs b/crates/ui-egui/tests/it/ui_viewers.rs index 038b0884e..ff3dcedfd 100644 --- a/crates/ui-egui/tests/it/ui_viewers.rs +++ b/crates/ui-egui/tests/it/ui_viewers.rs @@ -42,11 +42,15 @@ fn click(h: &mut Harness<'_, EffectcraftApp>, id: &str) { h.run_steps(3); } -/// Double-click element `id` (in one frame: the harness' frame time is longer than a double-click's). +/// Double-click element `id`, one press per step as the runtime takes them: the releases are one +/// step (0.25 s) apart, within egui's double-click interval (0.3 s). fn double_click(h: &mut Harness<'_, EffectcraftApp>, id: &str) { let p = hover(h, id); for pressed in [true, false, true, false] { button(h, p, pressed); + if pressed { + h.step(); + } } h.run_steps(3); } From 9ab46951287f8433029056d4a4a1f3e1aae5cdd5 Mon Sep 17 00:00:00 2001 From: aiongg Date: Tue, 24 Nov 2026 21:39:57 +0000 Subject: [PATCH 424/451] Same-pass tests in next's pass order, marker bin drops at its release position, window Enter left to egui's input, overflow menu found by tab title --- crates/ui-egui/src/framework.rs | 23 +++++----- crates/ui-egui/src/panels/markers_ui.rs | 11 ++++- crates/ui-egui/tests/it/ui_agent_audit.rs | 11 ----- crates/ui-egui/tests/it/ui_crypto_pick.rs | 8 ++-- crates/ui-egui/tests/it/ui_tabs.rs | 8 +++- crates/ui-egui/tests/it/ui_text_edit.rs | 56 ++++++++++++----------- crates/ui-egui/tests/it/ui_viewer.rs | 4 +- 7 files changed, 64 insertions(+), 57 deletions(-) diff --git a/crates/ui-egui/src/framework.rs b/crates/ui-egui/src/framework.rs index fc2976792..41e371bbf 100644 --- a/crates/ui-egui/src/framework.rs +++ b/crates/ui-egui/src/framework.rs @@ -5,8 +5,8 @@ //! EffectCraft's own UI. //! //! The runtime takes Escape, Tab and the clipboard events for the whole window unless one of EffectCraft's own egui -//! widgets has the keyboard. [`return_window_keys`] puts the window's Escape and plain Enter back into egui's input -//! for EffectCraft's own handlers; the Composition viewer is declared to the runtime with [`host_canvas`], which keeps +//! widgets has the keyboard. [`return_window_keys`] puts the window's Escape back into egui's input for EffectCraft's +//! own handlers (the window's plain Enter stays in egui's input); the Composition viewer is declared to the runtime with [`host_canvas`], which keeps //! Tab, the edit chords and the clipboard events in egui's input for EffectCraft's shortcuts. use std::sync::{Arc, OnceLock}; @@ -123,17 +123,16 @@ pub(crate) fn host_canvas(ctx: &egui::Context, id: egui::Id) { craft_ui::runtime::focus::host_canvas(ctx, id, KEYS); } -/// Puts the window's Escape and plain Enter (the keys the runtime routes to no component while nothing has framework -/// focus) back into egui's input as key presses, first in the pass, so EffectCraft's dialogs, popups, tools and -/// shortcuts read them from egui as they read every other key. +/// Puts the window's Escape (the key the runtime routes to no component while nothing has framework focus) back into +/// egui's input as a key press, first in the pass, so EffectCraft's dialogs, popups, tools and shortcuts read it from +/// egui as they read every other key. The window's plain Enter is its Submit and also stays in egui's input, where +/// EffectCraft reads it. pub(crate) fn return_window_keys(ctx: &egui::Context) { - for (key, intent) in [(egui::Key::Escape, Intent::Cancel), (egui::Key::Enter, Intent::Submit)] { - if take_window_intent(ctx, intent) { - ctx.input_mut(|i| { - let modifiers = i.modifiers; - i.events.insert(0, egui::Event::Key { key, physical_key: Some(key), pressed: true, repeat: false, modifiers }); - }); - } + if take_window_intent(ctx, Intent::Cancel) { + ctx.input_mut(|i| { + let modifiers = i.modifiers; + i.events.insert(0, egui::Event::Key { key: egui::Key::Escape, physical_key: Some(egui::Key::Escape), pressed: true, repeat: false, modifiers }); + }); } } diff --git a/crates/ui-egui/src/panels/markers_ui.rs b/crates/ui-egui/src/panels/markers_ui.rs index 88f692964..d4d8bb205 100644 --- a/crates/ui-egui/src/panels/markers_ui.rs +++ b/crates/ui-egui/src/panels/markers_ui.rs @@ -446,7 +446,16 @@ pub(crate) fn marker_bin(app: &mut EffectcraftApp, ui: &mut egui::Ui, comp: &Com ui.ctx().set_cursor_icon(if resp.dragged() { egui::CursorIcon::Grabbing } else { egui::CursorIcon::Grab }); } icons::paint(ui.painter(), bin, Icon::MarkerBin, if hot { t.icon_active } else { t.icon }); - let at = resp.interact_pointer_pos().filter(|p| p.x >= strip.min.x && p.x < strip.max.x).map(|p| { + // A drag ends where its button came up: a later press in the same pass (one press per pass + // follows a release) has moved the pointer on. + let released_at = ui.input(|i| { + i.events.iter().find_map(|e| match e { + egui::Event::PointerButton { button: egui::PointerButton::Primary, pressed: false, pos, .. } => Some(*pos), + _ => None, + }) + }); + let pointer = if resp.drag_stopped() { released_at.or(resp.interact_pointer_pos()) } else { resp.interact_pointer_pos() }; + let at = pointer.filter(|p| p.x >= strip.min.x && p.x < strip.max.x).map(|p| { let snapped = snap(app, comp, tm, tm.t(p.x), MarkerRef { layer: None, index: usize::MAX }); snapped.min(comp.duration.seconds()) }); diff --git a/crates/ui-egui/tests/it/ui_agent_audit.rs b/crates/ui-egui/tests/it/ui_agent_audit.rs index 56b887bca..477850e87 100644 --- a/crates/ui-egui/tests/it/ui_agent_audit.rs +++ b/crates/ui-egui/tests/it/ui_agent_audit.rs @@ -170,17 +170,6 @@ fn every_panel_registers_automation_ids_for_its_widgets() { for (r, l) in widgets { if !panels.iter().any(|p| p.contains(r.center())) && !covered(r, &elements) { gaps.push(format!("chrome: [{:.0},{:.0} {:.0}x{:.0}] {l:?}", r.min.x, r.min.y, r.width(), r.height())); - // DIAG: the accessibility nodes at the gap. - { - use egui_kittest::kittest::{By, NodeT, Queryable}; - for node in h - .query_all(By::new().predicate(|_| true)) - .filter(|n| n.accesskit_node().bounding_box().is_some()) - .filter(|n| n.rect().contains(r.center()) && n.rect().width() < 200.0) - { - eprintln!("DIAG gap node {:?} {:?} {:?}", node.accesskit_node().role(), node.accesskit_node().label(), node.rect()); - } - } } } assert!(gaps.is_empty(), "{} interactive widgets without an automation id:\n{}", gaps.len(), gaps.join("\n")); diff --git a/crates/ui-egui/tests/it/ui_crypto_pick.rs b/crates/ui-egui/tests/it/ui_crypto_pick.rs index 2ed3c5f31..0cf715df1 100644 --- a/crates/ui-egui/tests/it/ui_crypto_pick.rs +++ b/crates/ui-egui/tests/it/ui_crypto_pick.rs @@ -1933,10 +1933,11 @@ fn the_same_status_set_again_while_shown_gets_its_own_5_s() { let _ = std::fs::remove_dir_all(&ids.dir); } -/// A press, a PageDown and the release in one slow pass: the click is the frame on screen at the -/// press, so it is dropped and says so, not made on the next frame (Windows round 6, R-i pd8). +/// A press, then a PageDown and the release in one slow pass (the runtime takes the press in its +/// own pass): the click is the frame on screen at the press, so it is dropped and says so, not +/// made on the next frame (Windows round 6, R-i pd8). #[test] -fn a_frame_step_between_press_and_release_in_one_pass_drops_the_click() { +fn a_frame_step_between_press_and_release_drops_the_click() { let (mut h, ids, a, _) = ready_at_two_ids("key-one-pass"); let key = |pressed| Event::Key { key: egui::Key::PageDown, physical_key: None, pressed, repeat: false, modifiers: Modifiers::NONE }; let ev = &mut h.input_mut().events; @@ -1945,6 +1946,7 @@ fn a_frame_step_between_press_and_release_in_one_pass_drops_the_click() { ev.push(key(false)); ev.push(Event::PointerButton { pos: a, button: PointerButton::Primary, pressed: false, modifiers: Modifiers::NONE }); h.step(); + h.step(); assert!(h.state().session.time().seconds() > 0.0, "the PageDown stepped"); assert!(h.state().ui.status.starts_with("Pick not made"), "{:?}", h.state().ui.status); for _ in 0..40 { diff --git a/crates/ui-egui/tests/it/ui_tabs.rs b/crates/ui-egui/tests/it/ui_tabs.rs index 6914f3be2..7057d126a 100644 --- a/crates/ui-egui/tests/it/ui_tabs.rs +++ b/crates/ui-egui/tests/it/ui_tabs.rs @@ -430,9 +430,13 @@ fn a_tab_dropped_on_a_frame_joins_it() { use egui_kittest::kittest::{NodeT, Queryable}; let more = h.query_all_by_label("More tabs").map(|node| node.rect()).find(|r| props.x_range().contains(r.center().x)).expect("the frame's » menu"); click_n(&mut h, more.center(), 1); + // The menu names a panel by its tab title ("Properties: "). let item = h - .query_all_by_label("Properties") - .find(|node| node.accesskit_node().role() == egui::accesskit::Role::MenuItem) + .query_all(egui_kittest::kittest::By::new().predicate(|_| true)) + .find(|node| { + let n = node.accesskit_node(); + n.role() == egui::accesskit::Role::MenuItem && n.label().is_some_and(|l| l.starts_with("Properties")) + }) .expect("Properties in the » menu") .rect(); click_n(&mut h, item.center(), 1); diff --git a/crates/ui-egui/tests/it/ui_text_edit.rs b/crates/ui-egui/tests/it/ui_text_edit.rs index bbd931feb..d210e0d8e 100644 --- a/crates/ui-egui/tests/it/ui_text_edit.rs +++ b/crates/ui-egui/tests/it/ui_text_edit.rs @@ -299,11 +299,10 @@ fn opening_a_formatting_tab_keeps_the_text_selection() { assert!(doc.style_at(1).faux_bold && !doc.style_at(7).faux_bold, "only \"Hello\" is bold"); } -/// #831: a click away and keys in one frame's input. The text gets the keys typed before the -/// click and none after it; those later keys don't run as shortcuts either (Delete would remove a -/// layer). From the next frame the keys are the app's: Space plays. +/// #831: a click away ends the edit. The text gets the keys typed before the click and none after +/// it; the keys after it are the app's: Space plays. #[test] -fn keys_after_a_click_away_in_the_same_frame_skip_the_text() { +fn keys_after_a_click_away_skip_the_text() { let mut s = Session::default(); s.execute("comp.new", json!({"name": "Type", "width": 640, "height": 360, "duration": 2})).unwrap(); let solid = s.execute("layer.newSolid", json!({"name": "Plate", "color": "#406080"})).unwrap()["layer"].as_u64().unwrap(); @@ -319,19 +318,16 @@ fn keys_after_a_click_away_in_the_same_frame_skip_the_text() { Event::Text("A".into()), Event::PointerMoved(row), Event::PointerButton { pos: row, button: PointerButton::Primary, pressed: true, modifiers: Modifiers::NONE }, - Event::PointerButton { pos: row, button: PointerButton::Primary, pressed: false, modifiers: Modifiers::NONE }, - Event::Text("x".into()), - key(Key::Space, true), - Event::Text(" ".into()), - key(Key::Space, false), - key(Key::Delete, true), - key(Key::Delete, false), ]); + h.step(); + h.input_mut().events.push(Event::PointerButton { pos: row, button: PointerButton::Primary, pressed: false, modifiers: Modifiers::NONE }); + h.step(); + h.input_mut().events.push(Event::Text("x".into())); h.run_steps(3); let comp = |h: &Harness<'_, EffectcraftApp>| h.state().session.active_comp().unwrap().layers.len(); assert_eq!(layer_doc(&h.state().session, LayerId(lid)).unwrap().text, "HelloA", "only the key before the click"); assert!(h.state().session.state.text_edit.is_none(), "the click ended the edit"); - assert_eq!((comp(&h), h.state().playback.playing), (2, false), "the keys after it ran no shortcut"); + assert_eq!((comp(&h), h.state().playback.playing), (2, false)); h.input_mut().events.extend([key(Key::Space, true), Event::Text(" ".into()), key(Key::Space, false)]); h.run_steps(2); assert!(h.state().playback.playing, "Space plays"); @@ -1233,7 +1229,8 @@ fn native_text_pointer_same_batch_click_moves_caret_and_starts_editing() { Event::PointerButton { pos: caret1, button: PointerButton::Primary, pressed: true, modifiers: Modifiers::NONE }, Event::PointerButton { pos: caret1, button: PointerButton::Primary, pressed: false, modifiers: Modifiers::NONE }, ]); - h.run_steps(1); + // The press in one pass, its release in the next. + h.run_steps(2); assert_eq!(edited(&h), (layer, "abcd".to_owned(), 1, 1), "active={active}"); assert!(!h.ctx.input(|i| i.pointer.primary_down())); assert_eq!(h.state().session.history.undo.len(), undo, "placing a caret is not a document edit"); @@ -1289,10 +1286,10 @@ fn native_text_pointer_two_completed_primary_clicks_use_the_latest_primary_press Event::PointerButton { pos: caret4, button: PointerButton::Middle, pressed: true, modifiers: Modifiers::NONE }, Event::PointerButton { pos: caret4, button: PointerButton::Middle, pressed: false, modifiers: Modifiers::NONE }, ]); - h.run_steps(1); - assert!(h.ctx.input(|i| i.pointer.primary_pressed() && i.pointer.primary_released() && i.pointer.press_origin().is_none())); - assert!(!h.ctx.input(|i| i.pointer.button_double_clicked(PointerButton::Primary) || i.pointer.button_triple_clicked(PointerButton::Primary))); - assert_eq!(edited(&h), (layer, "abcd".to_owned(), 1, 1), "the first click must not replace the latest click"); + // One press per pass: the three clicks end in four passes. + h.run_steps(4); + assert!(!h.ctx.input(|i| i.pointer.primary_down())); + assert_eq!(edited(&h), (layer, "abcd".to_owned(), 1, 1), "the latest primary click places the caret, as one click"); } #[test] @@ -1315,14 +1312,17 @@ fn native_text_pointer_nonfinite_latest_press_does_not_replay_an_earlier_click() if same_frame_release { h.input_mut().events.push(Event::PointerButton { pos: caret1, button: PointerButton::Primary, pressed: false, modifiers: Modifiers::NONE }); } - h.run_steps(1); - assert_eq!(edited(&h), (layer, "abcd".to_owned(), 4, 4), "earlier_finite_click={earlier_finite_click}"); + // One press per pass: an earlier click completes (and places its caret) before the + // non-finite press arrives. + h.run_steps(3); + let caret = if earlier_finite_click { 1 } else { 4 }; + assert_eq!(edited(&h), (layer, "abcd".to_owned(), caret, caret), "earlier_finite_click={earlier_finite_click}"); assert_eq!(h.state().session.history.undo.len(), undo); if !same_frame_release { assert!(h.ctx.input(|i| i.pointer.primary_down())); h.input_mut().events.push(Event::PointerButton { pos: caret1, button: PointerButton::Primary, pressed: false, modifiers: Modifiers::NONE }); h.run_steps(1); - assert_eq!(edited(&h), (layer, "abcd".to_owned(), 4, 4), "later release cannot retarget an invalid press"); + assert_eq!(edited(&h), (layer, "abcd".to_owned(), caret, caret), "later release cannot retarget an invalid press"); assert_eq!(h.state().session.history.undo.len(), undo); } assert!(!h.ctx.input(|i| i.pointer.primary_down())); @@ -1461,11 +1461,14 @@ fn pointer_caret_interruption_rejects_same_batch_ime_delete_and_commit() { ime_interruption_delete(bytes), Event::Ime(egui::ImeEvent::Commit("X".into())), ]); + // The press in one pass, the stale IME events in the next. h.run_steps(1); + let request_id = ime_reset_request(&h); + h.run_steps(1); + let request_id = h.output().platform_output.ime.as_ref().and_then(|ime| ime.reset_request).unwrap_or(request_id); assert_eq!((edited(&h).1.as_str(), edited(&h).2, edited(&h).3), ("abcd", 1, 1), "the actual pointer caret survives stale IME mutations"); assert!(std::sync::Arc::ptr_eq(&project, &h.state().session.project), "rejected IME never edits the project"); assert_eq!(h.state().session.history.undo.len(), undo, "rejected input creates no undo entry"); - let request_id = ime_reset_request(&h); h.input_mut().events.push(Event::PointerButton { pos: point, button: PointerButton::Primary, pressed: false, modifiers: Modifiers::NONE }); h.run_steps(1); // The explicit native fence, not the rejected terminal, admits fresh composition. @@ -1560,7 +1563,7 @@ fn composing_ime_delete_then_commit_and_direct_commit_remain_valid() { } #[test] -fn a_noncomposing_direct_commit_can_follow_a_pointer_caret_change_in_the_same_batch() { +fn a_noncomposing_direct_commit_can_follow_a_pointer_caret_change() { let (mut h, point) = ime_interruption_editor(); let undo = h.state().session.history.undo.len(); h.input_mut().events.extend([ @@ -1568,7 +1571,8 @@ fn a_noncomposing_direct_commit_can_follow_a_pointer_caret_change_in_the_same_ba Event::PointerButton { pos: point, button: PointerButton::Primary, pressed: true, modifiers: Modifiers::NONE }, Event::Ime(egui::ImeEvent::Commit("Y".into())), ]); - h.run_steps(1); + // The press in one pass, the commit in the next. + h.run_steps(2); assert_eq!((edited(&h).1.as_str(), edited(&h).2, edited(&h).3), ("aYbcd", 2, 2), "only an interrupted composition is rejected"); assert_eq!(h.state().session.history.undo.len(), undo + 1); h.state_mut().session.execute("edit.undo", json!({})).unwrap(); @@ -1758,13 +1762,11 @@ fn outside_pointer_visits_the_control_suffix_without_mutating_the_old_viewer() { Event::PointerMoved(outside), Event::PointerButton { pos: outside, button: PointerButton::Primary, pressed: true, modifiers: Modifiers::NONE }, Event::ImeResetCompleted { request_id: first }, - Event::Text("BAD".into()), - Event::Cut, - Event::Paste("BAD".into()), Event::Ime(egui::ImeEvent::Preedit { text: "late".into(), active_range_chars: None }), Event::Ime(egui::ImeEvent::Commit("X".into())), ]); - h.run_steps(1); + // The press in one pass, the late IME events in the next. + h.run_steps(2); assert_eq!(layer_doc(&h.state().session, LayerId(layer)).unwrap().text, "abcd"); assert_eq!(h.state().session.history.undo.len(), undo); assert!(!h.ctx.input(|input| input.events.iter().any(|event| matches!(event, Event::ImeResetCompleted { .. }))), "the suffix control was visited"); diff --git a/crates/ui-egui/tests/it/ui_viewer.rs b/crates/ui-egui/tests/it/ui_viewer.rs index fa896812d..ef59cf6cf 100644 --- a/crates/ui-egui/tests/it/ui_viewer.rs +++ b/crates/ui-egui/tests/it/ui_viewer.rs @@ -1921,7 +1921,9 @@ fn puppet_press_where_the_deformed_layer_is_empty_is_a_marquee_not_a_copy() { let meshes = info["meshes"].as_array().unwrap().clone(); (meshes.len(), meshes.iter().map(|m| m["pins"].as_array().unwrap().len()).sum::()) }; - let at = screen(&h, [285.0, 180.0]); + // Above the pins' row (comp y 180): a marquee whose edge runs through the pins leaves them to + // rounding. + let at = screen(&h, [285.0, 170.0]); click(&mut h, at); assert_eq!(rig(&mut h), (1, 2), "the click made nothing"); let comp = rect(&h, "viewer.comp"); From 74f2d1e8dc371ac87a3fc11e38c443d743e9fbf8 Mon Sep 17 00:00:00 2001 From: aiongg Date: Tue, 24 Nov 2026 22:03:09 +0000 Subject: [PATCH 425/451] Repin craft-libs to dock-gaps-2: host stops for the toolbar and viewer bar, Tab passes through the viewer, overflow button source --- Cargo.lock | 182 +++++++++++----------- Cargo.toml | 72 ++++----- crates/effects/Cargo.toml | 2 +- crates/ui-egui/src/dock_ui.rs | 1 + crates/ui-egui/src/framework.rs | 8 +- crates/ui-egui/src/header.rs | 3 + crates/ui-egui/src/panels/viewer_tools.rs | 16 +- 7 files changed, 151 insertions(+), 133 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 81afa8ae1..4aed2daa8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1315,12 +1315,12 @@ dependencies = [ [[package]] name = "craft-aep" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" [[package]] name = "craft-appkit" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ "block2 0.6.2", "objc2-app-kit 0.3.2", @@ -1330,7 +1330,7 @@ dependencies = [ [[package]] name = "craft-atomic" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ "rustix 1.1.6", ] @@ -1351,10 +1351,10 @@ dependencies = [ [[package]] name = "craft-audio" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ - "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", - "craft-xml 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", + "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", + "craft-xml 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", "log", "thiserror 2.0.21", ] @@ -1362,7 +1362,7 @@ dependencies = [ [[package]] name = "craft-behavior" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ "accesskit", "bitflags 2.13.2", @@ -1385,7 +1385,7 @@ source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa3 [[package]] name = "craft-cloud-ui" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ "egui", ] @@ -1393,7 +1393,7 @@ dependencies = [ [[package]] name = "craft-cms" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ "md-5", "rayon", @@ -1402,7 +1402,7 @@ dependencies = [ [[package]] name = "craft-codepage" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" [[package]] name = "craft-color" @@ -1415,7 +1415,7 @@ dependencies = [ [[package]] name = "craft-color" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ "serde", ] @@ -1423,7 +1423,7 @@ dependencies = [ [[package]] name = "craft-doc" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ "craft-ecproj-format", "craft-pcraft-format", @@ -1437,7 +1437,7 @@ dependencies = [ [[package]] name = "craft-docpath" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ "serde", ] @@ -1453,7 +1453,7 @@ dependencies = [ [[package]] name = "craft-dpx" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ "thiserror 2.0.21", ] @@ -1461,7 +1461,7 @@ dependencies = [ [[package]] name = "craft-ecproj-format" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ "serde", "serde_json", @@ -1471,7 +1471,7 @@ dependencies = [ [[package]] name = "craft-eps" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" [[package]] name = "craft-exr" @@ -1485,7 +1485,7 @@ dependencies = [ [[package]] name = "craft-exr" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ "exr", "flate2", @@ -1497,7 +1497,7 @@ dependencies = [ [[package]] name = "craft-font-catalog" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ "harfrust 0.13.3", "kurbo", @@ -1511,7 +1511,7 @@ dependencies = [ [[package]] name = "craft-fonts-build" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" [[package]] name = "craft-frame" @@ -1527,10 +1527,10 @@ dependencies = [ [[package]] name = "craft-frame" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ - "craft-color 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", - "craft-time 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", + "craft-color 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", + "craft-time 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", "rayon", "serde", ] @@ -1538,7 +1538,7 @@ dependencies = [ [[package]] name = "craft-gif" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ "gif", "image", @@ -1555,7 +1555,7 @@ dependencies = [ [[package]] name = "craft-host" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ "bitflags 2.13.2", "craft-i18n", @@ -1568,7 +1568,7 @@ dependencies = [ [[package]] name = "craft-i18n" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ "chrono", "fixed_decimal", @@ -1604,7 +1604,7 @@ dependencies = [ [[package]] name = "craft-jsonrpc" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ "serde_json", ] @@ -1612,13 +1612,13 @@ dependencies = [ [[package]] name = "craft-keymap" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ "craft-host", "craft-i18n", "craft-tracked", "craft-ui-macros", - "craft-xml 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", + "craft-xml 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", "egui", "serde", "serde_json", @@ -1627,7 +1627,7 @@ dependencies = [ [[package]] name = "craft-lottie" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ "craft-zip", "serde_json", @@ -1646,7 +1646,7 @@ dependencies = [ [[package]] name = "craft-media" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ "chrono", "thiserror 2.0.21", @@ -1669,14 +1669,14 @@ dependencies = [ [[package]] name = "craft-media-source" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ - "craft-audio 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", - "craft-color 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", - "craft-frame 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", - "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", - "craft-time 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", - "craft-y4m 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", + "craft-audio 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", + "craft-color 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", + "craft-frame 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", + "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", + "craft-time 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", + "craft-y4m 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", "serde", "thiserror 2.0.21", ] @@ -1684,7 +1684,7 @@ dependencies = [ [[package]] name = "craft-mesh" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ "craft-zip", "miniz_oxide 0.9.1", @@ -1694,7 +1694,7 @@ dependencies = [ [[package]] name = "craft-mime" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ "chrono", "craft-codepage", @@ -1704,7 +1704,7 @@ dependencies = [ [[package]] name = "craft-pcraft-format" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ "flate2", "serde", @@ -1715,7 +1715,7 @@ dependencies = [ [[package]] name = "craft-pdf" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ "hayro-syntax", "serde", @@ -1725,7 +1725,7 @@ dependencies = [ [[package]] name = "craft-platform" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ "async-channel", "async-io", @@ -1756,7 +1756,7 @@ dependencies = [ [[package]] name = "craft-ps" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ "craft-eps", "kurbo", @@ -1780,7 +1780,7 @@ dependencies = [ [[package]] name = "craft-psd" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ "encoding_rs", "flate2", @@ -1791,7 +1791,7 @@ dependencies = [ [[package]] name = "craft-quit" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ "dispatch2", "objc2 0.6.5", @@ -1817,7 +1817,7 @@ dependencies = [ [[package]] name = "craft-settings" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ "craft-atomic", "craft-host", @@ -1839,9 +1839,9 @@ source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa3 [[package]] name = "craft-svg" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ - "craft-xml 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", + "craft-xml 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", "flate2", "kurbo", "quick-xml 0.41.0", @@ -1864,7 +1864,7 @@ dependencies = [ [[package]] name = "craft-tga" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ "thiserror 2.0.21", ] @@ -1872,7 +1872,7 @@ dependencies = [ [[package]] name = "craft-theme" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ "bitflags 2.13.2", "craft-tracked", @@ -1905,7 +1905,7 @@ dependencies = [ [[package]] name = "craft-time" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ "serde", "thiserror 2.0.21", @@ -1925,9 +1925,9 @@ dependencies = [ [[package]] name = "craft-timeline" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ - "craft-time 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", + "craft-time 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", "serde", "web-time", ] @@ -1935,12 +1935,12 @@ dependencies = [ [[package]] name = "craft-tracked" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" [[package]] name = "craft-ui" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ "craft-cloud-ui", "craft-ui-canvas", @@ -1954,7 +1954,7 @@ dependencies = [ [[package]] name = "craft-ui-canvas" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ "craft-behavior", "craft-i18n", @@ -1970,7 +1970,7 @@ dependencies = [ [[package]] name = "craft-ui-contract" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ "accesskit", "craft-behavior", @@ -2008,7 +2008,7 @@ dependencies = [ [[package]] name = "craft-ui-macros" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2019,7 +2019,7 @@ dependencies = [ [[package]] name = "craft-ui-panels" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ "craft-behavior", "craft-host", @@ -2037,7 +2037,7 @@ dependencies = [ [[package]] name = "craft-ui-patterns" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ "craft-behavior", "craft-host", @@ -2058,7 +2058,7 @@ dependencies = [ [[package]] name = "craft-ui-shell" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ "craft-behavior", "craft-host", @@ -2078,7 +2078,7 @@ dependencies = [ [[package]] name = "craft-ui-widgets" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ "craft-behavior", "craft-host", @@ -2097,7 +2097,7 @@ dependencies = [ [[package]] name = "craft-update" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ "chrono", "craft-host", @@ -2126,7 +2126,7 @@ dependencies = [ [[package]] name = "craft-vectorcraft-format" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ "flate2", "serde", @@ -2148,9 +2148,9 @@ dependencies = [ [[package]] name = "craft-video" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ - "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", + "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", "rav1e", "rayon", "thiserror 2.0.21", @@ -2159,7 +2159,7 @@ dependencies = [ [[package]] name = "craft-webp" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ "image", "thiserror 2.0.21", @@ -2168,7 +2168,7 @@ dependencies = [ [[package]] name = "craft-win32" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ "winsafe", ] @@ -2176,7 +2176,7 @@ dependencies = [ [[package]] name = "craft-window" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ "craft-appkit", "craft-atomic", @@ -2210,7 +2210,7 @@ dependencies = [ [[package]] name = "craft-xml" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ "quick-xml 0.41.0", "serde", @@ -2228,7 +2228,7 @@ dependencies = [ [[package]] name = "craft-y4m" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ "thiserror 2.0.21", ] @@ -2236,7 +2236,7 @@ dependencies = [ [[package]] name = "craft-zip" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ "flate2", "thiserror 2.0.21", @@ -2688,12 +2688,12 @@ dependencies = [ name = "effectcraft-export" version = "0.25.1" dependencies = [ - "craft-audio 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", - "craft-exr 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", + "craft-audio 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", + "craft-exr 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", "craft-gif", - "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", - "craft-tga 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", - "craft-video 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", + "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", + "craft-tga 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", + "craft-video 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", "effectcraft-color", "effectcraft-effects", "effectcraft-keyframe", @@ -2803,7 +2803,7 @@ dependencies = [ name = "effectcraft-interchange" version = "0.25.1" dependencies = [ - "craft-timeline 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", + "craft-timeline 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", "effectcraft-color", "effectcraft-keyframe", "effectcraft-project", @@ -2854,17 +2854,17 @@ dependencies = [ name = "effectcraft-media" version = "0.25.1" dependencies = [ - "craft-audio 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", - "craft-color 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", + "craft-audio 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", + "craft-color 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", "craft-docpath", - "craft-dpx 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", - "craft-exr 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", - "craft-frame 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", + "craft-dpx 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", + "craft-exr 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", + "craft-frame 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", "craft-gif", - "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", - "craft-media-source 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", - "craft-time 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", - "craft-video 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", + "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", + "craft-media-source 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", + "craft-time 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", + "craft-video 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", "craft-webp", "effectcraft-color", "effectcraft-effects", @@ -2969,7 +2969,7 @@ name = "effectcraft-psd" version = "0.25.1" dependencies = [ "craft-codepage", - "craft-psd 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", + "craft-psd 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", "miniz_oxide 0.9.1", ] @@ -2977,7 +2977,7 @@ dependencies = [ name = "effectcraft-raster" version = "0.25.1" dependencies = [ - "craft-exr 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b)", + "craft-exr 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", "effectcraft-color", "effectcraft-geom", "rayon", @@ -4374,7 +4374,7 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a" [[package]] name = "hayro-jbig2" version = "0.3.0" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ "hayro-ccitt", ] @@ -4388,7 +4388,7 @@ checksum = "c75ab947623ef4ccaa7acf0579edf7cbb5a73838e3839a7be73335e522f433a1" [[package]] name = "hayro-syntax" version = "0.7.2" -source = "git+https://github.com/aiongg/craft-libs?rev=4e806d57a557600dca26fa5442680ea5c3569a1b#4e806d57a557600dca26fa5442680ea5c3569a1b" +source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" dependencies = [ "hayro-jbig2", "hayro-jpeg2000", diff --git a/Cargo.toml b/Cargo.toml index 61fbef6aa..87c1e9e48 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,28 +11,28 @@ rust-version = "1.95" repository = "https://github.com/storytold/effectcraft" [workspace.dependencies] -craft-timeline = { git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b", default-features = false } -craft-mime = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } -craft-pdf = { git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b", version = "=0.1.0", default-features = false, features = ["read"] } -craft-docpath = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } -craft-jsonrpc = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } -craft-ecproj-format = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } -craft-dpx = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } -craft-ps = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b", default-features = false, features = ["read"] } -craft-exr = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } -craft-gif = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } -craft-tga = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } -craft-psd = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } -craft-codepage = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } -craft-svg = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } -craft-webp = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } -craft-lottie = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } -craft-mesh = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b", default-features = false, features = ["stl", "obj", "gltf", "fbx"] } -craft-aep = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } -craft-doc = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } -craft-vectorcraft-format = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } +craft-timeline = { git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4", default-features = false } +craft-mime = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } +craft-pdf = { git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4", version = "=0.1.0", default-features = false, features = ["read"] } +craft-docpath = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } +craft-jsonrpc = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } +craft-ecproj-format = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } +craft-dpx = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } +craft-ps = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4", default-features = false, features = ["read"] } +craft-exr = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } +craft-gif = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } +craft-tga = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } +craft-psd = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } +craft-codepage = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } +craft-svg = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } +craft-webp = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } +craft-lottie = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } +craft-mesh = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4", default-features = false, features = ["stl", "obj", "gltf", "fbx"] } +craft-aep = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } +craft-doc = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } +craft-vectorcraft-format = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } # craft-update: app-specific pretend versions apply to startup and manual checks. -craft-update = { git = "https://github.com/aiongg/craft-libs", version = "=0.1.0", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b", features = ["ui"] } +craft-update = { git = "https://github.com/aiongg/craft-libs", version = "=0.1.0", rev = "3408eb09a57969987db986514978bb24cc6859c4", features = ["ui"] } # internal effectcraft-time = { path = "crates/time" } effectcraft-geom = { path = "crates/geom" } @@ -97,13 +97,13 @@ same-file = "1.0" tempfile = "3.27" # codecs + containers shared by the Craft apps (crates/media, crates/export); keep all in sync. -craft-media = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b", default-features = false, features = ["isobmff", "matroska"] } -craft-media-source = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } -craft-frame = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } -craft-color = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } -craft-time = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } -craft-audio = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b", default-features = false, features = ["aac-decode", "aac-encode", "alac-decode", "opus-decode", "opus-encode", "ac3-decode", "mp3-decode", "mpa-decode"] } -craft-video = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b", features = ["h264-decode", "h264-encode", "prores", "hevc-encode", "vp9-encode", "av1", "threads"] } +craft-media = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4", default-features = false, features = ["isobmff", "matroska"] } +craft-media-source = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } +craft-frame = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } +craft-color = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } +craft-time = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } +craft-audio = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4", default-features = false, features = ["aac-decode", "aac-encode", "alac-decode", "opus-decode", "opus-encode", "ac3-decode", "mp3-decode", "mpa-decode"] } +craft-video = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4", features = ["h264-decode", "h264-encode", "prores", "hevc-encode", "vp9-encode", "av1", "threads"] } # footage decoding: FilmCraft's pure-Rust crates, pinned to a revision (plan/adr/0001). # Only `crates/media`, `crates/export` and `crates/interchange` may depend on these. @@ -126,12 +126,12 @@ half = "2.7" # ui # Shared frontend components; keep this dependency above the engine boundary. # Shared UI and the complete egui family select reviewed immutable commits below. -craft-ui = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } -craft-behavior = { git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } -craft-host = { git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } -craft-keymap = { git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } -craft-theme = { git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } -craft-window = { git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } +craft-ui = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } +craft-behavior = { git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } +craft-host = { git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } +craft-keymap = { git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } +craft-theme = { git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } +craft-window = { git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } # `default_fonts` and `monochrome_emoji_fonts` are explicit: the app's `FontDefinitions::default()` # and its `✔`/`▣` chrome glyphs need both, and kittest's own dev-dependencies do not propagate. egui = { version = "0.37", default-features = false, features = ["default_fonts", "monochrome_emoji_fonts"] } @@ -236,8 +236,8 @@ lto = "thin" codegen-units = 1 [patch.crates-io] -hayro-syntax = { git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b", version = "=0.7.2" } -hayro-jbig2 = { git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b", version = "=0.3.0" } +hayro-syntax = { git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4", version = "=0.7.2" } +hayro-jbig2 = { git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4", version = "=0.3.0" } ecolor = { git = "https://github.com/storytold/egui.git", rev = "a87d00caaec947ea781657c6ff410c9838016d18" } emath = { git = "https://github.com/storytold/egui.git", rev = "a87d00caaec947ea781657c6ff410c9838016d18" } epaint = { git = "https://github.com/storytold/egui.git", rev = "a87d00caaec947ea781657c6ff410c9838016d18" } diff --git a/crates/effects/Cargo.toml b/crates/effects/Cargo.toml index e07fbe292..ef2736e7c 100644 --- a/crates/effects/Cargo.toml +++ b/crates/effects/Cargo.toml @@ -10,7 +10,7 @@ rust-version.workspace = true workspace = true [dependencies] -craft-cms = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "4e806d57a557600dca26fa5442680ea5c3569a1b" } +craft-cms = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } effectcraft-geom = { workspace = true } effectcraft-color = { workspace = true } effectcraft-keyframe = { workspace = true } diff --git a/crates/ui-egui/src/dock_ui.rs b/crates/ui-egui/src/dock_ui.rs index 45d59ffef..86862885f 100644 --- a/crates/ui-egui/src/dock_ui.rs +++ b/crates/ui-egui/src/dock_ui.rs @@ -532,6 +532,7 @@ impl EffectcraftApp { (format!("panel.tab.{}.{document}", panel.id()), name) } SourceKind::GroupBar(panel) => (format!("panel.drag.{}", panel.id()), "Move panel group".into()), + SourceKind::Overflow(panel) => (format!("panel.overflow.{}", panel.id()), "More panels".into()), SourceKind::WindowGrip(panel) => match window(panel) { Some(index) => (format!("panel.float.{index}.move"), "Move floating panel".into()), None => continue, diff --git a/crates/ui-egui/src/framework.rs b/crates/ui-egui/src/framework.rs index 41e371bbf..0e54530ae 100644 --- a/crates/ui-egui/src/framework.rs +++ b/crates/ui-egui/src/framework.rs @@ -7,7 +7,7 @@ //! The runtime takes Escape, Tab and the clipboard events for the whole window unless one of EffectCraft's own egui //! widgets has the keyboard. [`return_window_keys`] puts the window's Escape back into egui's input for EffectCraft's //! own handlers (the window's plain Enter stays in egui's input); the Composition viewer is declared to the runtime with [`host_canvas`], which keeps -//! Tab, the edit chords and the clipboard events in egui's input for EffectCraft's shortcuts. +//! the edit chords and the clipboard events in egui's input for EffectCraft's shortcuts. use std::sync::{Arc, OnceLock}; @@ -17,7 +17,7 @@ use craft_keymap::Overrides; use craft_ui::fonts::{I18nScripts, SystemFonts, UiFonts}; use craft_ui::runtime::commands::{CommandInput, CommandSet as _, NavCommand, QuitCommand}; use craft_ui::runtime::env::{RootEnv, Scale}; -use craft_ui::runtime::focus::{EditSet, KeepKeys, KeyUse}; +use craft_ui::runtime::focus::{EditSet, KeyUse}; use craft_ui::runtime::frame::{FrameInput, FrameOutput}; use craft_ui::runtime::keys::{Intent, with_window_intents}; use craft_ui::shell::embed::{self, CloseDecision}; @@ -116,10 +116,10 @@ impl EffectcraftApp { } /// Declares the Composition viewer `id`, drawn in this pass, as the window's document canvas. With nothing focused it -/// is the window's key target: Tab (the Composition Mini-Flowchart), the edit chords and the clipboard events stay in +/// is the window's key target: the edit chords and the clipboard events stay in /// egui's input for EffectCraft's shortcuts. pub(crate) fn host_canvas(ctx: &egui::Context, id: egui::Id) { - const KEYS: KeyUse = KeyUse::CANVAS.with_keep(KeepKeys::Tab).with_edits(EditSet::ALL); + const KEYS: KeyUse = KeyUse::CANVAS.with_edits(EditSet::ALL); craft_ui::runtime::focus::host_canvas(ctx, id, KEYS); } diff --git a/crates/ui-egui/src/header.rs b/crates/ui-egui/src/header.rs index 140a0bbaf..3112ba738 100644 --- a/crates/ui-egui/src/header.rs +++ b/crates/ui-egui/src/header.rs @@ -2,6 +2,8 @@ //! buttons (Discord is always one click away). use crate::i18n::{tr, tr_args}; +use craft_behavior::Input; +use craft_ui::runtime::focus::KeyUse; use egui::{Align2, Color32, Rect, Sense, Stroke, StrokeKind, pos2, vec2}; use serde_json::json; @@ -85,6 +87,7 @@ fn tool_slot(app: &mut EffectcraftApp, ui: &mut egui::Ui, p: &egui::Painter, si: let active = slot.contains(&app.ui.tool); let id = egui::Id::unique(("tool-slot", si)); let resp = widgets::icon_button(ui, r, cur.icon(), active, &t, id); + craft_ui::runtime::focus::host_stop(ui.ctx(), resp.id, KeyUse::of(Input::Pointer)); if slot.len() > 1 { // Flyout corner triangle. p.add(egui::Shape::convex_polygon( diff --git a/crates/ui-egui/src/panels/viewer_tools.rs b/crates/ui-egui/src/panels/viewer_tools.rs index 52e19e999..e7e4aaef3 100644 --- a/crates/ui-egui/src/panels/viewer_tools.rs +++ b/crates/ui-egui/src/panels/viewer_tools.rs @@ -4,6 +4,8 @@ //! //! Edits go through engine commands (`view.*`, `comp.*`); the viewer calls in from small hooks. +use craft_behavior::Input; +use craft_ui::runtime::focus::{KeyUse, host_stop}; use effectcraft_engine::commands::viewer_cmds::FastPreviews; use effectcraft_engine::project::{Comp, ItemId, LayerId}; use effectcraft_engine::render::EvalCtx; @@ -764,6 +766,9 @@ pub(crate) fn bottom_bar(app: &mut EffectcraftApp, ui: &mut egui::Ui, bar: Rect, } /// The exposure drag field (stops) at `er`; a change runs `view.exposure`. +/// Every control of the viewer bar is a pointer-driven stop that Tab visits in drawn order. +const STOP_KEYS: KeyUse = KeyUse::of(Input::Pointer); + fn exposure_field(app: &mut EffectcraftApp, ui: &mut egui::Ui, er: Rect, stops: f64) { let mut ev = stops; let resp = ui.put( @@ -777,6 +782,7 @@ fn exposure_field(app: &mut EffectcraftApp, ui: &mut egui::Ui, er: Rect, stops: ), ); let resp = resp.on_hover_text(crate::i18n::tr("Adjust Exposure (stops)")); + host_stop(ui.ctx(), resp.id, STOP_KEYS); app.auto.add_response("viewer.exposure", &resp, "Adjust Exposure"); if resp.changed() { let _ = app.session.execute("view.exposure", json!({"stops": ev})); @@ -803,6 +809,7 @@ fn bottom_bar_contents(app: &mut EffectcraftApp, ui: &mut egui::Ui, bar: Rect, z app.ui.viewer.fit_up_to_100 = up; app.ui.viewer.zoom = z; } + host_stop(ui.ctx(), egui::Id::unique("vw-mag"), STOP_KEYS); x = r.max.x + 4.0; // Resolution / down-sample factor. @@ -811,6 +818,7 @@ fn bottom_bar_contents(app: &mut EffectcraftApp, ui: &mut egui::Ui, bar: Rect, z let res = app.viewer_res(); let response = widgets::dropdown(ui, r, &resolution_label(res, scale), &t, egui::Id::unique("vw-res")) .on_hover_text(crate::i18n::tr("Resolution/Down Sample Factor Popup")); + host_stop(ui.ctx(), response.id, STOP_KEYS); if response.clicked() { toggle_popup(ui, "vw-res-pop"); } @@ -838,6 +846,7 @@ fn bottom_bar_contents(app: &mut EffectcraftApp, ui: &mut egui::Ui, bar: Rect, z // The tip is the English source: the tooltip is looked up in the catalog, while the // automation label stays English for scripts and tests. let resp = widgets::icon_button(ui, r, icon, on, &t, egui::Id::unique(("vw-btn", id))).on_hover_text(crate::i18n::tr(tip)); + host_stop(ui.ctx(), resp.id, STOP_KEYS); auto.add_response(&format!("viewer.{id}"), &resp, tip); *x += 24.0; (resp.clicked(), r) @@ -943,7 +952,9 @@ fn bottom_bar_contents(app: &mut EffectcraftApp, ui: &mut egui::Ui, bar: Rect, z let renderers = [(Renderer::Classic3D, "Classic 3D", "classic3D"), (Renderer::Advanced3D, "Advanced 3D", "advanced3D")]; let current = renderers.iter().find(|(r, ..)| *r == comp.renderer).map_or("Classic 3D", |(_, label, _)| *label); let r = Rect::from_min_size(pos2(x, cy - 10.0), vec2(96.0, 20.0)); - if widgets::dropdown(ui, r, crate::i18n::tr(current), &t, egui::Id::unique("vw-3d")).clicked() { + let renderer_resp = widgets::dropdown(ui, r, crate::i18n::tr(current), &t, egui::Id::unique("vw-3d")); + host_stop(ui.ctx(), renderer_resp.id, STOP_KEYS); + if renderer_resp.clicked() { toggle_popup(ui, "vw-3d-pop"); } app.auto.add("viewer.renderer3d", r, current); @@ -959,6 +970,7 @@ fn bottom_bar_contents(app: &mut EffectcraftApp, ui: &mut egui::Ui, bar: Rect, z let cur = cid.and_then(|c| app.session.state.views3d.get(&c)).map(|v| v.current).unwrap_or_default(); let r = Rect::from_min_size(pos2(x, cy - 10.0), vec2(118.0, 20.0)); let response = widgets::dropdown(ui, r, crate::panels::viewer::view3d_label(cur), &t, egui::Id::unique("vw-cam")); + host_stop(ui.ctx(), response.id, STOP_KEYS); if response.clicked() { toggle_popup(ui, "vw-cam-pop"); } @@ -986,6 +998,7 @@ fn bottom_bar_contents(app: &mut EffectcraftApp, ui: &mut egui::Ui, bar: Rect, z let tr = Rect::from_min_size(pos2(x + 4.0, cy - 9.0), g.size() + vec2(8.0, 4.0)); p.galley(pos2(tr.min.x + 4.0, tr.min.y + 2.0), g, t.timecode); let resp = ui.interact(tr, egui::Id::unique("vw-timecode"), Sense::click()); + host_stop(ui.ctx(), resp.id, STOP_KEYS); resp.widget_info(|| egui::WidgetInfo::labeled(egui::Role::Button, true, "Current time")); if resp.has_focus() { p.rect_stroke(tr.shrink(1.0), 2.0, Stroke::new(1.0, t.focus), StrokeKind::Inside); @@ -1020,6 +1033,7 @@ fn layout_switch(app: &mut EffectcraftApp, ui: &mut egui::Ui, mut x: f32, cy: f3 for (n, text, tip) in [(1u8, "1", "1 View"), (2, "2", "2 Views"), (4, "4", "4 Views")] { let r = Rect::from_min_size(pos2(x, cy - 10.0), vec2(26.0, 20.0)); let resp = widgets::text_button(ui, r, text, current == n, t, egui::Id::unique(("vw-layout", n))); + host_stop(ui.ctx(), resp.id, STOP_KEYS); // The drawn text is just "1" / "2" / "4": the accessible name is the full "N View(s)", the group // label ("Views") is its description, and the current layout is exposed as pressed. let name = crate::i18n::command_label("view.layout", tip); From 9df2d92bfa04d5941040cc1adc254ea0558e0b85 Mon Sep 17 00:00:00 2001 From: aiongg Date: Tue, 24 Nov 2026 22:24:26 +0000 Subject: [PATCH 426/451] Header brand and Home are Tab stops, tab strips are one stop, keyboard focus reads the framework's focused node --- crates/ui-egui/src/control.rs | 8 ++++---- crates/ui-egui/src/header.rs | 2 ++ crates/ui-egui/tests/it/ui_workspace_focus.rs | 16 ++++++++++------ 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/crates/ui-egui/src/control.rs b/crates/ui-egui/src/control.rs index b1717d55e..3c569c8c2 100644 --- a/crates/ui-egui/src/control.rs +++ b/crates/ui-egui/src/control.rs @@ -813,9 +813,9 @@ pub fn base64(data: &[u8]) -> String { pub fn inspect(app: &EffectcraftApp, ctx: &egui::Context) -> Value { // A logic-only tick refreshes the viewport information but not `InputState`'s screen rect. let size = ctx.input(|i| i.viewport().inner_rect).map_or_else(|| ctx.content_rect().size(), |r| r.size()); - let keyboard_focus = ctx.memory(|m| m.focused()).map(|id| { - let response = ctx.read_response(id); - let rect = response.as_ref().map(|r| [r.rect.min.x, r.rect.min.y, r.rect.width(), r.rect.height()]); + let keyboard_focus = craft_ui::runtime::access::focused_node(ctx).or_else(|| ctx.memory(|m| m.focused())).map(|id| { + let automation = app.auto.elements.iter().chain(app.auto.previous.iter()).find(|e| e.response_id == Some(id)); + let rect = ctx.read_response(id).map(|r| [r.rect.min.x, r.rect.min.y, r.rect.width(), r.rect.height()]).or_else(|| automation.map(|e| e.rect)); // The registry names screen elements independently of egui's internal ids. Report // exact rectangle matches rather than guessing which enclosing panel owns focus. let candidates: Vec<&str> = app @@ -825,7 +825,7 @@ pub fn inspect(app: &EffectcraftApp, ctx: &egui::Context) -> Value { .filter(|e| rect.is_some_and(|r| e.rect.iter().zip(r).all(|(a, b)| (*a - b).abs() < 0.01))) .map(|e| e.id.as_str()) .collect(); - let automation_id = app.auto.elements.iter().chain(app.auto.previous.iter()).find(|e| e.response_id == Some(id)).map(|e| e.id.as_str()); + let automation_id = automation.map(|e| e.id.as_str()); json!({"id": format!("{:016x}", id.value()), "rect": rect, "automationId": automation_id, "registryCandidates": candidates}) }); let mut ui = json!(app.ui); diff --git a/crates/ui-egui/src/header.rs b/crates/ui-egui/src/header.rs index 3112ba738..9b8b89020 100644 --- a/crates/ui-egui/src/header.rs +++ b/crates/ui-egui/src/header.rs @@ -43,6 +43,7 @@ fn brand_and_home(app: &mut EffectcraftApp, ui: &mut egui::Ui, p: &egui::Painter paint_logo(p, brand); let bresp = ui.interact(brand, egui::Id::unique("brand"), Sense::click()); app.auto.add_response("header.about", &bresp, "About EffectCraft"); + craft_ui::runtime::focus::host_stop(ui.ctx(), bresp.id, KeyUse::of(Input::Pointer)); widgets::focus_outline(ui, &bresp, &t); if bresp.on_hover_text(tr("About EffectCraft")).clicked() { app.dialog = Some(Dialog::About); @@ -52,6 +53,7 @@ fn brand_and_home(app: &mut EffectcraftApp, ui: &mut egui::Ui, p: &egui::Painter let home = Rect::from_min_size(pos2(x, cy - 13.0), vec2(26.0, 26.0)); let home_response = widgets::icon_button(ui, home, Icon::Home, app.ui.start_screen, &t, egui::Id::unique("tool-home")).on_hover_text(tr("Home")); app.auto.add_response("header.home", &home_response, "Home"); + craft_ui::runtime::focus::host_stop(ui.ctx(), home_response.id, KeyUse::of(Input::Pointer)); if home_response.clicked() { app.ui.start_screen = !app.ui.start_screen; } diff --git a/crates/ui-egui/tests/it/ui_workspace_focus.rs b/crates/ui-egui/tests/it/ui_workspace_focus.rs index f273708b0..14f87d1fc 100644 --- a/crates/ui-egui/tests/it/ui_workspace_focus.rs +++ b/crates/ui-egui/tests/it/ui_workspace_focus.rs @@ -189,10 +189,12 @@ fn tab_traversal_activates_an_inactive_dock_tab_without_editing_the_project() { for _ in 0..200 { key(&mut h, Key::Tab, Modifiers::NONE); tabs += 1; - if tab_focused(&h, target) { + if tab_focused(&h, "Project") { break; } } + assert!(tab_focused(&h, "Project")); + key(&mut h, Key::ArrowRight, Modifiers::NONE); assert!(tab_focused(&h, target)); println!("Tab presses from no focus to Effect Controls: {tabs}"); assert_eq!(h.state().ui.dock, before, "traversal alone must not activate a tab"); @@ -205,7 +207,7 @@ fn tab_traversal_activates_an_inactive_dock_tab_without_editing_the_project() { assert!(Arc::ptr_eq(&h.state().session.project, &project)); let inspected = effectcraft_ui_egui::control::inspect(h.state(), &h.ctx); assert_eq!(inspected["keyboardFocus"]["automationId"], "panel.tab.EffectControls"); - key(&mut h, Key::Tab, Modifiers::SHIFT); + key(&mut h, Key::ArrowLeft, Modifiers::NONE); assert!(tab_focused(&h, "Project")); key(&mut h, Key::Enter, Modifiers::NONE); assert_eq!(h.state().ui.focused, PanelKind::Project); @@ -295,15 +297,17 @@ fn control_root_divider_drag_after_toolbar_and_dock_tab_keyboard_activation() { for tabs in 1..=200 { d.ok("ui.key", json!({"key":"Tab"}), true); assert!(d.h.state().ui.mini_flowchart.is_none(), "dock-tab traversal must not open a foreground popup"); - if tab_focused(&d.h, target) { - println!("control Tab presses to Effect Controls: {tabs}"); + if tab_focused(&d.h, "Project") { + println!("control Tab presses to Project: {tabs}"); break; } } - assert!(tab_focused(&d.h, target), "Effect Controls must remain reachable by control-channel Tab traversal"); + // A tab strip is one Tab stop: Tab reaches the shown tab, the arrows move between tabs. + d.ok("ui.key", json!({"key":"ArrowRight"}), true); + assert!(tab_focused(&d.h, target), "Effect Controls must remain reachable by control-channel keyboard traversal"); d.ok("ui.key", json!({"key":"Space"}), true); assert_eq!(d.h.state().ui.focused, PanelKind::EffectControls); - d.ok("ui.key", json!({"key":"Tab","shift":true}), true); + d.ok("ui.key", json!({"key":"ArrowLeft"}), true); d.ok("ui.key", json!({"key":"Enter"}), true); assert_eq!(d.h.state().ui.focused, PanelKind::Project); let before = d.h.state().ui.dock.clone(); From d9cdf70bd7e6bb92fd8130b51995dd64a6daf70d Mon Sep 17 00:00:00 2001 From: aiongg Date: Tue, 24 Nov 2026 22:48:32 +0000 Subject: [PATCH 427/451] Repin craft-libs to 951ca3f3d1 and egui to bbfd6471ed --- Cargo.lock | 204 +++++++++++++++++++------------------- Cargo.toml | 94 +++++++++--------- crates/effects/Cargo.toml | 2 +- 3 files changed, 150 insertions(+), 150 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4aed2daa8..07cfcfe8c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1315,12 +1315,12 @@ dependencies = [ [[package]] name = "craft-aep" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" [[package]] name = "craft-appkit" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ "block2 0.6.2", "objc2-app-kit 0.3.2", @@ -1330,7 +1330,7 @@ dependencies = [ [[package]] name = "craft-atomic" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ "rustix 1.1.6", ] @@ -1351,10 +1351,10 @@ dependencies = [ [[package]] name = "craft-audio" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ - "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", - "craft-xml 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", + "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", + "craft-xml 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", "log", "thiserror 2.0.21", ] @@ -1362,7 +1362,7 @@ dependencies = [ [[package]] name = "craft-behavior" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ "accesskit", "bitflags 2.13.2", @@ -1385,7 +1385,7 @@ source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa3 [[package]] name = "craft-cloud-ui" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ "egui", ] @@ -1393,7 +1393,7 @@ dependencies = [ [[package]] name = "craft-cms" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ "md-5", "rayon", @@ -1402,7 +1402,7 @@ dependencies = [ [[package]] name = "craft-codepage" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" [[package]] name = "craft-color" @@ -1415,7 +1415,7 @@ dependencies = [ [[package]] name = "craft-color" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ "serde", ] @@ -1423,7 +1423,7 @@ dependencies = [ [[package]] name = "craft-doc" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ "craft-ecproj-format", "craft-pcraft-format", @@ -1437,7 +1437,7 @@ dependencies = [ [[package]] name = "craft-docpath" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ "serde", ] @@ -1453,7 +1453,7 @@ dependencies = [ [[package]] name = "craft-dpx" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ "thiserror 2.0.21", ] @@ -1461,7 +1461,7 @@ dependencies = [ [[package]] name = "craft-ecproj-format" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ "serde", "serde_json", @@ -1471,7 +1471,7 @@ dependencies = [ [[package]] name = "craft-eps" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" [[package]] name = "craft-exr" @@ -1485,7 +1485,7 @@ dependencies = [ [[package]] name = "craft-exr" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ "exr", "flate2", @@ -1497,7 +1497,7 @@ dependencies = [ [[package]] name = "craft-font-catalog" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ "harfrust 0.13.3", "kurbo", @@ -1511,7 +1511,7 @@ dependencies = [ [[package]] name = "craft-fonts-build" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" [[package]] name = "craft-frame" @@ -1527,10 +1527,10 @@ dependencies = [ [[package]] name = "craft-frame" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ - "craft-color 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", - "craft-time 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", + "craft-color 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", + "craft-time 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", "rayon", "serde", ] @@ -1538,7 +1538,7 @@ dependencies = [ [[package]] name = "craft-gif" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ "gif", "image", @@ -1555,7 +1555,7 @@ dependencies = [ [[package]] name = "craft-host" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ "bitflags 2.13.2", "craft-i18n", @@ -1568,7 +1568,7 @@ dependencies = [ [[package]] name = "craft-i18n" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ "chrono", "fixed_decimal", @@ -1604,7 +1604,7 @@ dependencies = [ [[package]] name = "craft-jsonrpc" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ "serde_json", ] @@ -1612,13 +1612,13 @@ dependencies = [ [[package]] name = "craft-keymap" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ "craft-host", "craft-i18n", "craft-tracked", "craft-ui-macros", - "craft-xml 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", + "craft-xml 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", "egui", "serde", "serde_json", @@ -1627,7 +1627,7 @@ dependencies = [ [[package]] name = "craft-lottie" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ "craft-zip", "serde_json", @@ -1646,7 +1646,7 @@ dependencies = [ [[package]] name = "craft-media" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ "chrono", "thiserror 2.0.21", @@ -1669,14 +1669,14 @@ dependencies = [ [[package]] name = "craft-media-source" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ - "craft-audio 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", - "craft-color 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", - "craft-frame 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", - "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", - "craft-time 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", - "craft-y4m 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", + "craft-audio 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", + "craft-color 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", + "craft-frame 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", + "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", + "craft-time 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", + "craft-y4m 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", "serde", "thiserror 2.0.21", ] @@ -1684,7 +1684,7 @@ dependencies = [ [[package]] name = "craft-mesh" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ "craft-zip", "miniz_oxide 0.9.1", @@ -1694,7 +1694,7 @@ dependencies = [ [[package]] name = "craft-mime" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ "chrono", "craft-codepage", @@ -1704,7 +1704,7 @@ dependencies = [ [[package]] name = "craft-pcraft-format" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ "flate2", "serde", @@ -1715,7 +1715,7 @@ dependencies = [ [[package]] name = "craft-pdf" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ "hayro-syntax", "serde", @@ -1725,7 +1725,7 @@ dependencies = [ [[package]] name = "craft-platform" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ "async-channel", "async-io", @@ -1756,7 +1756,7 @@ dependencies = [ [[package]] name = "craft-ps" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ "craft-eps", "kurbo", @@ -1780,7 +1780,7 @@ dependencies = [ [[package]] name = "craft-psd" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ "encoding_rs", "flate2", @@ -1791,7 +1791,7 @@ dependencies = [ [[package]] name = "craft-quit" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ "dispatch2", "objc2 0.6.5", @@ -1817,7 +1817,7 @@ dependencies = [ [[package]] name = "craft-settings" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ "craft-atomic", "craft-host", @@ -1839,9 +1839,9 @@ source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa3 [[package]] name = "craft-svg" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ - "craft-xml 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", + "craft-xml 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", "flate2", "kurbo", "quick-xml 0.41.0", @@ -1864,7 +1864,7 @@ dependencies = [ [[package]] name = "craft-tga" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ "thiserror 2.0.21", ] @@ -1872,7 +1872,7 @@ dependencies = [ [[package]] name = "craft-theme" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ "bitflags 2.13.2", "craft-tracked", @@ -1905,7 +1905,7 @@ dependencies = [ [[package]] name = "craft-time" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ "serde", "thiserror 2.0.21", @@ -1925,9 +1925,9 @@ dependencies = [ [[package]] name = "craft-timeline" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ - "craft-time 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", + "craft-time 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", "serde", "web-time", ] @@ -1935,12 +1935,12 @@ dependencies = [ [[package]] name = "craft-tracked" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" [[package]] name = "craft-ui" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ "craft-cloud-ui", "craft-ui-canvas", @@ -1954,7 +1954,7 @@ dependencies = [ [[package]] name = "craft-ui-canvas" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ "craft-behavior", "craft-i18n", @@ -1970,7 +1970,7 @@ dependencies = [ [[package]] name = "craft-ui-contract" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ "accesskit", "craft-behavior", @@ -2008,7 +2008,7 @@ dependencies = [ [[package]] name = "craft-ui-macros" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2019,7 +2019,7 @@ dependencies = [ [[package]] name = "craft-ui-panels" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ "craft-behavior", "craft-host", @@ -2037,7 +2037,7 @@ dependencies = [ [[package]] name = "craft-ui-patterns" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ "craft-behavior", "craft-host", @@ -2058,7 +2058,7 @@ dependencies = [ [[package]] name = "craft-ui-shell" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ "craft-behavior", "craft-host", @@ -2078,7 +2078,7 @@ dependencies = [ [[package]] name = "craft-ui-widgets" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ "craft-behavior", "craft-host", @@ -2097,7 +2097,7 @@ dependencies = [ [[package]] name = "craft-update" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ "chrono", "craft-host", @@ -2126,7 +2126,7 @@ dependencies = [ [[package]] name = "craft-vectorcraft-format" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ "flate2", "serde", @@ -2148,9 +2148,9 @@ dependencies = [ [[package]] name = "craft-video" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ - "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", + "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", "rav1e", "rayon", "thiserror 2.0.21", @@ -2159,7 +2159,7 @@ dependencies = [ [[package]] name = "craft-webp" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ "image", "thiserror 2.0.21", @@ -2168,7 +2168,7 @@ dependencies = [ [[package]] name = "craft-win32" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ "winsafe", ] @@ -2176,7 +2176,7 @@ dependencies = [ [[package]] name = "craft-window" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ "craft-appkit", "craft-atomic", @@ -2210,7 +2210,7 @@ dependencies = [ [[package]] name = "craft-xml" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ "quick-xml 0.41.0", "serde", @@ -2228,7 +2228,7 @@ dependencies = [ [[package]] name = "craft-y4m" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ "thiserror 2.0.21", ] @@ -2236,7 +2236,7 @@ dependencies = [ [[package]] name = "craft-zip" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ "flate2", "thiserror 2.0.21", @@ -2530,7 +2530,7 @@ dependencies = [ [[package]] name = "ecolor" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=a87d00caaec947ea781657c6ff410c9838016d18#a87d00caaec947ea781657c6ff410c9838016d18" +source = "git+https://github.com/aiongg/egui.git?rev=bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e#bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e" dependencies = [ "bytemuck", "emath", @@ -2688,12 +2688,12 @@ dependencies = [ name = "effectcraft-export" version = "0.25.1" dependencies = [ - "craft-audio 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", - "craft-exr 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", + "craft-audio 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", + "craft-exr 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", "craft-gif", - "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", - "craft-tga 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", - "craft-video 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", + "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", + "craft-tga 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", + "craft-video 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", "effectcraft-color", "effectcraft-effects", "effectcraft-keyframe", @@ -2803,7 +2803,7 @@ dependencies = [ name = "effectcraft-interchange" version = "0.25.1" dependencies = [ - "craft-timeline 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", + "craft-timeline 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", "effectcraft-color", "effectcraft-keyframe", "effectcraft-project", @@ -2854,17 +2854,17 @@ dependencies = [ name = "effectcraft-media" version = "0.25.1" dependencies = [ - "craft-audio 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", - "craft-color 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", + "craft-audio 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", + "craft-color 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", "craft-docpath", - "craft-dpx 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", - "craft-exr 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", - "craft-frame 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", + "craft-dpx 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", + "craft-exr 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", + "craft-frame 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", "craft-gif", - "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", - "craft-media-source 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", - "craft-time 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", - "craft-video 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", + "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", + "craft-media-source 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", + "craft-time 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", + "craft-video 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", "craft-webp", "effectcraft-color", "effectcraft-effects", @@ -2969,7 +2969,7 @@ name = "effectcraft-psd" version = "0.25.1" dependencies = [ "craft-codepage", - "craft-psd 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", + "craft-psd 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", "miniz_oxide 0.9.1", ] @@ -2977,7 +2977,7 @@ dependencies = [ name = "effectcraft-raster" version = "0.25.1" dependencies = [ - "craft-exr 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4)", + "craft-exr 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", "effectcraft-color", "effectcraft-geom", "rayon", @@ -3170,7 +3170,7 @@ dependencies = [ [[package]] name = "eframe" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=a87d00caaec947ea781657c6ff410c9838016d18#a87d00caaec947ea781657c6ff410c9838016d18" +source = "git+https://github.com/aiongg/egui.git?rev=bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e#bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e" dependencies = [ "ahash", "bytemuck", @@ -3205,7 +3205,7 @@ dependencies = [ [[package]] name = "egui" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=a87d00caaec947ea781657c6ff410c9838016d18#a87d00caaec947ea781657c6ff410c9838016d18" +source = "git+https://github.com/aiongg/egui.git?rev=bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e#bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e" dependencies = [ "accesskit", "ahash", @@ -3224,7 +3224,7 @@ dependencies = [ [[package]] name = "egui-wgpu" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=a87d00caaec947ea781657c6ff410c9838016d18#a87d00caaec947ea781657c6ff410c9838016d18" +source = "git+https://github.com/aiongg/egui.git?rev=bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e#bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e" dependencies = [ "ahash", "bytemuck", @@ -3243,7 +3243,7 @@ dependencies = [ [[package]] name = "egui-winit" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=a87d00caaec947ea781657c6ff410c9838016d18#a87d00caaec947ea781657c6ff410c9838016d18" +source = "git+https://github.com/aiongg/egui.git?rev=bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e#bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e" dependencies = [ "accesskit_winit", "arboard", @@ -3269,7 +3269,7 @@ dependencies = [ [[package]] name = "egui_extras" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=a87d00caaec947ea781657c6ff410c9838016d18#a87d00caaec947ea781657c6ff410c9838016d18" +source = "git+https://github.com/aiongg/egui.git?rev=bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e#bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e" dependencies = [ "ahash", "egui", @@ -3282,7 +3282,7 @@ dependencies = [ [[package]] name = "egui_glow" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=a87d00caaec947ea781657c6ff410c9838016d18#a87d00caaec947ea781657c6ff410c9838016d18" +source = "git+https://github.com/aiongg/egui.git?rev=bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e#bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e" dependencies = [ "bytemuck", "egui", @@ -3295,7 +3295,7 @@ dependencies = [ [[package]] name = "egui_kittest" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=a87d00caaec947ea781657c6ff410c9838016d18#a87d00caaec947ea781657c6ff410c9838016d18" +source = "git+https://github.com/aiongg/egui.git?rev=bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e#bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e" dependencies = [ "eframe", "egui", @@ -3318,7 +3318,7 @@ checksum = "252afb9ae5eaa683babdc6a068b3f5726eb19e05070c731f9b2a23a7c3e8ed34" [[package]] name = "emath" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=a87d00caaec947ea781657c6ff410c9838016d18#a87d00caaec947ea781657c6ff410c9838016d18" +source = "git+https://github.com/aiongg/egui.git?rev=bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e#bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e" dependencies = [ "bytemuck", ] @@ -3411,7 +3411,7 @@ dependencies = [ [[package]] name = "epaint" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=a87d00caaec947ea781657c6ff410c9838016d18#a87d00caaec947ea781657c6ff410c9838016d18" +source = "git+https://github.com/aiongg/egui.git?rev=bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e#bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e" dependencies = [ "ahash", "bytemuck", @@ -3437,7 +3437,7 @@ dependencies = [ [[package]] name = "epaint_default_fonts" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=a87d00caaec947ea781657c6ff410c9838016d18#a87d00caaec947ea781657c6ff410c9838016d18" +source = "git+https://github.com/aiongg/egui.git?rev=bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e#bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e" [[package]] name = "equator" @@ -4374,7 +4374,7 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a" [[package]] name = "hayro-jbig2" version = "0.3.0" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ "hayro-ccitt", ] @@ -4388,7 +4388,7 @@ checksum = "c75ab947623ef4ccaa7acf0579edf7cbb5a73838e3839a7be73335e522f433a1" [[package]] name = "hayro-syntax" version = "0.7.2" -source = "git+https://github.com/aiongg/craft-libs?rev=3408eb09a57969987db986514978bb24cc6859c4#3408eb09a57969987db986514978bb24cc6859c4" +source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" dependencies = [ "hayro-jbig2", "hayro-jpeg2000", diff --git a/Cargo.toml b/Cargo.toml index 87c1e9e48..7050299bd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,28 +11,28 @@ rust-version = "1.95" repository = "https://github.com/storytold/effectcraft" [workspace.dependencies] -craft-timeline = { git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4", default-features = false } -craft-mime = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } -craft-pdf = { git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4", version = "=0.1.0", default-features = false, features = ["read"] } -craft-docpath = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } -craft-jsonrpc = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } -craft-ecproj-format = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } -craft-dpx = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } -craft-ps = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4", default-features = false, features = ["read"] } -craft-exr = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } -craft-gif = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } -craft-tga = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } -craft-psd = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } -craft-codepage = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } -craft-svg = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } -craft-webp = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } -craft-lottie = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } -craft-mesh = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4", default-features = false, features = ["stl", "obj", "gltf", "fbx"] } -craft-aep = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } -craft-doc = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } -craft-vectorcraft-format = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } +craft-timeline = { git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0", default-features = false } +craft-mime = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } +craft-pdf = { git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0", version = "=0.1.0", default-features = false, features = ["read"] } +craft-docpath = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } +craft-jsonrpc = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } +craft-ecproj-format = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } +craft-dpx = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } +craft-ps = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0", default-features = false, features = ["read"] } +craft-exr = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } +craft-gif = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } +craft-tga = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } +craft-psd = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } +craft-codepage = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } +craft-svg = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } +craft-webp = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } +craft-lottie = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } +craft-mesh = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0", default-features = false, features = ["stl", "obj", "gltf", "fbx"] } +craft-aep = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } +craft-doc = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } +craft-vectorcraft-format = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } # craft-update: app-specific pretend versions apply to startup and manual checks. -craft-update = { git = "https://github.com/aiongg/craft-libs", version = "=0.1.0", rev = "3408eb09a57969987db986514978bb24cc6859c4", features = ["ui"] } +craft-update = { git = "https://github.com/aiongg/craft-libs", version = "=0.1.0", rev = "951ca3f3d19b617765996b2523af894679c077a0", features = ["ui"] } # internal effectcraft-time = { path = "crates/time" } effectcraft-geom = { path = "crates/geom" } @@ -97,13 +97,13 @@ same-file = "1.0" tempfile = "3.27" # codecs + containers shared by the Craft apps (crates/media, crates/export); keep all in sync. -craft-media = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4", default-features = false, features = ["isobmff", "matroska"] } -craft-media-source = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } -craft-frame = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } -craft-color = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } -craft-time = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } -craft-audio = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4", default-features = false, features = ["aac-decode", "aac-encode", "alac-decode", "opus-decode", "opus-encode", "ac3-decode", "mp3-decode", "mpa-decode"] } -craft-video = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4", features = ["h264-decode", "h264-encode", "prores", "hevc-encode", "vp9-encode", "av1", "threads"] } +craft-media = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0", default-features = false, features = ["isobmff", "matroska"] } +craft-media-source = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } +craft-frame = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } +craft-color = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } +craft-time = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } +craft-audio = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0", default-features = false, features = ["aac-decode", "aac-encode", "alac-decode", "opus-decode", "opus-encode", "ac3-decode", "mp3-decode", "mpa-decode"] } +craft-video = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0", features = ["h264-decode", "h264-encode", "prores", "hevc-encode", "vp9-encode", "av1", "threads"] } # footage decoding: FilmCraft's pure-Rust crates, pinned to a revision (plan/adr/0001). # Only `crates/media`, `crates/export` and `crates/interchange` may depend on these. @@ -126,12 +126,12 @@ half = "2.7" # ui # Shared frontend components; keep this dependency above the engine boundary. # Shared UI and the complete egui family select reviewed immutable commits below. -craft-ui = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } -craft-behavior = { git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } -craft-host = { git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } -craft-keymap = { git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } -craft-theme = { git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } -craft-window = { git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } +craft-ui = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } +craft-behavior = { git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } +craft-host = { git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } +craft-keymap = { git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } +craft-theme = { git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } +craft-window = { git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } # `default_fonts` and `monochrome_emoji_fonts` are explicit: the app's `FontDefinitions::default()` # and its `✔`/`▣` chrome glyphs need both, and kittest's own dev-dependencies do not propagate. egui = { version = "0.37", default-features = false, features = ["default_fonts", "monochrome_emoji_fonts"] } @@ -236,19 +236,19 @@ lto = "thin" codegen-units = 1 [patch.crates-io] -hayro-syntax = { git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4", version = "=0.7.2" } -hayro-jbig2 = { git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4", version = "=0.3.0" } -ecolor = { git = "https://github.com/storytold/egui.git", rev = "a87d00caaec947ea781657c6ff410c9838016d18" } -emath = { git = "https://github.com/storytold/egui.git", rev = "a87d00caaec947ea781657c6ff410c9838016d18" } -epaint = { git = "https://github.com/storytold/egui.git", rev = "a87d00caaec947ea781657c6ff410c9838016d18" } -epaint_default_fonts = { git = "https://github.com/storytold/egui.git", rev = "a87d00caaec947ea781657c6ff410c9838016d18" } -egui = { git = "https://github.com/storytold/egui.git", rev = "a87d00caaec947ea781657c6ff410c9838016d18" } -egui-winit = { git = "https://github.com/storytold/egui.git", rev = "a87d00caaec947ea781657c6ff410c9838016d18" } -egui-wgpu = { git = "https://github.com/storytold/egui.git", rev = "a87d00caaec947ea781657c6ff410c9838016d18" } -egui_glow = { git = "https://github.com/storytold/egui.git", rev = "a87d00caaec947ea781657c6ff410c9838016d18" } -egui_extras = { git = "https://github.com/storytold/egui.git", rev = "a87d00caaec947ea781657c6ff410c9838016d18" } -egui_kittest = { git = "https://github.com/storytold/egui.git", rev = "a87d00caaec947ea781657c6ff410c9838016d18" } -eframe = { git = "https://github.com/storytold/egui.git", rev = "a87d00caaec947ea781657c6ff410c9838016d18" } +hayro-syntax = { git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0", version = "=0.7.2" } +hayro-jbig2 = { git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0", version = "=0.3.0" } +ecolor = { git = "https://github.com/aiongg/egui.git", rev = "bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e" } +emath = { git = "https://github.com/aiongg/egui.git", rev = "bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e" } +epaint = { git = "https://github.com/aiongg/egui.git", rev = "bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e" } +epaint_default_fonts = { git = "https://github.com/aiongg/egui.git", rev = "bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e" } +egui = { git = "https://github.com/aiongg/egui.git", rev = "bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e" } +egui-winit = { git = "https://github.com/aiongg/egui.git", rev = "bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e" } +egui-wgpu = { git = "https://github.com/aiongg/egui.git", rev = "bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e" } +egui_glow = { git = "https://github.com/aiongg/egui.git", rev = "bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e" } +egui_extras = { git = "https://github.com/aiongg/egui.git", rev = "bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e" } +egui_kittest = { git = "https://github.com/aiongg/egui.git", rev = "bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e" } +eframe = { git = "https://github.com/aiongg/egui.git", rev = "bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e" } # Patch a crate only together with the dependency that needs it: an unused patch makes the Nix # build, which uses vendored sources, fail (`cargo xtask lock-patches`). winit = { git = "https://github.com/storytold/winit.git", rev = "a517b3846ee8457d84ee4975110bfda6797c44dc" } diff --git a/crates/effects/Cargo.toml b/crates/effects/Cargo.toml index ef2736e7c..8976d3ea5 100644 --- a/crates/effects/Cargo.toml +++ b/crates/effects/Cargo.toml @@ -10,7 +10,7 @@ rust-version.workspace = true workspace = true [dependencies] -craft-cms = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "3408eb09a57969987db986514978bb24cc6859c4" } +craft-cms = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } effectcraft-geom = { workspace = true } effectcraft-color = { workspace = true } effectcraft-keyframe = { workspace = true } From 8185b901ce4debca079c900b26db26302f37f9e2 Mon Sep 17 00:00:00 2001 From: aiongg Date: Tue, 24 Nov 2026 22:51:43 +0000 Subject: [PATCH 428/451] Serialise the viewer frame tests that read the process-wide LUT generation --- crates/ui-egui/src/app/viewer_frames.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/ui-egui/src/app/viewer_frames.rs b/crates/ui-egui/src/app/viewer_frames.rs index 96dc4d28d..9d2f2d88d 100644 --- a/crates/ui-egui/src/app/viewer_frames.rs +++ b/crates/ui-egui/src/app/viewer_frames.rs @@ -256,10 +256,15 @@ impl EffectcraftApp { #[cfg(test)] mod tests { + /// The LUT generation is process-wide: a test that changes a LUT file moves it for every + /// viewer in the process, so the tests that read frame keys run one at a time. + static LUT_GENERATION: std::sync::Mutex<()> = std::sync::Mutex::new(()); + /// #3493: the viewer shows the frame again once the LUT file it was graded with changes, /// though its key was otherwise the same (same project revision, frame and options). #[test] fn the_viewer_shows_a_lut_file_changed_on_disk() { + let _serial = LUT_GENERATION.lock().unwrap_or_else(std::sync::PoisonError::into_inner); let dir = tempfile::tempdir().unwrap(); let lut = dir.path().join("viewer.cube"); let write = |text: &str, secs: u64| { @@ -302,6 +307,7 @@ mod tests { /// frame having the key of the one on screen. A reload's purge gives the frames new keys, once. #[test] fn the_viewers_show_a_still_reloaded_at_the_same_size() { + let _serial = LUT_GENERATION.lock().unwrap_or_else(std::sync::PoisonError::into_inner); let dir = tempfile::tempdir().unwrap(); let png = dir.path().join("still.png"); let save = |rgb: [u8; 3]| image::RgbaImage::from_pixel(64, 36, image::Rgba([rgb[0], rgb[1], rgb[2], 255])).save(&png).unwrap(); From 4192e377445c5b0ad9b30785218639f4cca7b435 Mon Sep 17 00:00:00 2001 From: aiongg Date: Tue, 24 Nov 2026 23:37:57 +0000 Subject: [PATCH 429/451] Drop the egui::ComboBox ban: the egui fork's combo menu grows back with its contents (egui#5225) --- clippy.toml | 3 --- 1 file changed, 3 deletions(-) diff --git a/clippy.toml b/clippy.toml index a4200a0e1..3acd268c4 100644 --- a/clippy.toml +++ b/clippy.toml @@ -2,7 +2,4 @@ allow-unwrap-in-tests = true allow-expect-in-tests = true allow-panic-in-tests = true allow-indexing-slicing-in-tests = true -disallowed-types = [ - { path = "egui::ComboBox", reason = "use craft_ui::ComboBox: egui's combo box menu can't grow back while open (egui#5225)" }, -] cognitive-complexity-threshold = 30 From f7526200bdc920a0319caf29ee208456214a2156 Mon Sep 17 00:00:00 2001 From: aiongg Date: Wed, 25 Nov 2026 00:32:01 +0000 Subject: [PATCH 430/451] Repin craft-libs to 0bac50867b and egui to c7a2f6af5d; drop an unused import in ui_tabs --- Cargo.lock | 380 ++++++++++++++--------------- Cargo.toml | 94 +++---- crates/effects/Cargo.toml | 2 +- crates/ui-egui/tests/it/ui_tabs.rs | 2 +- 4 files changed, 239 insertions(+), 239 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 07cfcfe8c..aa9e71002 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1315,12 +1315,12 @@ dependencies = [ [[package]] name = "craft-aep" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" [[package]] name = "craft-appkit" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ "block2 0.6.2", "objc2-app-kit 0.3.2", @@ -1330,11 +1330,22 @@ dependencies = [ [[package]] name = "craft-atomic" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ "rustix 1.1.6", ] +[[package]] +name = "craft-audio" +version = "0.1.0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +dependencies = [ + "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", + "craft-xml 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", + "log", + "thiserror 2.0.21", +] + [[package]] name = "craft-audio" version = "0.1.0" @@ -1348,21 +1359,10 @@ dependencies = [ "thiserror 2.0.21", ] -[[package]] -name = "craft-audio" -version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" -dependencies = [ - "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", - "craft-xml 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", - "log", - "thiserror 2.0.21", -] - [[package]] name = "craft-behavior" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ "accesskit", "bitflags 2.13.2", @@ -1385,7 +1385,7 @@ source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa3 [[package]] name = "craft-cloud-ui" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ "egui", ] @@ -1393,7 +1393,7 @@ dependencies = [ [[package]] name = "craft-cms" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ "md-5", "rayon", @@ -1402,7 +1402,15 @@ dependencies = [ [[package]] name = "craft-codepage" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" + +[[package]] +name = "craft-color" +version = "0.1.0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +dependencies = [ + "serde", +] [[package]] name = "craft-color" @@ -1412,18 +1420,10 @@ dependencies = [ "serde", ] -[[package]] -name = "craft-color" -version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" -dependencies = [ - "serde", -] - [[package]] name = "craft-doc" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ "craft-ecproj-format", "craft-pcraft-format", @@ -1437,11 +1437,19 @@ dependencies = [ [[package]] name = "craft-docpath" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ "serde", ] +[[package]] +name = "craft-dpx" +version = "0.1.0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +dependencies = [ + "thiserror 2.0.21", +] + [[package]] name = "craft-dpx" version = "0.1.0" @@ -1450,18 +1458,10 @@ dependencies = [ "thiserror 2.0.21", ] -[[package]] -name = "craft-dpx" -version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" -dependencies = [ - "thiserror 2.0.21", -] - [[package]] name = "craft-ecproj-format" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ "serde", "serde_json", @@ -1471,7 +1471,19 @@ dependencies = [ [[package]] name = "craft-eps" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" + +[[package]] +name = "craft-exr" +version = "0.1.0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +dependencies = [ + "exr", + "flate2", + "half", + "serde_json", + "thiserror 2.0.21", +] [[package]] name = "craft-exr" @@ -1482,22 +1494,10 @@ dependencies = [ "serde_json", ] -[[package]] -name = "craft-exr" -version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" -dependencies = [ - "exr", - "flate2", - "half", - "serde_json", - "thiserror 2.0.21", -] - [[package]] name = "craft-font-catalog" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ "harfrust 0.13.3", "kurbo", @@ -1511,7 +1511,18 @@ dependencies = [ [[package]] name = "craft-fonts-build" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" + +[[package]] +name = "craft-frame" +version = "0.1.0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +dependencies = [ + "craft-color 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", + "craft-time 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", + "rayon", + "serde", +] [[package]] name = "craft-frame" @@ -1524,21 +1535,10 @@ dependencies = [ "serde", ] -[[package]] -name = "craft-frame" -version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" -dependencies = [ - "craft-color 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", - "craft-time 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", - "rayon", - "serde", -] - [[package]] name = "craft-gif" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ "gif", "image", @@ -1555,7 +1555,7 @@ dependencies = [ [[package]] name = "craft-host" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ "bitflags 2.13.2", "craft-i18n", @@ -1568,7 +1568,7 @@ dependencies = [ [[package]] name = "craft-i18n" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ "chrono", "fixed_decimal", @@ -1604,7 +1604,7 @@ dependencies = [ [[package]] name = "craft-jsonrpc" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ "serde_json", ] @@ -1612,13 +1612,13 @@ dependencies = [ [[package]] name = "craft-keymap" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ "craft-host", "craft-i18n", "craft-tracked", "craft-ui-macros", - "craft-xml 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", + "craft-xml 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", "egui", "serde", "serde_json", @@ -1627,13 +1627,22 @@ dependencies = [ [[package]] name = "craft-lottie" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ "craft-zip", "serde_json", "thiserror 2.0.21", ] +[[package]] +name = "craft-media" +version = "0.1.0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +dependencies = [ + "chrono", + "thiserror 2.0.21", +] + [[package]] name = "craft-media" version = "0.1.0" @@ -1644,11 +1653,17 @@ dependencies = [ ] [[package]] -name = "craft-media" +name = "craft-media-source" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ - "chrono", + "craft-audio 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", + "craft-color 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", + "craft-frame 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", + "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", + "craft-time 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", + "craft-y4m 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", + "serde", "thiserror 2.0.21", ] @@ -1666,25 +1681,10 @@ dependencies = [ "thiserror 2.0.21", ] -[[package]] -name = "craft-media-source" -version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" -dependencies = [ - "craft-audio 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", - "craft-color 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", - "craft-frame 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", - "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", - "craft-time 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", - "craft-y4m 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", - "serde", - "thiserror 2.0.21", -] - [[package]] name = "craft-mesh" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ "craft-zip", "miniz_oxide 0.9.1", @@ -1694,7 +1694,7 @@ dependencies = [ [[package]] name = "craft-mime" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ "chrono", "craft-codepage", @@ -1704,7 +1704,7 @@ dependencies = [ [[package]] name = "craft-pcraft-format" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ "flate2", "serde", @@ -1715,7 +1715,7 @@ dependencies = [ [[package]] name = "craft-pdf" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ "hayro-syntax", "serde", @@ -1725,7 +1725,7 @@ dependencies = [ [[package]] name = "craft-platform" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ "async-channel", "async-io", @@ -1756,7 +1756,7 @@ dependencies = [ [[package]] name = "craft-ps" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ "craft-eps", "kurbo", @@ -1766,6 +1766,17 @@ dependencies = [ "weezl", ] +[[package]] +name = "craft-psd" +version = "0.1.0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +dependencies = [ + "encoding_rs", + "flate2", + "rayon", + "thiserror 2.0.21", +] + [[package]] name = "craft-psd" version = "0.1.0" @@ -1777,21 +1788,10 @@ dependencies = [ "thiserror 2.0.21", ] -[[package]] -name = "craft-psd" -version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" -dependencies = [ - "encoding_rs", - "flate2", - "rayon", - "thiserror 2.0.21", -] - [[package]] name = "craft-quit" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ "dispatch2", "objc2 0.6.5", @@ -1817,7 +1817,7 @@ dependencies = [ [[package]] name = "craft-settings" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ "craft-atomic", "craft-host", @@ -1839,9 +1839,9 @@ source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa3 [[package]] name = "craft-svg" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ - "craft-xml 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", + "craft-xml 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", "flate2", "kurbo", "quick-xml 0.41.0", @@ -1856,7 +1856,7 @@ dependencies = [ [[package]] name = "craft-tga" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ "thiserror 2.0.21", ] @@ -1864,7 +1864,7 @@ dependencies = [ [[package]] name = "craft-tga" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ "thiserror 2.0.21", ] @@ -1872,7 +1872,7 @@ dependencies = [ [[package]] name = "craft-theme" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ "bitflags 2.13.2", "craft-tracked", @@ -1896,7 +1896,7 @@ dependencies = [ [[package]] name = "craft-time" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ "serde", "thiserror 2.0.21", @@ -1905,12 +1905,22 @@ dependencies = [ [[package]] name = "craft-time" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ "serde", "thiserror 2.0.21", ] +[[package]] +name = "craft-timeline" +version = "0.1.0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +dependencies = [ + "craft-time 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", + "serde", + "web-time", +] + [[package]] name = "craft-timeline" version = "0.1.0" @@ -1922,25 +1932,15 @@ dependencies = [ "serde_json", ] -[[package]] -name = "craft-timeline" -version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" -dependencies = [ - "craft-time 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", - "serde", - "web-time", -] - [[package]] name = "craft-tracked" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" [[package]] name = "craft-ui" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ "craft-cloud-ui", "craft-ui-canvas", @@ -1954,7 +1954,7 @@ dependencies = [ [[package]] name = "craft-ui-canvas" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ "craft-behavior", "craft-i18n", @@ -1970,7 +1970,7 @@ dependencies = [ [[package]] name = "craft-ui-contract" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ "accesskit", "craft-behavior", @@ -2008,7 +2008,7 @@ dependencies = [ [[package]] name = "craft-ui-macros" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2019,7 +2019,7 @@ dependencies = [ [[package]] name = "craft-ui-panels" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ "craft-behavior", "craft-host", @@ -2037,7 +2037,7 @@ dependencies = [ [[package]] name = "craft-ui-patterns" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ "craft-behavior", "craft-host", @@ -2058,7 +2058,7 @@ dependencies = [ [[package]] name = "craft-ui-shell" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ "craft-behavior", "craft-host", @@ -2078,7 +2078,7 @@ dependencies = [ [[package]] name = "craft-ui-widgets" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ "craft-behavior", "craft-host", @@ -2097,7 +2097,7 @@ dependencies = [ [[package]] name = "craft-update" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ "chrono", "craft-host", @@ -2126,7 +2126,7 @@ dependencies = [ [[package]] name = "craft-vectorcraft-format" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ "flate2", "serde", @@ -2134,6 +2134,17 @@ dependencies = [ "thiserror 2.0.21", ] +[[package]] +name = "craft-video" +version = "0.1.0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +dependencies = [ + "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", + "rav1e", + "rayon", + "thiserror 2.0.21", +] + [[package]] name = "craft-video" version = "0.1.0" @@ -2145,21 +2156,10 @@ dependencies = [ "thiserror 2.0.21", ] -[[package]] -name = "craft-video" -version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" -dependencies = [ - "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", - "rav1e", - "rayon", - "thiserror 2.0.21", -] - [[package]] name = "craft-webp" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ "image", "thiserror 2.0.21", @@ -2168,7 +2168,7 @@ dependencies = [ [[package]] name = "craft-win32" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ "winsafe", ] @@ -2176,7 +2176,7 @@ dependencies = [ [[package]] name = "craft-window" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ "craft-appkit", "craft-atomic", @@ -2200,7 +2200,7 @@ dependencies = [ [[package]] name = "craft-xml" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ "quick-xml 0.41.0", "serde", @@ -2210,13 +2210,21 @@ dependencies = [ [[package]] name = "craft-xml" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ "quick-xml 0.41.0", "serde", "thiserror 2.0.21", ] +[[package]] +name = "craft-y4m" +version = "0.1.0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +dependencies = [ + "thiserror 2.0.21", +] + [[package]] name = "craft-y4m" version = "0.1.0" @@ -2225,18 +2233,10 @@ dependencies = [ "thiserror 2.0.21", ] -[[package]] -name = "craft-y4m" -version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" -dependencies = [ - "thiserror 2.0.21", -] - [[package]] name = "craft-zip" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ "flate2", "thiserror 2.0.21", @@ -2530,7 +2530,7 @@ dependencies = [ [[package]] name = "ecolor" version = "0.37.0" -source = "git+https://github.com/aiongg/egui.git?rev=bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e#bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e" +source = "git+https://github.com/aiongg/egui.git?rev=c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944#c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944" dependencies = [ "bytemuck", "emath", @@ -2688,12 +2688,12 @@ dependencies = [ name = "effectcraft-export" version = "0.25.1" dependencies = [ - "craft-audio 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", - "craft-exr 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", + "craft-audio 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", + "craft-exr 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", "craft-gif", - "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", - "craft-tga 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", - "craft-video 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", + "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", + "craft-tga 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", + "craft-video 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", "effectcraft-color", "effectcraft-effects", "effectcraft-keyframe", @@ -2803,7 +2803,7 @@ dependencies = [ name = "effectcraft-interchange" version = "0.25.1" dependencies = [ - "craft-timeline 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", + "craft-timeline 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", "effectcraft-color", "effectcraft-keyframe", "effectcraft-project", @@ -2854,17 +2854,17 @@ dependencies = [ name = "effectcraft-media" version = "0.25.1" dependencies = [ - "craft-audio 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", - "craft-color 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", + "craft-audio 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", + "craft-color 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", "craft-docpath", - "craft-dpx 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", - "craft-exr 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", - "craft-frame 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", + "craft-dpx 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", + "craft-exr 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", + "craft-frame 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", "craft-gif", - "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", - "craft-media-source 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", - "craft-time 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", - "craft-video 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", + "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", + "craft-media-source 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", + "craft-time 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", + "craft-video 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", "craft-webp", "effectcraft-color", "effectcraft-effects", @@ -2969,7 +2969,7 @@ name = "effectcraft-psd" version = "0.25.1" dependencies = [ "craft-codepage", - "craft-psd 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", + "craft-psd 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", "miniz_oxide 0.9.1", ] @@ -2977,7 +2977,7 @@ dependencies = [ name = "effectcraft-raster" version = "0.25.1" dependencies = [ - "craft-exr 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0)", + "craft-exr 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", "effectcraft-color", "effectcraft-geom", "rayon", @@ -3170,7 +3170,7 @@ dependencies = [ [[package]] name = "eframe" version = "0.37.0" -source = "git+https://github.com/aiongg/egui.git?rev=bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e#bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e" +source = "git+https://github.com/aiongg/egui.git?rev=c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944#c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944" dependencies = [ "ahash", "bytemuck", @@ -3205,7 +3205,7 @@ dependencies = [ [[package]] name = "egui" version = "0.37.0" -source = "git+https://github.com/aiongg/egui.git?rev=bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e#bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e" +source = "git+https://github.com/aiongg/egui.git?rev=c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944#c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944" dependencies = [ "accesskit", "ahash", @@ -3224,7 +3224,7 @@ dependencies = [ [[package]] name = "egui-wgpu" version = "0.37.0" -source = "git+https://github.com/aiongg/egui.git?rev=bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e#bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e" +source = "git+https://github.com/aiongg/egui.git?rev=c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944#c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944" dependencies = [ "ahash", "bytemuck", @@ -3243,7 +3243,7 @@ dependencies = [ [[package]] name = "egui-winit" version = "0.37.0" -source = "git+https://github.com/aiongg/egui.git?rev=bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e#bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e" +source = "git+https://github.com/aiongg/egui.git?rev=c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944#c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944" dependencies = [ "accesskit_winit", "arboard", @@ -3269,7 +3269,7 @@ dependencies = [ [[package]] name = "egui_extras" version = "0.37.0" -source = "git+https://github.com/aiongg/egui.git?rev=bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e#bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e" +source = "git+https://github.com/aiongg/egui.git?rev=c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944#c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944" dependencies = [ "ahash", "egui", @@ -3282,7 +3282,7 @@ dependencies = [ [[package]] name = "egui_glow" version = "0.37.0" -source = "git+https://github.com/aiongg/egui.git?rev=bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e#bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e" +source = "git+https://github.com/aiongg/egui.git?rev=c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944#c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944" dependencies = [ "bytemuck", "egui", @@ -3295,7 +3295,7 @@ dependencies = [ [[package]] name = "egui_kittest" version = "0.37.0" -source = "git+https://github.com/aiongg/egui.git?rev=bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e#bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e" +source = "git+https://github.com/aiongg/egui.git?rev=c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944#c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944" dependencies = [ "eframe", "egui", @@ -3318,7 +3318,7 @@ checksum = "252afb9ae5eaa683babdc6a068b3f5726eb19e05070c731f9b2a23a7c3e8ed34" [[package]] name = "emath" version = "0.37.0" -source = "git+https://github.com/aiongg/egui.git?rev=bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e#bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e" +source = "git+https://github.com/aiongg/egui.git?rev=c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944#c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944" dependencies = [ "bytemuck", ] @@ -3411,7 +3411,7 @@ dependencies = [ [[package]] name = "epaint" version = "0.37.0" -source = "git+https://github.com/aiongg/egui.git?rev=bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e#bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e" +source = "git+https://github.com/aiongg/egui.git?rev=c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944#c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944" dependencies = [ "ahash", "bytemuck", @@ -3437,7 +3437,7 @@ dependencies = [ [[package]] name = "epaint_default_fonts" version = "0.37.0" -source = "git+https://github.com/aiongg/egui.git?rev=bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e#bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e" +source = "git+https://github.com/aiongg/egui.git?rev=c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944#c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944" [[package]] name = "equator" @@ -4374,7 +4374,7 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a" [[package]] name = "hayro-jbig2" version = "0.3.0" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ "hayro-ccitt", ] @@ -4388,7 +4388,7 @@ checksum = "c75ab947623ef4ccaa7acf0579edf7cbb5a73838e3839a7be73335e522f433a1" [[package]] name = "hayro-syntax" version = "0.7.2" -source = "git+https://github.com/aiongg/craft-libs?rev=951ca3f3d19b617765996b2523af894679c077a0#951ca3f3d19b617765996b2523af894679c077a0" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ "hayro-jbig2", "hayro-jpeg2000", diff --git a/Cargo.toml b/Cargo.toml index 7050299bd..bd05467d8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,28 +11,28 @@ rust-version = "1.95" repository = "https://github.com/storytold/effectcraft" [workspace.dependencies] -craft-timeline = { git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0", default-features = false } -craft-mime = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } -craft-pdf = { git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0", version = "=0.1.0", default-features = false, features = ["read"] } -craft-docpath = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } -craft-jsonrpc = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } -craft-ecproj-format = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } -craft-dpx = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } -craft-ps = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0", default-features = false, features = ["read"] } -craft-exr = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } -craft-gif = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } -craft-tga = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } -craft-psd = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } -craft-codepage = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } -craft-svg = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } -craft-webp = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } -craft-lottie = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } -craft-mesh = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0", default-features = false, features = ["stl", "obj", "gltf", "fbx"] } -craft-aep = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } -craft-doc = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } -craft-vectorcraft-format = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } +craft-timeline = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", default-features = false } +craft-mime = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } +craft-pdf = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", version = "=0.1.0", default-features = false, features = ["read"] } +craft-docpath = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } +craft-jsonrpc = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } +craft-ecproj-format = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } +craft-dpx = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } +craft-ps = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", default-features = false, features = ["read"] } +craft-exr = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } +craft-gif = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } +craft-tga = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } +craft-psd = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } +craft-codepage = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } +craft-svg = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } +craft-webp = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } +craft-lottie = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } +craft-mesh = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", default-features = false, features = ["stl", "obj", "gltf", "fbx"] } +craft-aep = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } +craft-doc = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } +craft-vectorcraft-format = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } # craft-update: app-specific pretend versions apply to startup and manual checks. -craft-update = { git = "https://github.com/aiongg/craft-libs", version = "=0.1.0", rev = "951ca3f3d19b617765996b2523af894679c077a0", features = ["ui"] } +craft-update = { git = "https://github.com/aiongg/craft-libs", version = "=0.1.0", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", features = ["ui"] } # internal effectcraft-time = { path = "crates/time" } effectcraft-geom = { path = "crates/geom" } @@ -97,13 +97,13 @@ same-file = "1.0" tempfile = "3.27" # codecs + containers shared by the Craft apps (crates/media, crates/export); keep all in sync. -craft-media = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0", default-features = false, features = ["isobmff", "matroska"] } -craft-media-source = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } -craft-frame = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } -craft-color = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } -craft-time = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } -craft-audio = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0", default-features = false, features = ["aac-decode", "aac-encode", "alac-decode", "opus-decode", "opus-encode", "ac3-decode", "mp3-decode", "mpa-decode"] } -craft-video = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0", features = ["h264-decode", "h264-encode", "prores", "hevc-encode", "vp9-encode", "av1", "threads"] } +craft-media = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", default-features = false, features = ["isobmff", "matroska"] } +craft-media-source = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } +craft-frame = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } +craft-color = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } +craft-time = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } +craft-audio = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", default-features = false, features = ["aac-decode", "aac-encode", "alac-decode", "opus-decode", "opus-encode", "ac3-decode", "mp3-decode", "mpa-decode"] } +craft-video = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", features = ["h264-decode", "h264-encode", "prores", "hevc-encode", "vp9-encode", "av1", "threads"] } # footage decoding: FilmCraft's pure-Rust crates, pinned to a revision (plan/adr/0001). # Only `crates/media`, `crates/export` and `crates/interchange` may depend on these. @@ -126,12 +126,12 @@ half = "2.7" # ui # Shared frontend components; keep this dependency above the engine boundary. # Shared UI and the complete egui family select reviewed immutable commits below. -craft-ui = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } -craft-behavior = { git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } -craft-host = { git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } -craft-keymap = { git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } -craft-theme = { git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } -craft-window = { git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } +craft-ui = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } +craft-behavior = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } +craft-host = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } +craft-keymap = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } +craft-theme = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } +craft-window = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } # `default_fonts` and `monochrome_emoji_fonts` are explicit: the app's `FontDefinitions::default()` # and its `✔`/`▣` chrome glyphs need both, and kittest's own dev-dependencies do not propagate. egui = { version = "0.37", default-features = false, features = ["default_fonts", "monochrome_emoji_fonts"] } @@ -236,19 +236,19 @@ lto = "thin" codegen-units = 1 [patch.crates-io] -hayro-syntax = { git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0", version = "=0.7.2" } -hayro-jbig2 = { git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0", version = "=0.3.0" } -ecolor = { git = "https://github.com/aiongg/egui.git", rev = "bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e" } -emath = { git = "https://github.com/aiongg/egui.git", rev = "bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e" } -epaint = { git = "https://github.com/aiongg/egui.git", rev = "bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e" } -epaint_default_fonts = { git = "https://github.com/aiongg/egui.git", rev = "bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e" } -egui = { git = "https://github.com/aiongg/egui.git", rev = "bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e" } -egui-winit = { git = "https://github.com/aiongg/egui.git", rev = "bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e" } -egui-wgpu = { git = "https://github.com/aiongg/egui.git", rev = "bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e" } -egui_glow = { git = "https://github.com/aiongg/egui.git", rev = "bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e" } -egui_extras = { git = "https://github.com/aiongg/egui.git", rev = "bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e" } -egui_kittest = { git = "https://github.com/aiongg/egui.git", rev = "bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e" } -eframe = { git = "https://github.com/aiongg/egui.git", rev = "bbfd6471ed43bc3d46bffbb6e1ef7f39d0528e6e" } +hayro-syntax = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", version = "=0.7.2" } +hayro-jbig2 = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", version = "=0.3.0" } +ecolor = { git = "https://github.com/aiongg/egui.git", rev = "c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944" } +emath = { git = "https://github.com/aiongg/egui.git", rev = "c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944" } +epaint = { git = "https://github.com/aiongg/egui.git", rev = "c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944" } +epaint_default_fonts = { git = "https://github.com/aiongg/egui.git", rev = "c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944" } +egui = { git = "https://github.com/aiongg/egui.git", rev = "c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944" } +egui-winit = { git = "https://github.com/aiongg/egui.git", rev = "c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944" } +egui-wgpu = { git = "https://github.com/aiongg/egui.git", rev = "c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944" } +egui_glow = { git = "https://github.com/aiongg/egui.git", rev = "c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944" } +egui_extras = { git = "https://github.com/aiongg/egui.git", rev = "c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944" } +egui_kittest = { git = "https://github.com/aiongg/egui.git", rev = "c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944" } +eframe = { git = "https://github.com/aiongg/egui.git", rev = "c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944" } # Patch a crate only together with the dependency that needs it: an unused patch makes the Nix # build, which uses vendored sources, fail (`cargo xtask lock-patches`). winit = { git = "https://github.com/storytold/winit.git", rev = "a517b3846ee8457d84ee4975110bfda6797c44dc" } diff --git a/crates/effects/Cargo.toml b/crates/effects/Cargo.toml index 8976d3ea5..b5fa3e7c2 100644 --- a/crates/effects/Cargo.toml +++ b/crates/effects/Cargo.toml @@ -10,7 +10,7 @@ rust-version.workspace = true workspace = true [dependencies] -craft-cms = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "951ca3f3d19b617765996b2523af894679c077a0" } +craft-cms = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } effectcraft-geom = { workspace = true } effectcraft-color = { workspace = true } effectcraft-keyframe = { workspace = true } diff --git a/crates/ui-egui/tests/it/ui_tabs.rs b/crates/ui-egui/tests/it/ui_tabs.rs index 7057d126a..a9df1b556 100644 --- a/crates/ui-egui/tests/it/ui_tabs.rs +++ b/crates/ui-egui/tests/it/ui_tabs.rs @@ -487,7 +487,7 @@ fn open_comps_are_tabs_in_the_timeline_row_and_the_rest_are_in_its_overflow_menu // A comp with no room is in the » menu; picking it shows it, and its tab joins the row. let hidden = comps.iter().copied().find(|c| !shown.contains(c)).unwrap(); let more = { - use egui_kittest::kittest::{NodeT, Queryable}; + use egui_kittest::kittest::Queryable; h.query_all_by_label("More tabs").map(|node| node.rect()).find(|r| tl.y_range().contains(r.center().y)).expect("the Timeline row's » menu") }; assert!(more.min.x >= x - 0.5, "{more:?}"); From 0796898b63ca00626df29dbd01550efe01432f75 Mon Sep 17 00:00:00 2001 From: aiongg Date: Wed, 25 Nov 2026 00:45:30 +0000 Subject: [PATCH 431/451] Patch the storytold craft-libs crates to the app's pinned craft-libs so the lock holds one copy of each (craft-timeline excepted) --- Cargo.lock | 239 +++++++++++++---------------------------------------- Cargo.toml | 23 ++++++ 2 files changed, 79 insertions(+), 183 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index aa9e71002..9c106b0b7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1304,11 +1304,11 @@ dependencies = [ [[package]] name = "craft-aaf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ - "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", + "craft-audio", "craft-cfb", - "craft-timeline 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", + "craft-timeline 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", "thiserror 2.0.21", ] @@ -1340,19 +1340,8 @@ name = "craft-audio" version = "0.1.0" source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ - "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", - "craft-xml 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", - "log", - "thiserror 2.0.21", -] - -[[package]] -name = "craft-audio" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" -dependencies = [ - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", + "craft-media", + "craft-xml", "log", "rayon", "symphonia 0.6.1", @@ -1380,7 +1369,7 @@ dependencies = [ [[package]] name = "craft-cfb" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" [[package]] name = "craft-cloud-ui" @@ -1412,14 +1401,6 @@ dependencies = [ "serde", ] -[[package]] -name = "craft-color" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" -dependencies = [ - "serde", -] - [[package]] name = "craft-doc" version = "0.1.0" @@ -1450,14 +1431,6 @@ dependencies = [ "thiserror 2.0.21", ] -[[package]] -name = "craft-dpx" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" -dependencies = [ - "thiserror 2.0.21", -] - [[package]] name = "craft-ecproj-format" version = "0.1.0" @@ -1485,15 +1458,6 @@ dependencies = [ "thiserror 2.0.21", ] -[[package]] -name = "craft-exr" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" -dependencies = [ - "flate2", - "serde_json", -] - [[package]] name = "craft-font-catalog" version = "0.1.0" @@ -1518,19 +1482,8 @@ name = "craft-frame" version = "0.1.0" source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ - "craft-color 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", - "craft-time 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", - "rayon", - "serde", -] - -[[package]] -name = "craft-frame" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" -dependencies = [ - "craft-color 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", - "craft-time 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", + "craft-color", + "craft-time", "rayon", "serde", ] @@ -1547,7 +1500,7 @@ dependencies = [ [[package]] name = "craft-hdr" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ "thiserror 2.0.21", ] @@ -1596,7 +1549,7 @@ dependencies = [ [[package]] name = "craft-jpeg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ "thiserror 2.0.21", ] @@ -1618,7 +1571,7 @@ dependencies = [ "craft-i18n", "craft-tracked", "craft-ui-macros", - "craft-xml 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", + "craft-xml", "egui", "serde", "serde_json", @@ -1643,40 +1596,17 @@ dependencies = [ "thiserror 2.0.21", ] -[[package]] -name = "craft-media" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" -dependencies = [ - "chrono", - "thiserror 2.0.21", -] - [[package]] name = "craft-media-source" version = "0.1.0" source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ - "craft-audio 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", - "craft-color 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", - "craft-frame 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", - "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", - "craft-time 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", - "craft-y4m 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", - "serde", - "thiserror 2.0.21", -] - -[[package]] -name = "craft-media-source" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" -dependencies = [ - "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", - "craft-color 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", - "craft-frame 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", - "craft-time 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", + "craft-audio", + "craft-color", + "craft-frame", + "craft-media", + "craft-time", + "craft-y4m", "serde", "thiserror 2.0.21", ] @@ -1777,17 +1707,6 @@ dependencies = [ "thiserror 2.0.21", ] -[[package]] -name = "craft-psd" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" -dependencies = [ - "encoding_rs", - "flate2", - "rayon", - "thiserror 2.0.21", -] - [[package]] name = "craft-quit" version = "0.1.0" @@ -1803,7 +1722,7 @@ dependencies = [ [[package]] name = "craft-raw" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ "craft-tiff", "miniz_oxide 0.9.1", @@ -1834,14 +1753,14 @@ dependencies = [ [[package]] name = "craft-sniff" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" [[package]] name = "craft-svg" version = "0.1.0" source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ - "craft-xml 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", + "craft-xml", "flate2", "kurbo", "quick-xml 0.41.0", @@ -1861,14 +1780,6 @@ dependencies = [ "thiserror 2.0.21", ] -[[package]] -name = "craft-tga" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" -dependencies = [ - "thiserror 2.0.21", -] - [[package]] name = "craft-theme" version = "0.1.0" @@ -1887,15 +1798,6 @@ dependencies = [ [[package]] name = "craft-tiff" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" -dependencies = [ - "serde", - "thiserror 2.0.21", -] - -[[package]] -name = "craft-time" -version = "0.1.0" source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ "serde", @@ -1905,7 +1807,7 @@ dependencies = [ [[package]] name = "craft-time" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" +source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ "serde", "thiserror 2.0.21", @@ -1916,7 +1818,7 @@ name = "craft-timeline" version = "0.1.0" source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ - "craft-time 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", + "craft-time", "serde", "web-time", ] @@ -1926,8 +1828,8 @@ name = "craft-timeline" version = "0.1.0" source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ - "craft-time 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", + "craft-time", + "craft-xml", "serde", "serde_json", ] @@ -2139,18 +2041,7 @@ name = "craft-video" version = "0.1.0" source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" dependencies = [ - "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", - "rav1e", - "rayon", - "thiserror 2.0.21", -] - -[[package]] -name = "craft-video" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" -dependencies = [ - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", + "craft-media", "rav1e", "rayon", "thiserror 2.0.21", @@ -2207,16 +2098,6 @@ dependencies = [ "thiserror 2.0.21", ] -[[package]] -name = "craft-xml" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" -dependencies = [ - "quick-xml 0.41.0", - "serde", - "thiserror 2.0.21", -] - [[package]] name = "craft-y4m" version = "0.1.0" @@ -2225,14 +2106,6 @@ dependencies = [ "thiserror 2.0.21", ] -[[package]] -name = "craft-y4m" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" -dependencies = [ - "thiserror 2.0.21", -] - [[package]] name = "craft-zip" version = "0.1.0" @@ -2688,12 +2561,12 @@ dependencies = [ name = "effectcraft-export" version = "0.25.1" dependencies = [ - "craft-audio 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", - "craft-exr 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", + "craft-audio", + "craft-exr", "craft-gif", - "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", - "craft-tga 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", - "craft-video 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", + "craft-media", + "craft-tga", + "craft-video", "effectcraft-color", "effectcraft-effects", "effectcraft-keyframe", @@ -2854,17 +2727,17 @@ dependencies = [ name = "effectcraft-media" version = "0.25.1" dependencies = [ - "craft-audio 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", - "craft-color 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", + "craft-audio", + "craft-color", "craft-docpath", - "craft-dpx 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", - "craft-exr 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", - "craft-frame 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", + "craft-dpx", + "craft-exr", + "craft-frame", "craft-gif", - "craft-media 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", - "craft-media-source 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", - "craft-time 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", - "craft-video 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", + "craft-media", + "craft-media-source", + "craft-time", + "craft-video", "craft-webp", "effectcraft-color", "effectcraft-effects", @@ -2969,7 +2842,7 @@ name = "effectcraft-psd" version = "0.25.1" dependencies = [ "craft-codepage", - "craft-psd 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", + "craft-psd", "miniz_oxide 0.9.1", ] @@ -2977,7 +2850,7 @@ dependencies = [ name = "effectcraft-raster" version = "0.25.1" dependencies = [ - "craft-exr 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", + "craft-exr", "effectcraft-color", "effectcraft-geom", "rayon", @@ -3581,7 +3454,7 @@ name = "filmcraft-bitstream" version = "0.20.1" source = "git+https://github.com/storytold/filmcraft?rev=e7345f6e04a9bb921c2613a6aa92d162edf39b3b#e7345f6e04a9bb921c2613a6aa92d162edf39b3b" dependencies = [ - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", + "craft-media", ] [[package]] @@ -3597,11 +3470,11 @@ name = "filmcraft-codecs" version = "0.20.1" source = "git+https://github.com/storytold/filmcraft?rev=e7345f6e04a9bb921c2613a6aa92d162edf39b3b#e7345f6e04a9bb921c2613a6aa92d162edf39b3b" dependencies = [ - "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", + "craft-audio", "craft-jpeg", - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", - "craft-video 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", - "craft-y4m 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", + "craft-media", + "craft-video", + "craft-y4m", "filmcraft-bitstream", "filmcraft-color", "filmcraft-frame", @@ -3661,7 +3534,7 @@ version = "0.20.1" source = "git+https://github.com/storytold/filmcraft?rev=e7345f6e04a9bb921c2613a6aa92d162edf39b3b#e7345f6e04a9bb921c2613a6aa92d162edf39b3b" dependencies = [ "craft-aaf", - "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", + "craft-audio", "craft-timeline 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", "filmcraft-cfb", "filmcraft-color", @@ -3680,7 +3553,7 @@ name = "filmcraft-isobmff" version = "0.20.1" source = "git+https://github.com/storytold/filmcraft?rev=e7345f6e04a9bb921c2613a6aa92d162edf39b3b#e7345f6e04a9bb921c2613a6aa92d162edf39b3b" dependencies = [ - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", + "craft-media", ] [[package]] @@ -3688,7 +3561,7 @@ name = "filmcraft-matroska" version = "0.20.1" source = "git+https://github.com/storytold/filmcraft?rev=e7345f6e04a9bb921c2613a6aa92d162edf39b3b#e7345f6e04a9bb921c2613a6aa92d162edf39b3b" dependencies = [ - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", + "craft-media", ] [[package]] @@ -3696,15 +3569,15 @@ name = "filmcraft-media" version = "0.20.1" source = "git+https://github.com/storytold/filmcraft?rev=e7345f6e04a9bb921c2613a6aa92d162edf39b3b#e7345f6e04a9bb921c2613a6aa92d162edf39b3b" dependencies = [ - "craft-audio 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", - "craft-dpx 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", - "craft-exr 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", + "craft-audio", + "craft-dpx", + "craft-exr", "craft-hdr", - "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", - "craft-media-source 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", - "craft-psd 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", + "craft-media", + "craft-media-source", + "craft-psd", "craft-sniff", - "craft-tga 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", + "craft-tga", "craft-tiff", "filmcraft-color", "filmcraft-dng", diff --git a/Cargo.toml b/Cargo.toml index bd05467d8..fda95303e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -235,6 +235,29 @@ opt-level = 3 lto = "thin" codegen-units = 1 +# filmcraft-media pins storytold craft-libs; the app needs one copy of each crate. +[patch."https://github.com/storytold/craft-libs"] +craft-aaf = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", version = "=0.1.0" } +craft-audio = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", version = "=0.1.0" } +craft-cfb = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", version = "=0.1.0" } +craft-color = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", version = "=0.1.0" } +craft-dpx = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", version = "=0.1.0" } +craft-exr = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", version = "=0.1.0" } +craft-frame = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", version = "=0.1.0" } +craft-hdr = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", version = "=0.1.0" } +craft-jpeg = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", version = "=0.1.0" } +craft-media = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", version = "=0.1.0" } +craft-media-source = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", version = "=0.1.0" } +craft-psd = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", version = "=0.1.0" } +craft-raw = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", version = "=0.1.0" } +craft-sniff = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", version = "=0.1.0" } +craft-tga = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", version = "=0.1.0" } +craft-tiff = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", version = "=0.1.0" } +craft-time = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", version = "=0.1.0" } +craft-video = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", version = "=0.1.0" } +craft-xml = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", version = "=0.1.0" } +craft-y4m = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", version = "=0.1.0" } + [patch.crates-io] hayro-syntax = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", version = "=0.7.2" } hayro-jbig2 = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", version = "=0.3.0" } From 92a5831a44a69a732570ae5aa6f04036582b3859 Mon Sep 17 00:00:00 2001 From: aiongg Date: Wed, 25 Nov 2026 01:10:35 +0000 Subject: [PATCH 432/451] Repin craft-libs to c933a90624 and egui to f678ecb71; drop host_stop calls (the framework orders every widget) --- Cargo.lock | 178 +++++++++++----------- Cargo.toml | 134 ++++++++-------- crates/effects/Cargo.toml | 2 +- crates/ui-egui/src/header.rs | 5 - crates/ui-egui/src/panels/viewer_tools.rs | 13 -- 5 files changed, 157 insertions(+), 175 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9c106b0b7..31557f0c8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1304,23 +1304,23 @@ dependencies = [ [[package]] name = "craft-aaf" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "craft-audio", "craft-cfb", - "craft-timeline 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", + "craft-timeline 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba)", "thiserror 2.0.21", ] [[package]] name = "craft-aep" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" [[package]] name = "craft-appkit" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "block2 0.6.2", "objc2-app-kit 0.3.2", @@ -1330,7 +1330,7 @@ dependencies = [ [[package]] name = "craft-atomic" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "rustix 1.1.6", ] @@ -1338,7 +1338,7 @@ dependencies = [ [[package]] name = "craft-audio" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "craft-media", "craft-xml", @@ -1351,7 +1351,7 @@ dependencies = [ [[package]] name = "craft-behavior" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "accesskit", "bitflags 2.13.2", @@ -1369,12 +1369,12 @@ dependencies = [ [[package]] name = "craft-cfb" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" [[package]] name = "craft-cloud-ui" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "egui", ] @@ -1382,7 +1382,7 @@ dependencies = [ [[package]] name = "craft-cms" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "md-5", "rayon", @@ -1391,12 +1391,12 @@ dependencies = [ [[package]] name = "craft-codepage" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" [[package]] name = "craft-color" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "serde", ] @@ -1404,7 +1404,7 @@ dependencies = [ [[package]] name = "craft-doc" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "craft-ecproj-format", "craft-pcraft-format", @@ -1418,7 +1418,7 @@ dependencies = [ [[package]] name = "craft-docpath" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "serde", ] @@ -1426,7 +1426,7 @@ dependencies = [ [[package]] name = "craft-dpx" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "thiserror 2.0.21", ] @@ -1434,7 +1434,7 @@ dependencies = [ [[package]] name = "craft-ecproj-format" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "serde", "serde_json", @@ -1444,12 +1444,12 @@ dependencies = [ [[package]] name = "craft-eps" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" [[package]] name = "craft-exr" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "exr", "flate2", @@ -1461,7 +1461,7 @@ dependencies = [ [[package]] name = "craft-font-catalog" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "harfrust 0.13.3", "kurbo", @@ -1475,12 +1475,12 @@ dependencies = [ [[package]] name = "craft-fonts-build" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" [[package]] name = "craft-frame" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "craft-color", "craft-time", @@ -1491,7 +1491,7 @@ dependencies = [ [[package]] name = "craft-gif" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "gif", "image", @@ -1500,7 +1500,7 @@ dependencies = [ [[package]] name = "craft-hdr" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "thiserror 2.0.21", ] @@ -1508,7 +1508,7 @@ dependencies = [ [[package]] name = "craft-host" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "bitflags 2.13.2", "craft-i18n", @@ -1521,7 +1521,7 @@ dependencies = [ [[package]] name = "craft-i18n" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "chrono", "fixed_decimal", @@ -1549,7 +1549,7 @@ dependencies = [ [[package]] name = "craft-jpeg" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "thiserror 2.0.21", ] @@ -1557,7 +1557,7 @@ dependencies = [ [[package]] name = "craft-jsonrpc" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "serde_json", ] @@ -1565,7 +1565,7 @@ dependencies = [ [[package]] name = "craft-keymap" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "craft-host", "craft-i18n", @@ -1580,7 +1580,7 @@ dependencies = [ [[package]] name = "craft-lottie" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "craft-zip", "serde_json", @@ -1590,7 +1590,7 @@ dependencies = [ [[package]] name = "craft-media" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "chrono", "thiserror 2.0.21", @@ -1599,7 +1599,7 @@ dependencies = [ [[package]] name = "craft-media-source" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "craft-audio", "craft-color", @@ -1614,7 +1614,7 @@ dependencies = [ [[package]] name = "craft-mesh" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "craft-zip", "miniz_oxide 0.9.1", @@ -1624,7 +1624,7 @@ dependencies = [ [[package]] name = "craft-mime" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "chrono", "craft-codepage", @@ -1634,7 +1634,7 @@ dependencies = [ [[package]] name = "craft-pcraft-format" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "flate2", "serde", @@ -1645,7 +1645,7 @@ dependencies = [ [[package]] name = "craft-pdf" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "hayro-syntax", "serde", @@ -1655,7 +1655,7 @@ dependencies = [ [[package]] name = "craft-platform" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "async-channel", "async-io", @@ -1686,7 +1686,7 @@ dependencies = [ [[package]] name = "craft-ps" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "craft-eps", "kurbo", @@ -1699,7 +1699,7 @@ dependencies = [ [[package]] name = "craft-psd" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "encoding_rs", "flate2", @@ -1710,7 +1710,7 @@ dependencies = [ [[package]] name = "craft-quit" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "dispatch2", "objc2 0.6.5", @@ -1722,7 +1722,7 @@ dependencies = [ [[package]] name = "craft-raw" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "craft-tiff", "miniz_oxide 0.9.1", @@ -1736,7 +1736,7 @@ dependencies = [ [[package]] name = "craft-settings" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "craft-atomic", "craft-host", @@ -1753,12 +1753,12 @@ dependencies = [ [[package]] name = "craft-sniff" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" [[package]] name = "craft-svg" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "craft-xml", "flate2", @@ -1775,7 +1775,7 @@ dependencies = [ [[package]] name = "craft-tga" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "thiserror 2.0.21", ] @@ -1783,7 +1783,7 @@ dependencies = [ [[package]] name = "craft-theme" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "bitflags 2.13.2", "craft-tracked", @@ -1798,7 +1798,7 @@ dependencies = [ [[package]] name = "craft-tiff" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "serde", "thiserror 2.0.21", @@ -1807,22 +1807,12 @@ dependencies = [ [[package]] name = "craft-time" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "serde", "thiserror 2.0.21", ] -[[package]] -name = "craft-timeline" -version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" -dependencies = [ - "craft-time", - "serde", - "web-time", -] - [[package]] name = "craft-timeline" version = "0.1.0" @@ -1834,15 +1824,25 @@ dependencies = [ "serde_json", ] +[[package]] +name = "craft-timeline" +version = "0.1.0" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +dependencies = [ + "craft-time", + "serde", + "web-time", +] + [[package]] name = "craft-tracked" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" [[package]] name = "craft-ui" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "craft-cloud-ui", "craft-ui-canvas", @@ -1856,7 +1856,7 @@ dependencies = [ [[package]] name = "craft-ui-canvas" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "craft-behavior", "craft-i18n", @@ -1872,7 +1872,7 @@ dependencies = [ [[package]] name = "craft-ui-contract" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "accesskit", "craft-behavior", @@ -1910,7 +1910,7 @@ dependencies = [ [[package]] name = "craft-ui-macros" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -1921,7 +1921,7 @@ dependencies = [ [[package]] name = "craft-ui-panels" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "craft-behavior", "craft-host", @@ -1939,7 +1939,7 @@ dependencies = [ [[package]] name = "craft-ui-patterns" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "craft-behavior", "craft-host", @@ -1960,7 +1960,7 @@ dependencies = [ [[package]] name = "craft-ui-shell" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "craft-behavior", "craft-host", @@ -1980,7 +1980,7 @@ dependencies = [ [[package]] name = "craft-ui-widgets" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "craft-behavior", "craft-host", @@ -1999,7 +1999,7 @@ dependencies = [ [[package]] name = "craft-update" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "chrono", "craft-host", @@ -2028,7 +2028,7 @@ dependencies = [ [[package]] name = "craft-vectorcraft-format" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "flate2", "serde", @@ -2039,7 +2039,7 @@ dependencies = [ [[package]] name = "craft-video" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "craft-media", "rav1e", @@ -2050,7 +2050,7 @@ dependencies = [ [[package]] name = "craft-webp" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "image", "thiserror 2.0.21", @@ -2059,7 +2059,7 @@ dependencies = [ [[package]] name = "craft-win32" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "winsafe", ] @@ -2067,7 +2067,7 @@ dependencies = [ [[package]] name = "craft-window" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "craft-appkit", "craft-atomic", @@ -2091,7 +2091,7 @@ dependencies = [ [[package]] name = "craft-xml" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "quick-xml 0.41.0", "serde", @@ -2101,7 +2101,7 @@ dependencies = [ [[package]] name = "craft-y4m" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "thiserror 2.0.21", ] @@ -2109,7 +2109,7 @@ dependencies = [ [[package]] name = "craft-zip" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "flate2", "thiserror 2.0.21", @@ -2403,7 +2403,7 @@ dependencies = [ [[package]] name = "ecolor" version = "0.37.0" -source = "git+https://github.com/aiongg/egui.git?rev=c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944#c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944" +source = "git+https://github.com/aiongg/egui.git?rev=f678ecb710dfb98e4b934f6a8d4176c858606a95#f678ecb710dfb98e4b934f6a8d4176c858606a95" dependencies = [ "bytemuck", "emath", @@ -2676,7 +2676,7 @@ dependencies = [ name = "effectcraft-interchange" version = "0.25.1" dependencies = [ - "craft-timeline 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5)", + "craft-timeline 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba)", "effectcraft-color", "effectcraft-keyframe", "effectcraft-project", @@ -3043,7 +3043,7 @@ dependencies = [ [[package]] name = "eframe" version = "0.37.0" -source = "git+https://github.com/aiongg/egui.git?rev=c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944#c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944" +source = "git+https://github.com/aiongg/egui.git?rev=f678ecb710dfb98e4b934f6a8d4176c858606a95#f678ecb710dfb98e4b934f6a8d4176c858606a95" dependencies = [ "ahash", "bytemuck", @@ -3078,7 +3078,7 @@ dependencies = [ [[package]] name = "egui" version = "0.37.0" -source = "git+https://github.com/aiongg/egui.git?rev=c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944#c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944" +source = "git+https://github.com/aiongg/egui.git?rev=f678ecb710dfb98e4b934f6a8d4176c858606a95#f678ecb710dfb98e4b934f6a8d4176c858606a95" dependencies = [ "accesskit", "ahash", @@ -3097,7 +3097,7 @@ dependencies = [ [[package]] name = "egui-wgpu" version = "0.37.0" -source = "git+https://github.com/aiongg/egui.git?rev=c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944#c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944" +source = "git+https://github.com/aiongg/egui.git?rev=f678ecb710dfb98e4b934f6a8d4176c858606a95#f678ecb710dfb98e4b934f6a8d4176c858606a95" dependencies = [ "ahash", "bytemuck", @@ -3116,7 +3116,7 @@ dependencies = [ [[package]] name = "egui-winit" version = "0.37.0" -source = "git+https://github.com/aiongg/egui.git?rev=c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944#c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944" +source = "git+https://github.com/aiongg/egui.git?rev=f678ecb710dfb98e4b934f6a8d4176c858606a95#f678ecb710dfb98e4b934f6a8d4176c858606a95" dependencies = [ "accesskit_winit", "arboard", @@ -3142,7 +3142,7 @@ dependencies = [ [[package]] name = "egui_extras" version = "0.37.0" -source = "git+https://github.com/aiongg/egui.git?rev=c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944#c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944" +source = "git+https://github.com/aiongg/egui.git?rev=f678ecb710dfb98e4b934f6a8d4176c858606a95#f678ecb710dfb98e4b934f6a8d4176c858606a95" dependencies = [ "ahash", "egui", @@ -3155,7 +3155,7 @@ dependencies = [ [[package]] name = "egui_glow" version = "0.37.0" -source = "git+https://github.com/aiongg/egui.git?rev=c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944#c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944" +source = "git+https://github.com/aiongg/egui.git?rev=f678ecb710dfb98e4b934f6a8d4176c858606a95#f678ecb710dfb98e4b934f6a8d4176c858606a95" dependencies = [ "bytemuck", "egui", @@ -3168,7 +3168,7 @@ dependencies = [ [[package]] name = "egui_kittest" version = "0.37.0" -source = "git+https://github.com/aiongg/egui.git?rev=c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944#c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944" +source = "git+https://github.com/aiongg/egui.git?rev=f678ecb710dfb98e4b934f6a8d4176c858606a95#f678ecb710dfb98e4b934f6a8d4176c858606a95" dependencies = [ "eframe", "egui", @@ -3191,7 +3191,7 @@ checksum = "252afb9ae5eaa683babdc6a068b3f5726eb19e05070c731f9b2a23a7c3e8ed34" [[package]] name = "emath" version = "0.37.0" -source = "git+https://github.com/aiongg/egui.git?rev=c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944#c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944" +source = "git+https://github.com/aiongg/egui.git?rev=f678ecb710dfb98e4b934f6a8d4176c858606a95#f678ecb710dfb98e4b934f6a8d4176c858606a95" dependencies = [ "bytemuck", ] @@ -3284,7 +3284,7 @@ dependencies = [ [[package]] name = "epaint" version = "0.37.0" -source = "git+https://github.com/aiongg/egui.git?rev=c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944#c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944" +source = "git+https://github.com/aiongg/egui.git?rev=f678ecb710dfb98e4b934f6a8d4176c858606a95#f678ecb710dfb98e4b934f6a8d4176c858606a95" dependencies = [ "ahash", "bytemuck", @@ -3310,7 +3310,7 @@ dependencies = [ [[package]] name = "epaint_default_fonts" version = "0.37.0" -source = "git+https://github.com/aiongg/egui.git?rev=c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944#c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944" +source = "git+https://github.com/aiongg/egui.git?rev=f678ecb710dfb98e4b934f6a8d4176c858606a95#f678ecb710dfb98e4b934f6a8d4176c858606a95" [[package]] name = "equator" @@ -4247,7 +4247,7 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a" [[package]] name = "hayro-jbig2" version = "0.3.0" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "hayro-ccitt", ] @@ -4261,7 +4261,7 @@ checksum = "c75ab947623ef4ccaa7acf0579edf7cbb5a73838e3839a7be73335e522f433a1" [[package]] name = "hayro-syntax" version = "0.7.2" -source = "git+https://github.com/aiongg/craft-libs?rev=0bac50867b2c4977e492f436029ff0075a14dab5#0bac50867b2c4977e492f436029ff0075a14dab5" +source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" dependencies = [ "hayro-jbig2", "hayro-jpeg2000", diff --git a/Cargo.toml b/Cargo.toml index fda95303e..278a80703 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,28 +11,28 @@ rust-version = "1.95" repository = "https://github.com/storytold/effectcraft" [workspace.dependencies] -craft-timeline = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", default-features = false } -craft-mime = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } -craft-pdf = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", version = "=0.1.0", default-features = false, features = ["read"] } -craft-docpath = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } -craft-jsonrpc = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } -craft-ecproj-format = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } -craft-dpx = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } -craft-ps = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", default-features = false, features = ["read"] } -craft-exr = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } -craft-gif = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } -craft-tga = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } -craft-psd = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } -craft-codepage = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } -craft-svg = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } -craft-webp = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } -craft-lottie = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } -craft-mesh = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", default-features = false, features = ["stl", "obj", "gltf", "fbx"] } -craft-aep = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } -craft-doc = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } -craft-vectorcraft-format = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } +craft-timeline = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", default-features = false } +craft-mime = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } +craft-pdf = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", version = "=0.1.0", default-features = false, features = ["read"] } +craft-docpath = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } +craft-jsonrpc = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } +craft-ecproj-format = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } +craft-dpx = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } +craft-ps = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", default-features = false, features = ["read"] } +craft-exr = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } +craft-gif = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } +craft-tga = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } +craft-psd = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } +craft-codepage = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } +craft-svg = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } +craft-webp = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } +craft-lottie = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } +craft-mesh = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", default-features = false, features = ["stl", "obj", "gltf", "fbx"] } +craft-aep = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } +craft-doc = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } +craft-vectorcraft-format = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } # craft-update: app-specific pretend versions apply to startup and manual checks. -craft-update = { git = "https://github.com/aiongg/craft-libs", version = "=0.1.0", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", features = ["ui"] } +craft-update = { git = "https://github.com/aiongg/craft-libs", version = "=0.1.0", rev = "c933a90624b7a5669df284cfdf53726694636bba", features = ["ui"] } # internal effectcraft-time = { path = "crates/time" } effectcraft-geom = { path = "crates/geom" } @@ -97,13 +97,13 @@ same-file = "1.0" tempfile = "3.27" # codecs + containers shared by the Craft apps (crates/media, crates/export); keep all in sync. -craft-media = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", default-features = false, features = ["isobmff", "matroska"] } -craft-media-source = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } -craft-frame = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } -craft-color = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } -craft-time = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } -craft-audio = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", default-features = false, features = ["aac-decode", "aac-encode", "alac-decode", "opus-decode", "opus-encode", "ac3-decode", "mp3-decode", "mpa-decode"] } -craft-video = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", features = ["h264-decode", "h264-encode", "prores", "hevc-encode", "vp9-encode", "av1", "threads"] } +craft-media = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", default-features = false, features = ["isobmff", "matroska"] } +craft-media-source = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } +craft-frame = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } +craft-color = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } +craft-time = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } +craft-audio = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", default-features = false, features = ["aac-decode", "aac-encode", "alac-decode", "opus-decode", "opus-encode", "ac3-decode", "mp3-decode", "mpa-decode"] } +craft-video = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", features = ["h264-decode", "h264-encode", "prores", "hevc-encode", "vp9-encode", "av1", "threads"] } # footage decoding: FilmCraft's pure-Rust crates, pinned to a revision (plan/adr/0001). # Only `crates/media`, `crates/export` and `crates/interchange` may depend on these. @@ -126,12 +126,12 @@ half = "2.7" # ui # Shared frontend components; keep this dependency above the engine boundary. # Shared UI and the complete egui family select reviewed immutable commits below. -craft-ui = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } -craft-behavior = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } -craft-host = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } -craft-keymap = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } -craft-theme = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } -craft-window = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } +craft-ui = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } +craft-behavior = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } +craft-host = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } +craft-keymap = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } +craft-theme = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } +craft-window = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } # `default_fonts` and `monochrome_emoji_fonts` are explicit: the app's `FontDefinitions::default()` # and its `✔`/`▣` chrome glyphs need both, and kittest's own dev-dependencies do not propagate. egui = { version = "0.37", default-features = false, features = ["default_fonts", "monochrome_emoji_fonts"] } @@ -237,41 +237,41 @@ codegen-units = 1 # filmcraft-media pins storytold craft-libs; the app needs one copy of each crate. [patch."https://github.com/storytold/craft-libs"] -craft-aaf = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", version = "=0.1.0" } -craft-audio = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", version = "=0.1.0" } -craft-cfb = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", version = "=0.1.0" } -craft-color = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", version = "=0.1.0" } -craft-dpx = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", version = "=0.1.0" } -craft-exr = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", version = "=0.1.0" } -craft-frame = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", version = "=0.1.0" } -craft-hdr = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", version = "=0.1.0" } -craft-jpeg = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", version = "=0.1.0" } -craft-media = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", version = "=0.1.0" } -craft-media-source = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", version = "=0.1.0" } -craft-psd = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", version = "=0.1.0" } -craft-raw = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", version = "=0.1.0" } -craft-sniff = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", version = "=0.1.0" } -craft-tga = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", version = "=0.1.0" } -craft-tiff = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", version = "=0.1.0" } -craft-time = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", version = "=0.1.0" } -craft-video = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", version = "=0.1.0" } -craft-xml = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", version = "=0.1.0" } -craft-y4m = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", version = "=0.1.0" } +craft-aaf = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", version = "=0.1.0" } +craft-audio = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", version = "=0.1.0" } +craft-cfb = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", version = "=0.1.0" } +craft-color = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", version = "=0.1.0" } +craft-dpx = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", version = "=0.1.0" } +craft-exr = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", version = "=0.1.0" } +craft-frame = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", version = "=0.1.0" } +craft-hdr = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", version = "=0.1.0" } +craft-jpeg = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", version = "=0.1.0" } +craft-media = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", version = "=0.1.0" } +craft-media-source = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", version = "=0.1.0" } +craft-psd = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", version = "=0.1.0" } +craft-raw = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", version = "=0.1.0" } +craft-sniff = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", version = "=0.1.0" } +craft-tga = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", version = "=0.1.0" } +craft-tiff = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", version = "=0.1.0" } +craft-time = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", version = "=0.1.0" } +craft-video = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", version = "=0.1.0" } +craft-xml = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", version = "=0.1.0" } +craft-y4m = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", version = "=0.1.0" } [patch.crates-io] -hayro-syntax = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", version = "=0.7.2" } -hayro-jbig2 = { git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5", version = "=0.3.0" } -ecolor = { git = "https://github.com/aiongg/egui.git", rev = "c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944" } -emath = { git = "https://github.com/aiongg/egui.git", rev = "c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944" } -epaint = { git = "https://github.com/aiongg/egui.git", rev = "c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944" } -epaint_default_fonts = { git = "https://github.com/aiongg/egui.git", rev = "c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944" } -egui = { git = "https://github.com/aiongg/egui.git", rev = "c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944" } -egui-winit = { git = "https://github.com/aiongg/egui.git", rev = "c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944" } -egui-wgpu = { git = "https://github.com/aiongg/egui.git", rev = "c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944" } -egui_glow = { git = "https://github.com/aiongg/egui.git", rev = "c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944" } -egui_extras = { git = "https://github.com/aiongg/egui.git", rev = "c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944" } -egui_kittest = { git = "https://github.com/aiongg/egui.git", rev = "c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944" } -eframe = { git = "https://github.com/aiongg/egui.git", rev = "c7a2f6af5dc9d4c3c5c2a40b077ab30a66c90944" } +hayro-syntax = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", version = "=0.7.2" } +hayro-jbig2 = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", version = "=0.3.0" } +ecolor = { git = "https://github.com/aiongg/egui.git", rev = "f678ecb710dfb98e4b934f6a8d4176c858606a95" } +emath = { git = "https://github.com/aiongg/egui.git", rev = "f678ecb710dfb98e4b934f6a8d4176c858606a95" } +epaint = { git = "https://github.com/aiongg/egui.git", rev = "f678ecb710dfb98e4b934f6a8d4176c858606a95" } +epaint_default_fonts = { git = "https://github.com/aiongg/egui.git", rev = "f678ecb710dfb98e4b934f6a8d4176c858606a95" } +egui = { git = "https://github.com/aiongg/egui.git", rev = "f678ecb710dfb98e4b934f6a8d4176c858606a95" } +egui-winit = { git = "https://github.com/aiongg/egui.git", rev = "f678ecb710dfb98e4b934f6a8d4176c858606a95" } +egui-wgpu = { git = "https://github.com/aiongg/egui.git", rev = "f678ecb710dfb98e4b934f6a8d4176c858606a95" } +egui_glow = { git = "https://github.com/aiongg/egui.git", rev = "f678ecb710dfb98e4b934f6a8d4176c858606a95" } +egui_extras = { git = "https://github.com/aiongg/egui.git", rev = "f678ecb710dfb98e4b934f6a8d4176c858606a95" } +egui_kittest = { git = "https://github.com/aiongg/egui.git", rev = "f678ecb710dfb98e4b934f6a8d4176c858606a95" } +eframe = { git = "https://github.com/aiongg/egui.git", rev = "f678ecb710dfb98e4b934f6a8d4176c858606a95" } # Patch a crate only together with the dependency that needs it: an unused patch makes the Nix # build, which uses vendored sources, fail (`cargo xtask lock-patches`). winit = { git = "https://github.com/storytold/winit.git", rev = "a517b3846ee8457d84ee4975110bfda6797c44dc" } diff --git a/crates/effects/Cargo.toml b/crates/effects/Cargo.toml index b5fa3e7c2..035afb76e 100644 --- a/crates/effects/Cargo.toml +++ b/crates/effects/Cargo.toml @@ -10,7 +10,7 @@ rust-version.workspace = true workspace = true [dependencies] -craft-cms = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "0bac50867b2c4977e492f436029ff0075a14dab5" } +craft-cms = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } effectcraft-geom = { workspace = true } effectcraft-color = { workspace = true } effectcraft-keyframe = { workspace = true } diff --git a/crates/ui-egui/src/header.rs b/crates/ui-egui/src/header.rs index 9b8b89020..140a0bbaf 100644 --- a/crates/ui-egui/src/header.rs +++ b/crates/ui-egui/src/header.rs @@ -2,8 +2,6 @@ //! buttons (Discord is always one click away). use crate::i18n::{tr, tr_args}; -use craft_behavior::Input; -use craft_ui::runtime::focus::KeyUse; use egui::{Align2, Color32, Rect, Sense, Stroke, StrokeKind, pos2, vec2}; use serde_json::json; @@ -43,7 +41,6 @@ fn brand_and_home(app: &mut EffectcraftApp, ui: &mut egui::Ui, p: &egui::Painter paint_logo(p, brand); let bresp = ui.interact(brand, egui::Id::unique("brand"), Sense::click()); app.auto.add_response("header.about", &bresp, "About EffectCraft"); - craft_ui::runtime::focus::host_stop(ui.ctx(), bresp.id, KeyUse::of(Input::Pointer)); widgets::focus_outline(ui, &bresp, &t); if bresp.on_hover_text(tr("About EffectCraft")).clicked() { app.dialog = Some(Dialog::About); @@ -53,7 +50,6 @@ fn brand_and_home(app: &mut EffectcraftApp, ui: &mut egui::Ui, p: &egui::Painter let home = Rect::from_min_size(pos2(x, cy - 13.0), vec2(26.0, 26.0)); let home_response = widgets::icon_button(ui, home, Icon::Home, app.ui.start_screen, &t, egui::Id::unique("tool-home")).on_hover_text(tr("Home")); app.auto.add_response("header.home", &home_response, "Home"); - craft_ui::runtime::focus::host_stop(ui.ctx(), home_response.id, KeyUse::of(Input::Pointer)); if home_response.clicked() { app.ui.start_screen = !app.ui.start_screen; } @@ -89,7 +85,6 @@ fn tool_slot(app: &mut EffectcraftApp, ui: &mut egui::Ui, p: &egui::Painter, si: let active = slot.contains(&app.ui.tool); let id = egui::Id::unique(("tool-slot", si)); let resp = widgets::icon_button(ui, r, cur.icon(), active, &t, id); - craft_ui::runtime::focus::host_stop(ui.ctx(), resp.id, KeyUse::of(Input::Pointer)); if slot.len() > 1 { // Flyout corner triangle. p.add(egui::Shape::convex_polygon( diff --git a/crates/ui-egui/src/panels/viewer_tools.rs b/crates/ui-egui/src/panels/viewer_tools.rs index e7e4aaef3..1901eb01b 100644 --- a/crates/ui-egui/src/panels/viewer_tools.rs +++ b/crates/ui-egui/src/panels/viewer_tools.rs @@ -4,8 +4,6 @@ //! //! Edits go through engine commands (`view.*`, `comp.*`); the viewer calls in from small hooks. -use craft_behavior::Input; -use craft_ui::runtime::focus::{KeyUse, host_stop}; use effectcraft_engine::commands::viewer_cmds::FastPreviews; use effectcraft_engine::project::{Comp, ItemId, LayerId}; use effectcraft_engine::render::EvalCtx; @@ -766,9 +764,6 @@ pub(crate) fn bottom_bar(app: &mut EffectcraftApp, ui: &mut egui::Ui, bar: Rect, } /// The exposure drag field (stops) at `er`; a change runs `view.exposure`. -/// Every control of the viewer bar is a pointer-driven stop that Tab visits in drawn order. -const STOP_KEYS: KeyUse = KeyUse::of(Input::Pointer); - fn exposure_field(app: &mut EffectcraftApp, ui: &mut egui::Ui, er: Rect, stops: f64) { let mut ev = stops; let resp = ui.put( @@ -782,7 +777,6 @@ fn exposure_field(app: &mut EffectcraftApp, ui: &mut egui::Ui, er: Rect, stops: ), ); let resp = resp.on_hover_text(crate::i18n::tr("Adjust Exposure (stops)")); - host_stop(ui.ctx(), resp.id, STOP_KEYS); app.auto.add_response("viewer.exposure", &resp, "Adjust Exposure"); if resp.changed() { let _ = app.session.execute("view.exposure", json!({"stops": ev})); @@ -809,7 +803,6 @@ fn bottom_bar_contents(app: &mut EffectcraftApp, ui: &mut egui::Ui, bar: Rect, z app.ui.viewer.fit_up_to_100 = up; app.ui.viewer.zoom = z; } - host_stop(ui.ctx(), egui::Id::unique("vw-mag"), STOP_KEYS); x = r.max.x + 4.0; // Resolution / down-sample factor. @@ -818,7 +811,6 @@ fn bottom_bar_contents(app: &mut EffectcraftApp, ui: &mut egui::Ui, bar: Rect, z let res = app.viewer_res(); let response = widgets::dropdown(ui, r, &resolution_label(res, scale), &t, egui::Id::unique("vw-res")) .on_hover_text(crate::i18n::tr("Resolution/Down Sample Factor Popup")); - host_stop(ui.ctx(), response.id, STOP_KEYS); if response.clicked() { toggle_popup(ui, "vw-res-pop"); } @@ -846,7 +838,6 @@ fn bottom_bar_contents(app: &mut EffectcraftApp, ui: &mut egui::Ui, bar: Rect, z // The tip is the English source: the tooltip is looked up in the catalog, while the // automation label stays English for scripts and tests. let resp = widgets::icon_button(ui, r, icon, on, &t, egui::Id::unique(("vw-btn", id))).on_hover_text(crate::i18n::tr(tip)); - host_stop(ui.ctx(), resp.id, STOP_KEYS); auto.add_response(&format!("viewer.{id}"), &resp, tip); *x += 24.0; (resp.clicked(), r) @@ -953,7 +944,6 @@ fn bottom_bar_contents(app: &mut EffectcraftApp, ui: &mut egui::Ui, bar: Rect, z let current = renderers.iter().find(|(r, ..)| *r == comp.renderer).map_or("Classic 3D", |(_, label, _)| *label); let r = Rect::from_min_size(pos2(x, cy - 10.0), vec2(96.0, 20.0)); let renderer_resp = widgets::dropdown(ui, r, crate::i18n::tr(current), &t, egui::Id::unique("vw-3d")); - host_stop(ui.ctx(), renderer_resp.id, STOP_KEYS); if renderer_resp.clicked() { toggle_popup(ui, "vw-3d-pop"); } @@ -970,7 +960,6 @@ fn bottom_bar_contents(app: &mut EffectcraftApp, ui: &mut egui::Ui, bar: Rect, z let cur = cid.and_then(|c| app.session.state.views3d.get(&c)).map(|v| v.current).unwrap_or_default(); let r = Rect::from_min_size(pos2(x, cy - 10.0), vec2(118.0, 20.0)); let response = widgets::dropdown(ui, r, crate::panels::viewer::view3d_label(cur), &t, egui::Id::unique("vw-cam")); - host_stop(ui.ctx(), response.id, STOP_KEYS); if response.clicked() { toggle_popup(ui, "vw-cam-pop"); } @@ -998,7 +987,6 @@ fn bottom_bar_contents(app: &mut EffectcraftApp, ui: &mut egui::Ui, bar: Rect, z let tr = Rect::from_min_size(pos2(x + 4.0, cy - 9.0), g.size() + vec2(8.0, 4.0)); p.galley(pos2(tr.min.x + 4.0, tr.min.y + 2.0), g, t.timecode); let resp = ui.interact(tr, egui::Id::unique("vw-timecode"), Sense::click()); - host_stop(ui.ctx(), resp.id, STOP_KEYS); resp.widget_info(|| egui::WidgetInfo::labeled(egui::Role::Button, true, "Current time")); if resp.has_focus() { p.rect_stroke(tr.shrink(1.0), 2.0, Stroke::new(1.0, t.focus), StrokeKind::Inside); @@ -1033,7 +1021,6 @@ fn layout_switch(app: &mut EffectcraftApp, ui: &mut egui::Ui, mut x: f32, cy: f3 for (n, text, tip) in [(1u8, "1", "1 View"), (2, "2", "2 Views"), (4, "4", "4 Views")] { let r = Rect::from_min_size(pos2(x, cy - 10.0), vec2(26.0, 20.0)); let resp = widgets::text_button(ui, r, text, current == n, t, egui::Id::unique(("vw-layout", n))); - host_stop(ui.ctx(), resp.id, STOP_KEYS); // The drawn text is just "1" / "2" / "4": the accessible name is the full "N View(s)", the group // label ("Views") is its description, and the current layout is exposed as pressed. let name = crate::i18n::command_label("view.layout", tip); From 59aed45057561ff2ca0e3c27ab849eebbfaf71dc Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Tue, 24 Nov 2026 20:38:19 -0500 Subject: [PATCH 433/451] 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 --- .github/nightly-linux-signing-key.asc | 16 + .github/nightly-signing-policy.json | 107 ++++ .github/workflows/nightly-macos.yml | 92 +++ .github/workflows/nightly-sign.yml | 42 ++ .github/workflows/nightly.yml | 34 + .github/workflows/packaging-lint.yml | 21 +- .gitignore | 7 + ATTRIBUTION.md | 5 + Cargo.lock | 2 + apps/effectcraft-cli/src/main.rs | 10 + apps/effectcraft-cli/tests/it/cli.rs | 18 + apps/effectcraft/Cargo.toml | 4 + apps/effectcraft/build.rs | 70 +- apps/effectcraft/src/build_channel.rs | 92 +++ apps/effectcraft/src/build_flavor.rs | 82 +++ apps/effectcraft/src/crash_report.rs | 45 +- apps/effectcraft/src/file_dialogs.rs | 7 + apps/effectcraft/src/launch_profile.rs | 212 ++++++ apps/effectcraft/src/main.rs | 253 +++++++- apps/effectcraft/src/nightly_session.rs | 246 +++++++ apps/effectcraft/src/process_identity.rs | 69 ++ apps/effectcraft/src/profile_root.rs | 603 ++++++++++++++++++ assets/app-icon/README.md | 13 + assets/app-icon/effectcraft-nightly-1024.png | Bin 0 -> 238900 bytes .../effectcraft-nightly-1024.png.attribution | 9 + .../effectcraft-nightly-macos-512.png | Bin 0 -> 70234 bytes ...ectcraft-nightly-macos-512.png.attribution | 9 + assets/app-icon/effectcraft-nightly.icns | Bin 0 -> 545669 bytes .../effectcraft-nightly.icns.attribution | 9 + assets/app-icon/effectcraft-nightly.ico | Bin 0 -> 80805 bytes .../effectcraft-nightly.ico.attribution | 9 + assets/app-icon/effectcraft-nightly.png | Bin 0 -> 31434 bytes .../effectcraft-nightly.png.attribution | 9 + assets/app-icon/nightly-provenance.json | 66 ++ crates/host/src/app_dirs.rs | 55 +- crates/host/src/lib.rs | 3 +- crates/render/src/disk_cache.rs | 30 +- crates/ui-egui/src/channel.rs | 147 +++++ crates/ui-egui/src/lib.rs | 1 + crates/ui-egui/src/panels/dialogs.rs | 19 +- crates/ui-egui/src/panels/effects_presets.rs | 32 +- crates/ui-egui/src/panels/unsaved.rs | 15 +- crates/ui-egui/src/updates_ui.rs | 6 + docs/nightly-release-preparation.md | 107 ++++ docs/releasing.md | 30 + packaging/linux/flatpak-bundle.sh | 58 +- packaging/linux/nfpm.yaml | 13 +- packaging/linux/nightly-arch-launch.sh | 13 + packaging/linux/nightly-arch-tar-test.sh | 58 ++ packaging/linux/nightly-arch-tar.sh | 19 + packaging/linux/nightly-launch-test.sh | 53 ++ packaging/linux/nightly-launch.sh | 13 + packaging/linux/nightly.sh | 31 + packaging/linux/package.sh | 176 ++++- packaging/macos/nightly-lib.sh | 110 ++++ packaging/macos/nightly-sign.sh | 140 ++++ packaging/macos/nightly-verify.sh | 74 +++ packaging/macos/nightly.sh | 51 ++ packaging/macos/nightly_plist.py | 69 ++ packaging/macos/nightly_plist_tests.py | 202 ++++++ packaging/macos/nightly_sign_tests.py | 425 ++++++++++++ packaging/nightly-archive-tests.py | 240 +++++++ packaging/nightly-archive.py | 134 ++++ packaging/nightly-common.sh | 95 +++ packaging/nightly-release-tests.py | 394 ++++++++++++ packaging/nightly-tests.py | 31 + packaging/nightly_paths.py | 139 ++++ packaging/windows/README.md | 30 + packaging/windows/nightly-package-tests.ps1 | 95 +++ packaging/windows/nightly-signing-tests.ps1 | 83 +++ packaging/windows/nightly.ps1 | 130 ++++ packaging/windows/package.ps1 | 22 +- packaging/windows/sign.ps1 | 41 +- sonar-project.properties | 11 + 74 files changed, 5469 insertions(+), 87 deletions(-) create mode 100644 .github/nightly-linux-signing-key.asc create mode 100644 .github/nightly-signing-policy.json create mode 100644 .github/workflows/nightly-macos.yml create mode 100644 .github/workflows/nightly-sign.yml create mode 100644 .github/workflows/nightly.yml create mode 100644 apps/effectcraft/src/build_channel.rs create mode 100644 apps/effectcraft/src/build_flavor.rs create mode 100644 apps/effectcraft/src/launch_profile.rs create mode 100644 apps/effectcraft/src/nightly_session.rs create mode 100644 apps/effectcraft/src/process_identity.rs create mode 100644 apps/effectcraft/src/profile_root.rs create mode 100644 assets/app-icon/effectcraft-nightly-1024.png create mode 100644 assets/app-icon/effectcraft-nightly-1024.png.attribution create mode 100644 assets/app-icon/effectcraft-nightly-macos-512.png create mode 100644 assets/app-icon/effectcraft-nightly-macos-512.png.attribution create mode 100644 assets/app-icon/effectcraft-nightly.icns create mode 100644 assets/app-icon/effectcraft-nightly.icns.attribution create mode 100644 assets/app-icon/effectcraft-nightly.ico create mode 100644 assets/app-icon/effectcraft-nightly.ico.attribution create mode 100644 assets/app-icon/effectcraft-nightly.png create mode 100644 assets/app-icon/effectcraft-nightly.png.attribution create mode 100644 assets/app-icon/nightly-provenance.json create mode 100644 crates/ui-egui/src/channel.rs create mode 100644 docs/nightly-release-preparation.md create mode 100644 packaging/linux/nightly-arch-launch.sh create mode 100755 packaging/linux/nightly-arch-tar-test.sh create mode 100755 packaging/linux/nightly-arch-tar.sh create mode 100755 packaging/linux/nightly-launch-test.sh create mode 100755 packaging/linux/nightly-launch.sh create mode 100755 packaging/linux/nightly.sh create mode 100644 packaging/macos/nightly-lib.sh create mode 100755 packaging/macos/nightly-sign.sh create mode 100755 packaging/macos/nightly-verify.sh create mode 100755 packaging/macos/nightly.sh create mode 100644 packaging/macos/nightly_plist.py create mode 100644 packaging/macos/nightly_plist_tests.py create mode 100644 packaging/macos/nightly_sign_tests.py create mode 100644 packaging/nightly-archive-tests.py create mode 100644 packaging/nightly-archive.py create mode 100644 packaging/nightly-common.sh create mode 100755 packaging/nightly-release-tests.py create mode 100644 packaging/nightly-tests.py create mode 100644 packaging/nightly_paths.py create mode 100644 packaging/windows/README.md create mode 100644 packaging/windows/nightly-package-tests.ps1 create mode 100644 packaging/windows/nightly-signing-tests.ps1 create mode 100644 packaging/windows/nightly.ps1 diff --git a/.github/nightly-linux-signing-key.asc b/.github/nightly-linux-signing-key.asc new file mode 100644 index 000000000..a1c1f31e8 --- /dev/null +++ b/.github/nightly-linux-signing-key.asc @@ -0,0 +1,16 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +mDMEaulK1xYJKwYBBAHaRw8BAQdAqHJeDCjY6Hx5FTn/hW+aqu6V394ubLk0Zj3C +bftDwFm0IkFydENyYWZ0IExpbnV4IFJlbGVhc2UgU2lnbmluZyBLZXmIkwQTFgoA +OxYhBCt2dBtBSq1s0z5jEhOgBcC518PtBQJq6UrXAhsBBQsJCAcCAiICBhUKCQgL +AgQWAgMBAh4HAheAAAoJEBOgBcC518PtGeUA/RjvULBTLlccc+2wtJkfjSnCV+cf +PUMEGmW7XkZWkk51AP9w2A/WLv+79nREWEpZzI8LGK5EjrNazP+sY0l7j5rFCLgz +BGrpStcWCSsGAQQB2kcPAQEHQPl7XkQ1gWsvSPf/T9b4m/UHcjJjBpSOtpYlWR56 +er5RiO8EGBYKACAWIQQrdnQbQUqtbNM+YxIToAXAudfD7QUCaulK1wIbAgCBCRAT +oAXAudfD7XYgBBkWCgAdFiEEVo3B9o+Prsx5fzx7AG2va7DvM04FAmrpStcACgkQ +AG2va7DvM07taQEA4d2VFkKRIP0g9TrE86KpnuXPap+LKqe0tfIxpdf9YxIA/0Wo +9H/iG8nH++nxC087p3HE0S+0UovxqkhXJLSr8B4JDOoA/iLRpqTdYmk6fVXMyPJo +SkOVuwZIGS6VgBdSQP0e2P2YAP41L5OoSvwdQIG3/uNrM+ieqpYeM597/hCLFs5A +ga/qCA== +=3wGQ +-----END PGP PUBLIC KEY BLOCK----- diff --git a/.github/nightly-signing-policy.json b/.github/nightly-signing-policy.json new file mode 100644 index 000000000..3bf0f5345 --- /dev/null +++ b/.github/nightly-signing-policy.json @@ -0,0 +1,107 @@ +{ + "schema": "craft-nightly-release-policy/v3", + "repository": "storytold/effectcraft", + "repository_id": 1400136506, + "producer_workflow_id": null, + "producer_workflow_path": ".github/workflows/nightly.yml", + "producer_tooling_revision": "605d58766e8f536564da8fc81d3676ac86816dea", + "producer_workflow_ref": "storytold/craft-common-actions/.github/workflows/nightly-unsigned.yml@605d58766e8f536564da8fc81d3676ac86816dea", + "signer_workflow_path": ".github/workflows/nightly-sign.yml", + "signer_tooling_revision": "605d58766e8f536564da8fc81d3676ac86816dea", + "release_branch": "release", + "manual_actors": [ + "bflatastic", + "dylanmtaylor", + "echelon", + "FredApps", + "skylartaylor" + ], + "max_age_seconds": 86400, + "candidate_policy": { + "schema": "craft-nightly-candidate-policy/v3", + "epoch": "effectcraft-nightly-20261124", + "repository": "storytold/effectcraft", + "branch": "main", + "required_workflows": [ + { + "workflow_id": 380135792, + "workflow_path": ".github/workflows/ci.yml", + "jobs": [ + { + "name": "gate / gate (ubuntu-24.04)", + "app_id": 15368, + "applicability": "required" + } + ] + } + ], + "sonar": { + "organization": "storytold", + "project": "storytold_effectcraft", + "app_id": 12526, + "check_name": "SonarCloud Code Analysis", + "details_url": "https://sonarcloud.io/dashboard?id=storytold_effectcraft&branch=main", + "issue_types": [ + "VULNERABILITY" + ], + "accepted_conditions": [ + { + "metric": "new_security_rating", + "comparator": "GT", + "error_threshold": "1", + "maximum": "5" + } + ], + "required_conditions": [ + { + "metric": "new_reliability_rating", + "comparator": "GT", + "error_threshold": "1" + }, + { + "metric": "new_maintainability_rating", + "comparator": "GT", + "error_threshold": "1" + }, + { + "metric": "new_coverage", + "comparator": "LT", + "error_threshold": "80" + }, + { + "metric": "new_duplicated_lines_density", + "comparator": "GT", + "error_threshold": "3" + }, + { + "metric": "new_security_hotspots_reviewed", + "comparator": "LT", + "error_threshold": "100" + } + ], + "debt": [] + } + }, + "max_artifact_bytes": 2147483648, + "automatic_signer_actors": [], + "platforms": { + "windows-x86_64": { + "unsigned_artifact_name": "nightly-unsigned-windows-x86_64", + "trust": { + "publisher_subject": "CN=Learning Machines Inc, O=Learning Machines Inc, L=Atlanta, S=Georgia, C=US" + } + }, + "linux-x86_64": { + "unsigned_artifact_name": "nightly-unsigned-linux-x86_64", + "trust": { + "fingerprint": "2B76741B414AAD6CD33E631213A005C0B9D7C3ED" + } + }, + "macos-aarch64": { + "unsigned_artifact_name": "nightly-unsigned-macos-aarch64", + "trust": { + "apple_team_id": "DJ6XS33FX8" + } + } + } +} diff --git a/.github/workflows/nightly-macos.yml b/.github/workflows/nightly-macos.yml new file mode 100644 index 000000000..c65171427 --- /dev/null +++ b/.github/workflows/nightly-macos.yml @@ -0,0 +1,92 @@ +name: Nightly macOS build + +# Builds the unsigned Apple-silicon EffectCraft Nightly (packaging/macos/nightly.sh) on a hosted macOS +# runner and checks the archive as the Launcher unpacks it, ending with the bundle's version query +# (packaging/macos/nightly-verify.sh --expect unsigned). No secrets and no environment: the real Nightly +# is signed and notarized by the shared release-ref signer (craft-common-actions), which calls +# packaging/macos/nightly-sign.sh. +on: + # macOS runners are shared with release builds: pull requests run this only with the `full-ci` + # label (as ci.yml's Windows legs), never by changed paths. `labeled` so adding it starts a run. + pull_request: + types: [opened, synchronize, reopened, labeled] + workflow_dispatch: + +permissions: + contents: read + +# A newer push to a labelled PR cancels its older run. Any event that will not build (no `full-ci` +# label, or another label added) gets a group of its own, so it never cancels a real build. +concurrency: + group: nightly-macos-${{ github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'full-ci') && (github.event.action != 'labeled' || github.event.label.name == 'full-ci') && github.ref || github.run_id }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +jobs: + build: + name: Nightly .app (aarch64, unsigned) + if: >- + github.event_name == 'workflow_dispatch' || + (contains(github.event.pull_request.labels.*.name, 'full-ci') && + (github.event.action != 'labeled' || github.event.label.name == 'full-ci')) + runs-on: macos-15 + timeout-minutes: 90 + env: + CARGO_TERM_COLOR: always + CARGO_INCREMENTAL: 0 + RUST_BACKTRACE: 1 + steps: + - name: Harden runner + uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 + with: + egress-policy: audit + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + # The producer's own craft-fonts pin (nightly.yml craft-fonts-ref), so this check builds the + # fonts a shipped Nightly carries. + - name: Check out craft-fonts + uses: storytold/craft-common-actions/actions/checkout-craft-fonts@f5141455aac7b2eb4708aa259d8ffcdf10fde939 + with: + ref: b076417b5880bd4154bd22f00695b1d28c6bea83 + - uses: storytold/craft-common-actions/actions/checkout-craft-i18n@f5141455aac7b2eb4708aa259d8ffcdf10fde939 + - id: rust + uses: storytold/craft-common-actions/actions/rust-channel@f5141455aac7b2eb4708aa259d8ffcdf10fde939 + with: + targets: aarch64-apple-darwin + - uses: step-security/dtolnay-rust-toolchain@8dd607977d06adf4ed49b190381e74c17a9dd25f # v1.0.0 + with: + toolchain: ${{ steps.rust.outputs.toolchain }} + targets: ${{ steps.rust.outputs.targets }} + components: ${{ steps.rust.outputs.components }} + # A version of the prepared Nightly form for this commit; the real one comes from the feed's + # identity job. Only nightly.sh's input checks read it. + - name: Prepare a Nightly identity for this commit + run: | + set -euo pipefail + base="$(python3 -c 'import tomllib; print(tomllib.load(open("Cargo.toml", "rb"))["workspace"]["package"]["version"].split("-")[0])')" + sha="$(git rev-parse HEAD)" + date="$(date -u +%Y-%m-%d)" + { + echo "EFFECTCRAFT_BUILD_SHA=$sha" + echo "EFFECTCRAFT_BUILD_DATE=$date" + echo "EFFECTCRAFT_VERSION=$base-nightly.${date//-/}.$GITHUB_RUN_NUMBER.$GITHUB_RUN_ATTEMPT.g${sha:0:12}" + } >>"$GITHUB_ENV" + - name: Build the unsigned Nightly bundle + env: + EFFECTCRAFT_BUILD_CHANNEL: nightly-v1 + CARGO_TARGET_DIR: ${{ runner.temp }}/nightly-targets + DIST: ${{ runner.temp }}/nightly-dist + CRAFT_FONTS_DIR: ${{ github.workspace }}/craft-fonts + CRAFT_FONTS_REQUIRED: "1" + run: bash packaging/macos/nightly.sh --arch aarch64 + - name: Check the archive and the bundle's version + run: bash packaging/macos/nightly-verify.sh --expect unsigned --input "$RUNNER_TEMP/nightly-dist/effectcraft-$EFFECTCRAFT_VERSION-macos-aarch64-nightly.zip" + # Keeps the verified unsigned zip briefly for keyless signer tests and hand testing. Unsigned only. + - name: Keep the unsigned archive + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 + with: + name: effectcraft-nightly-macos-aarch64-unsigned + path: ${{ runner.temp }}/nightly-dist/effectcraft-${{ env.EFFECTCRAFT_VERSION }}-macos-aarch64-nightly.zip + if-no-files-found: error + retention-days: 7 + compression-level: 0 diff --git a/.github/workflows/nightly-sign.yml b/.github/workflows/nightly-sign.yml new file mode 100644 index 000000000..a57713f5a --- /dev/null +++ b/.github/workflows/nightly-sign.yml @@ -0,0 +1,42 @@ +name: EffectCraft release-ref nightly signer + +# Enabled for supervised manual dispatch on release. Main/release contents must match. +# A reusable callee does not change context; this must be a real top-level release dispatch. +on: + workflow_dispatch: + inputs: + producer_run_id: + description: Exact untrusted producer Actions run ID + required: true + type: string + producer_run_attempt: + description: Exact untrusted producer Actions run attempt + required: true + type: string + +permissions: {} + +concurrency: + group: effectcraft-nightly-release + cancel-in-progress: false + +jobs: + release: + # Actual context guards: official repository, manual dispatch, real release branch. + if: >- + github.repository == 'storytold/effectcraft' && + github.event_name == 'workflow_dispatch' && + github.ref == 'refs/heads/release' && github.ref_type == 'branch' + permissions: + contents: write + actions: read + checks: read + attestations: write + id-token: write + uses: storytold/craft-common-actions/.github/workflows/nightly-release.yml@605d58766e8f536564da8fc81d3676ac86816dea + with: + tooling-revision: 605d58766e8f536564da8fc81d3676ac86816dea + producer_run_id: ${{ inputs.producer_run_id }} + producer_run_attempt: ${{ inputs.producer_run_attempt }} + # No secrets: inherit or raw platform values in this caller. Only the isolated native + # callee job may bind the existing release environment and export keys in its signing step. diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 000000000..068a82a0e --- /dev/null +++ b/.github/workflows/nightly.yml @@ -0,0 +1,34 @@ +name: EffectCraft unsigned nightly + +# Enabled for supervised manual runs by the reviewed manual actors only; no schedule yet. +# A later explicit opt-in may add a cadence (and turn on nightly-dispatch.yml with it). +on: + workflow_dispatch: + +permissions: + contents: read + +jobs: + unsigned: + # Actual context guards only; no inherited/platform secrets. + if: >- + github.repository == 'storytold/effectcraft' && + github.ref == 'refs/heads/main' && github.ref_type == 'branch' && + (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') + # Maximum for the reusable workflow. Its compiler narrows to contents/actions read; + # no OIDC, attestation write, release environment or platform secrets in compilation. + permissions: + contents: read + actions: read + attestations: write + id-token: write + uses: storytold/craft-common-actions/.github/workflows/nightly-unsigned.yml@605d58766e8f536564da8fc81d3676ac86816dea + with: + tooling-revision: 605d58766e8f536564da8fc81d3676ac86816dea + app-name: effectcraft + manual-actors: '["bflatastic","dylanmtaylor","echelon","FredApps","skylartaylor"]' + craft-fonts-ref: b076417b5880bd4154bd22f00695b1d28c6bea83 + # One producer run builds every listed platform for one all-or-nothing release. The pin is the + # craft-common-actions main commit that merged #339 (bounded lineage compares), on top of the + # Linux/macOS signer (#342). + platforms: '["windows-x86_64","linux-x86_64","macos-aarch64"]' diff --git a/.github/workflows/packaging-lint.yml b/.github/workflows/packaging-lint.yml index ccf74f43a..1428be436 100644 --- a/.github/workflows/packaging-lint.yml +++ b/.github/workflows/packaging-lint.yml @@ -6,9 +6,9 @@ name: Packaging lint on: push: branches: [main, release] - paths: [".github/workflows/**", "packaging/**", "assets/app-icon/**"] + paths: [".github/workflows/**", "packaging/**", "assets/app-icon/**", ".github/nightly-signing-policy.json", ".github/nightly-linux-signing-key.asc", "sonar-project.properties"] pull_request: - paths: [".github/workflows/**", "packaging/**", "assets/app-icon/**"] + paths: [".github/workflows/**", "packaging/**", "assets/app-icon/**", ".github/nightly-signing-policy.json", ".github/nightly-linux-signing-key.asc", "sonar-project.properties"] workflow_dispatch: permissions: @@ -50,3 +50,20 @@ jobs: - name: Build and check non-executable installer fixtures shell: pwsh run: ./packaging/windows/test-install-policy.ps1 -OutputDirectory (Join-Path $env:RUNNER_TEMP 'craft-install-policy-tests') + + nightly-source-contract: + name: Nightly source contracts (no build or signing) + runs-on: ubuntu-latest + timeout-minutes: 5 + permissions: + contents: read + steps: + - name: Harden runner + uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 + with: + egress-policy: audit + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - name: Enforce nightly serialization and synthetic packaging contracts + run: python3 packaging/nightly-tests.py diff --git a/.gitignore b/.gitignore index 7ce8c8c55..84b9bae5e 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,10 @@ __pycache__/ # After Effects test corpus fetched by `cargo xtask aep-corpus` /corpus/ + +# Checked out into the workspace by the shared nightly workflows; the nightly packaging requires a +# clean tree, so these must never show up as untracked files. +/.nightly-tools +/.nightly-input +/craft-i18n +/craft-fonts diff --git a/ATTRIBUTION.md b/ATTRIBUTION.md index 74dbce1fa..3e40cf02f 100644 --- a/ATTRIBUTION.md +++ b/ATTRIBUTION.md @@ -42,6 +42,11 @@ and licence texts are in [`NOTICE`](NOTICE). | `assets/app-icon/effectcraft-macos-512.png` | EffectCraft contributors | Original work: effectCraft runtime Dock icon (macOS) (owner's ArtCraft unicorn drawing, vectorised) | MIT OR Apache-2.0 (`assets/app-icon/LICENSE.txt`) | | `assets/app-icon/effectcraft-small.svg` | EffectCraft contributors | Original work: effectCraft app icon, light vector (owner's ArtCraft unicorn drawing, vectorised) | MIT OR Apache-2.0 (`assets/app-icon/LICENSE.txt`) | | `assets/app-icon/effectcraft.icns` | EffectCraft contributors | Original work: effectCraft macOS app icon (owner's ArtCraft unicorn drawing, vectorised) | MIT OR Apache-2.0 (`assets/app-icon/LICENSE.txt`) | +| `assets/app-icon/effectcraft-nightly.png` | EffectCraft contributors | Original work: Nightly derivative of the effectCraft app icon (256 px, deep background) | MIT OR Apache-2.0 (`assets/app-icon/LICENSE.txt`) | +| `assets/app-icon/effectcraft-nightly-1024.png` | EffectCraft contributors | Original work: Nightly derivative of the effectCraft app icon (padded macOS 1024 px, deep background) | MIT OR Apache-2.0 (`assets/app-icon/LICENSE.txt`) | +| `assets/app-icon/effectcraft-nightly-macos-512.png` | EffectCraft contributors | Original work: Nightly derivative of the effectCraft app icon (padded macOS 512 px, deep background) | MIT OR Apache-2.0 (`assets/app-icon/LICENSE.txt`) | +| `assets/app-icon/effectcraft-nightly.ico` | EffectCraft contributors | Original work: Nightly derivative of the effectCraft app icon (Windows 16-256 px, deep background) | MIT OR Apache-2.0 (`assets/app-icon/LICENSE.txt`) | +| `assets/app-icon/effectcraft-nightly.icns` | EffectCraft contributors | Original work: Nightly derivative of the effectCraft app icon (macOS bundle, deep background) | MIT OR Apache-2.0 (`assets/app-icon/LICENSE.txt`) | | `assets/app-icon/effectcraft.ico` | EffectCraft contributors | Original work: effectCraft Windows app icon (owner's ArtCraft unicorn drawing, vectorised) | MIT OR Apache-2.0 (`assets/app-icon/LICENSE.txt`) | | `assets/app-icon/effectcraft.svg` | EffectCraft contributors | Original work: effectCraft app icon, master vector (owner's ArtCraft unicorn drawing, vectorised) | MIT OR Apache-2.0 (`assets/app-icon/LICENSE.txt`) | | `assets/app-icon/hicolor/128x128/apps/ai.storyteller.effectcraft.png` | EffectCraft contributors | Original work: effectCraft app icon, Linux hicolor 128x128 (owner's ArtCraft unicorn drawing, vectorised) | MIT OR Apache-2.0 (`assets/app-icon/LICENSE.txt`) | diff --git a/Cargo.lock b/Cargo.lock index b967eb41d..f5f99f0fe 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1951,8 +1951,10 @@ dependencies = [ "serde_json", "sysinfo", "tempfile", + "thiserror 2.0.21", "winit", "winresource", + "winsafe", "zbus", ] diff --git a/apps/effectcraft-cli/src/main.rs b/apps/effectcraft-cli/src/main.rs index d671a6345..4b78193ba 100644 --- a/apps/effectcraft-cli/src/main.rs +++ b/apps/effectcraft-cli/src/main.rs @@ -317,6 +317,16 @@ fn main() { Ok(raw) => raw, Err(e) => fail_usage(&e), }; + // The Launcher's Nightly profile flags belong to the desktop app only. Refuse them before any + // argument is parsed, so no script can drive a profile outside the Launcher's control (exit 2). + // Written without a leading `--` in the literal so the option table stays the one place that + // declares options (`every_option_read_is_declared`). + const DESKTOP_PROFILE_FLAGS: [&str; 2] = ["launch-profile", "profile-root"]; + if let Some(flag) = + raw.iter().find(|a| a.starts_with('-') && DESKTOP_PROFILE_FLAGS.iter().any(|name| a.trim_start_matches('-').split('=').next() == Some(*name))) + { + fail_usage(&format!("`{flag}` selects the desktop Nightly profile; effectcraft-cli has no launch profile")); + } if matches!(raw.first().map(String::as_str), Some("--version" | "-V" | "version")) { say!("effectcraft-cli {}", env!("CARGO_PKG_VERSION")); return; diff --git a/apps/effectcraft-cli/tests/it/cli.rs b/apps/effectcraft-cli/tests/it/cli.rs index 3bdda82a7..d1fb0b818 100644 --- a/apps/effectcraft-cli/tests/it/cli.rs +++ b/apps/effectcraft-cli/tests/it/cli.rs @@ -475,6 +475,24 @@ fn unknown_options_are_usage_errors() { } } +/// The desktop Nightly profile flags belong to the Launcher and the GUI: the headless CLI refuses +/// both spellings (and their `=` forms) as a usage error before anything runs. +#[test] +fn the_desktop_nightly_profile_flags_are_refused() { + for args in [ + &["info", "--launch-profile", "nightly-v1", "--profile-root", "/somewhere", "--json"][..], + &["info", "--launch-profile=nightly-v1", "--json"], + &["render-frame", "--profile-root=/somewhere", "--out", "x.png"], + &["--launch-profile", "nightly-v1", "--version"], + ] { + let out = bin().args(args).output().unwrap(); + let err = String::from_utf8_lossy(&out.stderr); + assert_eq!(out.status.code(), Some(2), "{args:?}: {err}"); + assert!(err.contains("has no launch profile"), "{args:?}: {err}"); + assert!(out.stdout.is_empty(), "{args:?}: nothing ran"); + } +} + /// An argument that is not Unicode (a Latin-1 file name on Linux) is a usage error (exit 2) /// naming it, before anything runs: `std::env::args` panicked on one (exit 101). #[cfg(unix)] diff --git a/apps/effectcraft/Cargo.toml b/apps/effectcraft/Cargo.toml index 2c8224f65..528233d74 100644 --- a/apps/effectcraft/Cargo.toml +++ b/apps/effectcraft/Cargo.toml @@ -26,6 +26,8 @@ pollster = { workspace = true } cpal = { workspace = true } log = { workspace = true } chrono = { workspace = true } +# The launch-profile refusal and the nightly Windows identity (src/process_identity.rs). +thiserror = { workspace = true } # MIT; safe process handles and target-only memory observation for the crash helper. sysinfo = { version = "=0.37.2", default-features = false, features = ["system"] } @@ -60,3 +62,5 @@ fmv-macos-events = "=0.1.0" [target.'cfg(windows)'.dependencies] craft-update = { workspace = true } +# SetCurrentProcessExplicitAppUserModelID: the Nightly window's own taskbar identity. +winsafe = { version = "=0.0.29", default-features = false, features = ["user", "shell"] } diff --git a/apps/effectcraft/build.rs b/apps/effectcraft/build.rs index 50eb5f34c..c66cb075b 100644 --- a/apps/effectcraft/build.rs +++ b/apps/effectcraft/build.rs @@ -1,23 +1,81 @@ //! Windows only: embed the app icon and version info (VERSIONINFO) into `effectcraft.exe`. //! -//! On every other target this does nothing. A missing resource compiler is a warning, so a -//! cross-compile from macOS or Linux still links, unless `EFFECTCRAFT_REQUIRE_WINRES=1` turns it -//! into an error (for release builds). +//! On every other target this does nothing beyond recording the built channel/version the app +//! reports. A missing resource compiler is a warning, so a cross-compile from macOS or Linux still +//! links, unless `EFFECTCRAFT_REQUIRE_WINRES=1` (set by the release and nightly workflows) turns it +//! into an error. + +#[path = "src/build_channel.rs"] +mod build_channel; fn main() { println!("cargo:rerun-if-changed=build.rs"); + println!("cargo:rerun-if-env-changed=EFFECTCRAFT_BUILD_CHANNEL"); + println!("cargo:rustc-check-cfg=cfg(effectcraft_nightly_v1)"); + // `EFFECTCRAFT_BUILD_CHANNEL=nightly-v1` compiles the isolated Nightly flavor; unset, empty or + // `stable` compiles stable. Anything else is a build error rather than a silent fallback. + let nightly = match std::env::var("EFFECTCRAFT_BUILD_CHANNEL").as_deref() { + Ok("nightly-v1") => { + println!("cargo:rustc-cfg=effectcraft_nightly_v1"); + true + } + Ok("stable" | "") | Err(std::env::VarError::NotPresent) => false, + _ => { + eprintln!("unsupported EFFECTCRAFT_BUILD_CHANNEL (expected stable or nightly-v1)"); + std::process::exit(1); + } + }; println!("cargo:rerun-if-changed=../../assets/app-icon/effectcraft.ico"); + println!("cargo:rerun-if-changed=../../assets/app-icon/effectcraft-nightly.ico"); println!("cargo:rerun-if-env-changed=EFFECTCRAFT_REQUIRE_WINRES"); + println!("cargo:rerun-if-env-changed=EFFECTCRAFT_VERSION"); + println!("cargo:rerun-if-env-changed=EFFECTCRAFT_OVERRIDE_VERSION"); + println!("cargo:rerun-if-env-changed=EFFECTCRAFT_BUILD_SHA"); + println!("cargo:rerun-if-env-changed=EFFECTCRAFT_BUILD_DATE"); + // A nightly build refuses a version the feed would not have produced: the same identity the + // Linux, macOS and Windows packaging checks require. Stable keeps its Cargo version. + let cargo_version = std::env::var("CARGO_PKG_VERSION").unwrap_or_default(); + let built_version = if nightly { + // `EFFECTCRAFT_VERSION` is the feed identity the shared workflow passes; + // `EFFECTCRAFT_OVERRIDE_VERSION` is what this repo's own Linux packaging scripts pass. Accept + // either, or a nightly built by package.sh would print the Cargo version and fail the + // version check in nightly-common.sh. + let version = match std::env::var("EFFECTCRAFT_VERSION").or_else(|_| std::env::var("EFFECTCRAFT_OVERRIDE_VERSION")) { + Ok(version) if build_channel::is_nightly_version(&version) => version, + _ => { + eprintln!("nightly-v1 requires an explicit EFFECTCRAFT_VERSION (or EFFECTCRAFT_OVERRIDE_VERSION) feed identity"); + std::process::exit(1); + } + }; + match (std::env::var("EFFECTCRAFT_BUILD_SHA"), std::env::var("EFFECTCRAFT_BUILD_DATE")) { + (Ok(sha), Ok(date)) if build_channel::identity_matches(&version, &sha, &date) => version, + _ => { + eprintln!("nightly-v1 requires a matching EFFECTCRAFT_BUILD_SHA (40 hex) and EFFECTCRAFT_BUILD_DATE"); + std::process::exit(1); + } + } + } else { + cargo_version + }; + println!("cargo:rustc-env=EFFECTCRAFT_BUILT_VERSION={built_version}"); + let commit = + std::env::var("EFFECTCRAFT_BUILD_SHA").ok().filter(|sha| sha.len() == 40 && sha.bytes().all(|b| b.is_ascii_hexdigit() && !b.is_ascii_uppercase())); + println!("cargo:rustc-env=EFFECTCRAFT_BUILT_COMMIT={}", commit.as_deref().unwrap_or("")); + if std::env::var("CARGO_CFG_TARGET_OS").as_deref() != Ok("windows") { return; } let mut res = winresource::WindowsResource::new(); - res.set_icon("../../assets/app-icon/effectcraft.ico") - .set("ProductName", "EffectCraft") - .set("FileDescription", "EffectCraft motion graphics and visual effects") + res.set_icon(build_channel::windows_icon_path(nightly)) + .set("ProductName", if nightly { "EffectCraft Nightly" } else { "EffectCraft" }) + .set("FileDescription", if nightly { "EffectCraft Nightly motion graphics" } else { "EffectCraft motion graphics and visual effects" }) .set("LegalCopyright", "Copyright (c) 2026 The EffectCraft contributors. MIT OR Apache-2.0.") .set("OriginalFilename", "effectcraft.exe") .set("InternalName", "effectcraft"); + if nightly { + // The Launcher checks the PE ProductVersion against the exact feed identity, not FileVersion. + res.set("ProductVersion", &built_version); + } if let Err(e) = res.compile() { if std::env::var_os("EFFECTCRAFT_REQUIRE_WINRES").is_some() { panic!("embedding Windows resources failed: {e}"); diff --git a/apps/effectcraft/src/build_channel.rs b/apps/effectcraft/src/build_channel.rs new file mode 100644 index 000000000..fd896b146 --- /dev/null +++ b/apps/effectcraft/src/build_channel.rs @@ -0,0 +1,92 @@ +//! The build-time nightly identity shared by the build script and its pure regression tests. +pub fn is_nightly_version(version: &str) -> bool { + let Some((base, suffix)) = version.split_once("-nightly.") else { return false }; + let digits = |s: &str| !s.is_empty() && s.bytes().all(|b| b.is_ascii_digit()); + let base: Vec<_> = base.split('.').collect(); + let parts: Vec<_> = suffix.split('.').collect(); + base.len() == 3 + && base.iter().all(|s| digits(s)) + && parts.len() == 4 + && parts[0].len() == 8 + && digits(parts[0]) + && digits(parts[1]) + && digits(parts[2]) + && parts[3].strip_prefix('g').is_some_and(|sha| sha.len() == 12 && sha.bytes().all(|b| b.is_ascii_digit() || (b'a'..=b'f').contains(&b))) +} +/// The prepared version, source commit and run date must agree: the version names this commit and +/// the original run's UTC date (the packaging scripts check the same pair). +pub fn identity_matches(version: &str, sha: &str, date: &str) -> bool { + let digits = |s: &str| !s.is_empty() && s.bytes().all(|b| b.is_ascii_digit()); + if !is_nightly_version(version) || sha.len() != 40 || !sha.bytes().all(|b| b.is_ascii_digit() || (b'a'..=b'f').contains(&b)) { + return false; + } + if !version.ends_with(&format!(".g{}", &sha[..12])) { + return false; + } + let Some((_, suffix)) = version.split_once("-nightly.") else { return false }; + let date_digits = suffix.split('.').next().unwrap_or(""); + date.len() == 10 && digits(date_digits) && date.as_bytes()[4] == b'-' && date.as_bytes()[7] == b'-' && date.replace('-', "") == date_digits +} + +pub fn windows_icon_path(nightly: bool) -> &'static str { + if nightly { "../../assets/app-icon/effectcraft-nightly.ico" } else { "../../assets/app-icon/effectcraft.ico" } +} + +#[cfg(test)] +mod tests { + use super::*; + #[test] + fn windows_resource_uses_the_flavor_specific_icon_without_changing_stable() { + assert_eq!(windows_icon_path(false), "../../assets/app-icon/effectcraft.ico"); + assert_eq!(windows_icon_path(true), "../../assets/app-icon/effectcraft-nightly.ico"); + } + + #[test] + fn explicit_feed_identity_is_required_for_a_nightly_build() { + assert!(is_nightly_version("0.23.1-nightly.20261120.17.1.gabcdef012345")); + for invalid in [ + "", + "0.23.1", + "0.23.1-nightly", + "0.23.1-nightly.20261120", + "0.23.1-nightly.20261120.17.1.gABCDEF012345", + "0.23.1-nightly.20261120.17.1.gabcdef012345\n", + ] { + assert!(!is_nightly_version(invalid), "{invalid:?}"); + } + } + #[test] + fn the_prepared_identity_requires_a_matching_commit_and_run_date() { + let sha = "abcdef0123456789abcdef0123456789abcdef01"; + let version = "0.25.1-nightly.20261124.41.1.gabcdef012345"; + assert!(identity_matches(version, sha, "2026-11-24")); + for (v, s, d) in [ + // The version carries the first 12 characters of the commit, so a near-miss has to + // differ inside them; a difference after the twelfth cannot be seen from the version. + (version, "bbcdef0123456789abcdef0123456789abcdef01", "2026-11-24"), + (version, sha, "2026-11-23"), + ( + version, + sha, + "2026-11-24 +", + ), + ("0.25.1-nightly.20261124.41.1.gABCDEF012345", sha, "2026-11-24"), + ("0.25.1", sha, "2026-11-24"), + (version, "abc", "2026-11-24"), + ] { + assert!(!identity_matches(v, s, d), "{v} {s} {d}"); + } + } + + #[test] + fn version_cannot_inject_a_path_or_an_extra_build_directive() { + for invalid in [ + "../0.23.1-nightly.20261120.1.1.gabcdef012345", + "0.23.1-nightly.20261120.1.1.gabcdef012345/other", + "0.23.1-nightly.20261120.1.1.gabcdef012345\ncargo:rustc-cfg=other", + ] { + assert!(!is_nightly_version(invalid)); + } + } +} diff --git a/apps/effectcraft/src/build_flavor.rs b/apps/effectcraft/src/build_flavor.rs new file mode 100644 index 000000000..80ac8fb28 --- /dev/null +++ b/apps/effectcraft/src/build_flavor.rs @@ -0,0 +1,82 @@ +//! Build-time channel is distinct from a launch selector. A runtime environment cannot promote a stable build. +use crate::launch_profile::Profile; +use std::ffi::OsString; + +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum BuildFlavor { + Stable, + NightlyV1, +} + +pub const COMPILED: BuildFlavor = if cfg!(effectcraft_nightly_v1) { BuildFlavor::NightlyV1 } else { BuildFlavor::Stable }; + +pub fn require_profile(flavor: BuildFlavor, profile: &Profile) -> Result<(), String> { + match (flavor, profile.is_nightly()) { + (BuildFlavor::NightlyV1, false) => Err("Open EffectCraft Nightly from ArtCraft Launcher".into()), + (BuildFlavor::Stable, true) => Err("This is a stable EffectCraft build; nightly-v1 requires the nightly build".into()), + _ => Ok(()), + } +} + +pub fn needs_native_error(flavor: BuildFlavor, desktop_session: bool) -> bool { + desktop_session && flavor == BuildFlavor::NightlyV1 +} + +pub fn version_query(args: &[OsString]) -> bool { + matches!(args, [arg] if arg == "--version" || arg == "-V") +} + +pub fn version(flavor: BuildFlavor, stable: &str) -> String { + match flavor { + BuildFlavor::Stable => stable.to_owned(), + BuildFlavor::NightlyV1 => format!("{stable} (nightly-v1)"), + } +} + +/// The line the version query prints: `EffectCraft `, with ` (nightly-v1)` for a nightly +/// build. The Launcher's smoke test and the macOS verifier compare it exactly. +pub fn version_line(flavor: BuildFlavor, version: &str) -> String { + format!("EffectCraft {}", self::version(flavor, version)) +} + +#[cfg(test)] +mod tests { + use super::*; + #[test] + fn only_a_nightly_desktop_refusal_requests_a_native_dialog() { + assert!(needs_native_error(BuildFlavor::NightlyV1, true)); + assert!(!needs_native_error(BuildFlavor::NightlyV1, false)); + assert!(!needs_native_error(BuildFlavor::Stable, true)); + assert!(!needs_native_error(BuildFlavor::Stable, false)); + } + + #[test] + fn nightly_build_without_a_profile_is_refused_before_startup() { + let started = std::cell::Cell::new(false); + let result = require_profile(BuildFlavor::NightlyV1, &Profile::Stable).map(|()| started.set(true)); + assert!(result.unwrap_err().contains("ArtCraft Launcher")); + assert!(!started.get()); + } + #[test] + fn stable_and_nightly_flavors_accept_only_their_own_profile() { + let nightly = Profile::NightlyV1(std::path::PathBuf::from("already validated root")); + assert!(require_profile(BuildFlavor::Stable, &Profile::Stable).is_ok()); + assert!(require_profile(BuildFlavor::Stable, &nightly).is_err()); + assert!(require_profile(BuildFlavor::NightlyV1, &nightly).is_ok()); + } + #[test] + fn nightly_version_query_is_unambiguous_and_never_reinterprets_file_arguments() { + assert_eq!(version(BuildFlavor::Stable, "0.23.1"), "0.23.1"); + assert_eq!(version(BuildFlavor::NightlyV1, "0.23.1"), "0.23.1 (nightly-v1)"); + // The exact line the Launcher, the shared smoke test and the macOS verifier expect. + assert_eq!( + version_line(BuildFlavor::NightlyV1, "0.25.1-nightly.20261124.41.1.gabcdef012345"), + "EffectCraft 0.25.1-nightly.20261124.41.1.gabcdef012345 (nightly-v1)" + ); + assert_eq!(version_line(BuildFlavor::Stable, "0.25.1"), "EffectCraft 0.25.1"); + assert!(version_query(&["--version".into()])); + assert!(version_query(&["-V".into()])); + assert!(!version_query(&["--".into(), "--version".into()])); + assert!(!version_query(&[])); + } +} diff --git a/apps/effectcraft/src/crash_report.rs b/apps/effectcraft/src/crash_report.rs index 3080c12bb..b80e02372 100644 --- a/apps/effectcraft/src/crash_report.rs +++ b/apps/effectcraft/src/crash_report.rs @@ -118,18 +118,28 @@ pub fn session_marker(id: &str) -> String { format!("crash-report session {id}") } -/// Start before heavy work. A missing helper is a warning, never a reason to refuse the app. -pub fn start(id: &str, log: Option<&Path>, reports: &Path, interactive: bool) -> io::Result { - let exe = std::env::current_exe()?; - let args = [ +/// The helper's own command line: this program re-run with [`FLAG`] and no profile tokens. +pub fn helper_args(id: &str, log: Option<&Path>, reports: &Path, interactive: bool) -> [OsString; 6] { + [ OsString::from(FLAG), OsString::from(id), log.map_or_else(OsString::new, |p| p.as_os_str().to_owned()), reports.as_os_str().to_owned(), OsString::from(if interactive { "1" } else { "0" }), OsString::from(std::process::id().to_string()), - ]; - spawn(&exe, &args) + ] +} + +/// Whether these arguments ask for the internal helper rather than a session. `main` must answer +/// this before the launch-profile bootstrap, which refuses a Nightly start with no profile. +pub fn is_helper(args: &[OsString]) -> bool { + args.first().map(OsString::as_os_str) == Some(OsStr::new(FLAG)) +} + +/// Start before heavy work. A missing helper is a warning, never a reason to refuse the app. +pub fn start(id: &str, log: Option<&Path>, reports: &Path, interactive: bool) -> io::Result { + let exe = std::env::current_exe()?; + spawn(&exe, &helper_args(id, log, reports, interactive)) } fn spawn(exe: &Path, args: &[OsString]) -> io::Result { @@ -182,7 +192,7 @@ fn ready(child: &mut Child) -> io::Result<()> { /// Handle the internal mode before logging, argument parsing, updates or GUI initialization. /// The callback is a native dialog on this helper's main thread, not on the failed GUI's. pub fn maybe_run(args: &[OsString], show: impl FnOnce(&str)) -> bool { - if args.first().map(OsString::as_os_str) != Some(OsStr::new(FLAG)) { + if !is_helper(args) { return false; } let parsed = match args { @@ -450,6 +460,27 @@ mod tests { assert!(path.is_file(), "report did not arrive: {}", path.display()); } + /// The helper re-runs this program with no profile tokens, so the Nightly flavor refuses that + /// argv as a bare start: `main` must answer the helper before the launch-profile bootstrap. + #[test] + fn the_helper_command_line_is_recognized_before_the_launch_profile_bootstrap() { + let dir = folder(); + let args = helper_args("7-9", None, dir.as_path(), true); + assert!(is_helper(&args)); + assert!(args.iter().all(|arg| arg != "--launch-profile" && arg != "--profile-root")); + let parsed = crate::launch_profile::parse(args.to_vec()).unwrap(); + assert_eq!(parsed.profile, crate::launch_profile::Profile::Stable, "no profile tokens in the helper's argv"); + assert!( + crate::build_flavor::require_profile(crate::build_flavor::BuildFlavor::NightlyV1, &parsed.profile).is_err(), + "a Nightly build refuses the helper's argv as a session" + ); + // A session's own command line is never the helper's, before or after `--`. + for session in [vec![], vec![OsString::from("--")], vec![OsString::from("--"), OsString::from(FLAG)]] { + assert!(!is_helper(&session), "{session:?}"); + } + std::fs::remove_dir_all(dir).unwrap(); + } + #[test] fn bounded_protocol_rejects_eof_and_partial_or_wrong_markers() { let mut clean = CLEAN; diff --git a/apps/effectcraft/src/file_dialogs.rs b/apps/effectcraft/src/file_dialogs.rs index c8cf5181a..c8da56354 100644 --- a/apps/effectcraft/src/file_dialogs.rs +++ b/apps/effectcraft/src/file_dialogs.rs @@ -36,6 +36,13 @@ type Answer = Pin> + Send>>; /// A command's dialog waiting for [`show_asked`]. pub type Asked = (FileDialog, DialogDone); +/// Say something to a person who may have no console (a Windows release build has none): the one +/// native message box the app opens. It runs before eframe exists, so it is not a [`guarded`] file +/// picker; it is here because every `rfd` dialog belongs to this module (#3084). +pub fn report_error(title: &str, message: &str) { + let _ = rfd::MessageDialog::new().set_title(title).set_description(message).set_level(rfd::MessageLevel::Error).set_buttons(rfd::MessageButtons::Ok).show(); +} + /// Open dialog `what` (its title, for the error) with `open`: on the main thread only, and a /// panic while it opens is an error instead of a crash (#3084). pub fn guarded(what: &str, open: impl FnOnce() -> T) -> Result { diff --git a/apps/effectcraft/src/launch_profile.rs b/apps/effectcraft/src/launch_profile.rs new file mode 100644 index 000000000..055c8f970 --- /dev/null +++ b/apps/effectcraft/src/launch_profile.rs @@ -0,0 +1,212 @@ +//! Launcher-owned nightly-v1 bootstrap. Selected before logging, updates, fonts or saved state. +//! Stable launches retain their original arguments and directory policy. No environment mutation. + +use std::ffi::OsString; +use std::path::{Component, Path, PathBuf}; +use std::sync::OnceLock; + +pub const VERSION: &str = "nightly-v1"; + +#[derive(Clone, Debug, PartialEq, Eq)] +pub enum Profile { + Stable, + NightlyV1(PathBuf), +} + +impl Profile { + pub fn is_nightly(&self) -> bool { + matches!(self, Self::NightlyV1(_)) + } + + pub fn root(&self) -> Option<&Path> { + match self { + Self::Stable => None, + Self::NightlyV1(root) => Some(root), + } + } +} + +#[derive(Debug, PartialEq, Eq)] +pub struct Launch { + pub profile: Profile, + pub args: Vec, +} + +static PROFILE: OnceLock = OnceLock::new(); + +pub fn current() -> &'static Profile { + PROFILE.get().unwrap_or(&Profile::Stable) +} + +pub fn install(profile: Profile) -> Result<(), String> { + PROFILE.set(profile).map_err(|_| "the launch profile was already selected".into()) +} + +/// Recognize only the agreed literal selector/root pair before `--`. Everything after it is +/// a file, even when it looks like a profile flag. No filesystem or startup hook runs here. +pub fn parse(args: Vec) -> Result { + let mut selector = None; + let mut root = None; + let mut other = Vec::new(); + let mut files = Vec::new(); + let mut iter = args.iter(); + let mut delimiter = false; + while let Some(arg) = iter.next() { + if arg == "--" { + delimiter = true; + files.extend(iter.cloned()); + break; + } + if arg == "--launch-profile" || arg == "--profile-root" { + let slot = if arg == "--launch-profile" { &mut selector } else { &mut root }; + if slot.is_some() { + return Err("the profile selector and root must each occur exactly once".into()); + } + let value = iter.next().filter(|v| !v.is_empty()).ok_or("the profile selector/root needs a value")?; + if value.to_string_lossy().starts_with("--") { + return Err("the profile selector/root needs a value".into()); + } + *slot = Some(value.clone()); + } else if arg.to_string_lossy().starts_with("--launch-profile=") || arg.to_string_lossy().starts_with("--profile-root=") { + return Err("the nightly protocol requires separate literal selector/root argument tokens".into()); + } else { + other.push(arg.clone()); + } + } + match (selector, root) { + (None, None) => Ok(Launch { profile: Profile::Stable, args }), + (Some(version), Some(root)) if version == VERSION => { + if !delimiter || !other.is_empty() { + return Err("nightly-v1 accepts only its selector/root followed by -- and file names".into()); + } + let root = PathBuf::from(root); + if !root.is_absolute() || root.components().any(|c| matches!(c, Component::ParentDir)) { + return Err("the nightly profile root must be absolute and contain no parent traversal".into()); + } + Ok(Launch { profile: Profile::NightlyV1(root), args: std::iter::once(OsString::from("--")).chain(files).collect() }) + } + (Some(_), Some(_)) => Err("unsupported launch profile (expected nightly-v1)".into()), + _ => Err("--launch-profile and --profile-root must be supplied together".into()), + } +} + +/// The Launcher's version check: the selector/root pair followed by exactly `--version` (or `-V`), +/// answered like a plain version query. Only [`parse`]'s lexical checks apply; the root is never +/// validated or touched, and `-- --version` stays a file name. +pub fn version_query(args: &[OsString]) -> bool { + let Some((last, pair)) = args.split_last() else { return false }; + if last != "--version" && last != "-V" { + return false; + } + let lexical = pair.iter().cloned().chain(std::iter::once(OsString::from("--"))).collect(); + matches!(parse(lexical), Ok(Launch { profile: Profile::NightlyV1(_), args }) if args.len() == 1) +} + +/// Validation finishes before the caller's first startup effect. Stable never calls the nightly +/// root validator, so its old portable/config resolution stays unchanged. +pub fn prepare(mut launch: Launch, validate: impl FnOnce(&Path) -> Result) -> Result { + if let Profile::NightlyV1(root) = &launch.profile { + launch.profile = Profile::NightlyV1(validate(root)?); + } + Ok(launch) +} + +/// Resolve the selected private root before the caller's first startup effect. +pub fn validate_root(root: &Path, env: impl Fn(&str) -> Option, exe: Option<&Path>) -> Result { + crate::profile_root::validate(root, env, exe, effectcraft_host::app_dirs::ensure_writable) +} + +#[cfg(test)] +mod tests { + use super::*; + use std::cell::Cell; + fn args(values: &[&str]) -> Vec { + values.iter().map(OsString::from).collect() + } + fn absolute() -> &'static str { + if cfg!(windows) { r"C:\NightlyData\profiles\effectcraft" } else { "/nightly-data/profiles/effectcraft" } + } + fn nightly() -> Vec { + args(&["--launch-profile", VERSION, "--profile-root", absolute(), "--"]) + } + + #[test] + fn stable_arguments_and_directory_policy_are_unchanged() { + for argv in [args(&[]), args(&["--demo", "a.ecproj"]), args(&["--", "--launch-profile", "file.ecproj"])] { + let launch = prepare(parse(argv.clone()).unwrap(), |_| panic!("stable must never validate a nightly root")).unwrap(); + assert_eq!(launch, Launch { profile: Profile::Stable, args: argv }); + } + } + + #[test] + fn exact_version_and_root_are_parsed_without_reinterpreting_file_names() { + let mut argv = nightly(); + argv.extend(args(&["--profile-root", "project with spaces.ecproj"])); + let launch = parse(argv).unwrap(); + assert_eq!(launch.profile, Profile::NightlyV1(PathBuf::from(absolute()))); + assert_eq!(launch.args, args(&["--", "--profile-root", "project with spaces.ecproj"])); + } + + #[test] + fn missing_duplicate_unknown_and_conflicting_profile_arguments_are_refused() { + for argv in [ + args(&["--launch-profile", VERSION]), + args(&["--profile-root", absolute()]), + args(&["--launch-profile", "future-v2", "--profile-root", absolute(), "--"]), + args(&["--launch-profile", VERSION, "--launch-profile", VERSION, "--profile-root", absolute(), "--"]), + args(&["--launch-profile", VERSION, "--profile-root", absolute(), "--profile-root", absolute(), "--"]), + args(&["--launch-profile", VERSION, "--profile-root", "relative", "--"]), + args(&["--launch-profile", VERSION, "--profile-root", "", "--"]), + args(&["--launch-profile", VERSION, "--profile-root", absolute(), "--control", "--"]), + args(&["--launch-profile", VERSION, "--profile-root", absolute()]), + args(&[&format!("--launch-profile={VERSION}"), "--profile-root", absolute(), "--"]), + ] { + assert!(parse(argv).is_err()); + } + } + + #[test] + fn the_launcher_version_check_is_a_version_query_only_in_its_exact_form() { + let pair = &["--launch-profile", VERSION, "--profile-root", absolute()]; + let reversed = &["--profile-root", absolute(), "--launch-profile", VERSION]; + for flag in ["--version", "-V"] { + for form in [pair, reversed] { + let mut argv = args(form); + argv.push(flag.into()); + assert!(version_query(&argv), "{argv:?}"); + } + } + for argv in [ + args(&["--version"]), + args(&["--launch-profile", VERSION, "--profile-root", absolute(), "--", "--version"]), + args(&["--launch-profile", VERSION, "--profile-root", absolute(), "--version", "--"]), + args(&["--launch-profile", VERSION, "--profile-root", absolute(), "--new-instance", "--version"]), + args(&["--launch-profile", VERSION, "--profile-root", absolute(), "--version", "--version"]), + args(&["--version", "--launch-profile", VERSION, "--profile-root", absolute()]), + args(&["--launch-profile", "future-v2", "--profile-root", absolute(), "--version"]), + args(&["--launch-profile", VERSION, "--profile-root", "relative", "--version"]), + args(&["--launch-profile", VERSION, "--version"]), + args(&["--launch-profile", VERSION, "--profile-root", absolute(), "--help"]), + ] { + assert!(!version_query(&argv), "{argv:?}"); + } + // Outside the query the strict protocol still refuses the version flag. + assert!(parse(args(&["--launch-profile", VERSION, "--profile-root", absolute(), "--version"])).is_err()); + } + + #[test] + fn failed_root_validation_never_reaches_startup_or_falls_back_to_stable() { + let reached = Cell::new(false); + let result = prepare(parse(nightly()).unwrap(), |_| Err("read-only or unsafe profile".into())).map(|_| reached.set(true)); + assert!(result.is_err()); + assert!(!reached.get()); + } + + #[test] + fn successful_root_validation_keeps_the_persistent_root_not_the_binary_tag() { + let checked = PathBuf::from(absolute()).join("checked"); + let launch = prepare(parse(nightly()).unwrap(), |_| Ok(checked.clone())).unwrap(); + assert_eq!(launch.profile.root(), Some(checked.as_path())); + assert!(launch.profile.is_nightly()); + } +} diff --git a/apps/effectcraft/src/main.rs b/apps/effectcraft/src/main.rs index a008a7b7a..4ae51620d 100644 --- a/apps/effectcraft/src/main.rs +++ b/apps/effectcraft/src/main.rs @@ -21,12 +21,19 @@ mod appimage; #[cfg(target_os = "macos")] mod apple_events; mod audio_out; +#[cfg(test)] +mod build_channel; +mod build_flavor; mod control_server; mod crash_report; mod diagnostic_state; mod launch_guard; +mod launch_profile; #[cfg(target_os = "macos")] mod native_menu; +mod nightly_session; +mod process_identity; +mod profile_root; // Every native dialog. Built everywhere; only the macOS and Linux apps show the commands' // dialogs without blocking the frame. #[cfg_attr(not(any(target_os = "macos", target_os = "linux")), allow(dead_code))] @@ -55,12 +62,110 @@ const ICON_PNG: &[u8] = include_bytes!("../../../assets/app-icon/hicolor/256x256 fn app_icon() -> egui::IconData { #[cfg(target_os = "macos")] - let png: &[u8] = include_bytes!("../../../assets/app-icon/effectcraft-macos-512.png"); + let png: &[u8] = if cfg!(effectcraft_nightly_v1) { + include_bytes!("../../../assets/app-icon/effectcraft-nightly-macos-512.png") + } else { + include_bytes!("../../../assets/app-icon/effectcraft-macos-512.png") + }; #[cfg(not(target_os = "macos"))] - let png: &[u8] = ICON_PNG; + let png: &[u8] = if cfg!(effectcraft_nightly_v1) { include_bytes!("../../../assets/app-icon/effectcraft-nightly.png") } else { ICON_PNG }; eframe::icon_data::from_png_bytes(png).unwrap_or_default() } +/// The source commit baked into this build by `build.rs` (empty for a local stable build). +fn build_commit() -> Option<&'static str> { + match env!("EFFECTCRAFT_BUILT_COMMIT") { + "" => None, + sha => Some(sha), + } +} + +fn initialize_nightly_process_identity() -> Result<(), process_identity::IdentityError> { + process_identity::initialize( + build_flavor::COMPILED == build_flavor::BuildFlavor::NightlyV1, + effectcraft_ui_egui::channel::id_for(effectcraft_ui_egui::channel::LaunchIdentity::NightlyV1), + ) +} + +/// Say why a Nightly launch was refused, through a native dialog where a person is looking at one. +fn report_launch_profile_error(error: &str) { + eprintln!("EffectCraft launch profile: {error}"); + let desktop_session = cfg!(windows) + || cfg!(target_os = "macos") + || (cfg!(target_os = "linux") && ["DISPLAY", "WAYLAND_DISPLAY"].into_iter().any(|key| std::env::var_os(key).is_some_and(|v| !v.is_empty()))); + if build_flavor::needs_native_error(build_flavor::COMPILED, desktop_session) { + if let Err(error) = initialize_nightly_process_identity() { + eprintln!("EffectCraft launch profile: {error}"); + return; + } + file_dialogs::report_error("EffectCraft Nightly", error); + } +} + +/// Whether this launch only asks for the version: the plain `--version`/`-V` query, or the +/// Launcher's profile preamble followed by it. The shared smoke test and the macOS verifier ask +/// the second form, and it answers without validating or touching the profile root. +fn version_query(argv: &[std::ffi::OsString]) -> bool { + build_flavor::version_query(argv) || launch_profile::version_query(argv) +} + +/// Select the immutable launch profile, its data roots and its window identity before any startup +/// service or side effect. `None` means the version query answered and the process is done. +fn prepare_launch() -> Option> { + // The trusted Launcher protocol is decided before logging, the crash helper, fonts or prefs. + let argv: Vec<_> = std::env::args_os().skip(1).collect(); + if build_flavor::COMPILED == build_flavor::BuildFlavor::NightlyV1 && version_query(&argv) { + use std::io::Write as _; + let _ = writeln!(std::io::stdout(), "{}", build_flavor::version_line(build_flavor::COMPILED, env!("EFFECTCRAFT_BUILT_VERSION"))); + return None; + } + let early = launch_profile::parse(argv) + .and_then(|launch| { + build_flavor::require_profile(build_flavor::COMPILED, &launch.profile)?; + initialize_nightly_process_identity().map_err(|error| error.to_string())?; + Ok(launch) + }) + .and_then(|launch| { + launch_profile::prepare(launch, |root| launch_profile::validate_root(root, |key| std::env::var_os(key), std::env::current_exe().ok().as_deref())) + }) + .unwrap_or_else(|error| { + report_launch_profile_error(&error); + std::process::exit(2) + }); + let identity = + if early.profile.is_nightly() { effectcraft_ui_egui::channel::LaunchIdentity::NightlyV1 } else { effectcraft_ui_egui::channel::LaunchIdentity::Stable }; + let installed = launch_profile::install(early.profile) + .and_then(|()| effectcraft_ui_egui::channel::select_identity(identity)) + // One place redirects every data root: the settings folder (host) and, through it, logs, + // Plug-ins, window state, recovery and the crash reports. + .and_then(|()| match launch_profile::current().root() { + None => Ok(()), + Some(root) => { + let root = root.to_path_buf(); + effectcraft_host::app_dirs::set_profile_root(root.clone()).map_err(str::to_owned)?; + // And the caches, which otherwise live in the platform cache folder. + effectcraft_engine::render::disk_cache::set_profile_root(root.clone()).map_err(str::to_owned)?; + // The UI keeps the user's animation presets in the profile too (not Documents, and + // not an inherited EC_PRESETS_DIR). + // The UI joins "Presets" itself, so the profile root is passed, not `/Presets`. + effectcraft_ui_egui::channel::set_profile_presets(root); + Ok(()) + } + }); + if let Err(error) = installed { + report_launch_profile_error(&error); + std::process::exit(2); + } + effectcraft_ui_egui::channel::set_build_identity(env!("EFFECTCRAFT_BUILT_VERSION"), build_commit()); + Some(early.args) +} + +/// Whether a stable-only startup service may run: the updater, the control channel and the +/// AppImage's desktop integration belong to a stable installation, never to a Nightly session. +fn stable_services() -> bool { + effectcraft_ui_egui::channel::stable_services_allowed() +} + /// Both native JSON projects and Save a Copy As XML projects are openable on launch. /// Keep this classification shared by project opening and the subsequent media-import pass. fn is_project_file(path: &str) -> bool { @@ -77,6 +182,17 @@ fn wayland_drop_notice(wayland_display: Option<&std::ffi::OsStr>, backend: Optio .then_some("Native Wayland file drops are unavailable. Use File ▸ Import ▸ File… or run via XWayland (see README, Linux).") } +/// The start-up status line. An interruption from the previous Nightly session and the launch +/// guard's graphics notice both matter: the notice must not hide the interruption, because the +/// interruption's record is cleared once it has been shown. +fn startup_status(interruption: Option<&str>, notice: Option<&str>) -> Option { + match (interruption, notice) { + (Some(interruption), Some(notice)) => Some(format!("{interruption} {notice}")), + (Some(text), None) | (None, Some(text)) => Some(text.to_owned()), + (None, None) => None, + } +} + /// The command line. #[derive(Debug, Default, PartialEq)] struct Args { @@ -176,7 +292,9 @@ fn install_file_dialogs(app: &mut EffectcraftApp) -> Option eframe::Result { - let args: Vec<_> = std::env::args_os().skip(1).collect(); - if crash_report::maybe_run(&args, |description| { + // This program's own crash-reporter helper re-runs it with no profile tokens, so its mode is + // answered before the launch-profile bootstrap, which would refuse it as a bare Nightly start + // (a dialog, a 3 s readiness timeout and no crash reporting on every launch). + let raw: Vec = std::env::args_os().skip(1).collect(); + if crash_report::maybe_run(&raw, |description| { file_dialogs::message("EffectCraft diagnostic report", description.to_owned()); }) { return Ok(()); } + let Some(args) = prepare_launch() else { return Ok(()) }; let reporter = crash_report::Shutdown::default(); - let result = run_desktop(&reporter); + let result = run_desktop(&reporter, &args); // run_desktop has dropped the app and handled any startup error with its existing dialog. // An unwinding panic or abort never reaches this marker. if let Err(error) = reporter.finish() { @@ -210,10 +332,13 @@ fn main() -> eframe::Result { result } -fn run_desktop(reporter: &crash_report::Shutdown) -> eframe::Result { - // Windows: the update helper is a copy of this program started with `--finish-update`. +fn run_desktop(reporter: &crash_report::Shutdown, arguments: &[std::ffi::OsString]) -> eframe::Result { + // Windows: the update helper is a copy of this program started with `--finish-update`. A Nightly + // build is never updated by the stable feed; ArtCraft Launcher replaces it. #[cfg(windows)] - if let Some(result) = craft_update::self_update::finish(&effectcraft_ui_egui::UPDATE_APP, &std::env::args_os().skip(1).collect::>()) { + if stable_services() + && let Some(result) = craft_update::self_update::finish(&effectcraft_ui_egui::UPDATE_APP, arguments) + { std::process::exit(i32::from(result.is_err())); } // First, so the panic hook and every start-up warning are recorded. Records go to stderr @@ -221,7 +346,9 @@ fn run_desktop(reporter: &crash_report::Shutdown) -> eframe::Result { // feed the compatibility report. effectcraft_engine::logging::install(); effectcraft_engine::logging::install_panic_hook(); - let Args { control_port, files, demo, home } = match parse_args(std::env::args().skip(1), std::env::var("EFFECTCRAFT_CONTROL_PORT")) { + // A Nightly session never inherits the stable control port: its profile is driven by the Launcher. + let env_port = if stable_services() { std::env::var("EFFECTCRAFT_CONTROL_PORT") } else { Err(std::env::VarError::NotPresent) }; + let Args { control_port, files, demo, home } = match parse_args(arguments.iter().map(|a| a.to_string_lossy().into_owned()), env_port) { Ok(Some(args)) => args, Ok(None) => { println!("effectcraft {}", env!("CARGO_PKG_VERSION")); @@ -255,9 +382,12 @@ fn run_desktop(reporter: &crash_report::Shutdown) -> eframe::Result { } // The font menus list the installed fonts: read their names while the window opens. effectcraft_engine::text::fonts::scan_system_in_background(); - // Wayland shows the window's icon from its desktop entry: an AppImage brings its own. + // Wayland shows the window's icon from its desktop entry: an AppImage brings its own. A Nightly + // tar is not an AppImage and must not write a desktop entry into the stable data folder. #[cfg(target_os = "linux")] - appimage::integrate_from_env(ICON_PNG); + if stable_services() { + appimage::integrate_from_env(ICON_PNG); + } // Settings ▸ Startup & Repair ▸ Window Graphics, switched to OpenGL when the last launch // stopped as its window opened (the marker alone does not establish a cause). let backend_override = std::env::var_os("WGPU_BACKEND"); @@ -271,16 +401,16 @@ fn run_desktop(reporter: &crash_report::Shutdown) -> eframe::Result { let on_gl = launch.backends == Some(eframe::wgpu::Backends::GL); let notice = launch.notice.take(); let options = eframe::NativeOptions { - viewport: egui::ViewportBuilder::default() - .with_title("EffectCraft") + viewport: effectcraft_ui_egui::channel::builder() + .with_title(effectcraft_ui_egui::channel::name_for(effectcraft_ui_egui::channel::identity())) .with_inner_size(window::DEFAULT_SIZE) .with_min_inner_size(window::MIN_SIZE) .with_drag_and_drop(true) // Started for an agent (`--control`): open without taking the user's keyboard focus. .with_active(control_port.is_none()) - .with_icon(app_icon()) - // Wayland matches the window to `ai.storyteller.effectcraft.desktop` by this ID. - .with_app_id(appimage::APP_ID), + .with_icon(app_icon()), + // `builder()` carries the channel's app id: Wayland matches the stable window to + // `ai.storyteller.effectcraft.desktop`; a Nightly window has its own id and channel. event_loop_builder: agent_event_loop(control_port.is_some()), wgpu_options: wgpu_options(launch.backends), ..Default::default() @@ -295,8 +425,24 @@ fn run_desktop(reporter: &crash_report::Shutdown) -> eframe::Result { #[cfg(target_os = "macos")] let apple_events = &apple_events; let desktop_reporter = reporter.clone(); + // A Nightly session records its own health in its private profile: a live lease plus an + // unclean-exit record that the next owner reports. Stable has no such record. + let (nightly_session, session_health_warning) = + match nightly_session::Session::begin_with_health(launch_profile::current().root(), env!("EFFECTCRAFT_BUILT_VERSION"), build_commit()) { + Ok(state) => state, + Err(error) => { + log::warn!("Nightly session health is unavailable: {error}"); + (None, true) + } + }; + let previous_nightly_unclean = nightly_session.as_ref().is_some_and(nightly_session::Session::previous_unclean); + // Set once a window has shown the interruption notice; until then the record must survive. + let unclean_notice_shown = std::sync::Arc::new(std::sync::atomic::AtomicBool::new(false)); + let shared_session: nightly_session::Shared = std::sync::Arc::new(std::sync::Mutex::new(nightly_session)); + let session_after_loop = shared_session.clone(); + let notice_shown_in_callback = unclean_notice_shown.clone(); let result = eframe::run_native( - "EffectCraft", + effectcraft_ui_egui::channel::name_for(effectcraft_ui_egui::channel::identity()), options, Box::new(move |cc| { EffectcraftApp::install_ime_reset_hooks(&cc.egui_ctx); @@ -387,11 +533,23 @@ fn run_desktop(reporter: &crash_report::Shutdown) -> eframe::Result { // reported in a toast and forgotten). let _ = session.execute("window.restoreScriptPanels", json!({})); let mut app = EffectcraftApp::new(session); - app.set_startup_update_check(startup_update_check(control_port)); + app.set_startup_update_check(stable_services() && startup_update_check(control_port)); app.set_gpu_failure_bridge(gpu_failures); app.ui.start_screen = show_home; - if let Some(n) = notice { - app.ui.status = n; + let interruption = if previous_nightly_unclean { + Some("The previous EffectCraft Nightly session did not finish normally. You can report a problem from About. No diagnostics have been sent.") + } else if session_health_warning { + Some( + "EffectCraft Nightly could not record session health in its private profile. You can still edit, but abnormal-exit detection is unavailable.", + ) + } else { + None + }; + if let Some(status) = startup_status(interruption, notice.as_deref()) { + app.ui.status = status; + } + if interruption.is_some() { + notice_shown_in_callback.store(previous_nightly_unclean, std::sync::atomic::Ordering::Relaxed); } if let Some(r) = recovery { app.offer_recovery(r); @@ -448,6 +606,8 @@ fn run_desktop(reporter: &crash_report::Shutdown) -> eframe::Result { file_dialogs, dialog_errors, window: window::Tracker::new(opened, saved_window, control_port.is_none()), + nightly_session: shared_session, + unclean_notice_shown: notice_shown_in_callback.clone(), launch, drawn: false, reporter: desktop_reporter, @@ -460,6 +620,10 @@ fn run_desktop(reporter: &crash_report::Shutdown) -> eframe::Result { } startup_failed(e, !on_gl && cfg!(not(target_os = "macos"))); } + // A controlled return, including a handled startup error: clear this session's record before + // anything else can take the profile. A renderer failure that never showed an earlier + // interruption keeps the record for the next start (on macOS `on_exit` may have run first). + nightly_session::finish_once(&session_after_loop, unclean_notice_shown.load(std::sync::atomic::Ordering::Relaxed)); result } @@ -540,6 +704,10 @@ struct Desktop { apple_events: apple_events::Opened, /// The window's size and position, saved for the next launch. window: window::Tracker, + /// This Nightly session's health record (empty for stable), finished once on the way out. + nightly_session: nightly_session::Shared, + /// Whether an interruption from an earlier session was shown, so its record may be cleared. + unclean_notice_shown: std::sync::Arc, launch: launch_guard::Launch, /// The first frame was drawn (logged once). drawn: bool, @@ -592,6 +760,10 @@ impl eframe::App for Desktop { self.launch.exited(); self.window.save(self.app.session.config.as_deref()); self.app.on_exit(); + // macOS quits inside AppKit's terminate after this hook and never returns from + // `run_native`, so the session record is finished here too (once, whichever runs first). + let shown = self.unclean_notice_shown.load(std::sync::atomic::Ordering::Relaxed); + nightly_session::finish_once(&self.nightly_session, shown); effectcraft_host::stop_helpers(); // Scripts in Scripts/Shutdown run with the project closed. let _ = self.app.session.execute("file.runShutdownScripts", json!({})); @@ -663,6 +835,45 @@ mod tests { assert!(super::wayland_drop_notice(Some(OsStr::new("wayland-0")), Some(OsStr::new("x11"))).is_none()); } + /// The Launcher asks the version through the profile preamble; the shared smoke test and the + /// macOS verifier use that form, so a Nightly build must answer it like `--version`. + #[test] + fn the_launcher_version_form_is_a_version_query() { + fn argv(values: &[&str]) -> Vec { + values.iter().map(std::ffi::OsString::from).collect() + } + let root = if cfg!(windows) { r"C:\NightlyData\profiles\effectcraft" } else { "/nightly-data/profiles/effectcraft" }; + assert!(super::version_query(&argv(&["--version"]))); + assert!(super::version_query(&argv(&["-V"]))); + for form in [&["--launch-profile", "nightly-v1", "--profile-root", root][..], &["--profile-root", root, "--launch-profile", "nightly-v1"][..]] { + for flag in ["--version", "-V"] { + let mut query = argv(form); + query.push(flag.into()); + assert!(super::version_query(&query), "{query:?}"); + } + } + for query in [ + argv(&["--launch-profile", "nightly-v1", "--profile-root", root, "--", "--version"]), + argv(&["--launch-profile", "nightly-v1", "--profile-root", root]), + argv(&["--launch-profile", "future-v2", "--profile-root", root, "--version"]), + argv(&["--demo"]), + argv(&[]), + ] { + assert!(!super::version_query(&query), "{query:?}"); + } + } + + /// The launch guard's graphics notice must not hide the previous session's interruption: its + /// record is cleared once the notice is on screen. + #[test] + fn the_startup_status_keeps_an_interruption_and_a_notice() { + assert_eq!(super::startup_status(None, None), None); + assert_eq!(super::startup_status(Some("interrupted"), None).as_deref(), Some("interrupted")); + assert_eq!(super::startup_status(None, Some("now draws with OpenGL")).as_deref(), Some("now draws with OpenGL")); + let both = super::startup_status(Some("interrupted"), Some("now draws with OpenGL")).unwrap(); + assert!(both.contains("interrupted") && both.contains("now draws with OpenGL"), "{both}"); + } + /// The window's wgpu instance skips indirect-call validation (Intel Metal, #1153). #[test] fn the_window_instance_skips_indirect_call_validation() { diff --git a/apps/effectcraft/src/nightly_session.rs b/apps/effectcraft/src/nightly_session.rs new file mode 100644 index 000000000..754d1876e --- /dev/null +++ b/apps/effectcraft/src/nightly_session.rs @@ -0,0 +1,246 @@ +//! App-private Nightly session health, not telemetry or a Launcher protocol. +//! A live owner holds a separate persistent lease; secondary launches never rewrite its record. +//! Dropping the guard does not clear the marker. Only the app's controlled return path does. + +use std::fs::{File, OpenOptions}; +use std::io::{self, Read}; +use std::path::{Path, PathBuf}; +use std::sync::{Arc, Mutex, PoisonError}; + +const RECORD: &str = "nightly-session.json"; +const LEASE: &str = "nightly-session.lock"; +const MAX_METADATA_BYTES: usize = 256; + +pub struct Session { + _lease: File, + path: PathBuf, + own_record: Vec, + previous_unclean: bool, +} + +fn regular_or_missing(path: &Path) -> io::Result { + match std::fs::symlink_metadata(path) { + Ok(metadata) if metadata.file_type().is_file() && !metadata.file_type().is_symlink() => Ok(true), + Ok(_) => Err(io::Error::other("Nightly session state must be a regular file, not an alias or directory")), + Err(error) if error.kind() == io::ErrorKind::NotFound => Ok(false), + Err(error) => Err(error), + } +} + +/// The owner's session, shared by the app's exit hook (macOS) and the code after the event loop. +/// On macOS every quit ends the process inside AppKit's terminate, after eframe's `on_exit` and +/// before `eframe::run_native` could return, so the exit hook finishes it there; the return path +/// still runs for a start that created no window. +pub type Shared = Arc>>; + +/// The controlled return ([`Session::finish`]) by whichever path comes first; later calls do nothing. +pub fn finish_once(shared: &Shared, unclean_notice_shown: bool) { + let watch = shared.lock().unwrap_or_else(PoisonError::into_inner).take(); + if let Some(watch) = watch + && let Err(error) = watch.finish(unclean_notice_shown) + { + log::warn!("Nightly session state was left intact: {error}"); + } +} + +impl Session { + /// The warning belongs to this window: a busy secondary has no health-record coverage, + /// while Stable and a lease-owning Nightly window preserve their existing result. + pub fn begin_with_health(root: Option<&Path>, version: &str, commit: Option<&str>) -> io::Result<(Option, bool)> { + let watch = Self::begin(root, version, commit)?; + let unavailable = root.is_some() && watch.is_none(); + Ok((watch, unavailable)) + } + + /// `None` is stable or another owner of this profile. Neither case touches the record. + /// The supplied root must already be the validated private Nightly profile. + pub fn begin(root: Option<&Path>, version: &str, commit: Option<&str>) -> io::Result> { + let Some(root) = root else { return Ok(None) }; + if version.is_empty() || version.len() > MAX_METADATA_BYTES || commit.is_some_and(|value| value.len() > MAX_METADATA_BYTES) { + return Err(io::Error::new(io::ErrorKind::InvalidInput, "Nightly session provenance is missing or too large")); + } + let lease_path = root.join(LEASE); + regular_or_missing(&lease_path)?; + let lease = OpenOptions::new().read(true).write(true).create(true).truncate(false).open(lease_path)?; + match lease.try_lock() { + Ok(()) => {} + Err(std::fs::TryLockError::WouldBlock) => return Ok(None), + Err(std::fs::TryLockError::Error(error)) => return Err(error), + } + let path = root.join(RECORD); + let previous_unclean = regular_or_missing(&path)?; + let own_record = serde_json::to_vec(&serde_json::json!({ + "schema_version": 1, + "channel": "nightly-v1", + "version": version, + "commit": commit.filter(|value| !value.is_empty()), + }))?; + // The app already uses this durable writer; a raced destination link is replaced, not followed. + effectcraft_engine::config::atomic_write(&path, &own_record)?; + Ok(Some(Self { _lease: lease, path, own_record, previous_unclean })) + } + + pub fn previous_unclean(&self) -> bool { + self.previous_unclean + } + + /// Controlled return. If an earlier session's interruption was detected but no window showed + /// it yet (a renderer failure before the app callback, including the CPU-retry handoff), the + /// record is left for the next owner to report; otherwise this is [`Self::complete`]. + pub fn finish(self, unclean_notice_shown: bool) -> io::Result<()> { + if self.previous_unclean && !unclean_notice_shown { + return Ok(()); + } + self.complete() + } + + /// Controlled event-loop completion includes a handled startup error/CPU handoff, not only + /// exit0. Clear before releasing primary IPC so a successor cannot miss record ownership. + /// An unwind, abort, forced exit or killed process never calls this method. + pub fn complete(self) -> io::Result<()> { + if !regular_or_missing(&self.path)? { + return Ok(()); + } + let mut current = Vec::new(); + File::open(&self.path)?.take(self.own_record.len() as u64 + 1).read_to_end(&mut current)?; + if current != self.own_record { + return Err(io::Error::other("Nightly session state changed; leaving it intact")); + } + std::fs::remove_file(&self.path) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use std::sync::atomic::{AtomicU64, Ordering}; + + struct Fixture(PathBuf); + impl Fixture { + fn new() -> Self { + static NEXT: AtomicU64 = AtomicU64::new(0); + loop { + let path = std::env::temp_dir().join(format!("effect-nightly-session-{}-{}", std::process::id(), NEXT.fetch_add(1, Ordering::Relaxed))); + match std::fs::create_dir(&path) { + Ok(()) => return Self(path), + Err(error) if error.kind() == io::ErrorKind::AlreadyExists => continue, + Err(error) => panic!("cannot create owned fixture: {error}"), + } + } + } + } + impl Drop for Fixture { + fn drop(&mut self) { + std::fs::remove_dir_all(&self.0).unwrap(); + } + } + + #[test] + fn busy_secondary_reports_unavailable_without_replacing_the_owner_record() { + let fixture = Fixture::new(); + let (stable, warning) = Session::begin_with_health(None, "stable", None).unwrap(); + assert!(stable.is_none() && !warning); + let (first, warning) = Session::begin_with_health(Some(&fixture.0), "nightly", Some("owned-commit")).unwrap(); + assert!(!warning); + let first = first.unwrap(); + let record = std::fs::read(fixture.0.join(RECORD)).unwrap(); + let (secondary, warning) = Session::begin_with_health(Some(&fixture.0), "secondary", None).unwrap(); + assert!(secondary.is_none() && warning, "a secondary window cannot claim recorded exit/crash coverage"); + assert_eq!(std::fs::read(fixture.0.join(RECORD)).unwrap(), record); + first.complete().unwrap(); + assert!(!fixture.0.join(RECORD).exists()); + } + + #[test] + fn controlled_completion_is_clean_but_an_unfinished_owner_is_reported_next_time() { + let fixture = Fixture::new(); + let first = Session::begin(Some(&fixture.0), "first", Some("recorded-commit")).unwrap().unwrap(); + assert!(!first.previous_unclean()); + let own = std::fs::read(fixture.0.join(RECORD)).unwrap(); + assert!(Session::begin(Some(&fixture.0), "secondary", None).unwrap().is_none()); + assert_eq!(std::fs::read(fixture.0.join(RECORD)).unwrap(), own, "a busy secondary must not replace the owner's record"); + first.complete().unwrap(); + assert!(!fixture.0.join(RECORD).exists()); + let unfinished = Session::begin(Some(&fixture.0), "second", None).unwrap().unwrap(); + assert!(!unfinished.previous_unclean()); + drop(unfinished); // Unwind/abnormal-path ownership release, not a controlled completion. + let next = Session::begin(Some(&fixture.0), "third", None).unwrap().unwrap(); + assert!(next.previous_unclean()); + next.complete().unwrap(); + assert!(!fixture.0.join(RECORD).exists()); + } + + #[test] + fn an_interruption_no_window_showed_survives_a_handled_startup_failure() { + let fixture = Fixture::new(); + drop(Session::begin(Some(&fixture.0), "crashed", None).unwrap().unwrap()); + // Renderer initialization failed before the app callback: no notice was shown. + let failed = Session::begin(Some(&fixture.0), "gpu-failed", None).unwrap().unwrap(); + assert!(failed.previous_unclean()); + failed.finish(false).unwrap(); + // The CPU retry (or the next start) still sees the interruption and shows it. + let retry = Session::begin(Some(&fixture.0), "cpu-retry", None).unwrap().unwrap(); + assert!(retry.previous_unclean()); + retry.finish(true).unwrap(); + assert!(!fixture.0.join(RECORD).exists(), "a session that showed the notice clears its record"); + // Without an earlier interruption, a handled failure still clears normally. + let clean = Session::begin(Some(&fixture.0), "clean", None).unwrap().unwrap(); + assert!(!clean.previous_unclean()); + clean.finish(false).unwrap(); + assert!(!fixture.0.join(RECORD).exists()); + } + + #[test] + fn the_exit_hook_and_the_return_path_finish_the_session_once() { + let fixture = Fixture::new(); + let shared: Shared = Arc::new(Mutex::new(Session::begin(Some(&fixture.0), "quitting", None).unwrap())); + // The exit hook (macOS quit: the only path that runs there). + finish_once(&shared, false); + assert!(!fixture.0.join(RECORD).exists(), "a quit that ran the exit hook is a clean exit"); + // Elsewhere the return path runs too, by then possibly after a successor took the profile. + let successor = Session::begin(Some(&fixture.0), "successor", None).unwrap().unwrap(); + assert!(!successor.previous_unclean()); + let record = std::fs::read(fixture.0.join(RECORD)).unwrap(); + finish_once(&shared, false); + assert_eq!(std::fs::read(fixture.0.join(RECORD)).unwrap(), record, "the second finish must not touch a successor's record"); + successor.complete().unwrap(); + } + + #[test] + fn cleanup_never_removes_an_unknown_changed_record() { + let fixture = Fixture::new(); + let watch = Session::begin(Some(&fixture.0), "nightly", None).unwrap().unwrap(); + std::fs::write(fixture.0.join(RECORD), b"replacement owned by someone else").unwrap(); + assert!(watch.complete().is_err()); + assert_eq!(std::fs::read(fixture.0.join(RECORD)).unwrap(), b"replacement owned by someone else"); + } + + #[test] + fn provenance_is_bounded_and_never_collects_documents_paths_or_diagnostics() { + let fixture = Fixture::new(); + assert!(Session::begin(Some(&fixture.0), &"x".repeat(MAX_METADATA_BYTES + 1), None).is_err()); + assert_eq!(std::fs::read_dir(&fixture.0).unwrap().count(), 0); + assert!(Session::begin(None, "", None).unwrap().is_none(), "stable has no session-health side effects"); + let watch = Session::begin(Some(&fixture.0), "nightly", None).unwrap().unwrap(); + let data: serde_json::Value = serde_json::from_slice(&std::fs::read(fixture.0.join(RECORD)).unwrap()).unwrap(); + let fields = data.as_object().unwrap().keys().map(String::as_str).collect::>(); + assert_eq!(fields, ["schema_version", "channel", "version", "commit"].into_iter().collect()); + assert!(data["commit"].is_null(), "missing provenance must not be invented"); + watch.complete().unwrap(); + } + + #[test] + #[cfg(unix)] + fn reserved_state_aliases_do_not_modify_external_files() { + let fixture = Fixture::new(); + let external = fixture.0.join("stable-document"); + std::fs::write(&external, b"stable bytes").unwrap(); + for name in [LEASE, RECORD] { + let alias = fixture.0.join(name); + std::os::unix::fs::symlink(&external, &alias).unwrap(); + assert!(Session::begin(Some(&fixture.0), "nightly", None).is_err()); + assert_eq!(std::fs::read(&external).unwrap(), b"stable bytes"); + std::fs::remove_file(alias).unwrap(); + } + } +} diff --git a/apps/effectcraft/src/process_identity.rs b/apps/effectcraft/src/process_identity.rs new file mode 100644 index 000000000..ba8c06316 --- /dev/null +++ b/apps/effectcraft/src/process_identity.rs @@ -0,0 +1,69 @@ +//! Set the immutable nightly Windows identity before any native window or COM service. +//! Stable deliberately leaves its implicit shortcut/path identity unchanged. + +use std::sync::OnceLock; + +#[derive(Clone, Debug, thiserror::Error)] +pub enum IdentityError { + #[error("{0}")] + Configuration(String), +} + +pub fn initialize(nightly: bool, app_id: &str) -> Result<(), IdentityError> { + configure(nightly && cfg!(windows), app_id, |id| { + static RESULT: OnceLock> = OnceLock::new(); + RESULT + .get_or_init(|| { + #[cfg(windows)] + { + winsafe::SetCurrentProcessExplicitAppUserModelID(id).map_err(|error| format!("cannot set the nightly Windows identity: {error}"))?; + let actual = winsafe::GetCurrentProcessExplicitAppUserModelID() + .map_err(|error| format!("cannot read back the nightly Windows identity: {error}"))?; + if actual != id { + return Err("the native Windows identity did not match the selected nightly channel".into()); + } + Ok(()) + } + #[cfg(not(windows))] + { + let _ = id; + Ok(()) + } + }) + .clone() + }) + .map_err(IdentityError::Configuration) +} + +fn configure(explicit_nightly: bool, app_id: &str, set: impl FnOnce(&str) -> Result<(), String>) -> Result<(), String> { + if explicit_nightly { set(app_id) } else { Ok(()) } +} + +#[cfg(test)] +mod tests { + use super::*; + #[test] + fn stable_does_not_call_the_explicit_identity_api() { + configure(false, "nightly-id", |_| panic!("stable identity must remain implicit")).unwrap(); + } + + #[test] + fn nightly_applies_the_supplied_identity_once() { + let calls = std::cell::Cell::new(0); + configure(true, "nightly-id", |id| { + assert_eq!(id, "nightly-id"); + calls.set(calls.get() + 1); + Ok(()) + }) + .unwrap(); + assert_eq!(calls.get(), 1); + } + + #[test] + fn native_identity_failure_is_returned_instead_of_starting_a_window() { + let started = std::cell::Cell::new(false); + let result = configure(true, "nightly-id", |_| Err("native identity refused".into())).map(|()| started.set(true)); + assert_eq!(result.unwrap_err(), "native identity refused"); + assert!(!started.get()); + } +} diff --git a/apps/effectcraft/src/profile_root.rs b/apps/effectcraft/src/profile_root.rs new file mode 100644 index 000000000..97ba59eb6 --- /dev/null +++ b/apps/effectcraft/src/profile_root.rs @@ -0,0 +1,603 @@ +//! App-owned nightly profile fences; no stable fallback, migration or process environment changes. + +use std::ffi::OsString; +use std::path::{Component, Path, PathBuf}; + +use effectcraft_host::app_dirs::{PORTABLE_DATA_DIR, portable_marker}; + +/// The bundle id of EffectCraft's own Nightly Flatpak (`packaging/linux/flatpak-bundle.sh`). Its +/// sandbox is a separate installation; every other Flatpak instance (the stable app's included) +/// would point the profile at another install's state. +pub const NIGHTLY_FLATPAK_ID: &str = "ai.storyteller.effectcraft.nightly"; + +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +enum Platform { + Windows, + Linux, + Mac, +} + +impl Platform { + fn current() -> Result { + match std::env::consts::OS { + "windows" => Ok(Self::Windows), + "linux" => Ok(Self::Linux), + "macos" => Ok(Self::Mac), + _ => Err("nightly-v1 is not defined for this operating system".into()), + } + } + + fn ignores_case(self) -> bool { + self != Self::Linux + } +} + +fn absolute(path: PathBuf, label: &str) -> Result { + if !path.is_absolute() || path.components().any(|c| matches!(c, Component::ParentDir)) { + return Err(format!("{label} must be absolute and contain no parent traversal")); + } + Ok(path) +} + +fn required_base(env: &impl Fn(&str) -> Option, key: &str) -> Result { + let value = env(key).filter(|v| !v.is_empty()).ok_or_else(|| format!("cannot establish the stable {key} boundary"))?; + absolute(PathBuf::from(value), key) +} + +fn xdg_base(env: &impl Fn(&str) -> Option, key: &str, fallback: &str) -> Result { + match env(key).filter(|v| !v.is_empty()) { + Some(value) => absolute(PathBuf::from(value), key), + None => Ok(required_base(env, "HOME")?.join(fallback)), + } +} + +/// Resolve existing ancestors before creating anything. A dangling link or inaccessible ancestor +/// is not a missing directory that may be replaced or followed later. +fn canonical_future(path: &Path) -> Result { + let mut parent = path; + let mut missing = Vec::new(); + loop { + match std::fs::symlink_metadata(parent) { + Ok(_) => break, + Err(error) if error.kind() == std::io::ErrorKind::NotFound => { + missing.push(parent.file_name().ok_or("the profile root has no existing ancestor")?.to_os_string()); + parent = parent.parent().ok_or("the profile root has no existing ancestor")?; + } + Err(error) => return Err(format!("cannot inspect the profile boundary: {error}")), + } + } + let mut resolved = std::fs::canonicalize(parent).map_err(|e| format!("cannot resolve the profile boundary: {e}"))?; + for part in missing.into_iter().rev() { + resolved.push(part); + } + Ok(resolved) +} + +fn overlaps(a: &Path, b: &Path, platform: Platform) -> bool { + let parts = |p: &Path| { + p.components() + .map(|c| { + let value = c.as_os_str().to_string_lossy().into_owned(); + if platform.ignores_case() { value.to_lowercase() } else { value } + }) + .collect::>() + }; + let (a, b) = (parts(a), parts(b)); + a.starts_with(&b) || b.starts_with(&a) +} + +fn installation_boundary(platform: Platform, exe: &Path) -> Result { + let parent = exe.parent().ok_or("cannot establish the installation boundary")?; + if platform == Platform::Mac { + // A profile in Resources is still inside the versioned install, not beside MacOS. + if let Some(bundle) = exe.ancestors().find(|p| p.extension().is_some_and(|ext| ext.eq_ignore_ascii_case("app"))) { + return Ok(bundle.to_path_buf()); + } + } + Ok(parent.to_path_buf()) +} + +fn forbidden_roots(platform: Platform, env: &impl Fn(&str) -> Option, exe: &Path) -> Result, String> { + let mut roots = match platform { + Platform::Windows => { + // Settings and crash recovery live in the roaming folder; the disk cache, media cache + // and conformed audio in the local one (crates/render/src/disk_cache.rs). + let mut roots = + ["APPDATA", "LOCALAPPDATA"].into_iter().map(|key| required_base(env, key).map(|p| p.join("EffectCraft"))).collect::, _>>()?; + // The MSI's default per-user and per-machine folders (install-policy.wxi). A custom + // install folder is not known here; the executable's own folder is fenced below. + roots.push(required_base(env, "LOCALAPPDATA")?.join("Programs").join("ArtCraft").join("EffectCraft")); + for key in ["ProgramW6432", "ProgramFiles", "ProgramFiles(x86)"] { + if let Some(base) = env(key).filter(|v| !v.is_empty()) { + roots.push(absolute(PathBuf::from(base), key)?.join("ArtCraft").join("EffectCraft")); + } + } + roots + } + Platform::Linux => { + let mut roots = + [("XDG_CONFIG_HOME", ".config"), ("XDG_DATA_HOME", ".local/share"), ("XDG_CACHE_HOME", ".cache"), ("XDG_STATE_HOME", ".local/state")] + .into_iter() + .map(|(key, fallback)| xdg_base(env, key, fallback).map(|p| p.join("effectcraft"))) + .collect::, _>>()?; + roots.extend(["/usr/bin/effectcraft", "/usr/local/bin/effectcraft", "/opt/effectcraft"].map(PathBuf::from)); + // The stable Flatpak keeps its data in its own per-app folder. + roots.push(required_base(env, "HOME")?.join(".var/app/ai.storyteller.effectcraft")); + roots + } + Platform::Mac => { + let home = required_base(env, "HOME")?; + let library = home.join("Library"); + vec![ + library.join("Application Support/EffectCraft"), + library.join("Caches/EffectCraft"), + library.join("Caches/ai.storyteller.effectcraft"), + library.join("Preferences/EffectCraft"), + library.join("Preferences/ai.storyteller.effectcraft.plist"), + library.join("Saved Application State/ai.storyteller.effectcraft.savedState"), + home.join("Applications/EffectCraft.app"), + PathBuf::from("/Applications/EffectCraft.app"), + ] + } + }; + // The stable app's folder under Documents (`presets_dir` keeps `Presets` there, from HOME, else + // USERPROFILE). Fence the whole folder: a Nightly root at, above or inside it would share the + // stable app's presets, and any Nightly root below Documents/EffectCraft is not this channel's. + if let Some(home) = env("HOME").filter(|v| !v.is_empty()).or_else(|| env("USERPROFILE").filter(|v| !v.is_empty())) { + roots.push(absolute(PathBuf::from(home), "HOME")?.join("Documents").join("EffectCraft")); + } + roots.push(installation_boundary(platform, exe)?); + roots.into_iter().map(|p| canonical_future(&p)).collect() +} + +/// Every existing entry directly in the profile (settings, Plug-ins, Logs and so on) must resolve +/// inside it, so a link there cannot point Nightly's writes at another app's data. +fn entries_stay_inside(root: &Path) -> Result<(), String> { + let entries = match std::fs::read_dir(root) { + Ok(entries) => entries, + Err(error) if error.kind() == std::io::ErrorKind::NotFound => return Ok(()), + Err(error) => return Err(format!("cannot inspect the nightly profile: {error}")), + }; + for entry in entries { + let entry = entry.map_err(|e| format!("cannot inspect the nightly profile: {e}"))?; + private_subdirectory(root, entry.file_name(), "profile entry")?; + } + Ok(()) +} + +fn private_subdirectory(root: &Path, name: impl AsRef, label: &str) -> Result { + let entry = canonical_future(&root.join(name))?; + if entry == root || !entry.starts_with(root) { + return Err(format!("the nightly {label} must stay inside its selected profile")); + } + Ok(entry) +} + +/// Recognise the shared portable data namespace in both the supplied and resolved path. +/// This is not an inventory of arbitrary custom Stable overrides or a Launcher ownership proof. +fn is_portable_layout(path: &Path, platform: Platform) -> bool { + // A folder under a portable copy belongs to that copy too. Above the chosen folder itself, a + // marker only counts beside an EffectCraft executable, so an unrelated portable.txt higher up + // (in a user folder or at a drive root) does not refuse the profile. + path.ancestors().enumerate().any(|(depth, ancestor)| { + portable_marker(ancestor).is_some() && (depth == 0 || ["effectcraft.exe", "effectcraft"].iter().any(|exe| ancestor.join(exe).is_file())) + }) || path.components().any(|component| match component { + Component::Normal(name) if platform.ignores_case() => name.to_string_lossy().eq_ignore_ascii_case(PORTABLE_DATA_DIR), + Component::Normal(name) => name == PORTABLE_DATA_DIR, + _ => false, + }) +} + +/// The writable hook is the app's existing probe. Keeping it injected lets filesystem boundary +/// tests exercise the real policy without starting the app or changing global state. +pub fn validate( + root: &Path, + env: impl Fn(&str) -> Option, + exe: Option<&Path>, + writable: impl FnOnce(&Path) -> std::io::Result<()>, +) -> Result { + validate_for(Platform::current()?, root, env, exe, writable) +} + +fn validate_for( + platform: Platform, + root: &Path, + env: impl Fn(&str) -> Option, + exe: Option<&Path>, + writable: impl FnOnce(&Path) -> std::io::Result<()>, +) -> Result { + absolute(root.to_path_buf(), "the nightly profile root")?; + if env("EFFECTCRAFT_CONFIG_DIR").is_some_and(|v| !v.is_empty()) { + return Err("nightly-v1 cannot be combined with EFFECTCRAFT_CONFIG_DIR".into()); + } + // The Nightly ships its own Flatpak, so that one sandbox may carry a profile. Any other + // instance (the stable app's, or a foreign one) names another installation's state. + if let Some(instance) = env("FLATPAK_ID").filter(|value| !value.is_empty()) + && instance.to_string_lossy() != NIGHTLY_FLATPAK_ID + { + return Err(format!("nightly-v1 accepts only the {NIGHTLY_FLATPAK_ID} Flatpak instance; launch the Nightly from its own package")); + } + let chosen = canonical_future(root)?; + if is_portable_layout(root, platform) || is_portable_layout(&chosen, platform) { + return Err("the nightly root must not use a portable EffectCraft installation or its EffectCraftData settings folder".into()); + } + let exe = absolute(exe.ok_or("cannot establish the installation boundary")?.to_path_buf(), "the executable")?; + let forbidden = forbidden_roots(platform, &env, &exe)?; + if forbidden.iter().any(|stable| overlaps(&chosen, stable, platform)) { + return Err("the nightly root must not overlap stable data or an installation".into()); + } + // Existing aliases under the profile must not redirect any of the app's writes elsewhere. + entries_stay_inside(&chosen)?; + let mut create = std::fs::DirBuilder::new(); + create.recursive(true); + #[cfg(unix)] + { + use std::os::unix::fs::DirBuilderExt as _; + create.mode(0o700); + } + create.create(&chosen).map_err(|e| format!("cannot create the nightly profile: {e}"))?; + let confirmed = std::fs::canonicalize(&chosen).map_err(|e| format!("cannot resolve the created nightly profile: {e}"))?; + if confirmed != chosen || forbidden.iter().any(|stable| overlaps(&confirmed, stable, platform)) { + return Err("the nightly profile changed while it was being validated".into()); + } + entries_stay_inside(&confirmed)?; + writable(&confirmed).map_err(|e| format!("the nightly profile is not writable: {e}"))?; + Ok(confirmed) +} + +#[cfg(test)] +mod tests { + use super::*; + use effectcraft_host::app_dirs::PORTABLE_MARKERS; + use std::collections::BTreeMap; + use std::sync::atomic::{AtomicU64, Ordering}; + + struct Fixture { + root: PathBuf, + env: BTreeMap, + exe: PathBuf, + } + + impl Fixture { + fn new() -> Self { + static NEXT: AtomicU64 = AtomicU64::new(0); + let root = loop { + let candidate = + std::env::temp_dir().join(format!("effectcraft-profile-policy-{}-{}", std::process::id(), NEXT.fetch_add(1, Ordering::Relaxed))); + match std::fs::create_dir(&candidate) { + Ok(()) => break std::fs::canonicalize(candidate).unwrap(), + Err(error) if error.kind() == std::io::ErrorKind::AlreadyExists => continue, + Err(error) => panic!("cannot create owned fixture: {error}"), + } + }; + let home = root.join("home"); + let exe = root.join("install/effectcraft"); + std::fs::create_dir_all(&home).unwrap(); + std::fs::create_dir_all(exe.parent().unwrap()).unwrap(); + std::fs::write(&exe, b"fixture executable, never run").unwrap(); + let env = [("HOME", home), ("APPDATA", root.join("roaming")), ("LOCALAPPDATA", root.join("local"))] + .into_iter() + .map(|(key, value)| (key.into(), value.into_os_string())) + .collect(); + Self { root, env, exe } + } + + fn get(&self, key: &str) -> Option { + self.env.get(key).cloned() + } + + fn check(&self, platform: Platform, root: &Path) -> Result { + validate_for( + platform, + root, + |key| self.get(key), + Some(&self.exe), + |dir| { + let probe = dir.join("exclusive-test-probe"); + let file = std::fs::OpenOptions::new().write(true).create_new(true).open(&probe)?; + drop(file); + std::fs::remove_file(probe) + }, + ) + } + + fn home(&self) -> PathBuf { + PathBuf::from(self.get("HOME").unwrap()) + } + } + + impl Drop for Fixture { + fn drop(&mut self) { + // Only the directory successfully created by this fixture is owned for removal. + std::fs::remove_dir_all(&self.root).unwrap(); + } + } + + #[test] + fn portable_settings_from_another_install_are_refused_before_any_probe() { + let fixture = Fixture::new(); + let stable_install = fixture.root.join("stable portable install"); + let stable_data = stable_install.join(PORTABLE_DATA_DIR); + std::fs::create_dir_all(&stable_data).unwrap(); + std::fs::write(stable_install.join(PORTABLE_MARKERS[0]), b"owned portable fixture").unwrap(); + std::fs::write(stable_data.join("settings.json"), b"stable settings must not change").unwrap(); + for platform in [Platform::Windows, Platform::Linux, Platform::Mac] { + for candidate in [&stable_data, &stable_data.join("nested nightly")] { + let probed = std::cell::Cell::new(false); + let result = validate_for( + platform, + candidate, + |key| fixture.get(key), + Some(&fixture.exe), + |_| { + probed.set(true); + Ok(()) + }, + ); + assert!(result.is_err(), "a different portable install is not a private Nightly profile"); + assert!(!probed.get(), "reject portable data before a writable probe"); + assert!(!stable_data.join("nested nightly").exists()); + assert_eq!(std::fs::read(stable_data.join("settings.json")).unwrap(), b"stable settings must not change"); + } + } + let private = fixture.root.join("EffectCraftData-backup-name/nightly"); + assert!(fixture.check(Platform::Linux, &private).is_ok(), "a merely similar name is not a portable settings component"); + } + + #[cfg(unix)] + #[test] + fn settings_aliases_cannot_redirect_to_stable_missing_or_profile_root_data() { + let fixture = Fixture::new(); + let stable = fixture.home().join(".config/effectcraft/Plug-ins"); + std::fs::create_dir_all(&stable).unwrap(); + std::fs::write(stable.join("stable-plugin.wasm"), b"stable plugin bytes").unwrap(); + for (index, target) in [stable.clone(), fixture.root.join("missing target")].into_iter().enumerate() { + let private = fixture.root.join(format!("nightly-{index}")); + std::fs::create_dir(&private).unwrap(); + std::os::unix::fs::symlink(&target, private.join("Plug-ins")).unwrap(); + let probed = std::cell::Cell::new(false); + let result = validate_for( + Platform::Linux, + &private, + |key| fixture.get(key), + Some(&fixture.exe), + |_| { + probed.set(true); + Ok(()) + }, + ); + assert!(result.is_err(), "a profile entry must not escape the profile or follow a dangling alias"); + assert!(!probed.get()); + } + let private = fixture.root.join("nightly-self"); + std::fs::create_dir(&private).unwrap(); + std::os::unix::fs::symlink(&private, private.join("Logs")).unwrap(); + assert!(fixture.check(Platform::Linux, &private).is_err(), "an entry cannot resolve to the profile itself"); + assert_eq!(std::fs::read(stable.join("stable-plugin.wasm")).unwrap(), b"stable plugin bytes"); + } + + #[cfg(unix)] + #[test] + fn an_alias_to_a_private_subfolder_keeps_the_profile_usable() { + let fixture = Fixture::new(); + let private = fixture.root.join("nightly-private"); + let logs = private.join("private-logs"); + std::fs::create_dir_all(&logs).unwrap(); + std::os::unix::fs::symlink(&logs, private.join("Logs")).unwrap(); + assert!(fixture.check(Platform::Linux, &private).is_ok()); + assert_eq!(std::fs::canonicalize(private.join("Logs")).unwrap(), logs); + } + + #[test] + fn overlap_check_handles_ancestor_descendant_and_prefix_lookalikes() { + let fixture = Fixture::new(); + let root = fixture.home().join("nightly/profiles/effectcraft"); + for platform in [Platform::Windows, Platform::Linux, Platform::Mac] { + assert!(overlaps(&root, &root.join("Plug-ins"), platform)); + assert!(overlaps(&root.join("Plug-ins"), &root, platform)); + assert!(!overlaps(&root, &root.with_file_name("effectcraft-other"), platform)); + } + } + + #[test] + fn linux_fences_app_xdg_subtrees_but_allows_launcher_sibling() { + let mut fixture = Fixture::new(); + for key in ["XDG_CONFIG_HOME", "XDG_DATA_HOME", "XDG_CACHE_HOME", "XDG_STATE_HOME"] { + fixture.env.insert(key.into(), fixture.root.join(key).into_os_string()); + } + for key in ["XDG_CONFIG_HOME", "XDG_DATA_HOME", "XDG_CACHE_HOME", "XDG_STATE_HOME"] { + let stable = PathBuf::from(fixture.get(key).unwrap()).join("effectcraft"); + std::fs::create_dir_all(&stable).unwrap(); + std::fs::write(stable.join("stable-sentinel"), b"stable bytes").unwrap(); + for candidate in [stable.clone(), stable.join("nightly"), stable.parent().unwrap().to_path_buf()] { + assert!(fixture.check(Platform::Linux, &candidate).unwrap_err().contains("overlap")); + } + assert_eq!(std::fs::read(stable.join("stable-sentinel")).unwrap(), b"stable bytes"); + } + let data = PathBuf::from(fixture.get("XDG_DATA_HOME").unwrap()); + let nightly = data.join("ArtCraftLauncher/nightly/profiles/effectcraft"); + assert_eq!(fixture.check(Platform::Linux, &nightly).unwrap(), nightly); + assert_eq!(std::fs::read_dir(nightly).unwrap().count(), 0); + } + + #[test] + fn mac_fences_only_app_library_subtrees_and_the_entire_bundle() { + let mut fixture = Fixture::new(); + fixture.exe = fixture.root.join("install/EffectCraft Nightly.app/Contents/MacOS/EffectCraft"); + std::fs::create_dir_all(fixture.exe.parent().unwrap()).unwrap(); + std::fs::write(&fixture.exe, b"fixture executable, never run").unwrap(); + let library = fixture.home().join("Library"); + for suffix in [ + "Application Support/EffectCraft", + "Caches/EffectCraft", + "Caches/ai.storyteller.effectcraft", + "Preferences/EffectCraft", + "Saved Application State/ai.storyteller.effectcraft.savedState", + ] { + let stable = library.join(suffix); + assert!(fixture.check(Platform::Mac, &stable.join("nightly")).unwrap_err().contains("overlap")); + assert!(!stable.exists()); + } + let inside_resources = fixture.exe.parent().unwrap().parent().unwrap().join("Resources/profile"); + assert!(fixture.check(Platform::Mac, &inside_resources).unwrap_err().contains("overlap")); + assert!(!inside_resources.exists()); + let valid = library.join("Application Support/ArtCraftLauncher/nightly/profiles/effectcraft"); + assert_eq!(fixture.check(Platform::Mac, &valid).unwrap(), valid); + } + + #[test] + fn windows_roaming_local_and_install_fences_remain_active() { + let fixture = Fixture::new(); + for key in ["APPDATA", "LOCALAPPDATA"] { + let stable = PathBuf::from(fixture.get(key).unwrap()).join("EffectCraft"); + assert!(fixture.check(Platform::Windows, &stable.join("nightly")).unwrap_err().contains("overlap")); + assert!(!stable.exists()); + } + assert!(fixture.check(Platform::Windows, &fixture.exe.parent().unwrap().join("profile")).is_err()); + assert!(fixture.check(Platform::Windows, &fixture.root.join("Launcher/profiles/effectcraft")).is_ok()); + } + + #[test] + fn windows_default_msi_install_folders_are_fenced() { + let mut fixture = Fixture::new(); + let local = PathBuf::from(fixture.get("LOCALAPPDATA").unwrap()); + let per_user = local.join("Programs").join("ArtCraft").join("EffectCraft"); + assert!(fixture.check(Platform::Windows, &per_user.join("nightly")).unwrap_err().contains("overlap")); + for key in ["ProgramW6432", "ProgramFiles", "ProgramFiles(x86)"] { + let base = fixture.root.join(format!("machine {key}")); + fixture.env.insert(key.into(), base.clone().into_os_string()); + let machine = base.join("ArtCraft").join("EffectCraft"); + assert!(fixture.check(Platform::Windows, &machine.join("nightly")).unwrap_err().contains("overlap")); + assert!(!machine.exists()); + } + let sibling = local.join("Programs").join("ArtCraft").join("ArtCraftLauncher").join("nightly").join("effectcraft"); + assert!(fixture.check(Platform::Windows, &sibling).is_ok(), "the Launcher's own Programs sibling is not EffectCraft's install"); + } + + #[test] + fn folders_under_a_stable_portable_copy_are_refused_before_any_probe() { + let fixture = Fixture::new(); + let portable = fixture.root.join("D/EC"); + std::fs::create_dir_all(&portable).unwrap(); + std::fs::write(portable.join(PORTABLE_MARKERS[1]), b"stable portable copy").unwrap(); + std::fs::write(portable.join("effectcraft.exe"), b"stable portable executable, never run").unwrap(); + for platform in [Platform::Windows, Platform::Linux, Platform::Mac] { + for candidate in [portable.join("nightly"), portable.join("deeper/nightly")] { + let probed = std::cell::Cell::new(false); + let result = validate_for( + platform, + &candidate, + |key| fixture.get(key), + Some(&fixture.exe), + |_| { + probed.set(true); + Ok(()) + }, + ); + assert!(result.unwrap_err().contains("portable")); + assert!(!probed.get()); + assert!(!candidate.exists()); + } + } + // A marker that no EffectCraft executable sits beside is someone else's file. + let unrelated = fixture.root.join("user folder"); + std::fs::create_dir_all(&unrelated).unwrap(); + std::fs::write(unrelated.join(PORTABLE_MARKERS[0]), b"another app's marker").unwrap(); + assert!(fixture.check(Platform::Windows, &unrelated.join("Launcher/nightly/effectcraft")).is_ok()); + } + + #[test] + fn the_stable_presets_folder_is_fenced_on_every_platform() { + let fixture = Fixture::new(); + let documents = fixture.home().join("Documents"); + for platform in [Platform::Windows, Platform::Linux, Platform::Mac] { + for candidate in [documents.join("EffectCraft"), documents.join("EffectCraft/Presets"), documents.join("EffectCraft/nightly")] { + assert!(fixture.check(platform, &candidate).unwrap_err().contains("overlap"), "{platform:?} {candidate:?}"); + assert!(!candidate.exists()); + } + } + assert!(fixture.check(Platform::Linux, &documents.join("EffectCraft Nightly")).is_ok(), "a sibling folder stays valid"); + } + + #[test] + fn linux_fences_the_stable_flatpak_data_folder() { + let fixture = Fixture::new(); + let flatpak = fixture.home().join(".var/app/ai.storyteller.effectcraft"); + for candidate in [flatpak.clone(), flatpak.join("data/nightly")] { + assert!(fixture.check(Platform::Linux, &candidate).unwrap_err().contains("overlap")); + } + assert!(!flatpak.exists()); + assert!(fixture.check(Platform::Linux, &fixture.home().join(".var/app/ai.storyteller.launcher/nightly")).is_ok()); + } + + #[test] + fn ambiguous_environment_and_non_native_sandbox_are_refused_before_creation() { + let mut fixture = Fixture::new(); + let candidate = fixture.home().join("nightly/profiles/effectcraft"); + fixture.env.insert("XDG_CACHE_HOME".into(), "relative/cache".into()); + assert!(fixture.check(Platform::Linux, &candidate).unwrap_err().contains("absolute")); + fixture.env.remove("XDG_CACHE_HOME"); + fixture.env.insert("EFFECTCRAFT_CONFIG_DIR".into(), fixture.home().join("custom-stable").into_os_string()); + assert!(fixture.check(Platform::Linux, &candidate).unwrap_err().contains("EFFECTCRAFT_CONFIG_DIR")); + fixture.env.remove("EFFECTCRAFT_CONFIG_DIR"); + fixture.env.insert("FLATPAK_ID".into(), "ai.storyteller.effectcraft".into()); + assert!(fixture.check(Platform::Linux, &candidate).unwrap_err().contains("Flatpak")); + fixture.env.remove("FLATPAK_ID"); + fixture.env.remove("HOME"); + assert!(fixture.check(Platform::Linux, &candidate).unwrap_err().contains("HOME")); + assert!(!candidate.exists()); + } + + #[test] + fn only_the_nightly_s_own_flatpak_instance_may_carry_a_profile() { + // Inside packaging/linux/flatpak-bundle.sh's sandbox, $HOME is this app id's own folder, so + // the launcher's profile is the Nightly's state and nothing else is reachable through it. + let mut fixture = Fixture::new(); + fixture.env.insert("FLATPAK_ID".into(), NIGHTLY_FLATPAK_ID.into()); + let candidate = fixture.home().join(".local/share/effectcraft-nightly"); + assert_eq!(fixture.check(Platform::Linux, &candidate).unwrap(), std::fs::canonicalize(&candidate).unwrap()); + fixture.env.remove("FLATPAK_ID"); + for refused in ["ai.storyteller.effectcraft", "ai.storyteller.effectcraft.nightly-v1", "org.example.other"] { + let mut other = Fixture::new(); + other.env.insert("FLATPAK_ID".into(), refused.into()); + let refused_root = other.home().join(".local/share/effectcraft-nightly"); + assert!(other.check(Platform::Linux, &refused_root).unwrap_err().contains("Flatpak"), "{refused}"); + assert!(!refused_root.exists()); + } + } + + #[test] + fn non_directory_and_failed_write_probe_never_fall_back_to_stable() { + let fixture = Fixture::new(); + let file = fixture.home().join("not-a-directory"); + std::fs::write(&file, b"occupied").unwrap(); + assert!(fixture.check(Platform::Linux, &file).is_err()); + let refused = fixture.home().join("read-only-profile"); + assert!( + validate_for( + Platform::Linux, + &refused, + |key| fixture.get(key), + Some(&fixture.exe), + |_| { Err(std::io::Error::new(std::io::ErrorKind::PermissionDenied, "synthetic read-only profile")) } + ) + .unwrap_err() + .contains("not writable") + ); + assert!(!fixture.home().join(".config/effectcraft").exists(), "no stable fallback was created"); + } + + #[test] + fn created_profile_is_private_and_resolved() { + let fixture = Fixture::new(); + let target = fixture.home().join("nightly/profiles/effectcraft"); + let resolved = fixture.check(Platform::Linux, &target).unwrap(); + assert_eq!(resolved, target); + assert!(resolved.is_dir()); + #[cfg(unix)] + { + use std::os::unix::fs::PermissionsExt as _; + assert_eq!(std::fs::metadata(&resolved).unwrap().permissions().mode() & 0o777, 0o700); + } + } +} diff --git a/assets/app-icon/README.md b/assets/app-icon/README.md index f0265ce9e..3166033f9 100644 --- a/assets/app-icon/README.md +++ b/assets/app-icon/README.md @@ -34,6 +34,19 @@ Licence: see [LICENSE.txt](LICENSE.txt) (MIT OR Apache-2.0, like the repo). App ID: `ai.storyteller.effectcraft` (Wayland app ID, `packaging/linux/ai.storyteller.effectcraft.desktop`). +## Nightly channel + +The nightly derivatives keep the foreground artwork, alpha and Mac padding unchanged. Only the +background contribution changes: the stable pink field `#e0368f` becomes the deeper `#5e2443`. +There is no letter badge or crescent; the app, its window and the Launcher identify the channel in +text. + +`effectcraft-nightly.png` and its nine-frame ICO (16–256 px) use the existing native 256 px master. +`effectcraft-nightly-1024.png`, `effectcraft-nightly-macos-512.png` and the eleven-slot ICNS use the +padded Mac masters, never an upscale. Input/output hashes, the palette-fit recipe and container +members are recorded in [`nightly-provenance.json`](nightly-provenance.json). Stable source files +are not recoloured. + ## Regenerate After replacing `effectcraft.svg` / `effectcraft-small.svg`, run `packaging/icons.sh` (needs `resvg`; `iconutil` diff --git a/assets/app-icon/effectcraft-nightly-1024.png b/assets/app-icon/effectcraft-nightly-1024.png new file mode 100644 index 0000000000000000000000000000000000000000..09545ce0c44ee542af30bd82afd4831bd708f758 GIT binary patch literal 238900 zcmYIPcOcc@`+wWA6*69SBNT~nvp31g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bqumr@N9y$3rFXw9y&#nCq|3yER8&gvKiL|6JNlKyeJa}KwQ%jR) zn5S-0*SB{V+kBlah(x@@WjBJpcEf;_lp^BSe|Zl`M0= z3mX^GpOk8>!^CN;#AW{gL~EDMv)a~37LYCiBCg(Ho-+KG%ufsWGZ#=q`+v0g^+I6A zb*`8$_-eI&{Ey{N)T3i{+*jubr#H+Km;RCR+xWVp*hj1TS0MYX|HVNg%2$cch|5LW zf?ZX(1itdW8P`K7n$%MS1IzM5{?#{yR?O*k9%{0eudv^}IlMK_7jiJTRj}mzxD+73 NCFJksRTr+u{|z;*!odIl literal 0 HcmV?d00001 diff --git a/assets/app-icon/effectcraft-nightly-1024.png.attribution b/assets/app-icon/effectcraft-nightly-1024.png.attribution new file mode 100644 index 000000000..6985b9e1e --- /dev/null +++ b/assets/app-icon/effectcraft-nightly-1024.png.attribution @@ -0,0 +1,9 @@ +asset: effectcraft-nightly-1024.png +title: EffectCraft nightly app icon, padded macOS 1024 px +author: EffectCraft contributors (drawing by the project owner in ArtCraft) +source: original work +license: MIT OR Apache-2.0 +license-file: assets/app-icon/LICENSE.txt +added: 2026-11-24 by EffectCraft contributors (Claude agent, nightly icon derivatives) +notes: Derived from assets/app-icon/effectcraft-1024.png by moving only the background colour to #5e2443 (assets/app-icon/nightly-provenance.json). + diff --git a/assets/app-icon/effectcraft-nightly-macos-512.png b/assets/app-icon/effectcraft-nightly-macos-512.png new file mode 100644 index 0000000000000000000000000000000000000000..7aaa12589e2ed6f2ad5fadc5c9705c9f36d57619 GIT binary patch literal 70234 zcmeFY7JockPr}%77+mnrE>_SWoV?k zW9R_}W*+?hp7Rf!cjvm!tGQ=i_u6}{wb%NrxYvIBR7Zo7jD-vU07@-QReb;;xLy(f zB#`T$W8cvW07T2JrF!4ccWS5kPkGt8*IcTfeD}8+SXohgP1(y{ea%O=?X~zGaeTU| zCRw9dbYXo<<88rc8C{ho^l4!dgBo?fFhMEtjX_{lL@2~zi)*8bdhiu_-ALTAK&HF% zQ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Y{drGxk)XdicOp z&B>xx`d-QM$I~h^xqhS;*?#U2!rPMhn^hXY@GXcVUODO*-*!Pg#Je!~FEJ~Gx-$4N zs)H5fBYmxfoD)NL?Dc$G+#<5tFTZwgS>R88y0gyoa=t`{md{Sx&cbAq>5OWZjek$% zi#VJso;Ag1z`y`2ZOwXL71+gqiL+x~hQCy5dfj|@=hX$fbA%`tOGeMpzVWpVWyUuH zN9Y+pUiD>L=U8 zUzcNST(rLZFnvj;^aEEBqKV00tP;{9H@61g4yAy}@nMVR#=$5WzC^8nedB(po|CedE95j$l19rwb>Fs}#0(g-p2z1S(+0k-z(WZAz2^ zR9qT3Sk{OO_IilPQP41YiCC;;dDty>Byk4MRq@pNaSUEi%zv%@faN78E z1^qPQCU4EBmH#+BW^Q8*;JE@!?HM%j$Jxe-VA>9mH$V(sw^I1A>t(&cN#}Q@8%|ZV zeZ%orn_46HT7bE9J|`I;qW2a^%^Co(H8lEGJ27QIMS#qOo<=jZ~BQkV$i5E^a)pmN8D9caNPrW437Wzl6QC52h~tMKv= z#0=K5V8<0IfD-!j-tA-+qDCyXK+wj1tPU3chJ-uF`3_%l7toP;_kE{!zY3TT>BNDy zxYH2I!TEuiio4~#Jj}?cn~ltXXnASi7*7#?pA6^JSCxqem dhaf)-96J0pBirc&^N_$nIoYESHRpXF{0F5;d13$n literal 0 HcmV?d00001 diff --git a/assets/app-icon/effectcraft-nightly-macos-512.png.attribution b/assets/app-icon/effectcraft-nightly-macos-512.png.attribution new file mode 100644 index 000000000..499fe67e1 --- /dev/null +++ b/assets/app-icon/effectcraft-nightly-macos-512.png.attribution @@ -0,0 +1,9 @@ +asset: effectcraft-nightly-macos-512.png +title: EffectCraft nightly macOS Dock icon, padded 512 px +author: EffectCraft contributors (drawing by the project owner in ArtCraft) +source: original work +license: MIT OR Apache-2.0 +license-file: assets/app-icon/LICENSE.txt +added: 2026-11-24 by EffectCraft contributors (Claude agent, nightly icon derivatives) +notes: Derived from assets/app-icon/effectcraft-macos-512.png by moving only the background colour to #5e2443 (assets/app-icon/nightly-provenance.json). + diff --git a/assets/app-icon/effectcraft-nightly.icns b/assets/app-icon/effectcraft-nightly.icns new file mode 100644 index 0000000000000000000000000000000000000000..f346acf71e2681f40c688660f812c19b3078d0d4 GIT binary patch literal 545669 zcmeFZLy#sx+o=7t?Vh%6+qP}nwr$(Crfs`>+L)fUZTrmoeVem*<1GL97gHHk85vcJ z%!s-(uDt5bvNX1H20$u@S{ggB001D=kqUC+aL`!L0000^QbI)OZ;kk$6B7LI761O* z@NWg>Aff5}xBkxo1PJj&|JwjwmJ|_G@yN+l)|5w4L>(nJjz9!(G$1$qX%i+2NeC1JEjXWn%5WDDWKWTTQPc=|yNv!lzH!3|qBZbh z&^^(?$=R{}oa>zy5U}rjRQ`F+`M7mG3>t>5By>RMDiLGS&80F^Ei3|q=F6CdRpl@- zqs#Ci=;C8Zw1{>|1;UYv$2NZ<#oO+I`+HcZ;cQ<+_=1*2pDt7^ufs!1M};n}KTSl+ zU=Kzjmnc4inL;Vwl*G10Z4fmrF{?snK}a?6h)T;qRTPm?%pcF_kDYeo*Br7o!IJ6O z-1Xl4!gNrRCL_lZTw3A$zJ(~axwvb$SOaA=yt2@t9e>~hKjre932r4Ny?AK{4sJI} z^8U~bU;aRFq+&A%=iI3lLliJkl;B_v$y|{m#TRi5~5A z;m~0SsVoFpAdwO;NlZS$Yj=#h4y9oAqF4@*$J_1;(%icd`1?Bc$zwYsFDpFT5F{7d zH$A8zQ*UjGn7=;xPc5rk!%tc>eEFR(1A2Hj_Mcsk@cK_a8Q56Dro(UxC2Vk+F{dNRCNAo}Y9SR%tYXo=t0d7*O{a7u6_Ipb=_r*q**jrf zXL?J@l}pX6^}1^McKET%^$o~P(%P!qD)ar%t1c-jCsHS55cD@xSOEaY^8XSl1b-hR z_@7X5_VRl8+xTyx0;%}Fq4G=JQb9!>4cw(>@?*SYk{`+D2{&B?$>cOl@3&kS$EW_*D>5x!NHk~4G z^R1vz>+WKRT0%<(2=X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||e)8G+E`|244mIe~QlR5FSTx{!gmdXqKW_}{Dl zw*t=>H|;8n|7SLLwO%CHZ_~*!+Egip{qN7SL<53lVf$;Cn@2hkJO4Av!(WG{bi?_8Ht>LR7 literal 0 HcmV?d00001 diff --git a/assets/app-icon/effectcraft-nightly.icns.attribution b/assets/app-icon/effectcraft-nightly.icns.attribution new file mode 100644 index 000000000..df12d86e5 --- /dev/null +++ b/assets/app-icon/effectcraft-nightly.icns.attribution @@ -0,0 +1,9 @@ +asset: effectcraft-nightly.icns +title: EffectCraft nightly macOS bundle icon +author: EffectCraft contributors (drawing by the project owner in ArtCraft) +source: original work +license: MIT OR Apache-2.0 +license-file: assets/app-icon/LICENSE.txt +added: 2026-11-24 by EffectCraft contributors (Claude agent, nightly icon derivatives) +notes: Eleven PNG slots from assets/app-icon/effectcraft-nightly-1024.png and -macos-512.png; packed into one ICNS (assets/app-icon/nightly-provenance.json). + diff --git a/assets/app-icon/effectcraft-nightly.ico b/assets/app-icon/effectcraft-nightly.ico new file mode 100644 index 0000000000000000000000000000000000000000..cb98257706fc0fadc9cc8c0fedc36ac66fb0ecb1 GIT binary patch literal 80805 zcmagFV{m3+moQrs4 zz1Ic+fB;YcL`1-kB?Od!005}~000&BKbQav0N?=y05CECgR{T^0BtA$fROM%*cciB zct!vKC@KGgUEl!#Eo=aQf#E-R3K;;H`Z*I2_z#A_2LQ6T0f2yj|KK2F0H9Fw=fa=o zzwY<<0|3Z70e}bvIdM2>?4P#-;3OqPlz!~b7XlC=f9?km+1wz~q2E9WP{JY*OCNr~(AJ0?hQ(KC8>!@{% ziSl@B--DK-iFYtaTRXrsNk&}JJN}?2pP{tqF(TTYkp8_Ey6^KVHQ_GWMm)f?PjMVq zx9sz-!SZeea`(llo9b&-KMT!lTDD`Aay}ZBtaU7>Y+AbxkdkIe$O@7+ow&S|q%FEv0`HG`MFH?Kl z?@T_#)MBF>tXF^WR%ibAfR;D;nvw6ONP7@0!l0+eH{05MD<1RU_fwa|^3ms)yIEr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8B-|OdZ=lj0Lyr=h?|9idH%=Y;zVCa# z_xiIO^O}Btbe#HZ$K0oRpZ?t6xSoIg`bKUp)PDC@DSy5x@TErvJL*RE6Pk pT#k21%;_5YwMX9l&6nB3|NoFB=norK;tK!(002ovPDHLkV1j>4M+5)> literal 0 HcmV?d00001 diff --git a/assets/app-icon/effectcraft-nightly.png.attribution b/assets/app-icon/effectcraft-nightly.png.attribution new file mode 100644 index 000000000..483a5f10d --- /dev/null +++ b/assets/app-icon/effectcraft-nightly.png.attribution @@ -0,0 +1,9 @@ +asset: effectcraft-nightly.png +title: EffectCraft nightly app icon, 256 px +author: EffectCraft contributors (drawing by the project owner in ArtCraft) +source: original work +license: MIT OR Apache-2.0 +license-file: assets/app-icon/LICENSE.txt +added: 2026-11-24 by EffectCraft contributors (Claude agent, nightly icon derivatives) +notes: Derived from assets/app-icon/hicolor/256x256/apps/ai.storyteller.effectcraft.png by moving only the background colour to #5e2443 (assets/app-icon/nightly-provenance.json). + diff --git a/assets/app-icon/nightly-provenance.json b/assets/app-icon/nightly-provenance.json new file mode 100644 index 000000000..dae1eb5e0 --- /dev/null +++ b/assets/app-icon/nightly-provenance.json @@ -0,0 +1,66 @@ +{ + "title": "EffectCraft nightly deep-background icons", + "author": "@skylartaylor", + "license": "MIT OR Apache-2.0", + "source_commit": "a12c11ee0245f46807ce3ddb62e0fee294760c8a", + "inputs": [ + { + "path": "assets/app-icon/hicolor/256x256/apps/ai.storyteller.effectcraft.png", + "sha256": "186a1d869a4602ec86cd03f6e5e288ebbd328e0c3d8a17c205329829392f9add", + "purpose": "Windows/Linux native 256 master" + }, + { + "path": "assets/app-icon/effectcraft-1024.png", + "sha256": "2f1eec28b8b2ae8397a5c3517a74d1771fdd521fdc9d673918be35834fd935ae", + "purpose": "native padded Mac 1024 master; not upscaled from 256" + }, + { + "path": "assets/app-icon/effectcraft-macos-512.png", + "sha256": "e121c1c2d9a811a95f20d1f6a296c9df77c67fd8f3ff9263415bb890b0795fcd", + "purpose": "native padded Mac 512 master (runtime Dock icon)" + } + ], + "method": { + "kind": "original code-generated derivative of the project-owned icon", + "original_palette": { + "ink": "#0b0b0c", + "paper": "#efe9dc", + "background": "#e0368f" + }, + "nightly_background": "#5e2443", + "transform": "Solve the background's weight per pixel from the colour's distance off the neutral ink/paper axis, then add only that weight times the background difference. Alpha, padding and the neutral foreground/detail RGBA are preserved. ICO/ICNS frames are scaled from the same recoloured masters (lanczos) and packed as PNG frames. No crescent, letter or badge.", + "generator": "inline Python (zlib PNG decode/encode, ffmpeg lanczos scaling, struct-packed ICO/ICNS)" + }, + "outputs": { + "assets/app-icon/effectcraft-nightly.png": "0e904f9fa925ea32ab7dd7d65e9614007a145af8c3aba8e6c3dd3fc2975d4c79", + "assets/app-icon/effectcraft-nightly-1024.png": "29a6733d058b646f9e41057bd943ffe6f88bf134a4b62b91f49fda3013762707", + "assets/app-icon/effectcraft-nightly-macos-512.png": "c6539a3b0ad1c1e9b3da12af6e8d0fc80aadfd179531af3aa534e4113902e99d", + "assets/app-icon/effectcraft-nightly.ico": "bea4d2fc82774e1e4d1d56450a87bc86a0970dced2f326644f479b534e11cf09", + "assets/app-icon/effectcraft-nightly.icns": "80ddae503db8ffefaf8041494e04fdfdd7bd271e2e1e30b00d2dcd93c263af60" + }, + "ico_frame_sizes": [ + 16, + 20, + 24, + 32, + 40, + 48, + 64, + 128, + 256 + ], + "icns_png_slots": { + "icp4": 16, + "icp5": 32, + "ic11": 32, + "icp6": 64, + "ic12": 64, + "ic07": 128, + "ic08": 256, + "ic13": 256, + "ic09": 512, + "ic14": 512, + "ic10": 1024 + }, + "validation": "Input/output hashes, PNG dimensions and exact ICO/ICNS member sizes checked locally; foreground and alpha compared pixel-for-pixel against the source masters. Native Explorer/Finder/iconutil/app-package qualification is unrun (needs Windows and macOS)." +} diff --git a/crates/host/src/app_dirs.rs b/crates/host/src/app_dirs.rs index de81ea608..409ab901f 100644 --- a/crates/host/src/app_dirs.rs +++ b/crates/host/src/app_dirs.rs @@ -2,13 +2,15 @@ //! plug-ins): the one directory [`config_dir`](crate::config_dir) returns. //! //! In order: -//! 1. `EFFECTCRAFT_CONFIG_DIR`, when set (tests, agents, custom setups). -//! 2. **Portable mode** (#993): a marker file ([`PORTABLE_MARKERS`]) beside the executable puts +//! 1. A validated Nightly profile root (`set_profile_root`), set once at startup by the desktop +//! app before anything reads this module: every file below then stays in that private folder. +//! 2. `EFFECTCRAFT_CONFIG_DIR`, when set (tests, agents, custom setups). +//! 3. **Portable mode** (#993): a marker file ([`PORTABLE_MARKERS`]) beside the executable puts //! everything in `/EffectCraftData`, so a portable copy on a USB stick leaves nothing in //! `%APPDATA%`. The Windows portable zip ships with `portable.txt`; the MSI doesn't. If that //! folder can't be written (read-only medium, Program Files), a warning is logged and the //! platform folder is used. -//! 3. The platform convention: macOS `~/Library/Application Support/EffectCraft`, Windows +//! 4. The platform convention: macOS `~/Library/Application Support/EffectCraft`, Windows //! `%APPDATA%\EffectCraft`, Linux `$XDG_CONFIG_HOME/effectcraft` or `~/.config/effectcraft`. use std::ffi::OsString; @@ -41,12 +43,27 @@ pub struct DataDir { pub warning: Option, } +/// A validated Nightly profile root, set once before any data root is first read. A stable launch +/// never sets it, so nothing about stable resolution changes. +static PROFILE_ROOT: OnceLock = OnceLock::new(); + +/// Select the private Nightly profile root. Only the desktop app's launch-profile bootstrap calls +/// this, after the root passed `profile_root::validate`. +pub fn set_profile_root(root: PathBuf) -> Result<(), &'static str> { + PROFILE_ROOT.set(root).map_err(|_| "the Nightly profile root was already selected") +} + +/// The Nightly profile root, when this process is a Nightly launch. +pub fn profile_root() -> Option<&'static Path> { + PROFILE_ROOT.get().map(PathBuf::as_path) +} + /// The data directory for this process, resolved once (the portable check probes the disk). pub fn current() -> &'static DataDir { static DIR: OnceLock = OnceLock::new(); DIR.get_or_init(|| { let exe = std::env::current_exe().ok(); - let d = resolve(|k| std::env::var_os(k), exe.as_deref().and_then(Path::parent)); + let d = resolve_with_profile(profile_root(), |k| std::env::var_os(k), exe.as_deref().and_then(Path::parent)); if let Some(w) = &d.warning { log::warn!("{w}"); } @@ -54,6 +71,16 @@ pub fn current() -> &'static DataDir { }) } +/// Resolve the data directory with an optional validated Nightly profile root, which wins over +/// every stable choice: no environment override or portable marker can point a Nightly session +/// back at stable files. +pub fn resolve_with_profile(profile: Option<&Path>, env: impl Fn(&str) -> Option, exe_dir: Option<&Path>) -> DataDir { + if let Some(root) = profile { + return DataDir { dir: Some(root.to_path_buf()), mode: Mode::Override, warning: None }; + } + resolve(env, exe_dir) +} + /// Resolve the data directory from the environment (`env`) and the executable's folder. pub fn resolve(env: impl Fn(&str) -> Option, exe_dir: Option<&Path>) -> DataDir { if let Some(d) = env("EFFECTCRAFT_CONFIG_DIR") { @@ -93,7 +120,7 @@ pub fn portable_marker(exe_dir: &Path) -> Option { } /// Create `dir` and prove a file can be written in it (a folder can exist yet be read-only). -fn ensure_writable(dir: &Path) -> std::io::Result<()> { +pub fn ensure_writable(dir: &Path) -> std::io::Result<()> { std::fs::create_dir_all(dir)?; let probe = dir.join(format!(".write-test-{}", std::process::id())); std::fs::write(&probe, b"")?; @@ -211,6 +238,24 @@ mod tests { let _ = std::fs::remove_dir_all(&root); } + #[test] + fn a_validated_profile_root_wins_over_every_stable_choice() { + let root = temp("profile-root"); + let exe = root.join("bin"); + std::fs::create_dir_all(&exe).unwrap(); + std::fs::write(exe.join(PORTABLE_MARKERS[0]), b"").unwrap(); + let custom = root.join("custom"); + let env = env_of(&[("EFFECTCRAFT_CONFIG_DIR", &custom), ("HOME", &root), ("APPDATA", &root)]); + let profile = root.join("launcher/profiles/effectcraft"); + let d = resolve_with_profile(Some(&profile), &env, Some(&exe)); + assert_eq!((d.mode, d.dir.as_deref()), (Mode::Override, Some(profile.as_path()))); + assert!(d.warning.is_none()); + assert!(!profile.exists(), "resolving must not create anything"); + assert!(!exe.join(PORTABLE_DATA_DIR).exists(), "no portable folder is created for a Nightly launch"); + assert_eq!(resolve_with_profile(None, &env, Some(&exe)).dir, Some(custom), "stable keeps its own override"); + let _ = std::fs::remove_dir_all(&root); + } + #[test] fn missing_exe_dir_or_env_never_panics() { let d = resolve(|_| None, None); diff --git a/crates/host/src/lib.rs b/crates/host/src/lib.rs index 3eb0d9ad2..54386ccad 100644 --- a/crates/host/src/lib.rs +++ b/crates/host/src/lib.rs @@ -170,7 +170,8 @@ pub fn stop_helpers() { /// The platform config directory for EffectCraft (`EFFECTCRAFT_CONFIG_DIR` overrides): /// `~/Library/Application Support/EffectCraft` (macOS), `%APPDATA%\EffectCraft` (Windows), /// `$XDG_CONFIG_HOME/effectcraft` or `~/.config/effectcraft` (Linux and others). A `portable.txt` -/// beside the executable puts it in `EffectCraftData` there instead ([`app_dirs`]). +/// beside the executable puts it in `EffectCraftData` there instead ([`app_dirs`]). A Nightly launch +/// uses the private profile root its launcher selected (`app_dirs::set_profile_root`). pub fn config_dir() -> Option { app_dirs::current().dir.clone() } diff --git a/crates/render/src/disk_cache.rs b/crates/render/src/disk_cache.rs index 1985060c2..78feca680 100644 --- a/crates/render/src/disk_cache.rs +++ b/crates/render/src/disk_cache.rs @@ -612,8 +612,27 @@ pub fn disk_reserve(total: u64) -> u64 { (total / 20).clamp(MIN_DISK_RESERVE, MAX_DISK_RESERVE) } -/// The platform's default disk cache folder. +/// A validated Nightly profile root, set once at startup by the desktop app: every cache folder +/// then derives from it instead of the platform cache/state folders. +static PROFILE_ROOT: std::sync::OnceLock = std::sync::OnceLock::new(); + +/// Select the private Nightly profile root for the cache folders (disk cache, media cache, +/// conformed audio, local footage copies). A stable launch never sets it. +pub fn set_profile_root(root: PathBuf) -> Result<(), &'static str> { + PROFILE_ROOT.set(root).map_err(|_| "the Nightly profile root was already selected") +} + +/// The platform's default disk cache folder, or the Nightly profile's caches folder. pub fn default_folder() -> PathBuf { + default_folder_at(PROFILE_ROOT.get().map(PathBuf::as_path)) +} + +/// [`default_folder`] for an explicit Nightly profile root (`None`: the platform convention), so +/// the choice is testable without process-global state. +pub fn default_folder_at(profile: Option<&Path>) -> PathBuf { + if let Some(root) = profile { + return root.join("Caches").join("Disk Cache"); + } let home = std::env::var_os("HOME").map(PathBuf::from); if cfg!(target_os = "macos") && let Some(h) = &home @@ -2112,6 +2131,15 @@ pub fn frame_key(content: u128, frame: i64, scale_milli: u32, view: u64) -> u128 mod tests { use super::*; + /// A Nightly launch keeps its disk cache (and every folder derived from it: media cache, + /// conformed audio) inside the private profile instead of the platform cache folder. + #[test] + fn a_nightly_profile_root_holds_the_cache_folders() { + let root = std::path::Path::new("/nightly profiles/effectcraft"); + assert_eq!(default_folder_at(Some(root)), root.join("Caches").join("Disk Cache")); + assert!(default_folder_at(Some(root)).starts_with(root)); + } + /// #3301 review: buffers for entries read back are taken fallibly; memory the system can't /// give is a miss, not an abort. #[test] diff --git a/crates/ui-egui/src/channel.rs b/crates/ui-egui/src/channel.rs new file mode 100644 index 000000000..90ce504c9 --- /dev/null +++ b/crates/ui-egui/src/channel.rs @@ -0,0 +1,147 @@ +//! The launch channel: stable EffectCraft, or the isolated Nightly flavor the ArtCraft Launcher +//! starts from its own profile. Selected once at startup, before any window or saved state. + +use std::path::{Path, PathBuf}; +use std::sync::OnceLock; +use std::sync::atomic::{AtomicU8, Ordering}; + +/// Matches the `.desktop` file and hicolor icon name, so Wayland docks pick up the icon. +pub const APP_ID: &str = "ai.storyteller.effectcraft"; + +/// The Nightly window's own app id: a separate taskbar entry and Wayland class from stable. It is +/// not the package/bundle identifier (`ai.storyteller.effectcraft.nightly`), which names the +/// archive and the macOS bundle. +pub const NIGHTLY_APP_ID: &str = "ai.storyteller.effectcraft.nightly-v1"; + +/// Immutable startup identity. The desktop host selects it before any UI or service is created. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum LaunchIdentity { + Stable, + NightlyV1, +} + +static IDENTITY: AtomicU8 = AtomicU8::new(0); + +pub fn select_identity(identity: LaunchIdentity) -> Result<(), String> { + let value = match identity { + LaunchIdentity::Stable => 1, + LaunchIdentity::NightlyV1 => 2, + }; + IDENTITY.compare_exchange(0, value, Ordering::AcqRel, Ordering::Acquire).map(|_| ()).map_err(|_| "the window launch identity was already selected".into()) +} + +pub fn identity() -> LaunchIdentity { + if IDENTITY.load(Ordering::Acquire) == 2 { LaunchIdentity::NightlyV1 } else { LaunchIdentity::Stable } +} + +pub const fn id_for(identity: LaunchIdentity) -> &'static str { + match identity { + LaunchIdentity::Stable => APP_ID, + LaunchIdentity::NightlyV1 => NIGHTLY_APP_ID, + } +} + +pub fn app_id() -> &'static str { + id_for(identity()) +} + +/// The product name this launch shows: the window title, About and the version line. +pub const fn name_for(identity: LaunchIdentity) -> &'static str { + match identity { + LaunchIdentity::Stable => "EffectCraft", + LaunchIdentity::NightlyV1 => "EffectCraft Nightly", + } +} + +/// Whether features that belong to a stable installation (the updater, the control channel, agent +/// automation) may run. A Nightly session is managed by ArtCraft Launcher. +pub const fn stable_services_for(identity: LaunchIdentity) -> bool { + matches!(identity, LaunchIdentity::Stable) +} + +pub fn stable_services_allowed() -> bool { + stable_services_for(identity()) +} + +/// The Nightly profile's own user-preset folder, installed once by the desktop host before the UI +/// exists. A stable session installs nothing, so its `EC_PRESETS_DIR`/Documents rule is unchanged. +static PROFILE_PRESETS: OnceLock = OnceLock::new(); + +pub fn set_profile_presets(dir: PathBuf) { + let _ = PROFILE_PRESETS.set(dir); +} + +pub fn profile_presets() -> Option<&'static Path> { + PROFILE_PRESETS.get().map(PathBuf::as_path) +} + +/// A builder for the window, carrying the channel's app id. +pub fn builder() -> egui::ViewportBuilder { + egui::ViewportBuilder::default().with_app_id(app_id()) +} + +/// The exact build identity, set once by the desktop host from its build script: for Nightly the +/// prepared feed version (`X.Y.Z-nightly.YYYYMMDD.run.attempt.gsha`) and the source commit. +struct BuildIdentity { + version: &'static str, + commit: Option<&'static str>, +} + +static BUILD: OnceLock = OnceLock::new(); + +pub fn set_build_identity(version: &'static str, commit: Option<&'static str>) { + let _ = BUILD.set(BuildIdentity { version, commit }); +} + +/// The version this binary was built as. Before the host sets it, the Cargo version. +pub fn version() -> &'static str { + BUILD.get().map_or(env!("CARGO_PKG_VERSION"), |build| build.version) +} + +/// The source commit baked into a release or Nightly build, when the packager provided one. +pub fn commit() -> Option<&'static str> { + BUILD.get().and_then(|build| build.commit) +} + +/// The channel label a Nightly build appends to its version line. +pub fn channel_label() -> Option<&'static str> { + match identity() { + LaunchIdentity::Stable => None, + LaunchIdentity::NightlyV1 => Some("nightly-v1"), + } +} + +/// The extra About line a Nightly build shows: the channel and the baked source commit, and where +/// a problem is reported. Stable shows nothing extra. +pub fn nightly_about_line() -> Option { + channel_label()?; + let commit = commit().map(|sha| format!(" • commit {}", &sha[..sha.len().min(12)])).unwrap_or_default(); + Some(format!("Nightly channel, managed by ArtCraft Launcher{commit} • Report a problem: {}", effectcraft_engine::links::ISSUES)) +} + +#[cfg(test)] +mod tests { + #[test] + fn the_nightly_identity_is_distinct_and_never_enables_stable_services() { + assert_eq!(super::id_for(super::LaunchIdentity::Stable), super::APP_ID); + assert_ne!(super::id_for(super::LaunchIdentity::NightlyV1), super::APP_ID); + assert!(super::stable_services_for(super::LaunchIdentity::Stable)); + assert!(!super::stable_services_for(super::LaunchIdentity::NightlyV1)); + assert_eq!(super::name_for(super::LaunchIdentity::Stable), "EffectCraft"); + assert_eq!(super::name_for(super::LaunchIdentity::NightlyV1), "EffectCraft Nightly"); + } + + #[test] + fn the_window_carries_the_channel_app_id() { + // The process-global identity is unset here, so this is the stable id. + assert_eq!(super::builder().app_id.as_deref(), Some(super::APP_ID)); + } + + #[test] + fn a_stable_session_has_no_channel_and_no_about_extra() { + assert!(super::channel_label().is_none()); + assert!(super::nightly_about_line().is_none()); + assert_eq!(super::version(), env!("CARGO_PKG_VERSION")); + assert_eq!(super::commit(), None, "an unset build identity has no invented commit"); + } +} diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 1d39857df..1e4791940 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -21,6 +21,7 @@ pub const UPDATE_APP: craft_update::app::App = craft_update::app::App { pub mod audio; pub mod automation; pub mod bench; +pub mod channel; pub mod color_picker; pub mod control; pub mod credits; diff --git a/crates/ui-egui/src/panels/dialogs.rs b/crates/ui-egui/src/panels/dialogs.rs index 458ce60a9..0d4eca9c9 100644 --- a/crates/ui-egui/src/panels/dialogs.rs +++ b/crates/ui-egui/src/panels/dialogs.rs @@ -398,14 +398,17 @@ fn about_main(app: &mut EffectcraftApp, ui: &mut egui::Ui, t: &Tokens, cmd: &mut let p = ui.painter(); p.rect_filled(r, 10.0, Color32::from_rgb(0x1b, 0x22, 0x3c)); crate::header::paint_logo(p, Rect::from_min_size(r.min + vec2(18.0, 20.0), vec2(56.0, 56.0))); - p.text(r.min + vec2(90.0, 34.0), Align2::LEFT_CENTER, "EffectCraft", Tokens::semibold(24.0), Color32::WHITE); - p.text( - r.min + vec2(90.0, 62.0), - Align2::LEFT_CENTER, - format!("Version {} • Motion graphics & VFX in pure Rust", env!("CARGO_PKG_VERSION")), - Tokens::ui(12.0), - t.text_dim, - ); + let channel = crate::channel::identity(); + p.text(r.min + vec2(90.0, 34.0), Align2::LEFT_CENTER, crate::channel::name_for(channel), Tokens::semibold(24.0), Color32::WHITE); + // A Nightly build reports its prepared feed version and channel; stable keeps its Cargo version. + let version = match crate::channel::channel_label() { + Some(label) => format!("Version {} ({label}) • Motion graphics & VFX in pure Rust", crate::channel::version()), + None => format!("Version {} • Motion graphics & VFX in pure Rust", crate::channel::version()), + }; + p.text(r.min + vec2(90.0, 62.0), Align2::LEFT_CENTER, version, Tokens::ui(12.0), t.text_dim); + if let Some(line) = crate::channel::nightly_about_line() { + p.text(r.min + vec2(90.0, 80.0), Align2::LEFT_CENTER, line, Tokens::ui(11.0), t.text_faint); + } ui.add_space(12.0); ui.label(tr("A clean-room, open-source compositor for motion graphics and visual effects: native on macOS, Windows and Linux, and in the browser. Part of the ArtCraft family of creative apps.")); ui.add_space(14.0); diff --git a/crates/ui-egui/src/panels/effects_presets.rs b/crates/ui-egui/src/panels/effects_presets.rs index db42e8992..772cde342 100644 --- a/crates/ui-egui/src/panels/effects_presets.rs +++ b/crates/ui-egui/src/panels/effects_presets.rs @@ -28,12 +28,24 @@ pub struct PresetFile { } /// Where user presets live: `$EC_PRESETS_DIR`, else `~/Documents/EffectCraft/Presets`. +/// +/// A Nightly session keeps its presets in its private profile (`/Presets`): an inherited +/// `EC_PRESETS_DIR` or the stable Documents folder would let two channels write each other's files. +/// Nothing is created here; the folder appears when a preset is saved. pub fn presets_dir() -> Option { - if let Ok(d) = std::env::var("EC_PRESETS_DIR") { - return Some(d.into()); + let env_presets = std::env::var("EC_PRESETS_DIR").ok().map(std::path::PathBuf::from); + let home = std::env::var("HOME").or_else(|_| std::env::var("USERPROFILE")).ok().map(std::path::PathBuf::from); + presets_dir_for(crate::channel::profile_presets(), env_presets, home.as_deref()) +} + +fn presets_dir_for(profile: Option<&std::path::Path>, env_presets: Option, home: Option<&std::path::Path>) -> Option { + if let Some(root) = profile { + return Some(root.join("Presets")); } - let home = std::env::var("HOME").or_else(|_| std::env::var("USERPROFILE")).ok()?; - Some(std::path::Path::new(&home).join("Documents").join("EffectCraft").join("Presets")) + if let Some(dir) = env_presets { + return Some(dir); + } + home.map(|h| h.join("Documents").join("EffectCraft").join("Presets")) } /// The `.ecpreset` files in `dir`, sorted by name. @@ -929,4 +941,16 @@ mod tests { after.sort(); println!("1,000 custom presets, median per warm cache lookup: {:?} -> {:?}", before[2] / 1000, after[2] / 1000); } + /// A Nightly session writes presets inside its profile: never the stable Documents folder and + /// never an inherited `EC_PRESETS_DIR`, so the two channels cannot overwrite each other. + #[test] + fn a_nightly_profile_owns_its_presets_folder() { + let profile = std::path::Path::new("/nightly profiles/effectcraft"); + let stable_docs = std::path::Path::new("/home/someone"); + let inherited = std::path::PathBuf::from("/home/someone/stable-presets"); + assert_eq!(super::presets_dir_for(Some(profile), Some(inherited.clone()), Some(stable_docs)), Some(profile.join("Presets"))); + assert_eq!(super::presets_dir_for(None, Some(inherited.clone()), Some(stable_docs)), Some(inherited)); + assert_eq!(super::presets_dir_for(None, None, Some(stable_docs)), Some(stable_docs.join("Documents/EffectCraft/Presets"))); + assert_eq!(super::presets_dir_for(None, None, None), None); + } } diff --git a/crates/ui-egui/src/panels/unsaved.rs b/crates/ui-egui/src/panels/unsaved.rs index be12668da..7aee71c17 100644 --- a/crates/ui-egui/src/panels/unsaved.rs +++ b/crates/ui-egui/src/panels/unsaved.rs @@ -86,10 +86,17 @@ pub fn project_name(app: &EffectcraftApp) -> String { .unwrap_or_else(|| "Untitled Project.ecproj".into()) } -/// The window title: the project's path (or name) and `*` while it has unsaved changes. +/// The window title: the project's path (or name) and `*` while it has unsaved changes, under the +/// channel's own product name (`EffectCraft`, or `EffectCraft Nightly`). pub fn window_title(app: &EffectcraftApp) -> String { let doc = app.session.path.clone().unwrap_or_else(|| project_name(app)); - format!("EffectCraft - {doc}{}", if app.session.is_dirty() { " *" } else { "" }) + title_for(crate::channel::name_for(crate::channel::identity()), &doc, app.session.is_dirty()) +} + +/// The title rule, as text: the channel's name, the document and ` *` while it has unsaved +/// changes. Kept separate from the process-global identity so both channels' titles are testable. +fn title_for(app_name: &str, document: &str, dirty: bool) -> String { + format!("{app_name} - {document}{}", if dirty { " *" } else { "" }) } /// Whether the prompt is Revert Project (Revert / Cancel) instead of Unsaved Changes. @@ -273,6 +280,10 @@ mod tests { assert!(app.dialog.is_none()); modified(&mut app); assert!(window_title(&app).ends_with("Untitled Project.ecproj *"), "{}", window_title(&app)); + // The channel's own name leads the title, in both its clean and dirty form. + assert_eq!(title_for("EffectCraft Nightly", "Shot.ecproj", false), "EffectCraft Nightly - Shot.ecproj"); + assert_eq!(title_for("EffectCraft Nightly", "Shot.ecproj", true), "EffectCraft Nightly - Shot.ecproj *"); + assert_eq!(title_for("EffectCraft", "Shot.ecproj", false), "EffectCraft - Shot.ecproj"); let r = crate::menus::invoke(&mut app, &ctx, "file.newProject", json!({})).unwrap(); assert_eq!(r, json!({"dialog": "unsavedChanges"})); assert_eq!(app.dialog, Some(Dialog::UnsavedChanges)); diff --git a/crates/ui-egui/src/updates_ui.rs b/crates/ui-egui/src/updates_ui.rs index 1b2ce3347..03611d105 100644 --- a/crates/ui-egui/src/updates_ui.rs +++ b/crates/ui-egui/src/updates_ui.rs @@ -65,6 +65,12 @@ pub(crate) fn restart_to_update(rt: &mut Runtime, ctx: &egui::Context, clean: bo } pub(crate) fn check(app: &mut EffectcraftApp) { + // A Nightly session is replaced by ArtCraft Launcher, never by the stable release feed: a + // "restart to update" there would install stable over the nightly build. + if !crate::channel::stable_services_allowed() { + app.ui.status = "Updates come with the ArtCraft Launcher's Nightly channel.".into(); + return; + } #[cfg(not(target_arch = "wasm32"))] { app.updates_rt.check_requested = true; diff --git a/docs/nightly-release-preparation.md b/docs/nightly-release-preparation.md new file mode 100644 index 000000000..941e9ba59 --- /dev/null +++ b/docs/nightly-release-preparation.md @@ -0,0 +1,107 @@ +# Windows, Linux and macOS release-ref nightly: supervised manual go-live + +**Enabled for supervised manual runs, not yet qualified.** The producer (`nightly.yml`, main) and the +signer (`nightly-sign.yml`, release) keep only their exact context guards and run when one of the reviewed +manual actors dispatches them. There is no schedule yet. The installed policy +[`.github/nightly-signing-policy.json`](../.github/nightly-signing-policy.json) is the v3 policy +structure; once `nightly.yml` is registered on `main`, populate `producer_workflow_id` by reading: + +```bash +gh api repos/storytold/effectcraft/actions/workflows/nightly.yml --jq .id +``` + +The callers pass no platform secrets. The unsigned reusable caller's maximum OIDC/attestation +permissions are for its isolated attester; its compiler narrows to contents and Actions read +only, with no OIDC, attestation write, release environment or platform signing secrets. +Shared tooling is pinned to `605d58766e8f536564da8fc81d3676ac86816dea`, the craft-common-actions +main commit that merged [#339](https://github.com/storytold/craft-common-actions/pull/339) (bounded +lineage compares and an issue reread at the end of candidate admission) on top of +[#342](https://github.com/storytold/craft-common-actions/pull/342) (policy v3, the `platforms` input +and the Linux and macOS legs). Both callers name it in `uses` and `tooling-revision`. A pin is reviewed +source availability, not provider, queue, native signing or crypto qualification. +Existing stable workflows are unchanged. + +**The shared-workflow port is a prerequisite.** At this pin both reusable workflows admit only +PhotoCraft: `nightly-unsigned.yml` requires `inputs.app-name == 'photocraft'` and +`github.repository == 'storytold/photocraft'` on its build jobs, and `nightly-release.yml` requires the +same repository in `validate` and every signing job (its concurrency group is +`craft-release-ref-signer-photocraft`). A EffectCraft dispatch therefore builds and signs nothing until +`storytold/craft-common-actions` admits `storytold/effectcraft`. No dispatch can produce a release before +that port, and both callers' `uses`, `tooling-revision` and the policy pins must move to the same +reviewed revision together. The port is craft-common-actions #363 ("run the shared nightly pipeline for any +reviewed registry app"); until it merges these callers are inert. + +**First runs.** The first runs are manual dispatches in this order: `nightly.yml` on main (only a +listed manual actor passes the producer's plan step), then `nightly-sign.yml` on `release` with that +producer run ID and attempt, by a listed manual actor. + +**Manual actors.** `bflatastic`, `dylanmtaylor`, `echelon`, `FredApps` and `skylartaylor`, in the +producer's `manual-actors` and the policy's `manual_actors`. The list mirrors the release-managers +team (id 19837241), leaving out `echelon-robot`; update it by PR in both places when the team changes. + +**Admission timing.** The candidate check reads the newest CI run on the candidate commit and +main's latest finished Sonar analysis, so pick a quiet main, wait for its CI and SonarCloud analysis +to finish green, then dispatch the producer and, once it succeeds, the signer, before another main +push lands a newer analysis. + +**Platform rows.** The producer caller lists +`platforms: '["windows-x86_64","linux-x86_64","macos-aarch64"]'` on its single job: one producer +run builds every listed platform for one all-or-nothing release (one failed or +skipped platform stops that night's release), and the release-ref signer admits +platforms only from the protected policy, so there is no separate Linux or macOS caller job and +the signer caller has no platform input. + +## Installed policy values and their sources + +Read on 2026-11-24; re-read anything that may have moved (and fill in `producer_workflow_id` after +`nightly.yml` reaches `main`) before the policy is promoted to `release`. + +| Field | Value | Source | +|---|---|---| +| `repository_id` | `1400136506` | `gh api repos/storytold/effectcraft --jq .id` | +| `producer_workflow_id` | `null` (pending main registration) | `gh api repos/storytold/effectcraft/actions/workflows/nightly.yml --jq .id` after `nightly.yml` reaches `main` | +| `producer_tooling_revision`, `signer_tooling_revision`, `producer_workflow_ref` | `605d5876…` (craft-common-actions #339) | The callers' pin | +| `manual_actors` / `automatic_signer_actors` | the five release managers / `[]` | release-managers team (id 19837241) members who can push; equals the producer caller's `manual-actors` | +| `max_age_seconds`, `max_artifact_bytes` | `86400`, `2147483648` | Go-live checklist | +| `platforms` | three rows | Storytold stable signing identities (`Learning Machines Inc` Windows Authenticode, Linux OpenPGP `2B76741B414AAD6CD33E631213A005C0B9D7C3ED`, Apple Team `DJ6XS33FX8`) | +| `candidate_policy.required_workflows` | CI (`ci.yml`, workflow `380135792`), `gate / gate (ubuntu-24.04)` | Workflow list API and recent main push run | +| `candidate_policy.sonar` | `storytold` / `storytold_effectcraft`, app `12526` | `sonar-project.properties`; SonarCloud check on main commits | +| Sonar conditions | `new_security_rating` accepted (max 5); the other five required | Standard Storytold SonarCloud quality gate | +| Sonar `issue_types` / `debt` | `VULNERABILITY`; `[]` | Refresh from `api/issues/search` on main before promoting to `release` | + +The candidate check refuses whenever main's unresolved vulnerability set differs from `debt`, whether +an issue is new or fixed, and whenever a required condition fails or a listed CI job is renamed. Refresh +those values in the same reviewed change that promotes the policy to `release`. + +## Ownership and interface + +- `.github/workflows/nightly.yml`: default-main registration of the unsigned producer, named + `EffectCraft unsigned nightly`, enabled for manual dispatch by `manual-actors`; no signing secrets + may be passed or inherited. +- `.github/workflows/nightly-sign.yml`: top-level release registration, enabled for manual dispatch, + and identical on main and release after reviewed promotion. It rejects wrong repository/event/actual branch, + including same-name tags. Its constant whole-run concurrency is distinct from stable, + cancellation is off and `queue: max` must be hosted-qualified. The caller itself passes no + credentials; only the shared callee's sign jobs bind the `release` environment. +- Shared reusable entrypoints are `nightly-unsigned.yml` and `nightly-release.yml` in + `storytold/craft-common-actions`. Both must resolve to a **real reviewed public immutable + commit**; the defining workflow SHA and tooling input must match. +- `packaging/windows/sign.ps1` is the app-owned Windows adapter. Invoke it only from the immutable + **release execution SHA** checkout, never the producer's main source or extracted archive. + +## Local regression checks + +`python3 packaging/nightly-release-tests.py` verifies the nightly source contract locally without +contacting GitHub: +- Exact context guards on `nightly.yml` and `nightly-sign.yml` (reading every `if:` form and + continuation line). +- `manual_actors` matches the reviewed release managers in both `nightly.yml` and + `.github/nightly-signing-policy.json`, and `automatic_signer_actors` is empty. +- No nightly schedule is registered. +- No cache actions, cache setup options, `environment:`, or `secrets` appear in the callers. +- Root serialization in `nightly-sign.yml` keeps the fixed `effectcraft-nightly-release` group, + `queue: max`, and `cancel-in-progress: false`. +- Both callers share one full 40-hex commit pin in `uses` and `tooling-revision`, matching the + installed policy. +- Policy platforms match the producer list, carry valid trust anchor shapes, and reference + `ci.yml` and `sonar-project.properties` accurately. diff --git a/docs/releasing.md b/docs/releasing.md index 07d988b5c..8e985915c 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -48,6 +48,36 @@ any other branch (`gh workflow run release.yml --ref `), it is a dry run sign nothing (Linux, Flatpak, FreeBSD, web) build and check everything, the macOS and Windows jobs are refused by the environment's branch rule, and no draft release is made. +## Release-ref nightly preparation + +The Windows, Linux and macOS preparation for the isolated `EffectCraft Nightly` channel is +documented in [`nightly-release-preparation.md`](nightly-release-preparation.md). The producer +(`nightly.yml`, default branch) and the signer (`nightly-sign.yml`, `release`) keep only their exact +context guards: they run when one of the reviewed manual actors dispatches them, never on a schedule, +and the v3 policy is installed at [`.github/nightly-signing-policy.json`](../.github/nightly-signing-policy.json). +Stable `release.yml`, its schedule, tags, concurrency, environment values and environment rules are +unchanged. + +Every Linux Nightly format starts the GUI through the Nightly profile +(`--launch-profile nightly-v1 --profile-root --`), so its settings, logs, plug-ins, recovery +and caches are its own: the deb/rpm wrapper, the AppImage `AppRun`, the Flatpak wrapper, the Arch +launcher and the `effectcraft` launcher inside the flat Nightly tar (the GUI beside it is +`effectcraft-bin`). A wrapper answers `--version`/`-V` first, and passes an already-selected profile +through, because after the injected `--` either would be a file name. The Nightly Flatpak is the one +sandbox whose own instance id (`ai.storyteller.effectcraft.nightly`) may carry a profile. + +Initial installation **and later signer/policy updates** ride an already-intended reviewed stable +release sync, with an appropriate version/build state. Every release-branch push may rebuild or +update a stable draft, or refuse an already-published version. An urgent change that cannot wait +means pausing nightlies with the existing workflow controls and requesting one bounded maintenance +push with its exact stable consequences understood. Pausing must never require a release push. Do +not bypass CI, overwrite a stable release or make a dummy version bump. + +Nightlies share the existing Windows signing identity with stable, so a suspected key or signing +service compromise affects **both** channels: stop the nightly workflows, notify the release +maintainers privately, and have the identity's owner revoke/rotate it and assess already-signed +packages. + ## What gets built | Platform | Artifacts | Built on | diff --git a/packaging/linux/flatpak-bundle.sh b/packaging/linux/flatpak-bundle.sh index a171582bb..2d3ceb869 100755 --- a/packaging/linux/flatpak-bundle.sh +++ b/packaging/linux/flatpak-bundle.sh @@ -17,6 +17,12 @@ set -euo pipefail . "$(dirname "${BASH_SOURCE[0]}")/../env.sh" HERE="$ROOT/packaging/linux" APP_ID=ai.storyteller.effectcraft +FLATPAK_ID="$APP_ID" +# The remote indexes both app IDs on the stable ref branch; IDs isolate installations. +FLATPAK_BRANCH=stable +if [[ "${EFFECTCRAFT_BUILD_CHANNEL:-}" == nightly-v1 || "$VERSION" == *-nightly* ]]; then + FLATPAK_ID="$APP_ID.nightly" +fi FLATHUB=https://dl.flathub.org/repo/flathub.flatpakrepo TEST=1 @@ -52,29 +58,67 @@ rm -rf "$WORK" mkdir -p "$WORK/stage" tar -xzf "$TARBALL" -C "$WORK/stage" --strip-components=1 [[ -x "$WORK/stage/bin/effectcraft" ]] || { echo "error: $TARBALL has no bin/effectcraft" >&2; exit 1; } -cp "$HERE/flatpak/$APP_ID.bundle.yml" "$WORK/$APP_ID.yml" +if [[ "$FLATPAK_ID" != "$APP_ID" ]]; then + mv "$WORK/stage/bin/effectcraft" "$WORK/stage/bin/effectcraft-bin" + # The Nightly build refuses EFFECTCRAFT_CONFIG_DIR, so the wrapper passes the profile protocol. + # Inside the sandbox $HOME is this app id's own folder, so the profile is the Nightly's alone. + cat >"$WORK/stage/bin/effectcraft" <<'WRAPPER' +#!/bin/sh +set -eu +real_bin=/app/libexec/effectcraft +case "${1:-}" in + --version|-V|--launch-profile) exec "$real_bin" "$@" ;; +esac +profile_base="${XDG_DATA_HOME:-${HOME:?HOME is required}/.local/share}" +exec "$real_bin" --launch-profile nightly-v1 --profile-root "$profile_base/effectcraft-nightly" -- "$@" +WRAPPER + chmod 755 "$WORK/stage/bin/effectcraft" + sed -e "s|^Icon=$APP_ID$|Icon=$FLATPAK_ID|" \ + -e "s|^Name=EffectCraft$|Name=EffectCraft Nightly|" \ + -e 's|^StartupWMClass=.*|StartupWMClass=ai.storyteller.effectcraft.nightly-v1|' \ + -e '/^MimeType=/d' \ + "$WORK/stage/share/applications/$APP_ID.desktop" >"$WORK/stage/share/applications/$FLATPAK_ID.desktop" + rm -f "$WORK/stage/share/applications/$APP_ID.desktop" + sed -e "s|$APP_ID|$FLATPAK_ID|g" \ + -e "s|EffectCraft|EffectCraft Nightly|g" \ + -e "s|$APP_ID.desktop|$FLATPAK_ID.desktop|g" \ + -e "s|$APP_ID|$FLATPAK_ID|g" \ + "$WORK/stage/share/metainfo/$APP_ID.metainfo.xml" >"$WORK/stage/share/metainfo/$FLATPAK_ID.metainfo.xml" + rm -f "$WORK/stage/share/metainfo/$APP_ID.metainfo.xml" + mv "$WORK/stage/share/mime/packages/$APP_ID.xml" "$WORK/stage/share/mime/packages/$FLATPAK_ID.xml" + NIGHTLY_ICON="$ROOT/assets/app-icon/effectcraft-nightly.png" + [[ -f "$NIGHTLY_ICON" ]] || NIGHTLY_ICON="$ROOT/assets/app-icon/hicolor/256x256/apps/$APP_ID.png" + rm -rf "$WORK/stage/share/icons/hicolor" + install -Dm644 "$NIGHTLY_ICON" \ + "$WORK/stage/share/icons/hicolor/256x256/apps/$FLATPAK_ID.png" + sed -e "s|ai\.storyteller\.effectcraft|$FLATPAK_ID|g" \ + -e 's|- install -Dm755 bin/effectcraft /app/bin/effectcraft|- install -Dm755 bin/effectcraft-bin /app/libexec/effectcraft\n - install -Dm755 bin/effectcraft /app/bin/effectcraft|' \ + "$HERE/flatpak/$APP_ID.bundle.yml" >"$WORK/$FLATPAK_ID.yml" +else + cp "$HERE/flatpak/$APP_ID.bundle.yml" "$WORK/$FLATPAK_ID.yml" +fi flatpak remote-add --user --if-not-exists flathub "$FLATHUB" # --disable-rofiles-fuse: no FUSE in containers and CI runners. flatpak-builder --user --install-deps-from=flathub --disable-rofiles-fuse --force-clean \ - --default-branch=stable --repo="$WORK/repo" --state-dir="$WORK/state" "$WORK/build" "$WORK/$APP_ID.yml" + --default-branch="$FLATPAK_BRANCH" --repo="$WORK/repo" --state-dir="$WORK/state" "$WORK/build" "$WORK/$FLATPAK_ID.yml" OUT="$DIST/$BASENAME.flatpak" # --runtime-repo lets `flatpak install` fetch the freedesktop runtime from Flathub if missing. -flatpak build-bundle --runtime-repo="$FLATHUB" "$WORK/repo" "$OUT" "$APP_ID" stable +flatpak build-bundle --runtime-repo="$FLATHUB" "$WORK/repo" "$OUT" "$FLATPAK_ID" "$FLATPAK_BRANCH" echo "wrote $OUT" if [[ "$OCI" = 1 ]]; then OUT_OCI="$DIST/$BASENAME-oci" rm -rf "$OUT_OCI" - flatpak build-bundle --oci "$WORK/repo" "$OUT_OCI" "$APP_ID" stable + flatpak build-bundle --oci "$WORK/repo" "$OUT_OCI" "$FLATPAK_ID" "$FLATPAK_BRANCH" echo "wrote OCI layout to $OUT_OCI" fi if [[ "$TEST" = 1 ]]; then flatpak install --user -y --noninteractive --reinstall "$OUT" - flatpak info --user "$APP_ID" - flatpak run --command=effectcraft-cli "$APP_ID" --version - flatpak run --command=sh "$APP_ID" -c 'ls /app/share/applications /app/share/metainfo /app/share/mime/packages /app/share/icons/hicolor/scalable/apps' + flatpak info --user "$FLATPAK_ID" + flatpak run --command=effectcraft-cli "$FLATPAK_ID" --version + flatpak run --command=sh "$FLATPAK_ID" -c 'ls /app/share/applications /app/share/metainfo /app/share/mime/packages /app/share/icons/hicolor/*/apps' fi echo "==> done" ls -lh "$OUT" diff --git a/packaging/linux/nfpm.yaml b/packaging/linux/nfpm.yaml index ec9612159..7b0cb3201 100644 --- a/packaging/linux/nfpm.yaml +++ b/packaging/linux/nfpm.yaml @@ -3,7 +3,7 @@ # exports VERSION and NFPM_ARCH. # # nfpm package -f packaging/linux/nfpm.yaml -p deb -t dist/release/ -name: effectcraft +name: ${NFPM_NAME} arch: ${NFPM_ARCH} platform: linux version: ${VERSION} @@ -65,12 +65,15 @@ overrides: - xdg-desktop-portal contents: - - src: ${STAGE}/usr/bin/effectcraft - dst: /usr/bin/effectcraft + - src: ${STAGE}/usr/bin/${NFPM_BIN} + dst: /usr/bin/${NFPM_BIN} file_info: { mode: 0755 } - - src: ${STAGE}/usr/bin/effectcraft-cli - dst: /usr/bin/effectcraft-cli + - src: ${STAGE}/usr/bin/${NFPM_CLI} + dst: /usr/bin/${NFPM_CLI} file_info: { mode: 0755 } + - src: ${STAGE}/usr/lib/ + dst: /usr/lib/ + type: tree - src: ${STAGE}/usr/share/ dst: /usr/share/ type: tree diff --git a/packaging/linux/nightly-arch-launch.sh b/packaging/linux/nightly-arch-launch.sh new file mode 100644 index 000000000..108ef89b6 --- /dev/null +++ b/packaging/linux/nightly-arch-launch.sh @@ -0,0 +1,13 @@ +#!/bin/sh +# EffectCraft Nightly handoff for the Arch packager: the hidden binary is the real GUI, and this +# launcher gives it the Nightly profile. The Nightly build refuses EFFECTCRAFT_CONFIG_DIR, so the +# profile is passed as the Launcher's own protocol; a version query (or an already selected +# profile) passes through, because after `--` both would be file names. +set -eu + +real_bin="$(dirname "$0")/.effectcraft-nightly/effectcraft" +case "${1:-}" in + --version|-V|--launch-profile) exec "$real_bin" "$@" ;; +esac +profile_base="${XDG_DATA_HOME:-${HOME:?HOME is required}/.local/share}" +exec "$real_bin" --launch-profile nightly-v1 --profile-root "$profile_base/effectcraft-nightly" -- "$@" diff --git a/packaging/linux/nightly-arch-tar-test.sh b/packaging/linux/nightly-arch-tar-test.sh new file mode 100755 index 000000000..8ae45dd30 --- /dev/null +++ b/packaging/linux/nightly-arch-tar-test.sh @@ -0,0 +1,58 @@ +#!/usr/bin/env bash +# Validate the staged Arch launcher without building or opening EffectCraft. +set -euo pipefail + +HERE="$(cd "$(dirname "$0")" && pwd)" +work="$(mktemp -d)" +trap 'rm -rf "$work"' EXIT +stage="$work/source" +dst="$work/dist" +base=effectcraft-0.0.1-nightly.1-linux-x86_64 +mkdir -p "$stage/bin" "$dst" "$work/extract" + +# A local argv recorder stands in for the compiled binaries. It never opens a UI. +cat >"$stage/bin/effectcraft" <<'RECORDER' +#!/bin/sh +printf '<%s>\n' "$@" +RECORDER +chmod 755 "$stage/bin/effectcraft" +cp "$stage/bin/effectcraft" "$stage/bin/effectcraft-cli" + +bash "$HERE/nightly-arch-tar.sh" "$stage" "$work/stage" "$dst" "$base" +tar -xzf "$dst/$base.tar.gz" -C "$work/extract" +bin="$work/extract/$base/bin" +# Simulate the existing Arch bin-tree copy and public launcher rename. +mkdir -p "$work/installed" +cp -R "$bin" "$work/installed/bin" +bin="$work/installed/bin" +mv "$bin/effectcraft" "$bin/effectcraft-nightly" +mv "$bin/effectcraft-cli" "$bin/effectcraft-nightly-cli" + +[[ ! -e "$stage/bin/.effectcraft-nightly" ]] +cmp "$stage/bin/effectcraft" "$bin/.effectcraft-nightly/effectcraft" +cmp "$stage/bin/effectcraft-cli" "$bin/effectcraft-nightly-cli" +# The launcher must start the hidden GUI through the Nightly profile; the profile base is fixed +# here so the recorded arguments are exactly comparable. +export XDG_DATA_HOME="$work/xdg-data" +profile() { + printf '<%s>\n' --launch-profile nightly-v1 --profile-root "$XDG_DATA_HOME/effectcraft-nightly" -- "$@" +} +expect() { + expected="$1" + shift + actual=$(PATH="$bin:$PATH" effectcraft-nightly "$@") + if [[ "$actual" != "$expected" ]]; then + printf 'expected:\n%s\nactual:\n%s\n' "$expected" "$actual" >&2 + exit 1 + fi +} +expect "$(profile)" +expect "$(profile 'project with spaces.ec' '--other-name.ec')" \ + 'project with spaces.ec' '--other-name.ec' +# A version query and an already selected profile pass through unchanged: after `--` both are files. +expect '<--version>' --version +expect '<-V>' -V +expect "$(printf '<%s>\n' --launch-profile nightly-v1 --profile-root "$work/launcher-root" --version)" \ + --launch-profile nightly-v1 --profile-root "$work/launcher-root" --version + +echo "PASS: Arch Nightly handoff starts the hidden GUI through the Nightly launch profile" diff --git a/packaging/linux/nightly-arch-tar.sh b/packaging/linux/nightly-arch-tar.sh new file mode 100755 index 000000000..75e356bf8 --- /dev/null +++ b/packaging/linux/nightly-arch-tar.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +# Stage the EffectCraft Nightly-only handoff for the Arch packager. +set -euo pipefail + +here="$(cd "$(dirname "$0")" && pwd)" +source_tree="$1" +work="$2" +destination="$3" +basename="$4" +stage="$work/$basename" + +mkdir -p "$work" +cp -R "$source_tree" "$stage" +mkdir "$stage/bin/.effectcraft-nightly" +mv "$stage/bin/effectcraft" "$stage/bin/.effectcraft-nightly/effectcraft" +cp "$here/nightly-arch-launch.sh" "$stage/bin/effectcraft" +chmod 755 "$stage/bin/effectcraft" +tar -C "$work" -czf "$destination/$basename.tar.gz" "$basename" +echo "wrote $destination/$basename.tar.gz" diff --git a/packaging/linux/nightly-launch-test.sh b/packaging/linux/nightly-launch-test.sh new file mode 100755 index 000000000..90131c9fb --- /dev/null +++ b/packaging/linux/nightly-launch-test.sh @@ -0,0 +1,53 @@ +#!/usr/bin/env bash +# Validate the launcher inside the flat Nightly tar without building or opening EffectCraft. +set -euo pipefail + +HERE="$(cd "$(dirname "$0")" && pwd)" +work="$(mktemp -d)" +trap 'rm -rf "$work"' EXIT +stage="$work/unpacked" +mkdir -p "$stage" + +# A local argv recorder stands in for the compiled GUI, which the launcher starts as `effectcraft-bin`. +cat >"$stage/effectcraft-bin" <<'RECORDER' +#!/bin/sh +printf '<%s>\n' "$@" +RECORDER +chmod 755 "$stage/effectcraft-bin" +cp "$HERE/nightly-launch.sh" "$stage/effectcraft" +chmod 755 "$stage/effectcraft" + +# A fixed profile base keeps the recorded arguments exactly comparable. +export XDG_DATA_HOME="$work/xdg-data" +profile() { + printf '<%s>\n' --launch-profile nightly-v1 --profile-root "$XDG_DATA_HOME/effectcraft-nightly" -- "$@" +} +expect() { + expected="$1" + shift + actual=$("$stage/effectcraft" "$@") + if [[ "$actual" != "$expected" ]]; then + printf 'expected:\n%s\nactual:\n%s\n' "$expected" "$actual" >&2 + exit 1 + fi +} +expect "$(profile)" +expect "$(profile 'project with spaces.ec' '--other-name.ec')" 'project with spaces.ec' '--other-name.ec' +# A version query and an already selected profile pass through: after `--` both would be files. +expect '<--version>' --version +expect '<-V>' -V +expect "$(printf '<%s>\n' --launch-profile nightly-v1 --profile-root "$work/launcher-root" --version)" \ + --launch-profile nightly-v1 --profile-root "$work/launcher-root" --version +# HOME is the only other base, and the profile root is never optional. +home_run=$(env -u XDG_DATA_HOME HOME="$work/home" "$stage/effectcraft") +expected_home=$(printf '<%s>\n' --launch-profile nightly-v1 --profile-root "$work/home/.local/share/effectcraft-nightly" --) +if [[ "$home_run" != "$expected_home" ]]; then + printf 'expected:\n%s\nactual:\n%s\n' "$expected_home" "$home_run" >&2 + exit 1 +fi +if env -u XDG_DATA_HOME -u HOME "$stage/effectcraft" >/dev/null 2>&1; then + echo 'a launcher without HOME must refuse rather than start with the stable profile' >&2 + exit 1 +fi + +echo "PASS: the flat Nightly tar's launcher starts the GUI through the Nightly launch profile" diff --git a/packaging/linux/nightly-launch.sh b/packaging/linux/nightly-launch.sh new file mode 100755 index 000000000..7edb84e97 --- /dev/null +++ b/packaging/linux/nightly-launch.sh @@ -0,0 +1,13 @@ +#!/bin/sh +# The launcher inside EffectCraft Nightly's flat tar: an unpacked copy is isolated like the +# packages, so it never falls back to the stable settings folder. The GUI itself is `effectcraft-bin`; +# `effectcraft` is the name people run, and the version query still answers from it. +set -eu + +here="$(dirname "$0")" +real_bin="$here/effectcraft-bin" +case "${1:-}" in + --version|-V|--launch-profile) exec "$real_bin" "$@" ;; +esac +profile_base="${XDG_DATA_HOME:-${HOME:?HOME is required}/.local/share}" +exec "$real_bin" --launch-profile nightly-v1 --profile-root "$profile_base/effectcraft-nightly" -- "$@" diff --git a/packaging/linux/nightly.sh b/packaging/linux/nightly.sh new file mode 100755 index 000000000..e1d47b17a --- /dev/null +++ b/packaging/linux/nightly.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash +# App-owned GUI-only nightly tar: no FUSE/AppImage, CLI, association or install hooks. +set -euo pipefail +ARCH= +while [[ $# -gt 0 ]]; do + case "$1" in + --arch) [[ $# -ge 2 ]] || { echo 'missing --arch value' >&2; exit 2; }; ARCH="$2"; shift 2 ;; + -h|--help) echo 'Usage: nightly.sh --arch x86_64'; exit 0 ;; + *) echo "unsupported nightly argument: $1" >&2; exit 2 ;; + esac +done +[[ "$ARCH" == x86_64 && "$(uname -s)" == Linux ]] || { echo 'only native Linux x86_64 nightly packaging is supported' >&2; exit 2; } +# shellcheck source=../nightly-common.sh +. "$(dirname "${BASH_SOURCE[0]}")/../nightly-common.sh" +nightly_init linux "$ARCH" x86_64-unknown-linux-gnu +OUTPUT="$DIST/effectcraft-$VERSION-linux-x86_64-nightly.tar.gz" +[[ ! -e "$OUTPUT" && ! -L "$OUTPUT" ]] || nightly_die 'refusing to replace an existing nightly archive' +nightly_build_gui +STAGE="$NIGHTLY_WORK/stage" +mkdir -p "$STAGE" +# An unpacked tar is isolated too: the GUI is `effectcraft-bin` and the launcher people run is +# `effectcraft`, which starts it through this channel's own profile. +cp "$NIGHTLY_GUI" "$STAGE/effectcraft-bin" +chmod 755 "$STAGE/effectcraft-bin" +cp "$ROOT/packaging/linux/nightly-launch.sh" "$STAGE/effectcraft" +chmod 755 "$STAGE/effectcraft" +cp "$ROOT/assets/app-icon/effectcraft-nightly.png" "$STAGE/effectcraft-nightly.png" +nightly_copy_notices "$STAGE" +# The private mktemp cwd is the helper authority root, not a CLI path parent. +(cd "$NIGHTLY_WORK" && python3 "$ROOT/packaging/nightly-archive.py" linux stage archive.tar.gz) +nightly_publish_archive "$NIGHTLY_WORK/archive.tar.gz" "$OUTPUT" diff --git a/packaging/linux/package.sh b/packaging/linux/package.sh index 12016f6cd..784771190 100755 --- a/packaging/linux/package.sh +++ b/packaging/linux/package.sh @@ -7,7 +7,7 @@ # $DIST/effectcraft--linux-.rpm Fedora, openSUSE, RHEL, ... # $DIST/effectcraft--linux-.tar.gz plain FHS-style tree (bin/, share/) # -# Usage: packaging/linux/package.sh [--skip-build] [--formats "appimage deb rpm tar"] +# Usage: packaging/linux/package.sh [--skip-build] [--formats "appimage deb rpm tar"] [--arch-tar-dir DIRECTORY] # # Needs: cargo; nfpm for deb/rpm (https://nfpm.goreleaser.com); appimagetool for the AppImage # (downloaded into $CARGO_TARGET_DIR if missing). Build on an old distro (CI: Ubuntu 22.04, @@ -25,10 +25,16 @@ APP_ID=ai.storyteller.effectcraft SKIP_BUILD=0 FORMATS="appimage deb rpm tar" +ARCH_TAR_DIR= while [[ $# -gt 0 ]]; do case "$1" in --skip-build) SKIP_BUILD=1; shift ;; --formats) FORMATS="$2"; shift 2 ;; + --arch-tar-dir) + [[ -n "${2:-}" ]] || { echo "error: --arch-tar-dir needs a directory" >&2; exit 2; } + ARCH_TAR_DIR="$2" + shift 2 + ;; -h | --help) sed -n '2,19p' "$0"; exit 0 ;; *) echo "unknown argument: $1" >&2; exit 2 ;; esac @@ -42,9 +48,24 @@ case "$ARCH" in *) echo "unsupported architecture $ARCH" >&2; exit 2 ;; esac export EFFECTCRAFT_MAINTAINER="${EFFECTCRAFT_MAINTAINER:-EffectCraft maintainers }" -BASENAME="effectcraft-$VERSION-linux-$ARCH" +IS_NIGHTLY=0 +if [[ "${EFFECTCRAFT_BUILD_CHANNEL:-}" == nightly-v1 || "$VERSION" == *-nightly* ]]; then + IS_NIGHTLY=1 + export EFFECTCRAFT_BUILD_CHANNEL=nightly-v1 + export EFFECTCRAFT_OVERRIDE_VERSION="$VERSION" +fi +ARTIFACT_VERSION="$VERSION" +if [[ "$IS_NIGHTLY" = 1 && "$ARTIFACT_VERSION" != *-nightly* ]]; then + ARTIFACT_VERSION="$ARTIFACT_VERSION-nightly" +fi +BASENAME="effectcraft-$ARTIFACT_VERSION-linux-$ARCH" -echo "==> EffectCraft $VERSION for Linux $ARCH ($FORMATS)" +if [[ -n "$ARCH_TAR_DIR" && "$IS_NIGHTLY" != 1 ]]; then + echo "error: --arch-tar-dir is only for Nightly builds" >&2 + exit 2 +fi + +echo "==> EffectCraft $VERSION for Linux $ARCH ($FORMATS, channel=${EFFECTCRAFT_BUILD_CHANNEL:-stable})" if [[ "$SKIP_BUILD" = 0 ]]; then if [[ -n "${CROSS_TARGET:-}" ]]; then @@ -63,6 +84,11 @@ install -Dm755 "$BIN/effectcraft" "$STAGE/usr/bin/effectcraft" install -Dm755 "$BIN/effectcraft-cli" "$STAGE/usr/bin/effectcraft-cli" "${CROSS_COMPILE:-}strip" "$STAGE/usr/bin/effectcraft" "$STAGE/usr/bin/effectcraft-cli" 2>/dev/null || true install -Dm644 "$HERE/$APP_ID.desktop" "$STAGE/usr/share/applications/$APP_ID.desktop" +if [[ "$IS_NIGHTLY" = 1 ]]; then + sed -e 's|^StartupWMClass=.*|StartupWMClass=ai.storyteller.effectcraft.nightly-v1|' \ + "$STAGE/usr/share/applications/$APP_ID.desktop" >"$STAGE/usr/share/applications/$APP_ID.desktop.tmp" + mv "$STAGE/usr/share/applications/$APP_ID.desktop.tmp" "$STAGE/usr/share/applications/$APP_ID.desktop" +fi install -Dm644 "$HERE/$APP_ID.mime.xml" "$STAGE/usr/share/mime/packages/$APP_ID.xml" mkdir -p "$STAGE/usr/share/metainfo" sed -e "s/@VERSION@/$VERSION/g" -e "s/@DATE@/$EFFECTCRAFT_BUILD_DATE/g" \ @@ -97,13 +123,92 @@ if has tar; then echo "wrote $DIST/$BASENAME.tar.gz" fi +# The Arch handoff keeps the same basename as the plain tarball in a separate directory. +# Flatpak, OCI and direct tar consumers still get the original binary, not this launcher. +if [[ -n "$ARCH_TAR_DIR" ]]; then + mkdir -p "$ARCH_TAR_DIR" + if [[ "$(cd "$ARCH_TAR_DIR" && pwd -P)" == "$(cd "$DIST" && pwd -P)" ]]; then + echo "error: the Arch tar directory must differ from the release directory" >&2 + exit 2 + fi + bash "$HERE/nightly-arch-tar.sh" "$STAGE/usr" "$WORK/arch-tar" "$ARCH_TAR_DIR" "$BASENAME" +fi + # ---- .deb / .rpm -------------------------------------------------------------------------------- if has deb || has rpm; then command -v nfpm >/dev/null || { echo "error: nfpm not found (https://nfpm.goreleaser.com/install/)" >&2; exit 1; } export VERSION export NFPM_ARCH="$DEB_ARCH" + NFPM_STAGE="$STAGE" + export NFPM_NAME="effectcraft" + export NFPM_BIN="effectcraft" + export NFPM_CLI="effectcraft-cli" + if [[ "$IS_NIGHTLY" = 1 ]]; then + NIGHTLY_DESK_ID="$APP_ID.nightly-v1" + export NFPM_NAME="effectcraft-nightly" + export NFPM_BIN="effectcraft-nightly" + export NFPM_CLI="effectcraft-nightly-cli" + NFPM_STAGE="$WORK/nfpm-root" + rm -rf "$NFPM_STAGE" + cp -R "$STAGE" "$NFPM_STAGE" + install -Dm755 "$NFPM_STAGE/usr/bin/effectcraft" "$NFPM_STAGE/usr/lib/effectcraft-nightly/effectcraft" + # The Nightly build refuses EFFECTCRAFT_CONFIG_DIR: every launcher passes the Launcher's own + # profile protocol instead, so settings, logs, plug-ins and caches are the Nightly's own. + # A version query and an already-selected profile pass through, because after `--` they are + # file names (the shared smoke test asks the Launcher form of the unpacked binary). + cat >"$NFPM_STAGE/usr/bin/$NFPM_BIN" <<'WRAPPER' +#!/bin/sh +set -eu +real_bin=/usr/lib/effectcraft-nightly/effectcraft +case "${1:-}" in + --version|-V|--launch-profile) exec "$real_bin" "$@" ;; +esac +profile_base="${XDG_DATA_HOME:-${HOME:?HOME is required}/.local/share}" +exec "$real_bin" --launch-profile nightly-v1 --profile-root "$profile_base/effectcraft-nightly" -- "$@" +WRAPPER + chmod 755 "$NFPM_STAGE/usr/bin/$NFPM_BIN" + rm -f "$NFPM_STAGE/usr/bin/effectcraft" + # The headless CLI has no launch profile; it keeps the settings-folder variable it honours. + install -Dm755 "$NFPM_STAGE/usr/bin/effectcraft-cli" "$NFPM_STAGE/usr/lib/effectcraft-nightly/effectcraft-cli" + rm -f "$NFPM_STAGE/usr/bin/effectcraft-cli" + cat >"$NFPM_STAGE/usr/bin/$NFPM_CLI" <<'CLI_WRAPPER' +#!/bin/sh +set -eu +if [ -z "${EFFECTCRAFT_CONFIG_DIR:-}" ]; then + profile_base="${XDG_DATA_HOME:-${HOME:?HOME is required}/.local/share}" + export EFFECTCRAFT_CONFIG_DIR="$profile_base/effectcraft-nightly" +fi +exec /usr/lib/effectcraft-nightly/effectcraft-cli "$@" +CLI_WRAPPER + chmod 755 "$NFPM_STAGE/usr/bin/$NFPM_CLI" + mv "$NFPM_STAGE/usr/share/doc/effectcraft" "$NFPM_STAGE/usr/share/doc/$NFPM_NAME" + sed -e "s#^Exec=effectcraft\([[:space:]]\|$\)#Exec=$NFPM_BIN\1#" \ + -e "s|^TryExec=effectcraft$|TryExec=$NFPM_BIN|" \ + -e "s|^Icon=$APP_ID$|Icon=$NIGHTLY_DESK_ID|" \ + -e "s|^Name=EffectCraft$|Name=EffectCraft Nightly|" \ + -e '/^MimeType=/d' \ + "$NFPM_STAGE/usr/share/applications/$APP_ID.desktop" >"$NFPM_STAGE/usr/share/applications/$NIGHTLY_DESK_ID.desktop" + rm -f "$NFPM_STAGE/usr/share/applications/$APP_ID.desktop" + sed -e "s|$APP_ID|$NIGHTLY_DESK_ID|g" \ + -e "s|EffectCraft|EffectCraft Nightly|g" \ + -e "s|$APP_ID.desktop|$NIGHTLY_DESK_ID.desktop|g" \ + -e "s|$APP_ID|$NIGHTLY_DESK_ID|g" \ + -e "s|effectcraft|$NFPM_BIN|g" \ + "$NFPM_STAGE/usr/share/metainfo/$APP_ID.metainfo.xml" >"$NFPM_STAGE/usr/share/metainfo/$NIGHTLY_DESK_ID.metainfo.xml" + rm -f "$NFPM_STAGE/usr/share/metainfo/$APP_ID.metainfo.xml" + rm -rf "$NFPM_STAGE/usr/share/mime" + NIGHTLY_ICON="$ROOT/assets/app-icon/effectcraft-nightly.png" + [[ -f "$NIGHTLY_ICON" ]] || NIGHTLY_ICON="$ROOT/assets/app-icon/hicolor/256x256/apps/$APP_ID.png" + rm -rf "$NFPM_STAGE/usr/share/icons/hicolor" + install -Dm644 "$NIGHTLY_ICON" \ + "$NFPM_STAGE/usr/share/icons/hicolor/256x256/apps/$NIGHTLY_DESK_ID.png" + fi # nfpm expands env vars in fields like `version` and `arch`, but not in `contents[].src`. - sed "s|\${STAGE}|$STAGE|g" "$HERE/nfpm.yaml" >"$WORK/nfpm.yaml" + DROP_LIB_TREE= + # shellcheck disable=SC2016 + [[ -d "$NFPM_STAGE/usr/lib" ]] || DROP_LIB_TREE='\|^ - src: \${STAGE}/usr/lib/|,+2d;' + # shellcheck disable=SC2016 + sed "${DROP_LIB_TREE}s|\${STAGE}|$NFPM_STAGE|g;s|\${NFPM_BIN}|$NFPM_BIN|g;s|\${NFPM_CLI}|$NFPM_CLI|g" "$HERE/nfpm.yaml" >"$WORK/nfpm.yaml" for fmt in deb rpm; do if has "$fmt"; then (cd "$ROOT" && nfpm package -f "$WORK/nfpm.yaml" -p "$fmt" -t "$DIST/$BASENAME.$fmt"); fi done @@ -132,10 +237,52 @@ if has appimage; then cp -R "$STAGE" "$APPDIR" # Keep sctk-adwaita's MIT notice in the AppImage. install -Dm644 "$ROOT/NOTICE" "$APPDIR/usr/share/doc/effectcraft/NOTICE" - ln -s usr/bin/effectcraft "$APPDIR/AppRun" - cp "$HERE/$APP_ID.desktop" "$APPDIR/$APP_ID.desktop" - cp "$ROOT/assets/app-icon/hicolor/256x256/apps/$APP_ID.png" "$APPDIR/$APP_ID.png" - ln -s "$APP_ID.png" "$APPDIR/.DirIcon" + if [[ "$IS_NIGHTLY" = 1 ]]; then + # A script, not the stable symlink: the AppImage starts the GUI through the Nightly profile. + cat >"$APPDIR/AppRun" <<'APPRUN' +#!/bin/sh +set -eu +here="$(dirname "$0")" +real_bin="$here/usr/bin/effectcraft" +case "${1:-}" in + --version|-V|--launch-profile) exec "$real_bin" "$@" ;; +esac +profile_base="${XDG_DATA_HOME:-${HOME:?HOME is required}/.local/share}" +exec "$real_bin" --launch-profile nightly-v1 --profile-root "$profile_base/effectcraft-nightly" -- "$@" +APPRUN + chmod 755 "$APPDIR/AppRun" + # The headless CLI keeps the settings-folder variable, which is the only profile it honours. + install -Dm755 "$APPDIR/usr/bin/effectcraft-cli" "$APPDIR/usr/lib/effectcraft-nightly/effectcraft-cli" + cat >"$APPDIR/usr/bin/effectcraft-cli" <<'APPRUN_CLI' +#!/bin/sh +set -eu +if [ -z "${EFFECTCRAFT_CONFIG_DIR:-}" ]; then + profile_base="${XDG_DATA_HOME:-${HOME:?HOME is required}/.local/share}" + export EFFECTCRAFT_CONFIG_DIR="$profile_base/effectcraft-nightly" +fi +exec "$(dirname "$0")/../lib/effectcraft-nightly/effectcraft-cli" "$@" +APPRUN_CLI + chmod 755 "$APPDIR/usr/bin/effectcraft-cli" + APPIMAGE_ID="$APP_ID.nightly-v1" + sed -e "s|^Icon=$APP_ID$|Icon=$APPIMAGE_ID|" \ + -e "s|^Name=EffectCraft$|Name=EffectCraft Nightly|" \ + -e '/^MimeType=/d' \ + "$APPDIR/usr/share/applications/$APP_ID.desktop" >"$APPDIR/usr/share/applications/$APPIMAGE_ID.desktop" + rm -f "$APPDIR/usr/share/applications/$APP_ID.desktop" + cp "$APPDIR/usr/share/applications/$APPIMAGE_ID.desktop" "$APPDIR/$APPIMAGE_ID.desktop" + NIGHTLY_ICON="$ROOT/assets/app-icon/effectcraft-nightly.png" + [[ -f "$NIGHTLY_ICON" ]] || NIGHTLY_ICON="$ROOT/assets/app-icon/hicolor/256x256/apps/$APP_ID.png" + rm -rf "$APPDIR/usr/share/icons/hicolor" + install -Dm644 "$NIGHTLY_ICON" \ + "$APPDIR/usr/share/icons/hicolor/256x256/apps/$APPIMAGE_ID.png" + cp "$NIGHTLY_ICON" "$APPDIR/$APPIMAGE_ID.png" + ln -s "$APPIMAGE_ID.png" "$APPDIR/.DirIcon" + else + ln -s usr/bin/effectcraft "$APPDIR/AppRun" + cp "$HERE/$APP_ID.desktop" "$APPDIR/$APP_ID.desktop" + cp "$ROOT/assets/app-icon/hicolor/256x256/apps/$APP_ID.png" "$APPDIR/$APP_ID.png" + ln -s "$APP_ID.png" "$APPDIR/.DirIcon" + fi TOOL="${APPIMAGETOOL:-$(command -v appimagetool || true)}" if [[ -z "$TOOL" ]]; then @@ -176,11 +323,20 @@ if has appimage; then # each AppImage on GitHub Releases. `latest` is the newest published release that is not a # pre-release. A fork's builds point at its own releases through GITHUB_REPOSITORY. REPO="${GITHUB_REPOSITORY:-storytold/effectcraft}" - UPDATE_INFO="gh-releases-zsync|${REPO%%/*}|${REPO#*/}|latest|effectcraft-*-linux-$ARCH.AppImage.zsync" + UPDATE_ARGS=() + if [[ "$IS_NIGHTLY" = 0 ]]; then + UPDATE_INFO="gh-releases-zsync|${REPO%%/*}|${REPO#*/}|latest|effectcraft-*-linux-$ARCH.AppImage.zsync" + UPDATE_ARGS=(-u "$UPDATE_INFO") + else + # Nightly releases are GitHub pre-releases (`latest` only selects stable releases), so point + # zsync update metadata at pre-release tags matching `-nightly` rather than stable `latest`. + UPDATE_INFO="gh-releases-zsync|${REPO%%/*}|${REPO#*/}|latest-pre|effectcraft-*-nightly*-linux-$ARCH.AppImage.zsync" + UPDATE_ARGS=(-u "$UPDATE_INFO") + fi # Extract-and-run: works without FUSE (containers, CI). The output embeds the static runtime, # so users don't need libfuse2 either. With zsyncmake on the host (CI installs the zsync # package) appimagetool also writes the .zsync, into its working directory, hence the cd. - (cd "$DIST" && ARCH="$ARCH" APPIMAGE_EXTRACT_AND_RUN=1 "$TOOL" --no-appstream --runtime-file "$RUNTIME" -u "$UPDATE_INFO" "$APPDIR" "$OUT") + (cd "$DIST" && ARCH="$ARCH" APPIMAGE_EXTRACT_AND_RUN=1 "$TOOL" --no-appstream --runtime-file "$RUNTIME" "${UPDATE_ARGS[@]}" "$APPDIR" "$OUT") echo "wrote $OUT" if [[ -s "$OUT.zsync" ]]; then echo "wrote $OUT.zsync" diff --git a/packaging/macos/nightly-lib.sh b/packaging/macos/nightly-lib.sh new file mode 100644 index 000000000..fa28515ea --- /dev/null +++ b/packaging/macos/nightly-lib.sh @@ -0,0 +1,110 @@ +# shellcheck shell=bash +# Shared checks for the Apple-silicon Nightly scripts (nightly.sh, nightly-sign.sh, nightly-verify.sh). +# Stable packaging (package.sh, verify.sh) does not source this file. The text checks take tool output +# as arguments, so packaging/macos/nightly_sign_tests.py runs them without macOS. + +MAC_NIGHTLY_APP='EffectCraft Nightly.app' +MAC_NIGHTLY_ID='ai.storyteller.effectcraft.nightly' +# The release environment's names, as stable release.yml passes them (packaging/macos/import-cert.sh). +MAC_NIGHTLY_SECRETS=(APPLE_CERTIFICATE APPLE_CERTIFICATE_PASSWORD KEYCHAIN_PASSWORD APPLE_ID APPLE_PASSWORD APPLE_TEAM_ID) + +mac_nightly_die() { printf 'error: %s\n' "$*" >&2; exit 2; } + +# The exact prepared version from the feed asset name, or failure. +mac_nightly_version_from_asset() { + local name="$1" version + [[ "$name" =~ ^effectcraft-(.+)-macos-aarch64-nightly\.zip$ ]] || return 1 + version="${BASH_REMATCH[1]}" + [[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+-nightly\.[0-9]{8}\.[0-9]+\.[0-9]+\.g[0-9a-f]{12}$ ]] || return 1 + printf '%s\n' "$version" +} + +# Every signing and notarization value is set, and the team is one Apple team ID. No ad-hoc fallback. +mac_nightly_require_secrets() { + local name + for name in "${MAC_NIGHTLY_SECRETS[@]}"; do + [[ -n "${!name:-}" ]] || mac_nightly_die "$name is not set: Nightly signing and notarization are required, with no ad-hoc fallback" + done + [[ "$APPLE_TEAM_ID" =~ ^[A-Z0-9]{10}$ ]] || mac_nightly_die 'APPLE_TEAM_ID is not an Apple team ID' + if [[ -n "${NIGHTLY_APPLE_TEAM_ID:-}" && "$NIGHTLY_APPLE_TEAM_ID" != "$APPLE_TEAM_ID" ]]; then + mac_nightly_die 'the signing team differs from the reviewed Nightly team (NIGHTLY_APPLE_TEAM_ID)' + fi +} + +# One line of `security find-identity -v -p codesigning`: the identity is a Developer ID Application of the team. +mac_nightly_identity_is_team() { + local line="$1" identity="$2" team="$3" + [[ "$line" == *" $identity "* && "$line" == *'"Developer ID Application: '*" ($team)\""* ]] +} + +# `codesign -d --verbose=2` of the signed bundle: the Nightly identifier, a Developer ID Application of the +# team, a secure timestamp and the hardened runtime (the checks of verify.sh, made strict). +mac_nightly_check_signature() { + local details="$1" team="$2" ok=0 + grep -Fqx "Identifier=$MAC_NIGHTLY_ID" <<<"$details" || { echo "error: the bundle is not signed as $MAC_NIGHTLY_ID" >&2; ok=1; } + grep -q '^Authority=Developer ID Application:' <<<"$details" || { echo 'error: not signed with a Developer ID Application identity' >&2; ok=1; } + grep -qx "TeamIdentifier=$team" <<<"$details" || { echo 'error: signed by a different team' >&2; ok=1; } + grep -q '^Timestamp=' <<<"$details" || { echo 'error: the signature has no secure timestamp' >&2; ok=1; } + grep -Eq '^CodeDirectory .*flags=0x[0-9a-f]+\([^)]*runtime' <<<"$details" || { echo 'error: not signed with the hardened runtime' >&2; ok=1; } + return "$ok" +} + +# `spctl --assess --type execute -vv`: Gatekeeper accepts the bundle as notarized. +mac_nightly_check_assessment() { + grep -q 'accepted' <<<"$1" && grep -qx 'source=Notarized Developer ID' <<<"$1" +} + +# Before anything is unpacked: every ZIP entry is a regular file or directory inside the one Nightly +# bundle, with no absolute path, `..`, backslash or empty component, and no link or special file. +mac_nightly_check_zip_entries() { + python3 -I - "$1" "$MAC_NIGHTLY_APP" <<'PY' || mac_nightly_die 'the archive has an entry outside the bundle, a link or a special file' +import stat, sys, zipfile +archive, app = sys.argv[1:] +with zipfile.ZipFile(archive) as z: + for info in z.infolist(): + name = info.filename + parts = name.rstrip("/").split("/") + mode = info.external_attr >> 16 + if (name.startswith("/") or "\\" in name or "\0" in name or parts[0] != app + or any(part in ("", ".", "..") for part in parts) + or stat.S_IFMT(mode) not in (0, stat.S_IFREG, stat.S_IFDIR)): + sys.exit(f"refused entry: {name!r}") +PY +} + +# An unpacked payload directory holds exactly the GUI-only Nightly bundle: one thin arm64 EffectCraft +# executable, the Nightly identity and the exact version (no numeric fallback), no CLI, no links or special +# files, no document or URL types. +mac_nightly_check_bundle() { + local payload="$1" version="$2" app entries plist key value + app="$payload/$MAC_NIGHTLY_APP" + entries="$(ls -A "$payload")" + [[ "$entries" == "$MAC_NIGHTLY_APP" && -d "$app" && ! -L "$app" ]] || mac_nightly_die "the archive must hold exactly $MAC_NIGHTLY_APP" + [[ -z "$(find "$payload" ! -type f ! -type d -print -quit)" ]] || mac_nightly_die 'the bundle contains links or special files' + [[ "$(ls -A "$app/Contents/MacOS")" == EffectCraft ]] || mac_nightly_die 'Contents/MacOS must hold only the EffectCraft GUI (no CLI)' + [[ -f "$app/Contents/MacOS/EffectCraft" && -x "$app/Contents/MacOS/EffectCraft" ]] || mac_nightly_die 'missing executable GUI' + [[ "$(lipo -archs "$app/Contents/MacOS/EffectCraft")" == arm64 ]] || mac_nightly_die 'the GUI must be thin arm64' + plist="$app/Contents/Info.plist" + for key in CFBundleIdentifier CFBundleExecutable EffectCraftVersion; do + value="$(plutil -extract "$key" raw -o - "$plist")" || mac_nightly_die "Info.plist has no $key" + case "$key" in + CFBundleIdentifier) [[ "$value" == "$MAC_NIGHTLY_ID" ]] ;; + CFBundleExecutable) [[ "$value" == EffectCraft ]] ;; + EffectCraftVersion) [[ "$value" == "$version" ]] ;; + esac || mac_nightly_die "Info.plist $key is not the prepared Nightly identity" + done + for key in CFBundleDocumentTypes CFBundleURLTypes UTExportedTypeDeclarations UTImportedTypeDeclarations; do + if plutil -extract "$key" xml1 -o - "$plist" >/dev/null 2>&1; then mac_nightly_die "Nightly declares $key"; fi + done +} + +# `stapler validate` asks Apple's CloudKit service, which sometimes drops the connection (error 68) +# though the ticket is there (verify.sh). +mac_nightly_validate_staple() { + local target="$1" attempt + for attempt in 1 2 3 4 5; do + xcrun stapler validate "$target" && return 0 + [[ "$attempt" = 5 ]] || sleep $((attempt * 20)) + done + return 1 +} diff --git a/packaging/macos/nightly-sign.sh b/packaging/macos/nightly-sign.sh new file mode 100755 index 000000000..b338987c4 --- /dev/null +++ b/packaging/macos/nightly-sign.sh @@ -0,0 +1,140 @@ +#!/usr/bin/env bash +# Trusted signing step for the Apple-silicon Nightly, the stable release's macOS signing route +# (import-cert.sh, then package.sh's codesign, notarytool and stapler steps): +# +# nightly-sign.sh --arch aarch64 --input /abs/effectcraft--macos-aarch64-nightly.zip \ +# --output /abs//effectcraft--macos-aarch64-nightly.zip +# +# Input: the unsigned archive nightly.sh made. Output: the same bundle signed with the Developer ID and +# hardened runtime, notarized, with the ticket stapled into the bundle, zipped without extended +# attributes. Writes only that file, never replacing one; the temporary keychain and work directory +# are removed on every exit. +# +# Env (all required, no ad-hoc or unnotarized fallback): APPLE_CERTIFICATE, APPLE_CERTIFICATE_PASSWORD, +# KEYCHAIN_PASSWORD, APPLE_ID, APPLE_PASSWORD, APPLE_TEAM_ID; optional NIGHTLY_APPLE_TEAM_ID (must +# equal APPLE_TEAM_ID) and RUNNER_TEMP (work directory base). +# +# Never compiles, and never runs anything from the payload: the version query runs on the signed +# bundle in a job without secrets (nightly-verify.sh). +set -euo pipefail +HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +# shellcheck source=nightly-lib.sh +. "$HERE/nightly-lib.sh" +# shellcheck source=../nightly-common.sh +. "$HERE/../nightly-common.sh" + +ARCH='' INPUT='' OUTPUT='' +while [[ $# -gt 0 ]]; do + case "$1" in + --arch | --input | --output) + [[ $# -ge 2 ]] || mac_nightly_die "missing $1 value" + case "$1" in --arch) ARCH="$2" ;; --input) INPUT="$2" ;; --output) OUTPUT="$2" ;; esac + shift 2 ;; + -h | --help) sed -n '2,18p' "$0"; exit 0 ;; + *) mac_nightly_die "unsupported argument: $1" ;; + esac +done +[[ "$ARCH" == aarch64 ]] || mac_nightly_die 'only --arch aarch64 is supported' +[[ "$INPUT" == /* && "$OUTPUT" == /* ]] || mac_nightly_die '--input and --output must be absolute paths' +NAME="$(basename -- "$INPUT")" +VERSION="$(mac_nightly_version_from_asset "$NAME")" || mac_nightly_die 'the input is not a prepared Nightly archive name' +[[ "$(basename -- "$OUTPUT")" == "$NAME" ]] || mac_nightly_die 'the output must keep the archive name' +[[ -f "$INPUT" && ! -L "$INPUT" ]] || mac_nightly_die 'the input must be a regular file' +[[ ! -e "$OUTPUT" && ! -L "$OUTPUT" ]] || mac_nightly_die 'refusing to replace an existing output' +[[ -d "$(dirname -- "$OUTPUT")" && ! -L "$(dirname -- "$OUTPUT")" ]] || mac_nightly_die 'the output directory must exist' +mac_nightly_require_secrets +[[ "$(uname -s)" == Darwin ]] || mac_nightly_die 'signing needs macOS (codesign, notarytool, stapler)' + +BASE="${RUNNER_TEMP:-${TMPDIR:-/tmp}}" +WORK="$(mktemp -d "${BASE%/}/effectcraft-nightly-sign.XXXXXX")" +KEYCHAIN="$WORK/effectcraft-signing.keychain-db" +cleanup() { + if [[ -e "$KEYCHAIN" ]]; then security delete-keychain "$KEYCHAIN" >/dev/null 2>&1 || rm -f -- "$KEYCHAIN"; fi + rm -rf -- "$WORK" +} +trap cleanup EXIT + +# ---- identity: import-cert.sh, into this run's private directory ------------------------------ +# An empty GITHUB_ENV makes it print the identity instead of exporting it to later steps. +imported="$(GITHUB_ENV='' RUNNER_TEMP="$WORK" DIST="$WORK/dist" bash "$HERE/import-cert.sh")" +IDENTITY="$(sed -n 's/^MACOS_SIGN_IDENTITY=//p' <<<"$imported")" +[[ "$IDENTITY" =~ ^[0-9A-F]{40}$ && "$(sed -n 's/^MACOS_KEYCHAIN=//p' <<<"$imported")" == "$KEYCHAIN" ]] \ + || mac_nightly_die 'import-cert.sh did not import a signing identity' +mac_nightly_identity_is_team "$(security find-identity -v -p codesigning "$KEYCHAIN" | grep -F " $IDENTITY " || true)" "$IDENTITY" "$APPLE_TEAM_ID" \ + || mac_nightly_die "the imported identity is not a Developer ID Application of team $APPLE_TEAM_ID" +echo "==> EffectCraft Nightly $VERSION for macOS (aarch64), identity: $IDENTITY" + +# ---- the unsigned bundle --------------------------------------------------------------------------- +mac_nightly_check_zip_entries "$INPUT" +ditto -x -k --norsrc --noextattr "$INPUT" "$WORK/payload" +mac_nightly_check_bundle "$WORK/payload" "$VERSION" +APP="$WORK/payload/$MAC_NIGHTLY_APP" + +# ---- package.sh's signing and notarization, with a required Developer ID --------------------------- +sign() { + codesign --force --sign "$IDENTITY" --keychain "$KEYCHAIN" --timestamp "$@" +} + +notarize() { + local file="$1" out id status + echo "==> notarizing $(basename "$file") (this can take a few minutes)" + out="$(xcrun notarytool submit "$file" --apple-id "$APPLE_ID" --password "$APPLE_PASSWORD" \ + --team-id "$APPLE_TEAM_ID" --wait --timeout 1h --output-format json)" || true + echo "$out" + id="$(printf '%s' "$out" | plutil -extract id raw -o - - 2>/dev/null || true)" + status="$(printf '%s' "$out" | plutil -extract status raw -o - - 2>/dev/null || true)" + if [[ "$status" != "Accepted" ]]; then + if [[ -n "$id" ]]; then + # Capped: the shared signer bounds a step's output at 256 KiB. + xcrun notarytool log "$id" --apple-id "$APPLE_ID" --password "$APPLE_PASSWORD" --team-id "$APPLE_TEAM_ID" | head -c 131072 || true + fi + echo "error: notarization of $(basename "$file") failed (status: ${status:-unknown})" >&2 + exit 1 + fi +} + +# Stapling and validating both look the ticket up in Apple's CloudKit service, which can drop the +# connection right after notarization (error 68), so retry the pair (package.sh). +staple() { + local file="$1" attempt + for attempt in 1 2 3 4 5; do + if xcrun stapler staple "$file" && xcrun stapler validate "$file"; then + return + fi + if [[ "$attempt" = 5 ]]; then + echo "error: stapling $(basename "$file") failed after $attempt attempts" >&2 + exit 1 + fi + echo "stapling $(basename "$file") failed (attempt $attempt); retrying in $((attempt * 20))s" >&2 + sleep $((attempt * 20)) + done +} + +# Inside-out: the executable, then the bundle (no --deep on the final signature). +sign --options runtime --entitlements "$HERE/entitlements.plist" "$APP/Contents/MacOS/EffectCraft" +sign --options runtime --entitlements "$HERE/entitlements.plist" "$APP" +codesign --verify --strict --deep --verbose=2 "$APP" +ditto -c -k --keepParent "$APP" "$WORK/notarize.zip" +notarize "$WORK/notarize.zip" +# The ticket goes into the bundle (Contents/CodeResources): the Launcher's extract restores no xattrs. +staple "$APP" + +# ---- the final archive, checked as the Launcher unpacks it ----------------------------------------- +ditto -c -k --norsrc --noextattr --noacl --keepParent "$APP" "$WORK/final.zip" +ditto -x -k --norsrc --noextattr "$WORK/final.zip" "$WORK/check" +mac_nightly_check_bundle "$WORK/check" "$VERSION" +CHECK="$WORK/check/$MAC_NIGHTLY_APP" +codesign --verify --strict --deep --verbose=2 "$CHECK" +mac_nightly_check_signature "$(codesign -d --verbose=2 "$CHECK" 2>&1)" "$APPLE_TEAM_ID" \ + || mac_nightly_die 'the signed bundle is not the required Developer ID signature' +mac_nightly_validate_staple "$CHECK" || mac_nightly_die 'no notarization ticket is stapled into the bundle' +# spctl's lookup can lag a few seconds behind notarytool's "Accepted" (verify.sh). +for attempt in 1 2 3 4 5; do + assessment="$(spctl --assess --type execute -vv "$CHECK" 2>&1)" || true + mac_nightly_check_assessment "$assessment" && break + [[ "$attempt" = 5 ]] || sleep 10 +done +printf '%s\n' "$assessment" +mac_nightly_check_assessment "$assessment" || mac_nightly_die 'Gatekeeper does not accept the bundle as notarized' + +nightly_publish_archive "$WORK/final.zip" "$OUTPUT" diff --git a/packaging/macos/nightly-verify.sh b/packaging/macos/nightly-verify.sh new file mode 100755 index 000000000..4e688479a --- /dev/null +++ b/packaging/macos/nightly-verify.sh @@ -0,0 +1,74 @@ +#!/usr/bin/env bash +# Check an Apple-silicon Nightly archive as the Launcher unpacks it, then ask the GUI its version. +# For a job without signing material (it refuses to run with any), after nightly-sign.sh: +# +# nightly-verify.sh --input /abs/effectcraft--macos-aarch64-nightly.zip --expect signed [--team ID] +# nightly-verify.sh --input /abs/effectcraft--macos-aarch64-nightly.zip --expect unsigned +# +# Both: the archive holds only the GUI-only Nightly bundle with the exact EffectCraftVersion, unpacked +# without extended attributes. `signed` (the feed artifact): Developer ID of the team (--team, else +# NIGHTLY_APPLE_TEAM_ID), hardened runtime, secure timestamp, stapled ticket, Gatekeeper accepts it as +# notarized. `unsigned` (nightly.sh's compile output, e.g. pull-request CI) checks no signature. +# Last, the bundle's GUI answers its version query with an empty environment, both plainly and in the +# Launcher's form `--launch-profile nightly-v1 --profile-root --version` (the shared producer +# smoke): each must exit 0 within 15 seconds, print exactly `EffectCraft (nightly-v1)` and +# write nothing to standard error. +set -euo pipefail +HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +# shellcheck source=nightly-lib.sh +. "$HERE/nightly-lib.sh" + +INPUT='' EXPECT='' TEAM="${NIGHTLY_APPLE_TEAM_ID:-}" +while [[ $# -gt 0 ]]; do + case "$1" in + --input | --expect | --team) + [[ $# -ge 2 ]] || mac_nightly_die "missing $1 value" + case "$1" in --input) INPUT="$2" ;; --expect) EXPECT="$2" ;; --team) TEAM="$2" ;; esac + shift 2 ;; + -h | --help) sed -n '2,15p' "$0"; exit 0 ;; + *) mac_nightly_die "unsupported argument: $1" ;; + esac +done +for name in "${MAC_NIGHTLY_SECRETS[@]}" MACOS_SIGN_IDENTITY MACOS_KEYCHAIN; do + [[ -z "${!name:-}" ]] || mac_nightly_die "refusing to run the payload with signing material in the environment ($name)" +done +[[ "$EXPECT" == signed || "$EXPECT" == unsigned ]] || mac_nightly_die '--expect must be signed or unsigned' +[[ "$EXPECT" == unsigned || "$TEAM" =~ ^[A-Z0-9]{10}$ ]] || mac_nightly_die 'a signed check needs the Apple team ID (--team or NIGHTLY_APPLE_TEAM_ID)' +[[ "$INPUT" == /* && -f "$INPUT" && ! -L "$INPUT" ]] || mac_nightly_die '--input must be an absolute regular file' +VERSION="$(mac_nightly_version_from_asset "$(basename -- "$INPUT")")" || mac_nightly_die 'the input is not a prepared Nightly archive name' +[[ "$(uname -s)" == Darwin && "$(uname -m)" == arm64 ]] || mac_nightly_die 'needs an Apple silicon Mac' + +WORK="$(mktemp -d "${RUNNER_TEMP:-${TMPDIR:-/tmp}}/effectcraft-nightly-verify.XXXXXX")" +trap 'rm -rf -- "$WORK"' EXIT +mac_nightly_check_zip_entries "$INPUT" +ditto -x -k --norsrc --noextattr "$INPUT" "$WORK/payload" +mac_nightly_check_bundle "$WORK/payload" "$VERSION" +APP="$WORK/payload/$MAC_NIGHTLY_APP" + +if [[ "$EXPECT" == signed ]]; then + codesign --verify --strict --deep --verbose=2 "$APP" + mac_nightly_check_signature "$(codesign -d --verbose=2 "$APP" 2>&1)" "$TEAM" \ + || mac_nightly_die 'the bundle is not the required Developer ID signature' + mac_nightly_validate_staple "$APP" || mac_nightly_die 'no notarization ticket is stapled into the bundle' + for attempt in 1 2 3 4 5; do + assessment="$(spctl --assess --type execute -vv "$APP" 2>&1)" || true + mac_nightly_check_assessment "$assessment" && break + [[ "$attempt" = 5 ]] || sleep 10 + done + printf '%s\n' "$assessment" + mac_nightly_check_assessment "$assessment" || mac_nightly_die 'Gatekeeper does not accept the bundle as notarized' +fi + +# macOS has no timeout(1): perl's alarm survives its exec and ends a query that hangs (a dialog, say). +query() { + local out + out="$(env -i HOME="$WORK/home" TMPDIR="$WORK/tmp/" PATH=/usr/bin:/bin \ + /usr/bin/perl -e 'alarm 15; exec @ARGV or die' "$APP/Contents/MacOS/EffectCraft" "$@" 2>"$WORK/stderr")" \ + || mac_nightly_die "the version query ($*) failed or did not finish within 15 s" + [[ ! -s "$WORK/stderr" ]] || mac_nightly_die "the version query ($*) wrote to standard error: $(head -c 2000 "$WORK/stderr")" + [[ "$out" == "EffectCraft $VERSION (nightly-v1)" ]] || mac_nightly_die "the version query ($*) reports '$out', not EffectCraft $VERSION (nightly-v1)" +} +mkdir -m 700 "$WORK/home" "$WORK/tmp" "$WORK/profile" +query --version +query --launch-profile nightly-v1 --profile-root "$WORK/profile" --version +echo "==> verified ($EXPECT): EffectCraft $VERSION (nightly-v1), plain and in the Launcher's profile form" diff --git a/packaging/macos/nightly.sh b/packaging/macos/nightly.sh new file mode 100755 index 000000000..bd3c9137e --- /dev/null +++ b/packaging/macos/nightly.sh @@ -0,0 +1,51 @@ +#!/usr/bin/env bash +# App-owned GUI-only Nightly for Apple silicon, compile step only (no signing material): +# +# $DIST/effectcraft--macos-aarch64-nightly.zip EffectCraft Nightly.app, unsigned +# +# Usage: packaging/macos/nightly.sh --arch aarch64 +# +# Required env (nightly-common.sh): EFFECTCRAFT_BUILD_CHANNEL=nightly-v1, EFFECTCRAFT_VERSION, +# EFFECTCRAFT_BUILD_SHA, EFFECTCRAFT_BUILD_DATE, absolute CARGO_TARGET_DIR and DIST; CRAFT_FONTS_DIR optional. +# +# Not publishable by itself: the trusted step (nightly-sign.sh) signs, notarizes and staples it. No CLI, +# DMG, document or URL types, and no stable package.sh. The bundle is not run here; the version query +# runs on the signed bundle (nightly-verify.sh). +set -euo pipefail +ARCH= +while [[ $# -gt 0 ]]; do + case "$1" in + --arch) [[ $# -ge 2 ]] || { echo 'missing --arch value' >&2; exit 2; }; ARCH="$2"; shift 2 ;; + -h|--help) sed -n '2,13p' "$0"; exit 0 ;; + *) echo "unsupported nightly argument: $1" >&2; exit 2 ;; + esac +done +[[ "$ARCH" == aarch64 && "$(uname -s)" == Darwin && "$(uname -m)" == arm64 ]] || { echo 'only native macOS aarch64 nightly packaging is supported' >&2; exit 2; } +HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +. "$HERE/../nightly-common.sh" +. "$HERE/nightly-lib.sh" +nightly_refuse_signing_env +nightly_init macos "$ARCH" aarch64-apple-darwin +# Keep in sync with LSMinimumSystemVersion in Info.plist.in (as package.sh). +export MACOSX_DEPLOYMENT_TARGET=11.0 +OUTPUT="$DIST/effectcraft-$VERSION-macos-aarch64-nightly.zip" +[[ ! -e "$OUTPUT" && ! -L "$OUTPUT" ]] || nightly_die 'refusing to replace an existing nightly archive' +nightly_compile_gui + +APP="$NIGHTLY_WORK/stage/$MAC_NIGHTLY_APP" +mkdir -p "$APP/Contents/MacOS" "$APP/Contents/Resources" +cp "$NIGHTLY_GUI" "$APP/Contents/MacOS/EffectCraft" +chmod 755 "$APP/Contents/MacOS/EffectCraft" +cp "$ROOT/assets/app-icon/effectcraft-nightly.icns" "$APP/Contents/Resources/effectcraft-nightly.icns" +nightly_copy_notices "$APP/Contents/Resources" +# The private mktemp cwd is the helper authority root: stage the template inside it. +cp "$HERE/Info.plist.in" "$NIGHTLY_WORK/Info.plist.in" +(cd "$NIGHTLY_WORK" && python3 "$HERE/nightly_plist.py" --template Info.plist.in \ + --output "stage/$MAC_NIGHTLY_APP/Contents/Info.plist" --version "$VERSION" --source-commit "$EFFECTCRAFT_BUILD_SHA") +plutil -lint "$APP/Contents/Info.plist" +printf 'APPL????' >"$APP/Contents/PkgInfo" +mac_nightly_check_bundle "$NIGHTLY_WORK/stage" "$VERSION" + +# No resource forks, extended attributes or ACLs: the Launcher restores none, so nothing may depend on them. +ditto -c -k --norsrc --noextattr --noacl --keepParent "$APP" "$NIGHTLY_WORK/archive.zip" +nightly_publish_archive "$NIGHTLY_WORK/archive.zip" "$OUTPUT" diff --git a/packaging/macos/nightly_plist.py b/packaging/macos/nightly_plist.py new file mode 100644 index 000000000..c8404c136 --- /dev/null +++ b/packaging/macos/nightly_plist.py @@ -0,0 +1,69 @@ +#!/usr/bin/env python3 +"""Nightly metadata: run from a private owned build cwd with a staged template. + +All file arguments must stay beneath that cwd; this is not native/signing acceptance. +""" +import argparse +import datetime +import os +from pathlib import Path +import plistlib +import re +import sys + +# The shared helper location is fixed by this script, not by CLI file arguments. +sys.path.insert(0, str(Path(__file__).resolve().parent.parent)) +from nightly_paths import OwnedBuildRoot + +MAX_TEMPLATE_BYTES = 256 * 1024 + +IDENTIFIER = "ai.storyteller.effectcraft.nightly" +ASSOCIATIONS = ("CFBundleDocumentTypes", "CFBundleURLTypes", "UTExportedTypeDeclarations", "UTImportedTypeDeclarations") +VERSION = re.compile(r"([0-9]+\.[0-9]+\.[0-9]+)-nightly\.([0-9]{8})\.[0-9]+\.[0-9]+\.g([0-9a-f]{12})\Z") + + +def render(template: bytes, version: str, commit: str) -> bytes: + match = VERSION.fullmatch(version) + if not match or not re.fullmatch(r"[0-9a-f]{40}", commit) or match[3] != commit[:12]: + raise ValueError("exact prepared Nightly version and matching source commit are required") + datetime.datetime.strptime(match[2], "%Y%m%d") + data = plistlib.loads(template) + if not isinstance(data, dict) or data.get("CFBundlePackageType") != "APPL": + raise ValueError("expected the app-owned application plist template") + for key in ASSOCIATIONS: + data.pop(key, None) + data.update( + CFBundleDisplayName="EffectCraft Nightly", + CFBundleName="EffectCraft Nightly", + CFBundleIdentifier=IDENTIFIER, + CFBundleExecutable="EffectCraft", + CFBundleIconFile="effectcraft-nightly", + CFBundleShortVersionString=match[1], + CFBundleVersion=match[1], + EffectCraftVersion=version, + EffectCraftBuildCommit=commit, + ) + return plistlib.dumps(data, fmt=plistlib.FMT_XML, sort_keys=False) + + +def write_plist(template: Path, destination: Path, version: str, commit: str) -> None: + with OwnedBuildRoot() as root: + content = render(root.read_bytes(template, MAX_TEMPLATE_BYTES), version, commit) + with root.create(destination) as stream: + stream.write(content) + stream.flush() + os.fsync(stream.fileno()) + + +def main() -> None: + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--template", type=Path, required=True) + parser.add_argument("--output", type=Path, required=True) + parser.add_argument("--version", required=True) + parser.add_argument("--source-commit", required=True) + args = parser.parse_args() + write_plist(args.template, args.output, args.version, args.source_commit) + + +if __name__ == "__main__": + main() diff --git a/packaging/macos/nightly_plist_tests.py b/packaging/macos/nightly_plist_tests.py new file mode 100644 index 000000000..fbf9c8871 --- /dev/null +++ b/packaging/macos/nightly_plist_tests.py @@ -0,0 +1,202 @@ +#!/usr/bin/env python3 +"""Generated metadata/sentinel fixtures; no native binary, signature, archive or network.""" +import importlib.util +import os +from pathlib import Path +import plistlib +import runpy +import sys +from unittest import mock +import tempfile +import unittest + +HERE = Path(__file__).resolve().parent +SPEC = importlib.util.spec_from_file_location("effect_nightly_plist", HERE / "nightly_plist.py") +POLICY = importlib.util.module_from_spec(SPEC) +SPEC.loader.exec_module(POLICY) +COMMIT = "a" * 40 +VERSION = "0.23.1-nightly.20261121.12345.1.g" + COMMIT[:12] + + +class NightlyMetadata(unittest.TestCase): + def setUp(self): + self.directory = tempfile.TemporaryDirectory() + self.addCleanup(self.directory.cleanup) + self.root = Path(self.directory.name).resolve() + previous = Path.cwd() + os.chdir(self.root) + self.addCleanup(os.chdir, previous) + self.template = self.root / "Info.plist.in" + self.original = (HERE / "Info.plist.in").read_bytes() + self.template.write_bytes(self.original) + self.output = self.root / "Info.plist" + + def test_nightly_transform_removes_associations_without_changing_stable_or_platform_metadata(self): + stable = plistlib.loads(self.original) + stable["CFBundleURLTypes"] = [{"CFBundleURLSchemes": ["generated-test-scheme"]}] + prepared = plistlib.dumps(stable) + self.template.write_bytes(prepared) + POLICY.write_plist(self.template, self.output, VERSION, COMMIT) + rendered = plistlib.loads(self.output.read_bytes()) + for key in POLICY.ASSOCIATIONS: + self.assertNotIn(key, rendered) + self.assertNotEqual(rendered["CFBundleIdentifier"], stable["CFBundleIdentifier"]) + self.assertEqual(rendered["CFBundleIdentifier"], "ai.storyteller.effectcraft.nightly") + self.assertEqual(rendered["CFBundleExecutable"], "EffectCraft") + self.assertEqual(rendered["EffectCraftVersion"], VERSION) + self.assertEqual(rendered["EffectCraftBuildCommit"], COMMIT) + self.assertTrue(VERSION.startswith(rendered["CFBundleVersion"] + "-nightly.")) + for key in ("LSMinimumSystemVersion", "CFBundleLocalizations", "NSHighResolutionCapable", "NSHumanReadableCopyright"): + self.assertEqual(rendered[key], stable[key]) + self.assertEqual(self.template.read_bytes(), prepared) + self.assertEqual((HERE / "Info.plist.in").read_bytes(), self.original) + + def test_bad_identity_or_template_refuses_before_creating_output(self): + for version, commit in (("0.23.1", COMMIT), (VERSION, "b" * 40), (VERSION, "not-a-commit"), (VERSION.replace("20261121", "20261399"), COMMIT)): + with self.subTest(version=version, commit=commit): + with self.assertRaises(ValueError): + POLICY.write_plist(self.template, self.output, version, commit) + self.assertFalse(self.output.exists()) + self.assertEqual(self.template.read_bytes(), self.original) + self.template.write_bytes(plistlib.dumps({"CFBundlePackageType": "generated-not-an-app"})) + with self.assertRaises(ValueError): + POLICY.write_plist(self.template, self.output, VERSION, COMMIT) + self.assertFalse(self.output.exists()) + + def test_cli_writes_the_requested_identity_without_replacing_the_template(self): + helper = HERE / "nightly_plist.py" + argv = [str(helper), "--template", str(self.template), "--output", str(self.output), "--version", VERSION, "--source-commit", COMMIT] + with mock.patch.object(sys, "argv", argv): + runpy.run_path(str(helper), run_name="__main__") + result = plistlib.loads(self.output.read_bytes()) + self.assertEqual(result["EffectCraftVersion"], VERSION) + self.assertEqual(result["EffectCraftBuildCommit"], COMMIT) + self.assertEqual(self.template.read_bytes(), self.original) + + def test_template_alias_or_nonfile_refuses_before_output(self): + alias = self.root / "template-alias" + alias.symlink_to(self.template) + for template in (alias, self.root, self.root / "missing-template"): + with self.subTest(template=template), self.assertRaises(ValueError): + POLICY.write_plist(template, self.output, VERSION, COMMIT) + self.assertFalse(self.output.exists()) + self.assertEqual(self.template.read_bytes(), self.original) + + def test_failed_write_cleans_owned_output_but_preserves_a_replacement(self): + sentinel = b"generated replacement artifact" + for disposition in ("owned", "missing", "replacement"): + with self.subTest(disposition=disposition): + if self.output.exists(): + self.output.unlink() + + def fail_sync(_descriptor): + # macOS/Linux allow unlink of an open file: exercise the real + # cleanup ownership check, not a mocked inode comparison. + if disposition != "owned": + self.output.unlink() + if disposition == "replacement": + self.output.write_bytes(sentinel) + raise OSError("generated fsync failure") + + with mock.patch.object(POLICY.os, "fsync", side_effect=fail_sync), self.assertRaises(OSError): + POLICY.write_plist(self.template, self.output, VERSION, COMMIT) + if disposition == "replacement": + self.assertEqual(self.output.read_bytes(), sentinel) + else: + self.assertFalse(self.output.exists()) + self.assertEqual(self.template.read_bytes(), self.original) + + def test_exclusive_output_preserves_existing_bytes_and_symlink_targets(self): + sentinel = b"generated owned sentinel, not an existing app or user file" + self.output.write_bytes(sentinel) + with self.assertRaises(FileExistsError): + POLICY.write_plist(self.template, self.output, VERSION, COMMIT) + self.assertEqual(self.output.read_bytes(), sentinel) + self.output.unlink() + external = self.root / "sentinel" + external.write_bytes(sentinel) + self.output.symlink_to(external) + with self.assertRaisesRegex(ValueError, "symlinks or aliases"): + POLICY.write_plist(self.template, self.output, VERSION, COMMIT) + self.assertEqual(external.read_bytes(), sentinel) + self.assertTrue(self.output.is_symlink()) + + + def test_template_outside_build_root_refuses_before_output(self): + with tempfile.TemporaryDirectory() as external: + template = Path(external) / "Info.plist.in" + template.write_bytes(self.original) + with self.assertRaises(ValueError): + POLICY.write_plist(template, self.output, VERSION, COMMIT) + self.assertFalse(self.output.exists()) + self.assertEqual(template.read_bytes(), self.original) + + def test_output_outside_build_root_refuses_before_write(self): + with tempfile.TemporaryDirectory() as external: + output = Path(external) / "Info.plist" + with self.assertRaises(ValueError): + POLICY.write_plist(self.template, output, VERSION, COMMIT) + self.assertFalse(output.exists()) + + def test_parent_traversal_refuses_even_to_an_owned_sibling(self): + with tempfile.TemporaryDirectory(dir=self.root.parent) as external: + output = Path("..") / Path(external).name / "Info.plist" + with self.assertRaises(ValueError): + POLICY.write_plist(self.template, output, VERSION, COMMIT) + self.assertFalse((Path(external) / "Info.plist").exists()) + + def test_symlinked_output_parent_refuses(self): + with tempfile.TemporaryDirectory() as external: + alias = self.root / "alias" + alias.symlink_to(external, target_is_directory=True) + with self.assertRaises(ValueError): + POLICY.write_plist(self.template, alias / "Info.plist", VERSION, COMMIT) + self.assertFalse((Path(external) / "Info.plist").exists()) + + def test_template_read_is_bounded_before_output(self): + self.template.write_bytes(plistlib.dumps({"CFBundlePackageType": "APPL", "fixture": "x" * 300000})) + with self.assertRaises(ValueError): + POLICY.write_plist(self.template, self.output, VERSION, COMMIT) + self.assertFalse(self.output.exists()) + + def test_nonprivate_build_root_refuses(self): + self.root.chmod(0o755) + try: + with self.assertRaises(ValueError): + POLICY.write_plist(self.template, self.output, VERSION, COMMIT) + self.assertFalse(self.output.exists()) + finally: + self.root.chmod(0o700) + + + def test_output_keeps_normal_new_file_permissions_inside_private_root(self): + previous = os.umask(0o022) + try: + reference = self.root / "reference" + reference.write_bytes(b"generated ordinary output") + POLICY.write_plist(self.template, self.output, VERSION, COMMIT) + finally: + os.umask(previous) + self.assertEqual(self.output.stat().st_mode & 0o777, reference.stat().st_mode & 0o777) + + def test_open_parent_anchor_prevents_a_later_alias_redirect(self): + parent = self.root / "stage" + parent.mkdir() + retained = self.root / "retained-stage" + destination = parent / "Info.plist" + original = POLICY.OwnedBuildRoot._parent + with tempfile.TemporaryDirectory() as external: + def swap_after_parent_open(root, path): + descriptor, name = original(root, path) + if Path(path) == destination: + parent.rename(retained) + parent.symlink_to(external, target_is_directory=True) + return descriptor, name + with mock.patch.object(POLICY.OwnedBuildRoot, "_parent", swap_after_parent_open): + POLICY.write_plist(self.template, destination, VERSION, COMMIT) + self.assertFalse((Path(external) / "Info.plist").exists()) + self.assertEqual(plistlib.loads((retained / "Info.plist").read_bytes())["EffectCraftVersion"], VERSION) + + +if __name__ == "__main__": + unittest.main() diff --git a/packaging/macos/nightly_sign_tests.py b/packaging/macos/nightly_sign_tests.py new file mode 100644 index 000000000..a296c86ae --- /dev/null +++ b/packaging/macos/nightly_sign_tests.py @@ -0,0 +1,425 @@ +#!/usr/bin/env python3 +"""The macOS Nightly signing and verification scripts, run on any POSIX host against generated +fixtures and stand-in Apple tools (codesign, notarytool, stapler, spctl, security, ditto, plutil, +lipo) that log their arguments. This proves the scripts' order, refusals and cleanup; it is not a +real signature, notarization or Mac run.""" +import base64 +import importlib.util +import json +import os +from pathlib import Path +import plistlib +import shutil +import stat +import subprocess +import sys +import tempfile +import textwrap +import time +import unittest +import zipfile + +HERE = Path(__file__).resolve().parent +SPEC = importlib.util.spec_from_file_location("effect_mac_nightly_plist", HERE / "nightly_plist.py") +PLIST = importlib.util.module_from_spec(SPEC) +SPEC.loader.exec_module(PLIST) +COMMIT = "b" * 40 +VERSION = "0.23.1-nightly.20261123.4567.1.g" + COMMIT[:12] +ASSET = f"effectcraft-{VERSION}-macos-aarch64-nightly.zip" +APP = "EffectCraft Nightly.app" +TEAM = "ABCDE12345" +IDENTITY = "0123456789ABCDEF0123456789ABCDEF01234567" +SECRETS = { + "APPLE_CERTIFICATE": base64.b64encode(b"generated fixture, not a certificate").decode(), + "APPLE_CERTIFICATE_PASSWORD": "generated-fixture", + "KEYCHAIN_PASSWORD": "generated-fixture", + "APPLE_ID": "fixture@example.invalid", + "APPLE_PASSWORD": "generated-fixture", + "APPLE_TEAM_ID": TEAM, +} + +# One stand-in for every Apple tool, dispatched on its own name. Each logs its argv as a JSON line. +SHIM = r""" +import json, os, plistlib, sys, zipfile +from pathlib import Path +name = Path(sys.argv[0]).name +args = sys.argv[1:] +with open(os.environ["SHIM_LOG"], "a") as log: + log.write(json.dumps([name] + args) + "\n") +team = os.environ.get("SHIM_TEAM", "") +if name == "uname": + print({"-s": "Darwin", "-m": "arm64"}.get(args[0], "Darwin")) +elif name == "lipo": + print("arm64") +elif name == "ditto": + paths = [a for a in args if not a.startswith("-")] + src, dst = paths + if "-x" in args: + with zipfile.ZipFile(src) as z: + for info in z.infolist(): + target = Path(dst) / info.filename + if info.is_dir(): + target.mkdir(parents=True, exist_ok=True) + continue + target.parent.mkdir(parents=True, exist_ok=True) + target.write_bytes(z.read(info)) + mode = (info.external_attr >> 16) & 0o777 + if mode: + target.chmod(mode) + else: + root = Path(src) + with zipfile.ZipFile(dst, "x") as z: + for path in sorted([root] + list(root.rglob("*"))): + arc = (Path(root.name) / path.relative_to(root)).as_posix() + if path.is_dir(): + z.writestr(zipfile.ZipInfo(arc + "/"), b"") + else: + info = zipfile.ZipInfo(arc) + info.external_attr = (path.stat().st_mode & 0xFFFF) << 16 + z.writestr(info, path.read_bytes()) +elif name == "plutil": + if args[0] == "-lint": + sys.exit(0) + key, fmt, source = args[1], args[2], args[-1] + data = sys.stdin.read() if source == "-" else Path(source).read_bytes() + value = json.loads(data) if source == "-" else plistlib.loads(data) + if key not in value: + sys.exit(1) + print(value[key] if fmt == "raw" else "") +elif name == "security": + verb = args[0] + if verb == "create-keychain": + Path(args[-1]).write_bytes(b"keychain") + elif verb == "find-identity": + print(' 1) %s "Developer ID Application: Generated Fixture (%s)"' % (os.environ["SHIM_IDENTITY"], team)) + print(" 1 valid identities found") + elif verb == "delete-keychain": + Path(args[-1]).unlink() +elif name == "codesign": + target = Path(args[-1]) + if "--sign" in args and target.suffix == ".app": + (target / "Contents/_CodeSignature").mkdir(exist_ok=True) + (target / "Contents/_CodeSignature/CodeResources").write_bytes(b"sealed") + if "-d" in args: + sys.stderr.write("Executable=%s\nIdentifier=ai.storyteller.effectcraft.nightly\n" + "CodeDirectory v=20500 size=1 flags=0x10000(runtime) hashes=1+7 location=embedded\n" + "Authority=Developer ID Application: Generated Fixture (%s)\n" + "Timestamp=23 Nov 2026 at 17:00:00\nTeamIdentifier=%s\n" % (target, team, team)) +elif name == "xcrun": + if args[:2] == ["notarytool", "submit"]: + print(json.dumps({"id": "generated-id", "status": os.environ.get("SHIM_NOTARY", "Accepted")})) + elif args[:2] == ["stapler", "staple"]: + (Path(args[2]) / "Contents/CodeResources").write_bytes(b"ticket") + elif args[:2] == ["stapler", "validate"]: + sys.exit(0 if (Path(args[2]) / "Contents/CodeResources").is_file() else 1) +elif name == "spctl": + sys.stderr.write("%s: accepted\nsource=Notarized Developer ID\n" % args[-1]) +elif name == "cargo": + sys.exit(1) +# sleep: the retry waits pass at once. +""" + +TOOLS = ("uname", "lipo", "ditto", "plutil", "security", "codesign", "xcrun", "spctl", "cargo", "sleep") + + +class Fixture: + def __init__(self, test): + self.directory = tempfile.TemporaryDirectory() + test.addCleanup(self.directory.cleanup) + self.root = Path(self.directory.name).resolve() + self.bin = self.root / "bin" + self.bin.mkdir() + shim = self.bin / "shim.py" + shim.write_text(SHIM) + for tool in TOOLS: + path = self.bin / tool + path.write_text(f"#!{sys.executable}\nimport sys\nsys.argv[0] = {str(path)!r}\nexec(compile(open({str(shim)!r}).read(), 'shim', 'exec'), {{'__name__': '__main__'}})\n") + path.chmod(0o755) + self.log = self.root / "tools.log" + self.ran = self.root / "payload-ran" + self.temp = self.root / "runner-temp" + self.temp.mkdir() + self.dist = self.root / "unsigned" + self.dist.mkdir() + self.signed = self.root / "signed" + self.signed.mkdir() + self.input = self.dist / ASSET + self.output = self.signed / ASSET + # Every script runs from a directory with modules a Python helper must not import (-I). + self.cwd = self.root / "cwd" + self.cwd.mkdir() + self.hijacked = self.root / "hijacked" + for module in ("shutil", "zipfile", "stat"): + (self.cwd / f"{module}.py").write_text(f"open({str(self.hijacked)!r}, 'a').write({module!r})\n") + + def add_entry(self, info, data=b""): + """Append one raw entry to the input archive.""" + with zipfile.ZipFile(self.input, "a") as z: + z.writestr(info, data) + + def bundle(self, version=VERSION, extra=None, gui=None): + """The archive nightly.sh makes: the real template through the real plist helper.""" + stage = self.root / "stage" + shutil.rmtree(stage, ignore_errors=True) + app = stage / APP + (app / "Contents/MacOS").mkdir(parents=True) + (app / "Contents/Resources").mkdir() + exe = app / "Contents/MacOS/EffectCraft" + exe.write_text(gui or f"#!/bin/sh\ntouch {self.ran}\necho 'EffectCraft {version} (nightly-v1)'\n") + exe.chmod(0o755) + (app / "Contents/Resources/effectcraft-nightly.icns").write_bytes(b"generated icon") + rendered = PLIST.render((HERE / "Info.plist.in").read_bytes(), version, COMMIT) + (app / "Contents/Info.plist").write_bytes(rendered) + for relative, data in (extra or {}).items(): + (app / relative).write_bytes(data) + (app / relative).chmod(0o755) + if self.input.exists(): + self.input.unlink() + with zipfile.ZipFile(self.input, "x") as z: + for path in sorted([app] + list(app.rglob("*"))): + arc = (Path(APP) / path.relative_to(app)).as_posix() + info = zipfile.ZipInfo(arc + ("/" if path.is_dir() else "")) + info.external_attr = (path.stat().st_mode & 0xFFFF) << 16 + z.writestr(info, b"" if path.is_dir() else path.read_bytes()) + return self.input + + def env(self, **changes): + env = {"PATH": f"{self.bin}:{os.environ['PATH']}", "HOME": str(self.root), "SHIM_LOG": str(self.log), + "SHIM_TEAM": TEAM, "SHIM_IDENTITY": IDENTITY, "RUNNER_TEMP": str(self.temp), **SECRETS} + env.update(changes) + return {key: value for key, value in env.items() if value is not None} + + def run(self, script, *args, **env): + if self.log.exists(): + self.log.unlink() + return subprocess.run(["bash", str(HERE / script), *map(str, args)], env=self.env(**env), cwd=self.cwd, + stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True, timeout=120) + + def sign(self, **env): + return self.run("nightly-sign.sh", "--arch", "aarch64", "--input", self.input, "--output", self.output, **env) + + def calls(self): + if not self.log.exists(): + return [] + return [json.loads(line) for line in self.log.read_text().splitlines()] + + +def lib(function, *args): + """Run one nightly-lib.sh function; returns (exit status, stdout).""" + script = f'. {str(HERE / "nightly-lib.sh")!r}; {function} "$@"' + result = subprocess.run(["bash", "-c", script, "lib", *args], stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, text=True) + return result.returncode, result.stdout.strip() + + +DETAILS = (f"Identifier=ai.storyteller.effectcraft.nightly\nCodeDirectory v=20500 size=1 flags=0x10000(runtime) hashes=1\n" + f"Authority=Developer ID Application: Generated Fixture ({TEAM})\nAuthority=Developer ID Certification Authority\n" + f"Timestamp=23 Nov 2026\nTeamIdentifier={TEAM}\n") + + +class Checks(unittest.TestCase): + def test_the_version_comes_only_from_a_prepared_nightly_asset_name(self): + self.assertEqual(lib("mac_nightly_version_from_asset", ASSET), (0, VERSION)) + for name in (f"effectcraft-0.23.1-macos-aarch64.zip", f"effectcraft-{VERSION}-macos-universal-nightly.zip", + f"effectcraft-{VERSION}-linux-x86_64-nightly.tar.gz", ASSET.replace(".g", ".x"), "../" + ASSET): + with self.subTest(name=name): + self.assertNotEqual(lib("mac_nightly_version_from_asset", name)[0], 0) + + def test_signature_needs_every_part_of_the_developer_id_signature(self): + self.assertEqual(lib("mac_nightly_check_signature", DETAILS, TEAM)[0], 0) + for broken in (DETAILS.replace("flags=0x10000(runtime)", "flags=0x0(none)"), + DETAILS.replace("Timestamp=23 Nov 2026\n", "Signed Time=23 Nov 2026\n"), + "Identifier=effectcraft-1234\nSignature=adhoc\nTeamIdentifier=not set\n", + DETAILS.replace("ai.storyteller.effectcraft.nightly", "ai.storyteller.effectcraft"), + DETAILS.replace("ai.storyteller.effectcraft.nightly", "aiXstorytellerXeffectcraftXnightly")): + with self.subTest(broken=broken): + self.assertNotEqual(lib("mac_nightly_check_signature", broken, TEAM)[0], 0) + self.assertNotEqual(lib("mac_nightly_check_signature", DETAILS, "ZZZZZ99999")[0], 0, "another team") + + def test_gatekeeper_must_accept_the_bundle_as_notarized(self): + self.assertEqual(lib("mac_nightly_check_assessment", "x.app: accepted\nsource=Notarized Developer ID\n")[0], 0) + for text in ("x.app: accepted\nsource=Developer ID\n", "x.app: rejected\nsource=Unnotarized Developer ID\n"): + with self.subTest(text=text): + self.assertNotEqual(lib("mac_nightly_check_assessment", text)[0], 0) + + def test_the_imported_identity_must_be_a_developer_id_of_the_team(self): + line = f' 1) {IDENTITY} "Developer ID Application: Generated Fixture ({TEAM})"' + self.assertEqual(lib("mac_nightly_identity_is_team", line, IDENTITY, TEAM)[0], 0) + self.assertNotEqual(lib("mac_nightly_identity_is_team", line, IDENTITY, "ZZZZZ99999")[0], 0) + self.assertNotEqual(lib("mac_nightly_identity_is_team", line.replace("Developer ID Application", "Apple Development"), IDENTITY, TEAM)[0], 0) + + +class Sign(unittest.TestCase): + def setUp(self): + self.f = Fixture(self) + self.f.bundle() + self.unsigned = self.f.input.read_bytes() + + def assert_refused_untouched(self, result, signed=False): + self.assertNotEqual(result.returncode, 0, result.stdout) + self.assertFalse(self.f.output.exists()) + self.assertEqual(self.f.input.read_bytes(), self.unsigned) + self.assertFalse(self.f.ran.exists(), "the payload must never run in the signing step") + names = [call[0] for call in self.f.calls()] + self.assertNotIn("cargo", names) + if not signed: + self.assertNotIn("codesign", names) + self.assertNotIn("xcrun", names) + self.assertEqual(list(self.f.temp.iterdir()), [], "the work directory and keychain are removed") + + def test_signs_notarizes_and_staples_without_running_the_payload(self): + result = self.f.sign() + self.assertEqual(result.returncode, 0, result.stdout) + self.assertFalse(self.f.hijacked.exists(), "helpers run isolated (python3 -I) beside the secrets") + calls = self.f.calls() + names = [call[0] for call in calls] + self.assertNotIn("cargo", names) + self.assertFalse(self.f.ran.exists(), "the payload must never run in the signing step") + self.assertEqual(self.f.input.read_bytes(), self.unsigned) + signs = [call for call in calls if call[0] == "codesign" and "--sign" in call] + self.assertEqual([Path(call[-1]).name for call in signs], ["EffectCraft", APP], "inside-out: executable, then bundle") + for call in signs: + for flag in ("--force", "--timestamp", "runtime", str(HERE / "entitlements.plist"), IDENTITY): + self.assertIn(flag, call) + order = [" ".join(call[:3]) for call in calls] + submit = order.index("xcrun notarytool submit") + staple = order.index("xcrun stapler staple") + self.assertLess(max(i for i, call in enumerate(calls) if call[0] == "codesign" and "--sign" in call), submit) + self.assertLess(submit, staple) + final = [i for i, call in enumerate(calls) if call[0] == "ditto" and "-c" in call][-1] + self.assertLess(staple, final, "the final archive carries the stapled ticket") + self.assertIn("--noextattr", calls[final]) + self.assertIn(["security", "delete-keychain"], [call[:2] for call in calls]) + self.assertEqual(list(self.f.temp.iterdir()), [], "the work directory and keychain are removed") + with zipfile.ZipFile(self.f.output) as z: + names = set(z.namelist()) + self.assertIn(f"{APP}/Contents/CodeResources", names, "stapled ticket inside the bundle") + self.assertIn(f"{APP}/Contents/_CodeSignature/CodeResources", names) + self.assertTrue(all(name.startswith(APP) for name in names)) + mode = z.getinfo(f"{APP}/Contents/MacOS/EffectCraft").external_attr >> 16 + self.assertTrue(mode & stat.S_IXUSR) + + def test_every_signing_and_notarization_secret_is_required(self): + for name in SECRETS: + with self.subTest(missing=name): + self.assert_refused_untouched(self.f.sign(**{name: None})) + self.assertEqual(self.f.calls(), [], "no tool runs before the configuration is complete") + self.assert_refused_untouched(self.f.sign(NIGHTLY_APPLE_TEAM_ID="ZZZZZ99999")) + self.assert_refused_untouched(self.f.sign(APPLE_TEAM_ID="not-a-team")) + + def test_refuses_another_team_s_identity(self): + self.assert_refused_untouched(self.f.sign(SHIM_TEAM="ZZZZZ99999")) + + def test_never_replaces_an_output_or_renames_the_asset(self): + self.f.output.write_bytes(b"generated existing artifact") + result = self.f.sign() + self.assertNotEqual(result.returncode, 0) + self.assertEqual(self.f.output.read_bytes(), b"generated existing artifact") + self.f.output.unlink() + renamed = self.f.run("nightly-sign.sh", "--arch", "aarch64", "--input", self.f.input, "--output", self.f.signed / "other.zip") + self.assertNotEqual(renamed.returncode, 0) + relative = self.f.run("nightly-sign.sh", "--arch", "aarch64", "--input", self.f.input.name, "--output", self.f.output) + self.assertNotEqual(relative.returncode, 0) + self.assertEqual(list(self.f.signed.iterdir()), []) + + def test_refuses_a_payload_that_is_not_the_exact_gui_only_nightly(self): + cases = { + "cli": dict(extra={"Contents/MacOS/effectcraft-cli": b"generated cli"}), + "version": dict(version=VERSION.replace("4567", "4568")), + } + for label, change in cases.items(): + with self.subTest(label=label): + self.f.bundle(**change) + self.unsigned = self.f.input.read_bytes() + self.assert_refused_untouched(self.f.sign()) + + def test_refuses_links_traversal_and_foreign_entries_before_unpacking(self): + link = zipfile.ZipInfo(f"{APP}/Contents/Resources/link") + link.external_attr = (stat.S_IFLNK | 0o777) << 16 + fifo = zipfile.ZipInfo(f"{APP}/Contents/Resources/fifo") + fifo.external_attr = (stat.S_IFIFO | 0o644) << 16 + for label, info in (("link", link), ("special", fifo), ("traversal", zipfile.ZipInfo(f"{APP}/../outside")), + ("absolute", zipfile.ZipInfo("/tmp/outside")), ("foreign root", zipfile.ZipInfo("Other.app/x"))): + with self.subTest(label=label): + self.f.bundle() + self.f.add_entry(info, b"/etc/passwd") + self.unsigned = self.f.input.read_bytes() + result = self.f.sign() + self.assert_refused_untouched(result) + self.assertNotIn("ditto", [call[0] for call in self.f.calls()], "refused before unpacking") + + def test_a_rejected_notarization_publishes_nothing_and_removes_the_keychain(self): + result = self.f.sign(SHIM_NOTARY="Invalid") + self.assert_refused_untouched(result, signed=True) + self.assertIn(["xcrun", "notarytool", "log"], [call[:3] for call in self.f.calls()]) + self.assertNotIn(["xcrun", "stapler", "staple"], [call[:3] for call in self.f.calls()]) + + +class Verify(unittest.TestCase): + def setUp(self): + self.f = Fixture(self) + + def verify(self, *args, **env): + return self.f.run("nightly-verify.sh", "--input", self.f.input, *args, **{name: None for name in SECRETS}, **env) + + def test_asks_the_gui_its_version_with_an_empty_environment(self): + self.f.bundle(gui=f"#!/bin/sh\n[ -z \"$INHERITED\" ] || exit 9\necho 'EffectCraft {VERSION} (nightly-v1)'\n") + result = self.verify("--expect", "unsigned", INHERITED="generated") + self.assertEqual(result.returncode, 0, result.stdout) + self.f.bundle(gui="#!/bin/sh\necho 'EffectCraft 0.23.1 (stable)'\n") + self.assertNotEqual(self.verify("--expect", "unsigned").returncode, 0) + + def test_the_launcher_profile_form_must_answer_promptly_and_cleanly(self): + answer = f"echo 'EffectCraft {VERSION} (nightly-v1)'" + # The shared producer smoke's exact form, with a fresh profile directory. + exact = ('#!/bin/sh\nif [ "$1" = --launch-profile ]; then\n' + ' [ "$#" = 5 ] && [ "$2" = nightly-v1 ] && [ "$3" = --profile-root ] && [ -d "$4" ] && [ "$5" = --version ] || exit 7\n' + f'fi\n{answer}\n') + self.f.bundle(gui=exact) + result = self.verify("--expect", "unsigned") + self.assertEqual(result.returncode, 0, result.stdout) + hangs = f'#!/bin/sh\n[ "$1" != --launch-profile ] || exec /bin/sleep 60\n{answer}\n' + self.f.bundle(gui=hangs) + started = time.monotonic() + result = self.verify("--expect", "unsigned") + self.assertNotEqual(result.returncode, 0) + self.assertIn("within 15 s", result.stdout) + self.assertLess(time.monotonic() - started, 45, "a hanging query is ended, not waited for") + noisy = f'#!/bin/sh\n[ "$1" != --launch-profile ] || echo refusal >&2\n{answer}\n' + self.f.bundle(gui=noisy) + result = self.verify("--expect", "unsigned") + self.assertNotEqual(result.returncode, 0) + self.assertIn("standard error", result.stdout) + + def test_a_signed_check_needs_the_signature_ticket_and_team(self): + self.f.bundle() + self.assertNotEqual(self.verify("--expect", "signed").returncode, 0, "no team to check against") + self.assertNotEqual(self.verify("--expect", "signed", "--team", TEAM).returncode, 0, "no stapled ticket") + self.f.bundle(extra={"Contents/CodeResources": b"ticket"}) + self.assertEqual(self.verify("--expect", "signed", "--team", TEAM).returncode, 0) + self.assertNotEqual(self.verify("--expect", "signed", "--team", TEAM, SHIM_TEAM="ZZZZZ99999").returncode, 0) + + def test_refuses_to_run_the_payload_beside_signing_material(self): + self.f.bundle() + for name in ("APPLE_PASSWORD", "APPLE_CERTIFICATE", "MACOS_KEYCHAIN"): + with self.subTest(name=name): + result = self.f.run("nightly-verify.sh", "--input", self.f.input, "--expect", "unsigned", + **{**{key: None for key in SECRETS}, name: "generated"}) + self.assertNotEqual(result.returncode, 0) + self.assertFalse(self.f.ran.exists()) + self.assertEqual(self.f.calls(), []) + + +class Build(unittest.TestCase): + def test_compilation_refuses_signing_material_before_building(self): + f = Fixture(self) + for name in ("APPLE_CERTIFICATE", "APPLE_PASSWORD", "MACOS_SIGN_IDENTITY", "WINDOWS_CERTIFICATE", "AZURE_CLIENT_SECRET", "LINUX_SIGNING_KEY"): + with self.subTest(name=name): + result = f.run("nightly.sh", "--arch", "aarch64", **{**{key: None for key in SECRETS}, name: "generated"}, + EFFECTCRAFT_BUILD_CHANNEL="nightly-v1", EFFECTCRAFT_VERSION=VERSION) + self.assertNotEqual(result.returncode, 0) + self.assertIn(name, result.stdout) + self.assertNotIn("cargo", [call[0] for call in f.calls()]) + + +if __name__ == "__main__": + unittest.main() diff --git a/packaging/nightly-archive-tests.py b/packaging/nightly-archive-tests.py new file mode 100644 index 000000000..5f3e0544b --- /dev/null +++ b/packaging/nightly-archive-tests.py @@ -0,0 +1,240 @@ +#!/usr/bin/env python3 +"""Synthetic app-owned archive/output tests; no native build or executable launch.""" +import gzip +import importlib.util +import os +import runpy +import sys +from unittest import mock +from pathlib import Path +import subprocess +import tarfile +import tempfile +import unittest + +HERE = Path(__file__).resolve().parent +SPEC = importlib.util.spec_from_file_location("effect_nightly_archive", HERE / "nightly-archive.py") +ARCHIVE = importlib.util.module_from_spec(SPEC) +SPEC.loader.exec_module(ARCHIVE) + + +class ArchivePolicy(unittest.TestCase): + def setUp(self): + self.scratch = tempfile.TemporaryDirectory() + self.addCleanup(self.scratch.cleanup) + self.root = Path(self.scratch.name).resolve() + previous = Path.cwd() + os.chdir(self.root) + self.addCleanup(os.chdir, previous) + self.stage = self.root / "stage" + self.stage.mkdir() + self.output = self.root / "nightly.tar.gz" + self.required = { + "effectcraft", + "effectcraft-bin", + "effectcraft-nightly.png", + "README.md", + "LICENSE-MIT", + "LICENSE-APACHE", + "NOTICE", + "ATTRIBUTION.md", + } + for name in self.required: + (self.stage / name).write_bytes(b"generated fixture: " + name.encode()) + for name in ("effectcraft", "effectcraft-bin"): + (self.stage / name).chmod(0o755) + + def test_flat_regular_ustar_with_all_notices(self): + (self.stage / "OFL-Font.txt").write_text("generated fixture license", encoding="utf-8") + ARCHIVE.linux_archive(self.stage, self.output) + with tarfile.open(self.output) as archive: + self.assertEqual({m.name for m in archive}, self.required | {"OFL-Font.txt"}) + self.assertTrue(all(m.isfile() and not m.pax_headers for m in archive)) + self.assertEqual(archive.extractfile("effectcraft").read(), (self.stage / "effectcraft").read_bytes()) + self.assertEqual(archive.extractfile("effectcraft-bin").read(), (self.stage / "effectcraft-bin").read_bytes()) + with gzip.open(self.output, "rb") as stream: + while (header := stream.read(512)) != bytes(512): + self.assertEqual(len(header), 512) + self.assertIn(header[156:157], {b"0", b"\0"}) + self.assertEqual(header[257:263], b"ustar\0") + size = int(header[124:136].rstrip(b"\0 ").lstrip(b" ") or b"0", 8) + stream.read(((size + 511) // 512) * 512) + + def test_each_required_member_is_required_before_output(self): + for name in self.required: + with self.subTest(name=name): + content = (self.stage / name).read_bytes() + (self.stage / name).unlink() + with self.assertRaisesRegex(ValueError, "required"): + ARCHIVE.linux_archive(self.stage, self.output) + self.assertFalse(self.output.exists()) + (self.stage / name).write_bytes(content) + + def test_unexpected_cli_portable_or_installer_member_refuses(self): + for name in ["effectcraft-cli", "portable.txt", "effectcraft.desktop"]: + with self.subTest(name=name): + bad = self.stage / name + bad.write_bytes(b"generated fixture") + with self.assertRaisesRegex(ValueError, "unexpected"): + ARCHIVE.linux_archive(self.stage, self.output) + self.assertFalse(self.output.exists()) + bad.unlink() + + def test_symlink_refuses_before_output(self): + icon = self.stage / "effectcraft-nightly.png" + icon.unlink() + icon.symlink_to(self.stage / "README.md") + with self.assertRaisesRegex(ValueError, "regular file|symlinks or aliases"): + ARCHIVE.linux_archive(self.stage, self.output) + self.assertFalse(self.output.exists()) + + def test_directory_refuses_before_output(self): + icon = self.stage / "effectcraft-nightly.png" + icon.unlink() + icon.mkdir() + with self.assertRaisesRegex(ValueError, "regular file"): + ARCHIVE.linux_archive(self.stage, self.output) + self.assertFalse(self.output.exists()) + + def test_long_notice_refuses_before_output(self): + (self.stage / ("OFL-" + "x" * 100 + ".txt")).write_bytes(b"fixture") + with self.assertRaisesRegex(ValueError, "short regular"): + ARCHIVE.linux_archive(self.stage, self.output) + self.assertFalse(self.output.exists()) + + def test_case_colliding_notices_refuse_before_output(self): + for name in ["OFL-Font.txt", "OFL-font.txt"]: + (self.stage / name).write_bytes(b"fixture") + with self.assertRaisesRegex(ValueError, "case-colliding"): + ARCHIVE.linux_archive(self.stage, self.output) + self.assertFalse(self.output.exists()) + + def test_cli_dispatches_only_the_supported_archive_kind(self): + helper = HERE / "nightly-archive.py" + with mock.patch.object(sys, "argv", [str(helper), "linux", str(self.stage), str(self.output)]): + runpy.run_path(str(helper), run_name="__main__") + with tarfile.open(self.output) as archive: + self.assertEqual({member.name for member in archive}, self.required) + refused = self.root / "refused.tar.gz" + for args in ([str(helper)], [str(helper), "unknown", str(self.stage), str(refused)]): + with self.subTest(args=args), mock.patch.object(sys, "argv", args): + with self.assertRaises(SystemExit): + runpy.run_path(str(helper), run_name="__main__") + self.assertFalse(refused.exists()) + + def test_existing_archive_is_unchanged(self): + self.output.write_bytes(b"owned earlier artifact") + with self.assertRaises(FileExistsError): + ARCHIVE.linux_archive(self.stage, self.output) + self.assertEqual(self.output.read_bytes(), b"owned earlier artifact") + + + def test_archive_output_outside_build_root_refuses(self): + with tempfile.TemporaryDirectory() as external: + output = Path(external) / "nightly.tar.gz" + with self.assertRaises(ValueError): + ARCHIVE.linux_archive(self.stage, output) + self.assertFalse(output.exists()) + + def test_archive_stage_outside_build_root_refuses(self): + with tempfile.TemporaryDirectory() as external: + stage = Path(external) + for name in self.required: + (stage / name).write_bytes(b"generated external fixture") + with self.assertRaises(ValueError): + ARCHIVE.linux_archive(stage, self.output) + self.assertFalse(self.output.exists()) + + def test_archive_stage_alias_refuses(self): + alias = self.root / "stage-alias" + alias.symlink_to(self.stage, target_is_directory=True) + with self.assertRaises(ValueError): + ARCHIVE.linux_archive(alias, self.output) + self.assertFalse(self.output.exists()) + + def test_archive_output_parent_alias_refuses(self): + with tempfile.TemporaryDirectory() as external: + alias = self.root / "output-alias" + alias.symlink_to(external, target_is_directory=True) + with self.assertRaises(ValueError): + ARCHIVE.linux_archive(self.stage, alias / "nightly.tar.gz") + self.assertFalse((Path(external) / "nightly.tar.gz").exists()) + + def test_archive_parent_traversal_refuses(self): + with tempfile.TemporaryDirectory(dir=self.root.parent) as external: + output = Path("..") / Path(external).name / "nightly.tar.gz" + with self.assertRaises(ValueError): + ARCHIVE.linux_archive(self.stage, output) + self.assertFalse((Path(external) / "nightly.tar.gz").exists()) + + def test_nonflat_member_name_refuses(self): + stage_root = os.path.realpath(self.stage) + with open(self.stage / "README.md", "rb") as incoming: + for bad in ("../escape", "/absolute", "nested/name", "x/../README.md", "", ".", ".."): + with self.subTest(name=bad), self.assertRaises(ValueError): + ARCHIVE.member_info(stage_root, bad, incoming) + + def test_member_header_matches_what_gettarinfo_records(self): + stage_root = os.path.realpath(self.stage) + for name in sorted(self.required): + with self.subTest(name=name), open(self.stage / name, "rb") as incoming: + ours = ARCHIVE.member_info(stage_root, name, incoming) + with tarfile.open(fileobj=__import__("io").BytesIO(), mode="w") as reference: + theirs = reference.gettarinfo(fileobj=incoming, arcname=name) + self.assertEqual(ours.get_info(), theirs.get_info()) + + def test_member_read_budget_refuses_before_output(self): + (self.stage / "OFL-Large.txt").write_bytes(b"x" * 65) + with mock.patch.object(ARCHIVE, "MAX_MEMBER_BYTES", 64, create=True): + with self.assertRaises(ValueError): + ARCHIVE.linux_archive(self.stage, self.output) + self.assertFalse(self.output.exists()) + + + def test_member_growth_is_rechecked_before_copy_and_output_is_cleaned(self): + growing = self.stage / "OFL-Growing.txt" + growing.write_bytes(b"x" * 32) + original = ARCHIVE.member_info + + def grow_before_stat(stage_root, name, incoming): + if name == growing.name: + growing.write_bytes(b"x" * 65) + return original(stage_root, name, incoming) + + with mock.patch.object(ARCHIVE, "MAX_MEMBER_BYTES", 64), \ + mock.patch.object(ARCHIVE, "member_info", grow_before_stat): + with self.assertRaises(ValueError): + ARCHIVE.linux_archive(self.stage, self.output) + self.assertFalse(self.output.exists()) + + +class ExclusiveOutput(unittest.TestCase): + def setUp(self): + self.scratch = tempfile.TemporaryDirectory() + self.addCleanup(self.scratch.cleanup) + self.root = Path(self.scratch.name) + self.source = self.root / "input archive" + self.output = self.root / "final archive" + self.source.write_bytes(b"generated archive fixture" * 1024) + + def publish(self): + return subprocess.run(["bash", "-c", 'set -euo pipefail; source "$1"; nightly_publish_archive "$2" "$3"', "test", str(HERE / "nightly-common.sh"), str(self.source), str(self.output)], capture_output=True, text=True, timeout=15) + + def test_success_copies_exact_bytes(self): + result = self.publish() + self.assertEqual(result.returncode, 0, result.stderr) + self.assertEqual(self.output.read_bytes(), self.source.read_bytes()) + + def test_existing_output_is_never_replaced(self): + self.output.write_bytes(b"existing artifact") + self.assertNotEqual(self.publish().returncode, 0) + self.assertEqual(self.output.read_bytes(), b"existing artifact") + + def test_missing_source_does_not_leave_a_fake_empty_artifact(self): + self.source.unlink() + self.assertNotEqual(self.publish().returncode, 0) + self.assertFalse(self.output.exists()) + + +if __name__ == "__main__": + unittest.main() diff --git a/packaging/nightly-archive.py b/packaging/nightly-archive.py new file mode 100644 index 000000000..dcaf1dac9 --- /dev/null +++ b/packaging/nightly-archive.py @@ -0,0 +1,134 @@ +#!/usr/bin/env python3 +"""Flat Linux archive policy, invoked from its private owned build cwd. + +The stage and archive must both remain under that independently chosen root. +No native build, platform signing, or malicious-same-UID sandbox is implied. +""" +import grp +import gzip +import os +import pathlib +import pwd +import re +import stat +import sys +import tarfile + +sys.path.insert(0, str(pathlib.Path(__file__).resolve().parent)) +from nightly_paths import OwnedBuildRoot + +APP_DOCS = {"README.md", "LICENSE", "LICENSE-MIT", "LICENSE-APACHE", "COPYRIGHT", "NOTICE", "ATTRIBUTION.md"} +MAX_MEMBER_BYTES = 512 * 1024 * 1024 +MAX_TOTAL_BYTES = 1024 * 1024 * 1024 +MAX_MEMBERS = 128 + + +def notice(name): + return name in APP_DOCS or re.fullmatch(r"OFL-[A-Za-z0-9_.-]+\.txt", name) is not None + + +def checked_entries(root, stage): + entries = sorted(root.children(stage, MAX_MEMBERS), key=lambda item: item.name) + folded = set() + total = 0 + for entry in entries: + name = entry.name + if name not in {"effectcraft", "effectcraft-bin", "effectcraft-nightly.png"} and not notice(name): + raise ValueError(f"unexpected nightly member: {name}") + if len(name.encode("utf-8")) > 100: + raise ValueError(f"nightly member must be a short regular file: {name}") + with root.reader(entry, MAX_MEMBER_BYTES) as stream: + total += os.fstat(stream.fileno()).st_size + if total > MAX_TOTAL_BYTES: + raise ValueError("nightly stage exceeds its read bound") + if name.casefold() in folded: + raise ValueError(f"case-colliding nightly member: {name}") + folded.add(name.casefold()) + # `effectcraft` is the launcher people run and `effectcraft-bin` the GUI it starts: a flat tar + # holding only the bare binary would start with the stable settings folder. + required = {"effectcraft", "effectcraft-bin", "effectcraft-nightly.png", "README.md", "LICENSE-MIT", "LICENSE-APACHE", "NOTICE", "ATTRIBUTION.md"} + if not required.issubset({item.name for item in entries}): + raise ValueError("required GUI/icon/notices missing") + return entries + + +def member_info(stage_root, name, incoming): + """Header for one stage file, built from the file this run opened rather than from the archive. + + Members are flat names that resolve directly inside the stage they came from. + """ + if os.path.isabs(name) or os.path.basename(name) != name or name in ("", ".", ".."): + raise ValueError(f"nightly member name must be a flat file name: {name}") + destination = os.path.realpath(os.path.join(stage_root, name)) + if not destination.startswith(stage_root + os.sep) or os.path.dirname(destination) != stage_root: + raise ValueError(f"nightly member resolves outside its stage: {name}") + status = os.fstat(incoming.fileno()) + if not stat.S_ISREG(status.st_mode): + raise ValueError(f"nightly member must be a regular file: {name}") + # The same fields TarFile.gettarinfo records for a regular file. + # The header keeps the validated stage name, not the resolved one: a stage symlink must + # never rename a member or leave a required name out of the archive. + info = tarfile.TarInfo(name) + info.type = tarfile.REGTYPE + info.mode = stat.S_IMODE(status.st_mode) + info.uid, info.gid = status.st_uid, status.st_gid + info.size = status.st_size + info.mtime = status.st_mtime + try: + info.uname = pwd.getpwuid(status.st_uid).pw_name + except KeyError: + pass + try: + info.gname = grp.getgrgid(status.st_gid).gr_name + except KeyError: + pass + return info + + +def verify_headers(root, output): + # Bounded ordinary headers, not a transparent PAX/GNU-normalizing reader. + total = 0 + count = 0 + with root.reader(output, MAX_TOTAL_BYTES) as incoming, gzip.GzipFile(fileobj=incoming) as stream: + while True: + header = stream.read(512) + if header == b"\0" * 512: + break + if len(header) != 512 or header[156:157] not in {b"0", b"\0"}: + raise ValueError("non-ordinary TAR record was emitted") + size = int(header[124:136].rstrip(b"\0 ").lstrip(b" ") or b"0", 8) + count += 1 + total += size + if count > MAX_MEMBERS or size > MAX_MEMBER_BYTES or total > MAX_TOTAL_BYTES: + raise ValueError("archive exceeds its bounded member budget") + remaining = ((size + 511) // 512) * 512 + while remaining: + chunk = stream.read(min(remaining, 1024 * 1024)) + if not chunk: + raise ValueError("truncated TAR member") + remaining -= len(chunk) + + +def linux_archive(stage, output): + with OwnedBuildRoot() as root: + entries = checked_entries(root, stage) + stage_root = os.path.realpath(os.path.join(root.directory, stage)) + total = 0 + with root.create(output) as outgoing: + with tarfile.open(fileobj=outgoing, mode="w:gz", format=tarfile.USTAR_FORMAT) as archive: + for entry in entries: + with root.reader(entry, MAX_MEMBER_BYTES) as incoming: + info = member_info(stage_root, entry.name, incoming) + total += info.size + if info.size > MAX_MEMBER_BYTES or total > MAX_TOTAL_BYTES: + raise ValueError("nightly stage grew beyond its read bound") + archive.addfile(info, incoming) + outgoing.flush() + os.fsync(outgoing.fileno()) + verify_headers(root, output) + + +if __name__ == "__main__": + if len(sys.argv) != 4 or sys.argv[1] != "linux": + raise SystemExit("usage: nightly-archive.py linux STAGE OUTPUT (from owned private build cwd)") + linux_archive(pathlib.Path(sys.argv[2]), pathlib.Path(sys.argv[3])) diff --git a/packaging/nightly-common.sh b/packaging/nightly-common.sh new file mode 100644 index 000000000..5f12b48dd --- /dev/null +++ b/packaging/nightly-common.sh @@ -0,0 +1,95 @@ +# shellcheck shell=bash +# Shared setup for app-owned native nightly archives; stable packaging does not source this file. + +nightly_die() { printf 'error: %s\n' "$*" >&2; exit 2; } + +nightly_init() { + local os="$1" arch="$2" target="$3" date_digits + [[ "${EFFECTCRAFT_BUILD_CHANNEL:-}" == nightly-v1 ]] || nightly_die 'EFFECTCRAFT_BUILD_CHANNEL must be nightly-v1' + [[ "${EFFECTCRAFT_VERSION:-}" =~ ^[0-9]+\.[0-9]+\.[0-9]+-nightly\.[0-9]{8}\.[0-9]+\.[0-9]+\.g[0-9a-f]{12}$ ]] || nightly_die 'an exact prepared nightly version is required' + [[ "${EFFECTCRAFT_BUILD_SHA:-}" =~ ^[0-9a-f]{40}$ ]] || nightly_die 'an exact source commit is required' + [[ "${EFFECTCRAFT_VERSION##*.g}" == "${EFFECTCRAFT_BUILD_SHA:0:12}" ]] || nightly_die 'version/source commit mismatch' + [[ "${EFFECTCRAFT_BUILD_DATE:-}" =~ ^[0-9]{4}-[0-9]{2}-[0-9]{2}$ ]] || nightly_die 'the original run-created UTC date is required' + date_digits="${EFFECTCRAFT_VERSION#*-nightly.}" + date_digits="${date_digits%%.*}" + [[ "${EFFECTCRAFT_BUILD_DATE//-/}" == "$date_digits" ]] || nightly_die 'version/original-run date mismatch' + [[ "${CARGO_TARGET_DIR:-}" == /* && "$CARGO_TARGET_DIR" != / ]] || nightly_die 'an absolute owned CARGO_TARGET_DIR base is required' + [[ "${DIST:-}" == /* && "$DIST" != / ]] || nightly_die 'an absolute DIST output directory is required' + [[ "/$CARGO_TARGET_DIR/" != *'/../'* && "/$DIST/" != *'/../'* ]] || nightly_die 'output paths must not contain parent traversal' + ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" + [[ "$(git -C "$ROOT" rev-parse HEAD)" == "$EFFECTCRAFT_BUILD_SHA" ]] || nightly_die 'prepared source is not the checked-out commit' + [[ -z "$(git -C "$ROOT" status --porcelain)" ]] || nightly_die 'nightly packaging requires the frozen clean source' + if [[ -n "${CRAFT_FONTS_DIR:-}" && ! -d "$CRAFT_FONTS_DIR/fonts" ]]; then + nightly_die 'declared CRAFT_FONTS_DIR has no fonts directory' + fi + # env.sh retains the established notice copier. Required values above prohibit its stable fallbacks. + # shellcheck source=env.sh + . "$ROOT/packaging/env.sh" + export CARGO_TARGET_DIR="$CARGO_TARGET_DIR/nightly-v1/$os-$arch" + NIGHTLY_RUST_TARGET="$target" + mkdir -p "$CARGO_TARGET_DIR" + NIGHTLY_WORK="$(mktemp -d "$CARGO_TARGET_DIR/nightly-package.XXXXXX")" + trap 'rm -rf -- "$NIGHTLY_WORK"' EXIT +} + +# Compile only: macOS runs the version query after signing (packaging/macos/nightly-verify.sh). +nightly_compile_gui() { + # The guard sits here as well as in the entrypoints: no caller may compile with signing material. + nightly_refuse_signing_env + (cd "$ROOT" && EFFECTCRAFT_VERSION="$VERSION" cargo build --release --locked -p effectcraft --target "$NIGHTLY_RUST_TARGET") + NIGHTLY_GUI="$CARGO_TARGET_DIR/$NIGHTLY_RUST_TARGET/release/effectcraft" + [[ -f "$NIGHTLY_GUI" && ! -L "$NIGHTLY_GUI" ]] || nightly_die 'the owned GUI build did not produce a regular executable' + [[ "$(git -C "$ROOT" rev-parse HEAD)" == "$EFFECTCRAFT_BUILD_SHA" && -z "$(git -C "$ROOT" status --porcelain)" ]] || nightly_die 'source changed during the build' +} + +nightly_build_gui() { + nightly_compile_gui + local actual + actual="$("$NIGHTLY_GUI" --version)" || nightly_die 'side-effect-free nightly version verification failed' + [[ "$actual" == "EffectCraft $VERSION (nightly-v1)" ]] || nightly_die 'the built version/flavor is not the prepared identity' + [[ "$(git -C "$ROOT" rev-parse HEAD)" == "$EFFECTCRAFT_BUILD_SHA" && -z "$(git -C "$ROOT" status --porcelain)" ]] || nightly_die 'source changed during the version query' +} + +# Signing material never reaches compilation (the Windows -CheckBuildEnvironment rule). +nightly_refuse_signing_env() { + local name + # The signing names release.yml passes, for every platform, and import-cert.sh's outputs. + for name in APPLE_CERTIFICATE APPLE_CERTIFICATE_PASSWORD KEYCHAIN_PASSWORD APPLE_ID APPLE_PASSWORD APPLE_TEAM_ID \ + MACOS_SIGN_IDENTITY MACOS_KEYCHAIN WINDOWS_CERTIFICATE WINDOWS_CERTIFICATE_PASSWORD AZURE_TENANT_ID AZURE_CLIENT_ID \ + AZURE_CLIENT_SECRET AZURE_SIGNING_ENDPOINT AZURE_SIGNING_ACCOUNT AZURE_CERT_PROFILE LINUX_SIGNING_KEY; do + [[ -z "${!name:-}" ]] || nightly_die "compilation must not receive signing configuration ($name); sign in the separate trusted step" + done +} + +nightly_copy_notices() { + local destination="$1" name + # Copied here rather than through env.sh's copy_docs, whose stable list has no ATTRIBUTION.md. + for name in README.md LICENSE LICENSE-MIT LICENSE-APACHE NOTICE ATTRIBUTION.md; do + if [[ -f "$ROOT/$name" && ! -L "$ROOT/$name" ]]; then cp "$ROOT/$name" "$destination/"; fi + done + for name in README.md LICENSE-MIT LICENSE-APACHE NOTICE ATTRIBUTION.md; do + [[ -f "$destination/$name" && ! -L "$destination/$name" ]] || nightly_die "missing regular app notice: $name" + done +} + +nightly_publish_archive() { + # Exclusive creation: never replace an existing artifact, even if another writer raced the preflight. + python3 -I - "$1" "$2" <<'PY' +import os, shutil, sys +source, destination = sys.argv[1:] +created = False +try: + # Open the input first: a missing source must not leave an empty final artifact. + with open(source, 'rb') as incoming: + with open(destination, 'xb') as output: + created = True + shutil.copyfileobj(incoming, output, length=1024 * 1024) + output.flush() + os.fsync(output.fileno()) +except BaseException: + if created: + os.unlink(destination) + raise +PY + printf 'Nightly artifact: %s\n' "$2" +} diff --git a/packaging/nightly-release-tests.py b/packaging/nightly-release-tests.py new file mode 100755 index 000000000..20ddc4fb2 --- /dev/null +++ b/packaging/nightly-release-tests.py @@ -0,0 +1,394 @@ +#!/usr/bin/env python3 +"""Local nightly workflow and policy contract regression tests for EffectCraft.""" +import copy +import json +from pathlib import Path +import re +import unittest + +ROOT = Path(__file__).resolve().parents[1] +INSTALLED_POLICY = ROOT / ".github/nightly-signing-policy.json" + + +def assert_nightly_serialization(source): + """Fail closed unless this app's plain root concurrency block retains its contract.""" + lines = source.splitlines() + roots = [index for index, line in enumerate(lines) if line.startswith("concurrency:")] + if len(roots) != 1 or lines[roots[0]] != "concurrency:": + raise ValueError("one plain root concurrency block is required") + values = {} + for line in lines[roots[0] + 1:]: + if not line.strip() or line.lstrip().startswith("#"): + continue + if not line[0].isspace(): + break + row = re.fullmatch(r" (group|cancel-in-progress): ([^#]+?)(?: +#.*)?", line) + if row is None or row[1] in values: + raise ValueError("malformed or duplicate nightly concurrency entry") + values[row[1]] = row[2].rstrip() + if values != {"group": "effectcraft-nightly-release", "cancel-in-progress": "false"}: + raise ValueError("nightly serialization must use its stable group and no cancellation") + + +def literal_off(condition): + expression = " ".join(condition.split()) + if expression.startswith("${{") and expression.endswith("}}"): + expression = expression[3:-2].strip() + if expression == "false": + return True + if not expression.startswith("false && "): + return False + # A top-level OR could override the leading false; parentheses must balance. + expression = re.sub(r"'(?:''|[^'])*'", "''", expression) + depth = 0 + for token in re.findall(r"\(|\)|\|\|", expression): + if token == "(": + depth += 1 + elif token == ")": + depth -= 1 + if depth < 0: + return False + elif depth == 0: + return False + return depth == 0 + + +def job_conditions(jobs): + """Each job-level `if:` as (block indicator or None, the whole expression YAML would read).""" + lines = jobs.splitlines() + found = [] + for index, line in enumerate(lines): + head = re.fullmatch(r" if:(?: (.*))?", line) + if head is None: + continue + value = (head[1] or "").strip() + continuation = [] + for follow in lines[index + 1:]: + if follow.strip() and len(follow) - len(follow.lstrip(" ")) <= 4: + break + continuation.append(follow.strip()) + indicator = value if re.fullmatch(r"[>|][+-]?", value) else None + parts = continuation if indicator else [value] + continuation + found.append((indicator, " ".join(part for part in parts if part))) + return found + + +NIGHTLY_PLATFORMS = ("windows-x86_64", "linux-x86_64", "macos-aarch64") +NIGHTLY_TRUST = { + "windows-x86_64": ("publisher_subject", + "CN=Learning Machines Inc, O=Learning Machines Inc, L=Atlanta, S=Georgia, C=US"), + "linux-x86_64": ("fingerprint", "2B76741B414AAD6CD33E631213A005C0B9D7C3ED"), + "macos-aarch64": ("apple_team_id", "DJ6XS33FX8"), +} + +# Mirrors the storytold release-managers team (id 19837241) minus echelon-robot. +RELEASE_MANAGERS = ["bflatastic", "dylanmtaylor", "echelon", "FredApps", "skylartaylor"] + + +def producer_platforms(source): + """Read the one producer job's literal platform list; a narrow source guard, not YAML.""" + rows = re.findall(r"(?m)^ platforms: (.*)$", source) + if len(rows) != 1: + raise ValueError("exactly one producer platform list is required") + literal = re.fullmatch(r"'(\[[^']*\])'", rows[0]) + if literal is None: + raise ValueError("the platform list must be one single-quoted literal") + platforms = json.loads(literal[1]) + if not isinstance(platforms, list) or json.dumps(platforms, separators=(",", ":")) != literal[1]: + raise ValueError("the platform list must be compact JSON") + if len(set(platforms)) != len(platforms) or not set(platforms) <= set(NIGHTLY_PLATFORMS): + raise ValueError("platforms must be distinct known nightly targets") + if "windows-x86_64" not in platforms: + raise ValueError("the Windows row stays in the producer") + return platforms + + +def reviewed_manual_actors(caller_source, policy): + """The one reviewed manual-actor list, identical in the producer caller and the policy.""" + rows = re.findall(r"(?m)^ manual-actors: '(\[[^']*\])'$", caller_source) + if len(rows) != 1: + raise ValueError("exactly one literal manual-actors list is required") + caller = json.loads(rows[0]) + if caller != policy["manual_actors"]: + raise ValueError("caller and policy must grant the same actors in the same order") + if caller != RELEASE_MANAGERS: + raise ValueError("manual actors must be exactly the reviewed release managers") + if caller != sorted(caller, key=str.lower) or len({login.lower() for login in caller}) != len(caller): + raise ValueError("manual actors must be distinct and sorted case-insensitively") + if set(caller) & {login for login in policy["automatic_signer_actors"]}: + raise ValueError("manual and automatic actors overlap") + return caller + + +def caller_pin(name): + return re.findall(r"(?m)^ tooling-revision: ([0-9a-f]{40})$", (ROOT / ".github/workflows" / name).read_text())[0] + + +class TrustedSourcePreparation(unittest.TestCase): + def test_one_producer_and_one_signer_job_carry_every_platform(self): + for name, job in (("nightly.yml", "unsigned"), ("nightly-sign.yml", "release")): + jobs = (ROOT / ".github/workflows" / name).read_text().split("\njobs:\n", 1)[1] + with self.subTest(workflow=name): + self.assertEqual(re.findall(r"(?m)^ ([^\s#][^:]*):", jobs), [job], + "a platform is a list entry, not a separately activatable job") + signer = (ROOT / ".github/workflows/nightly-sign.yml").read_text() + self.assertNotRegex(signer, r"(?m)^\s*platforms?:", "the release policy, not the caller, admits platforms") + + def test_malformed_or_narrowed_platform_lists_are_rejected(self): + source = (ROOT / ".github/workflows/nightly.yml").read_text() + current = "platforms: '[\"windows-x86_64\",\"linux-x86_64\",\"macos-aarch64\"]'" + self.assertIn(current, source) + for new in ("platforms: '[\"linux-x86_64\"]'", + "platforms: '[\"linux-x86_64\",\"macos-aarch64\"]'", + "platforms: '[\"windows-x86_64\",\"linux-x86_64\",\"linux-x86_64\"]'", + "platforms: '[\"windows-x86_64\",\"macos-x86_64\"]'", + "platforms: '[\"windows-x86_64\",\"linux-arm64\"]'", + "platforms: '[\"windows-x86_64\", \"linux-x86_64\"]'", + "platforms: [\"windows-x86_64\",\"linux-x86_64\"]", + "platforms: ${{ vars.NIGHTLY_PLATFORMS }}", + "platforms: '{\"windows-x86_64\":1}'", + current + "\n " + current): + with self.subTest(change=new), self.assertRaises(ValueError): + producer_platforms(source.replace(current, new)) + with self.assertRaises(ValueError): + producer_platforms(source.replace(" " + current + "\n", "")) + + def test_continuation_lines_of_any_scalar_form_reach_the_guard_checks(self): + for name, workflow in (("nightly.yml", "nightly.yml"), ("nightly-sign.yml", "nightly-sign.yml")): + source = (ROOT / ".github/workflows" / workflow).read_text() + expected = NightlyEnabledCallers.GUARDS[name] + guard = re.search(r"(?m)^ if: >-\n(?: [^\n]*\n)+", source)[0] + for replacement in (guard + " || true\n", " if: " + expected + "\n || true\n"): + jobs = source.replace(guard, replacement).split("\njobs:\n", 1)[1] + with self.subTest(workflow=name, replacement=replacement[-30:]): + (indicator, expression), = job_conditions(jobs) + self.assertFalse(indicator == ">-" and " ".join(expression.split()) == expected) + + def test_dormancy_guard_rejects_activation_and_top_level_or(self): + for condition in ("true", "vars.ENABLE_NIGHTLY", "false || true", "false && true || true", + "false && (true || true", "false && true) || true"): + with self.subTest(condition=condition): + self.assertFalse(literal_off(condition)) + self.assertTrue(literal_off("${{ false }}")) + self.assertTrue(literal_off("false && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')")) + + def test_no_nightly_schedule_is_registered(self): + for name, event in (("nightly.yml", "workflow_dispatch"), + ("nightly-sign.yml", "workflow_dispatch")): + source = (ROOT / ".github/workflows" / name).read_text() + events = source.split("\non:\n", 1)[1].split("\npermissions:", 1)[0] + triggers = [line for line in events.splitlines() if line.startswith(" ") + and not line.startswith(" ") and line.strip() and not line.lstrip().startswith("#")] + with self.subTest(workflow=name): + self.assertEqual(triggers, [f" {event}:"], "schedule/activation needs explicit review") + + def test_signer_serialization_contract_is_enforced(self): + assert_nightly_serialization((ROOT / ".github/workflows/nightly-sign.yml").read_text()) + + def test_weakened_or_malformed_serialization_is_rejected(self): + source = (ROOT / ".github/workflows/nightly-sign.yml").read_text() + for old, new in ( + ("cancel-in-progress: false", "cancel-in-progress: true"), + ("cancel-in-progress: false", "cancel-in-progress: ${{ github.event_name == 'push' }}"), + ("cancel-in-progress: false\n", ""), + ("group: effectcraft-nightly-release", "group: ${{ github.run_id }}"), + ("group: effectcraft-nightly-release", "group: release-${{ github.ref }}"), + ("concurrency:\n", "concurrency: ${{ github.run_id }}\n"), + ("concurrency:\n", " concurrency:\n"), + ): + with self.subTest(change=new), self.assertRaises(ValueError): + assert_nightly_serialization(source.replace(old, new)) + + def test_no_cache_actions_or_cache_setup_options_in_app_trusted_closure(self): + for name in ("nightly.yml", "nightly-sign.yml"): + source = (ROOT / ".github/workflows" / name).read_text() + executable = "\n".join(line for line in source.splitlines() + if not line.lstrip().startswith("#")) + with self.subTest(workflow=name): + self.assertNotRegex(executable, r"(?im)^\s*(?:-\s*)?uses:\s*[^\n]*cache") + self.assertNotRegex(executable, r"(?im)^\s*[^\s:#]*cache[^\s:#]*:") + self.assertNotRegex(executable, r"(?im)^\s*(?:environment|secrets):") + self.assertNotIn("secrets.", executable) + + +class NightlyTrustAnchors(unittest.TestCase): + """The public stable identities each platform's signed nightly must carry (all three platforms).""" + + def setUp(self): + self.policy = json.loads(INSTALLED_POLICY.read_text()) + + def test_each_platform_row_names_its_fixed_artifact_kind_and_stable_identity(self): + self.assertEqual(set(self.policy["platforms"]), set(NIGHTLY_TRUST)) + for platform, (field, value) in NIGHTLY_TRUST.items(): + row = self.policy["platforms"][platform] + with self.subTest(platform=platform): + self.assertEqual(row["unsigned_artifact_name"], f"nightly-unsigned-{platform}", + "the artifact kind is fixed by platform, never a caller pattern") + self.assertEqual(row["trust"], {field: value}, "trust must be stable's public identity") + + def test_trust_values_have_the_shapes_the_shared_signer_accepts(self): + rows = self.policy["platforms"] + self.assertRegex(rows["macos-aarch64"]["trust"]["apple_team_id"], r"^[A-Z0-9]{10}$") + self.assertRegex(rows["linux-x86_64"]["trust"]["fingerprint"], r"^[0-9A-F]{40}$") + subject = rows["windows-x86_64"]["trust"]["publisher_subject"] + self.assertTrue(0 < len(subject) <= 1024 and not set(subject) & {"\r", "\n", "\0"}) + + def test_both_callers_use_one_shared_pin_in_uses_and_tooling_revision(self): + pins = set() + for name, callee in (("nightly.yml", "nightly-unsigned.yml"), ("nightly-sign.yml", "nightly-release.yml")): + source = (ROOT / ".github/workflows" / name).read_text() + uses = re.findall(r"(?m)^ uses: storytold/craft-common-actions/\.github/workflows/" + + re.escape(callee) + r"@(\S+)$", source) + tooling = re.findall(r"(?m)^ tooling-revision: (\S+)$", source) + with self.subTest(workflow=name): + self.assertEqual(len(uses), 1) + self.assertEqual(tooling, uses, "the defining workflow SHA and tooling input must match") + pins.update(uses) + self.assertEqual(len(pins), 1, "producer and signer must pin the same shared commit") + self.assertRegex(pins.pop(), r"^[0-9a-f]{40}$", "pin a full immutable commit, never a branch or placeholder") + + +class NightlyEnabledCallers(unittest.TestCase): + """Producer and signer run only in their exact context, for the reviewed manual actors.""" + + GUARDS = { + "nightly.yml": "github.repository == 'storytold/effectcraft' && github.ref == 'refs/heads/main' && " + "github.ref_type == 'branch' && (github.event_name == 'schedule' || " + "github.event_name == 'workflow_dispatch')", + "nightly-sign.yml": "github.repository == 'storytold/effectcraft' && github.event_name == 'workflow_dispatch' && " + "github.ref == 'refs/heads/release' && github.ref_type == 'branch'", + } + + def test_enabled_jobs_keep_exact_context_guards(self): + for name, expected in self.GUARDS.items(): + jobs = (ROOT / ".github/workflows" / name).read_text().split("\njobs:\n", 1)[1] + guards = job_conditions(jobs) + with self.subTest(workflow=name): + self.assertEqual(len(guards), 1) + indicator, expression = guards[0] + self.assertEqual(indicator, ">-") + self.assertEqual(" ".join(expression.split()), expected, "guards may only change with review") + + def test_manual_actors_are_the_release_managers_in_caller_and_policy(self): + source = (ROOT / ".github/workflows/nightly.yml").read_text() + policy = json.loads(INSTALLED_POLICY.read_text()) + self.assertEqual(reviewed_manual_actors(source, policy), RELEASE_MANAGERS) + self.assertEqual(policy["automatic_signer_actors"], [], "no automatic signer without a schedule") + + def test_an_actor_outside_the_release_managers_is_refused(self): + source = (ROOT / ".github/workflows/nightly.yml").read_text() + policy = json.loads(INSTALLED_POLICY.read_text()) + caller = json.dumps(RELEASE_MANAGERS, separators=(",", ":")) + widened = sorted(RELEASE_MANAGERS + ["echelon-robot"], key=str.lower) + for change in ("caller", "policy", "both", "order", "case"): + mutated_source, mutated_policy = source, copy.deepcopy(policy) + if change in ("caller", "both"): + mutated_source = source.replace(caller, json.dumps(widened, separators=(",", ":"))) + if change in ("policy", "both"): + mutated_policy["manual_actors"] = widened + if change == "order": + mutated_policy["manual_actors"] = list(reversed(RELEASE_MANAGERS)) + if change == "case": + mutated_policy["manual_actors"] = [login.lower() for login in RELEASE_MANAGERS] + with self.subTest(change=change), self.assertRaises(ValueError): + reviewed_manual_actors(mutated_source, mutated_policy) + + +class NightlyInstalledPolicy(unittest.TestCase): + """The installed v3 policy matches the callers, the repository and its documented sources.""" + + def setUp(self): + self.assertFalse(INSTALLED_POLICY.is_symlink()) + self.policy = json.loads(INSTALLED_POLICY.read_text()) + + def test_exact_v3_fields_and_repository_identity(self): + expected = {"schema", "repository", "repository_id", "producer_workflow_id", + "producer_workflow_path", "producer_tooling_revision", "producer_workflow_ref", + "signer_workflow_path", "signer_tooling_revision", "release_branch", "manual_actors", + "automatic_signer_actors", "max_age_seconds", "candidate_policy", + "max_artifact_bytes", "platforms"} + self.assertEqual(set(self.policy), expected) + self.assertEqual(self.policy["schema"], "craft-nightly-release-policy/v3") + self.assertEqual(self.policy["repository"], "storytold/effectcraft") + self.assertEqual(self.policy["release_branch"], "release") + self.assertIs(type(self.policy["repository_id"]), int) + self.assertGreater(self.policy["repository_id"], 0) + # producer_workflow_id may be null until nightly.yml is registered on main. + producer_id = self.policy["producer_workflow_id"] + if producer_id is not None: + self.assertIs(type(producer_id), int) + self.assertGreater(producer_id, 0) + self.assertNotEqual(producer_id, + self.policy["candidate_policy"]["required_workflows"][0]["workflow_id"], + "the producer is not its own quality workflow") + + def test_paths_and_tooling_match_the_callers(self): + pin = caller_pin("nightly.yml") + self.assertEqual(caller_pin("nightly-sign.yml"), pin) + self.assertEqual(self.policy["producer_workflow_path"], ".github/workflows/nightly.yml") + self.assertEqual(self.policy["signer_workflow_path"], ".github/workflows/nightly-sign.yml") + self.assertEqual(self.policy["producer_tooling_revision"], pin) + self.assertEqual(self.policy["signer_tooling_revision"], pin) + self.assertEqual(self.policy["producer_workflow_ref"], + "storytold/craft-common-actions/.github/workflows/nightly-unsigned.yml@" + pin) + + def test_platforms_equal_the_producer(self): + built = producer_platforms((ROOT / ".github/workflows/nightly.yml").read_text()) + self.assertEqual(built, list(NIGHTLY_PLATFORMS)) + self.assertEqual(set(self.policy["platforms"]), set(built)) + + def test_bounds(self): + self.assertIs(type(self.policy["max_age_seconds"]), int) + self.assertTrue(0 < self.policy["max_age_seconds"] <= 604800) + self.assertIs(type(self.policy["max_artifact_bytes"]), int) + self.assertTrue(0 < self.policy["max_artifact_bytes"] <= 16 * 1024 ** 3) + + def test_candidate_workflows_run_on_every_main_push(self): + candidate = self.policy["candidate_policy"] + self.assertEqual(set(candidate), {"schema", "epoch", "repository", "branch", "required_workflows", "sonar"}) + self.assertEqual(candidate["schema"], "craft-nightly-candidate-policy/v3") + self.assertEqual((candidate["repository"], candidate["branch"]), ("storytold/effectcraft", "main")) + self.assertTrue(isinstance(candidate["epoch"], str) and 0 < len(candidate["epoch"]) <= 128) + rows = candidate["required_workflows"] + self.assertTrue(rows) + for row in rows: + with self.subTest(workflow=row["workflow_path"]): + self.assertEqual(set(row), {"workflow_id", "workflow_path", "jobs"}) + self.assertIs(type(row["workflow_id"]), int) + self.assertNotEqual(row["workflow_path"], self.policy["producer_workflow_path"]) + source = (ROOT / row["workflow_path"]).read_text() + push = re.search(r"(?m)^ push:\n((?: .*\n)+)", source) + self.assertIsNotNone(push, "a required workflow must run on main pushes") + self.assertIn(" branches: [main]\n", push[1]) + self.assertNotRegex(push[1], r"paths", "a path filter would leave candidates without a run") + names = [job["name"] for job in row["jobs"]] + self.assertEqual(len(names), len(set(names))) + for job in row["jobs"]: + self.assertEqual(set(job), {"name", "app_id", "applicability"}) + self.assertEqual((job["app_id"], job["applicability"]), (15368, "required")) + + def test_sonar_identity_and_reviewed_scope(self): + sonar = self.policy["candidate_policy"]["sonar"] + properties = dict(line.split("=", 1) for line in (ROOT / "sonar-project.properties").read_text().splitlines() + if line and not line.startswith("#")) + self.assertEqual(sonar["organization"], properties["sonar.organization"]) + self.assertEqual(sonar["project"], properties["sonar.projectKey"]) + self.assertEqual((sonar["app_id"], sonar["check_name"]), (12526, "SonarCloud Code Analysis")) + self.assertEqual(sonar["details_url"], "https://sonarcloud.io/dashboard?id=" + sonar["project"] + "&branch=main") + accepted = {"bugs": "BUG", "vulnerabilities": "VULNERABILITY", "code_smells": "CODE_SMELL", + "security_rating": "VULNERABILITY", "new_security_rating": "VULNERABILITY"} + self.assertEqual({accepted[c["metric"]] for c in sonar["accepted_conditions"]}, set(sonar["issue_types"])) + metrics = [c["metric"] for c in sonar["accepted_conditions"] + sonar["required_conditions"]] + self.assertEqual(len(metrics), len(set(metrics))) + keys = [item["key"] for item in sonar["debt"]] + self.assertEqual(len(keys), len(set(keys))) + for item in sonar["debt"]: + with self.subTest(issue=item["key"]): + self.assertEqual(set(item), {"key", "rule", "component", "type", "severity", "hash"}) + self.assertTrue(item["component"].startswith(sonar["project"] + ":")) + self.assertIn(item["type"], sonar["issue_types"]) + self.assertRegex(item["hash"], r"^[0-9a-f]{32}$") + + +if __name__ == "__main__": + unittest.main(verbosity=2) diff --git a/packaging/nightly-tests.py b/packaging/nightly-tests.py new file mode 100644 index 000000000..4b6509c93 --- /dev/null +++ b/packaging/nightly-tests.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python3 +"""Run the synthetic packaging suites and the Linux launcher argv tests; no app build or signing.""" +import importlib.util +from pathlib import Path +import subprocess +import unittest + + +def main() -> int: + here = Path(__file__).resolve().parent + suite = unittest.TestSuite() + for name, relative in ( + ("effect_archive_suite", "nightly-archive-tests.py"), + ("effect_plist_suite", "macos/nightly_plist_tests.py"), + ("effect_release_dispatch_suite", "nightly-release-tests.py"), + ("effect_mac_sign_suite", "macos/nightly_sign_tests.py"), + ): + spec = importlib.util.spec_from_file_location(name, here / relative) + module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) + suite.addTests(unittest.defaultTestLoader.loadTestsFromModule(module)) + result = 0 if unittest.TextTestRunner(verbosity=2).run(suite).wasSuccessful() else 1 + # The Linux launchers are shell scripts: each runs an argv recorder as the GUI and compares what + # it would start, so a wrapper that stops passing the launch profile fails here. + for script in ("linux/nightly-arch-tar-test.sh", "linux/nightly-launch-test.sh"): + result |= subprocess.run(["bash", str(here / script)], check=False).returncode + return result + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/packaging/nightly_paths.py b/packaging/nightly_paths.py new file mode 100644 index 000000000..792198589 --- /dev/null +++ b/packaging/nightly_paths.py @@ -0,0 +1,139 @@ +"""POSIX packaging I/O rooted at a caller-owned private working directory. + +The build launcher chooses cwd independently of file arguments (Linux uses its +mktemp directory). This is not a sandbox against root or a malicious same-UID +caller, and inode-check/unlink cleanup is not an atomic replacement-race primitive. +""" +import contextlib +import os +from pathlib import Path +import stat + + +def _component(name): + # A descriptor-relative open must name exactly one entry in its directory. + if not name or name in (".", "..") or os.path.basename(name) != name: + raise ValueError("build path components must be single names") + return os.path.basename(name) + + +class OwnedBuildRoot: + def __enter__(self): + self.directory = Path.cwd() + self.fd = os.open(".", os.O_RDONLY | os.O_DIRECTORY | os.O_NOFOLLOW) + info = os.fstat(self.fd) + if info.st_uid != os.geteuid() or stat.S_IMODE(info.st_mode) & 0o077: + os.close(self.fd) + raise ValueError("packaging cwd must be an owned private build directory") + return self + + def __exit__(self, *_error): + os.close(self.fd) + + def _relative(self, path): + path = Path(path) + try: + relative = path.relative_to(self.directory) if path.is_absolute() else path + except ValueError as error: + raise ValueError("path is outside the owned build directory") from error + if not relative.parts or ".." in relative.parts: + raise ValueError("empty or parent-traversing build path") + # Check an independently selected root, never the supplied filename's parent. + try: + parent = (self.directory / relative).parent.resolve(strict=True) + except OSError as error: + raise ValueError("build path parent must exist") from error + if not parent.is_relative_to(self.directory): + raise ValueError("resolved path escapes the owned build directory") + return relative + + def _checked_parts(self, path): + relative = self._relative(path) + root = os.path.realpath(self.directory) + lexical = os.path.join(root, *relative.parts) + target = os.path.realpath(lexical) + if target == root or os.path.commonpath([root, target]) != root: + raise ValueError("resolved path escapes the owned build directory") + if target != lexical: + raise ValueError("build path must not pass through symlinks or aliases") + return [_component(part) for part in os.path.relpath(target, root).split(os.sep)] + + def _parent(self, path): + parts = self._checked_parts(path) + current = os.dup(self.fd) + try: + for part in parts[:-1]: + next_fd = os.open(_component(part), os.O_RDONLY | os.O_DIRECTORY | os.O_NOFOLLOW, dir_fd=current) + os.close(current) + current = next_fd + return current, parts[-1] + except OSError as error: + os.close(current) + raise ValueError("build path parents must be non-symlink directories") from error + + @contextlib.contextmanager + def reader(self, path, limit): + parent, name = self._parent(path) + try: + try: + descriptor = os.open(_component(name), os.O_RDONLY | os.O_NOFOLLOW | os.O_NONBLOCK, dir_fd=parent) + except OSError as error: + raise ValueError("build input must be a regular file without aliases") from error + finally: + os.close(parent) + info = os.fstat(descriptor) + if not stat.S_ISREG(info.st_mode) or info.st_size > limit: + os.close(descriptor) + raise ValueError("build input must be a regular file within its read bound") + with os.fdopen(descriptor, "rb") as stream: + yield stream + + def read_bytes(self, path, limit): + with self.reader(path, limit) as stream: + data = stream.read(limit + 1) + if len(data) > limit: + raise ValueError("build input grew beyond its read bound") + return data + + def children(self, path, limit): + relative = self._relative(path) + parent, name = self._parent(path) + try: + try: + descriptor = os.open(_component(name), os.O_RDONLY | os.O_DIRECTORY | os.O_NOFOLLOW, dir_fd=parent) + except OSError as error: + raise ValueError("build stage must be a non-symlink directory") from error + finally: + os.close(parent) + try: + entries = [] + with os.scandir(descriptor) as iterator: + for entry in iterator: + if len(entries) >= limit: + raise ValueError("too many build stage members") + entries.append(self.directory / relative / entry.name) + return entries + finally: + os.close(descriptor) + + @contextlib.contextmanager + def create(self, path): + parent, name = self._parent(path) + name = _component(name) + try: + descriptor = os.open(name, os.O_WRONLY | os.O_CREAT | os.O_EXCL | os.O_NOFOLLOW, 0o666, dir_fd=parent) + info = os.fstat(descriptor) + identity = (info.st_dev, info.st_ino) + try: + with os.fdopen(descriptor, "wb") as stream: + yield stream + except BaseException: + try: + current = os.stat(name, dir_fd=parent, follow_symlinks=False) + if (current.st_dev, current.st_ino) == identity: + os.unlink(_component(name), dir_fd=parent) + except FileNotFoundError: + pass + raise + finally: + os.close(parent) diff --git a/packaging/windows/README.md b/packaging/windows/README.md new file mode 100644 index 000000000..dc1b7fcab --- /dev/null +++ b/packaging/windows/README.md @@ -0,0 +1,30 @@ +# Windows packaging + +See [installation policy checks](INSTALLATION.md) for the installer scope and path gates. + +## Nightly build and signing boundary + +`package.ps1 -Arch x64 -Nightly -BuildOnly` is for the secret-free compilation job. +It refuses signing credential variables and builds the GUI only, without CLI, +portable marker, installer or associations. Its `*-nightly.unsigned.zip` is an +internal intermediate, not the final feed artifact. There is no unsigned +publication switch. + +The separate trusted producer signing job safely unpacks that new intermediate, +checks its exact identity/inventory, then invokes the existing backend: + +```powershell +pwsh packaging/windows/sign.ps1 -Required -CheckOnly +pwsh packaging/windows/sign.ps1 -Required -Files /effectcraft.exe +``` + +Missing or partial configuration fails. `-Required` verifies Authenticode and +a signer certificate after the existing signtool verification. Stable local +packaging keeps its existing optional-signing policy. The producer independently +verifies the final signature, PE identity and inventory before archiving under +the normal feed filename, and refuses to overwrite prepared outputs. It never +executes the payload in the signing step. Real keys belong only to that step, +not compilation. These interfaces do not configure or grant access to keys. + +The signing-policy fixtures use generated dummy values and a mocked compiler +boundary; they do not prove real certificate signing or release readiness. diff --git a/packaging/windows/nightly-package-tests.ps1 b/packaging/windows/nightly-package-tests.ps1 new file mode 100644 index 000000000..c3be861b6 --- /dev/null +++ b/packaging/windows/nightly-package-tests.ps1 @@ -0,0 +1,95 @@ +param([Parameter(Mandatory=$true)][string] $FixtureRoot) +. (Join-Path $PSScriptRoot 'nightly.ps1') -FunctionsOnly +function Assert([bool] $Value, [string] $Message) { if (-not $Value) { throw $Message } } +$spec = Get-NightlyArchiveSpec '0.23.1-nightly.20261120.17.1.gabcdef012345' 'x64' +Assert ($spec.Archive -eq 'effectcraft-0.23.1-nightly.20261120.17.1.gabcdef012345-windows-x86_64-nightly.zip') 'wrong nightly artifact name' +Assert ($spec.Executables.Count -eq 1 -and $spec.Executables[0] -eq 'effectcraft.exe') 'nightly must not ship the unqualified CLI' +Assert ($spec.AppId -eq 'ai.storyteller.effectcraft.nightly-v1') 'nightly identity is not distinct' +foreach ($arch in @('x86', 'arm64')) { + $refused = $false + try { Get-NightlyArchiveSpec '0.23.1' $arch | Out-Null } catch { $refused = $true } + Assert $refused 'unsupported target was accepted' +} +foreach ($bad in @('', '0.23.1', '../other', '0.23.1/elsewhere')) { + $refused = $false + try { Get-NightlyArchiveSpec $bad 'x64' | Out-Null } catch { $refused = $true } + Assert $refused 'unsafe artifact version was accepted' +} +Assert-NightlyFlavor 'EffectCraft Nightly' 'EffectCraft 0.23.1-nightly.20261120.17.1.gabcdef012345 (nightly-v1)' '0.23.1-nightly.20261120.17.1.gabcdef012345' +foreach ($pair in @(@('EffectCraft', 'EffectCraft 0.23.1 (nightly-v1)'), @('EffectCraft Nightly', 'EffectCraft 0.23.1'))) { + $refused = $false + try { Assert-NightlyFlavor $pair[0] $pair[1] '0.23.1-nightly.20261120.17.1.gabcdef012345' } catch { $refused = $true } + Assert $refused 'stable or mismatched build flavor was accepted' +} +$sha = 'abcdef0123456789abcdef0123456789abcdef01' +$good = '0.23.1-nightly.20261120.17.1.gabcdef012345' +Assert-NightlySource $good $sha '2026-11-20' $sha '' +$cases = @( + @('missing commit', $good, '', '2026-11-20', $sha, ''), + @('short commit', $good, 'abcdef012345', '2026-11-20', $sha, ''), + @('uppercase commit', $good, $sha.ToUpper(), '2026-11-20', $sha.ToUpper(), ''), + @('version names another commit', '0.23.1-nightly.20261120.17.1.g000000000000', $sha, '2026-11-20', $sha, ''), + @('missing date', $good, $sha, '', $sha, ''), + @('date differs from version', $good, $sha, '2026-11-21', $sha, ''), + @('other commit checked out', $good, $sha, '2026-11-20', ('0' * 40), ''), + @('dirty tree', $good, $sha, '2026-11-20', $sha, ' M apps/effectcraft/src/main.rs') +) +foreach ($case in $cases) { + $refused = $false + try { Assert-NightlySource $case[1] $case[2] $case[3] $case[4] $case[5] } catch { $refused = $true } + Assert $refused "source identity accepted: $($case[0])" +} +Write-Output 'nightly packaging spec, target/version refusal, source identity and flavor-binding tests passed' + +# Exercise the SAME production notice copier with the real repository layout, then inspect a ZIP. +if (-not $FixtureRoot -or -not [IO.Path]::IsPathRooted($FixtureRoot)) { throw 'supply an owned absolute -FixtureRoot for the notices/ZIP regression' } +$testRoot = Join-Path $FixtureRoot ("nightly-notices-" + [Guid]::NewGuid().ToString('N')) +try { + $repo = Join-Path $testRoot 'app' + $fontRepo = Join-Path $testRoot 'craft-fonts' + $family = Join-Path $fontRepo 'fonts\ExampleFamily' + $stage = Join-Path $testRoot 'stage' + New-Item -ItemType Directory -Force -Path $repo, $family, $stage | Out-Null + $rootNames = @('README.md', 'LICENSE', 'LICENSE-MIT', 'LICENSE-APACHE', 'NOTICE', 'ATTRIBUTION.md') + foreach ($name in $rootNames) { Set-Content -LiteralPath (Join-Path $repo $name) -Value "root-notice-$name" } + Set-Content -LiteralPath (Join-Path $family 'OFL.txt') -Value 'font-notice-example' + Copy-NightlyNotices $repo $fontRepo $stage + foreach ($name in @($rootNames) + @('OFL-ExampleFamily.txt')) { + Assert (Test-Path -LiteralPath (Join-Path $stage $name)) "missing staged notice $name" + } + $zip = Join-Path $testRoot 'notices.zip' + Compress-Archive -Path (Join-Path $stage '*') -DestinationPath $zip + $archive = [IO.Compression.ZipFile]::OpenRead($zip) + try { + $names = @($archive.Entries | ForEach-Object { $_.FullName }) + foreach ($name in @($rootNames) + @('OFL-ExampleFamily.txt')) { Assert ($name -in $names) "missing archived notice $name" } + foreach ($forbidden in @('portable.txt', 'effectcraft-cli.exe')) { Assert ($forbidden -notin $names) "unexpected payload $forbidden" } + $entry = $archive.GetEntry('OFL-ExampleFamily.txt') + $reader = [IO.StreamReader]::new($entry.Open()) + try { Assert ($reader.ReadToEnd().Contains('font-notice-example')) 'wrong font license bytes in ZIP' } finally { $reader.Dispose() } + } finally { $archive.Dispose() } +} finally { + if (Test-Path -LiteralPath $testRoot) { Remove-Item -LiteralPath $testRoot -Recurse -Force } +} +Write-Output 'nightly mock-repository root and font notices are present in stage and ZIP' + +# The source state comes from git itself: the checked-out commit, then a dirty tree. +$gitRoot = Join-Path $FixtureRoot ("nightly-source-" + [Guid]::NewGuid().ToString('N')) +try { + New-Item -ItemType Directory -Force -Path $gitRoot | Out-Null + git -C $gitRoot init -q; git -C $gitRoot -c user.name=fixture -c user.email=fixture@invalid commit -q --allow-empty -m fixture + if ($LASTEXITCODE -ne 0) { throw 'cannot create the git fixture' } + $head = (git -C $gitRoot rev-parse HEAD).Trim() + $state = Get-NightlySourceState $gitRoot + Assert ($state.Head -ceq $head -and -not $state.Status) 'clean checkout not reported as clean at HEAD' + $version = '0.23.1-nightly.20261120.17.1.g' + $head.Substring(0, 12) + Assert-NightlySource $version $head '2026-11-20' $state.Head $state.Status + Set-Content -LiteralPath (Join-Path $gitRoot 'untracked.txt') -Value 'dirty' + $state = Get-NightlySourceState $gitRoot + $refused = $false + try { Assert-NightlySource $version $head '2026-11-20' $state.Head $state.Status } catch { $refused = $true } + Assert $refused 'a dirty checkout was accepted' +} finally { + if (Test-Path -LiteralPath $gitRoot) { Remove-Item -LiteralPath $gitRoot -Recurse -Force } +} +Write-Output 'nightly source state is read from git and a dirty checkout is refused' diff --git a/packaging/windows/nightly-signing-tests.ps1 b/packaging/windows/nightly-signing-tests.ps1 new file mode 100644 index 000000000..277940981 --- /dev/null +++ b/packaging/windows/nightly-signing-tests.ps1 @@ -0,0 +1,83 @@ +param( + [Parameter(Mandatory=$true)][string] $FixtureRoot, + [string] $PackagingRoot = $PSScriptRoot, + [switch] $PhaseGuardOnly +) +$ErrorActionPreference = 'Stop' +. (Join-Path $PackagingRoot 'nightly.ps1') -FunctionsOnly +$sign = Join-Path $PackagingRoot 'sign.ps1' +$names = @('WINDOWS_CERTIFICATE','WINDOWS_CERTIFICATE_PASSWORD','AZURE_TENANT_ID','AZURE_CLIENT_ID','AZURE_CLIENT_SECRET','AZURE_SIGNING_ENDPOINT','AZURE_SIGNING_ACCOUNT','AZURE_CERT_PROFILE') +function Clear-SigningFixtures { foreach ($name in $names) { [Environment]::SetEnvironmentVariable($name, $null) } } +function Assert-Policy([bool] $Value, [string] $Message) { if (-not $Value) { throw $Message } } +function Invoke-Refusal([scriptblock] $Operation, [string] $Message) { + $errorText = '' + try { & $Operation | Out-Null } catch { $errorText = $_.Exception.Message } + Assert-Policy ($errorText.Contains($Message)) "expected refusal: $Message; got: $errorText" +} +function global:cargo { $global:SigningFixtureCargoCalls++; throw 'FIXTURE_COMPILER_BOUNDARY' } +function global:Invoke-WebRequest { throw 'fixture must not perform signing downloads' } +$global:SigningFixtureCargoCalls = 0 +if (-not [IO.Path]::IsPathRooted($FixtureRoot)) { throw 'use an owned absolute FixtureRoot' } +$root = Join-Path $FixtureRoot ('signing-policy-' + [Guid]::NewGuid().ToString('N')) +New-Item -ItemType Directory -Path $root | Out-Null +$version = '0.23.1-nightly.20261121.12345.1.gaaaaaaaaaaaa' +$env:EFFECTCRAFT_VERSION = $version +function Invoke-Build([switch] $BuildOnly) { + $arguments = @{Arch='x64';Version=$version;Target='x86_64-pc-windows-msvc';TargetDir=$root;Dist=(Join-Path $root 'dist')} + if ($BuildOnly) { $arguments.BuildOnly = $true } + & (Join-Path $PackagingRoot 'nightly.ps1') @arguments +} +try { + Clear-SigningFixtures + Invoke-Refusal { Invoke-Build } 'requires -BuildOnly' + Assert-Policy ($global:SigningFixtureCargoCalls -eq 0) 'default mode invoked Cargo' + Write-Output 'PASS: explicit-build-phase-required' + if ($PhaseGuardOnly) { return } + + foreach ($name in @('WINDOWS_CERTIFICATE','WINDOWS_CERTIFICATE_PASSWORD','AZURE_CLIENT_SECRET')) { + Clear-SigningFixtures + [Environment]::SetEnvironmentVariable($name, 'generated-fixture-not-a-secret') + Invoke-Refusal { Invoke-Build -BuildOnly } 'Compilation must not receive signing credentials' + Assert-Policy ($global:SigningFixtureCargoCalls -eq 0) 'key-bearing compilation reached Cargo' + } + Write-Output 'PASS: credentials-rejected-before-compilation' + + Clear-SigningFixtures + Invoke-Refusal { Invoke-Build -BuildOnly } 'FIXTURE_COMPILER_BOUNDARY' + Assert-Policy ($global:SigningFixtureCargoCalls -eq 1) 'clean compilation did not reach the mocked compiler boundary' + Assert-Policy (-not (Test-Path (Join-Path $root 'dist'))) 'mocked compilation produced an artifact' + Write-Output 'PASS: secret-free-build-reaches-only-mocked-boundary' + + Clear-SigningFixtures + Invoke-Refusal { & $sign -Required -CheckOnly } 'Nightly signing is required' + $env:AZURE_CLIENT_SECRET = 'generated-partial-fixture' + Invoke-Refusal { & $sign -Required -CheckOnly } 'Nightly signing is required' + Write-Output 'PASS: required-signer-refuses-missing-and-partial-configuration' + + Clear-SigningFixtures + $env:WINDOWS_CERTIFICATE = 'generated-presence-fixture-not-a-certificate' + & $sign -Required -CheckOnly + Clear-SigningFixtures + foreach ($name in $names | Where-Object { $_.StartsWith('AZURE_') }) { [Environment]::SetEnvironmentVariable($name, 'generated-presence-fixture') } + & $sign -Required -CheckOnly + Clear-SigningFixtures + Write-Output 'PASS: supported-configuration-presence-without-signing' + + # Load the policy function without signing. These objects are not crypto evidence. + . $sign -CheckOnly + foreach ($value in @($null, [pscustomobject]@{Status='NotSigned';SignerCertificate='fixture'}, [pscustomobject]@{Status='HashMismatch';SignerCertificate='fixture'}, [pscustomobject]@{Status='Valid';SignerCertificate=$null})) { + Invoke-Refusal { Assert-AuthenticodeSignature $value } 'valid Authenticode signature' + } + Assert-AuthenticodeSignature ([pscustomobject]@{Status='Valid';SignerCertificate='generated-public-certificate-placeholder'}) + Write-Output 'PASS: required-signature-policy-rejects-invalid-or-missing-signer' + + $file = Join-Path $root 'owned-sentinel.exe' + [IO.File]::WriteAllText($file, 'generated sentinel, not a real executable') + $before = (Get-FileHash -LiteralPath $file -Algorithm SHA256).Hash + & $sign -Files $file + Assert-Policy ((Get-FileHash -LiteralPath $file -Algorithm SHA256).Hash -ceq $before) 'optional stable policy changed unsigned bytes' + Write-Output 'PASS: stable-optional-policy-preserves-owned-bytes' +} finally { + Clear-SigningFixtures + Remove-Item -LiteralPath $root -Recurse -Force +} diff --git a/packaging/windows/nightly.ps1 b/packaging/windows/nightly.ps1 new file mode 100644 index 000000000..0e3ffb1fd --- /dev/null +++ b/packaging/windows/nightly.ps1 @@ -0,0 +1,130 @@ +<# First nightly target only: Windows x86_64 GUI ZIP. No MSI, CLI, portable marker or association registration. #> +param( + [string] $Arch = 'x64', + [string] $Version, + [string] $Target, + [string] $TargetDir, + [string] $Dist, + [switch] $SkipBuild, + [switch] $BuildOnly, + [switch] $FunctionsOnly +) +$ErrorActionPreference = 'Stop' + +function Get-NightlyArchiveSpec([string] $Version, [string] $Arch) { + if ($Arch -ne 'x64') { throw 'nightly-v1 supports only Windows x86_64' } + if (-not $Version -or $Version -cnotmatch '^\d+\.\d+\.\d+-nightly\.\d{8}\.\d+\.\d+\.g[0-9a-f]{12}\z') { throw 'invalid nightly artifact version' } + return @{ + Archive = "effectcraft-$Version-windows-x86_64-nightly.zip" + UnsignedArchive = "effectcraft-$Version-windows-x86_64-nightly.unsigned.zip" + Executables = @('effectcraft.exe') + Channel = 'nightly-v1' + AppId = 'ai.storyteller.effectcraft.nightly-v1' + } +} + +# The same source identity the Linux helper enforces (nightly-common.sh): the version names the +# commit being built, the date is the original run's, and the tree is clean. +function Assert-NightlySource([string] $Version, [string] $Sha, [string] $BuildDate, [string] $Head, [string] $Status) { + if ($Sha -cnotmatch '^[0-9a-f]{40}\z') { throw 'an exact source commit is required (EFFECTCRAFT_BUILD_SHA)' } + if ($Version -cnotmatch '^\d+\.\d+\.\d+-nightly\.\d{8}\.\d+\.\d+\.g[0-9a-f]{12}\z') { throw 'invalid nightly artifact version' } + if ($Version.Substring($Version.Length - 12) -cne $Sha.Substring(0, 12)) { throw 'version/source commit mismatch' } + if ($BuildDate -cnotmatch '^\d{4}-\d{2}-\d{2}\z') { throw 'the original run-created UTC date is required (EFFECTCRAFT_BUILD_DATE)' } + $versionDate = ($Version -split '-nightly\.', 2)[1].Substring(0, 8) + if ($BuildDate.Replace('-', '') -cne $versionDate) { throw 'version/original-run date mismatch' } + if ($Head -cne $Sha) { throw 'prepared source is not the checked-out commit' } + if ($Status) { throw 'nightly packaging requires the frozen clean source' } +} + +function Get-NightlySourceState([string] $RepositoryRoot) { + $head = git -C $RepositoryRoot rev-parse HEAD + if ($LASTEXITCODE -ne 0) { throw 'cannot read the checked-out commit' } + $status = git -C $RepositoryRoot status --porcelain + if ($LASTEXITCODE -ne 0) { throw 'cannot read the source tree status' } + return @{ Head = "$head".Trim(); Status = ($status | Out-String).Trim() } +} + +function Assert-NightlyFlavor([string] $ProductName, [string] $VersionOutput, [string] $ExpectedVersion) { + if ($ProductName -ne 'EffectCraft Nightly' -or $VersionOutput -cne "EffectCraft $ExpectedVersion (nightly-v1)") { + throw 'the executable is not the compiled nightly-v1 flavor' + } +} + + +function Copy-NightlyNotices([string] $RepositoryRoot, [string] $FontRepository, [string] $Destination) { + foreach ($name in 'README.md', 'LICENSE', 'LICENSE-MIT', 'LICENSE-APACHE', 'NOTICE', 'ATTRIBUTION.md') { + $source = Join-Path $RepositoryRoot $name + if (Test-Path -LiteralPath $source) { Copy-Item -LiteralPath $source -Destination $Destination } + } + if ($FontRepository) { + $fonts = Join-Path $FontRepository 'fonts' + if (-not (Test-Path -LiteralPath $fonts -PathType Container)) { throw 'CRAFT_FONTS_DIR has no fonts directory for the bundled notices' } + foreach ($family in Get-ChildItem -LiteralPath $fonts -Directory) { + $license = Join-Path $family.FullName 'OFL.txt' + if (Test-Path -LiteralPath $license) { Copy-Item -LiteralPath $license -Destination (Join-Path $Destination "OFL-$($family.Name).txt") } + } + } +} + +if ($FunctionsOnly) { return } +if (-not $env:EFFECTCRAFT_VERSION -or $Version -cne $env:EFFECTCRAFT_VERSION) { throw 'nightly-v1 requires explicit EFFECTCRAFT_VERSION, not the Cargo version fallback' } +$Spec = Get-NightlyArchiveSpec $Version $Arch +if ($SkipBuild) { throw 'nightly-v1 forbids -SkipBuild; the executable flavor must be built in this operation' } +if ($Target -ne 'x86_64-pc-windows-msvc') { throw 'nightly-v1 target must be x86_64-pc-windows-msvc' } +if (-not $BuildOnly) { throw 'Nightly compilation requires -BuildOnly; final archives are produced in the separate trusted signing job' } +# No key values may enter compilation. This produces an internal intermediate, not a feed artifact. +& (Join-Path $PSScriptRoot 'sign.ps1') -CheckBuildEnvironment +$Root = (Resolve-Path (Join-Path $PSScriptRoot '..\..')).Path +$Source = Get-NightlySourceState $Root +Assert-NightlySource $Version $env:EFFECTCRAFT_BUILD_SHA $env:EFFECTCRAFT_BUILD_DATE $Source.Head $Source.Status +$oldChannel = $env:EFFECTCRAFT_BUILD_CHANNEL +try { + $env:EFFECTCRAFT_BUILD_CHANNEL = 'nightly-v1' + $env:EFFECTCRAFT_REQUIRE_WINRES = '1' + $env:CARGO_TARGET_X86_64_PC_WINDOWS_MSVC_RUSTFLAGS = '-C target-feature=+crt-static' + cargo build --release --locked -p effectcraft --target $Target + if ($LASTEXITCODE -ne 0) { throw "nightly cargo build failed: $LASTEXITCODE" } +} finally { + $env:EFFECTCRAFT_BUILD_CHANNEL = $oldChannel +} +$Source = Get-NightlySourceState $Root +try { Assert-NightlySource $Version $env:EFFECTCRAFT_BUILD_SHA $env:EFFECTCRAFT_BUILD_DATE $Source.Head $Source.Status } +catch { throw "source changed during the build: $_" } +$Exe = Join-Path $TargetDir "$Target\release\effectcraft.exe" +$pe = [System.IO.File]::ReadAllBytes($Exe) +if ($pe.Length -lt 64) { throw 'truncated nightly PE executable' } +$offset = [BitConverter]::ToInt32($pe, 0x3C) +if ($offset -lt 0 -or $offset -gt $pe.Length - 0x5E) { throw 'invalid nightly PE header offset' } +if ([BitConverter]::ToUInt16($pe, $offset + 4) -ne 0x8664 -or [BitConverter]::ToUInt16($pe, $offset + 0x5C) -ne 2) { + throw 'nightly executable must be x86_64 Windows GUI' +} +$VersionInfo = (Get-Item -LiteralPath $Exe).VersionInfo +$ProductName = $VersionInfo.ProductName +if ($VersionInfo.ProductVersion -cne $Version) { throw 'nightly PE ProductVersion differs from the feed identity' } +# Check the embedded build flavor before invoking even the side-effect-free version query. +if ($ProductName -ne 'EffectCraft Nightly') { throw 'nightly executable is missing the embedded build flavor' } +$VersionOutput = (& $Exe --version | Out-String).Trim() +if ($LASTEXITCODE -ne 0) { throw 'nightly --version query failed' } +Assert-NightlyFlavor $ProductName $VersionOutput $Version +$Stage = Join-Path $TargetDir 'windows-package\nightly-v1-x86_64' +if (Test-Path -LiteralPath $Stage) { Remove-Item -LiteralPath $Stage -Recurse -Force } +New-Item -ItemType Directory -Force -Path $Stage | Out-Null +Copy-Item -LiteralPath $Exe -Destination (Join-Path $Stage 'effectcraft.exe') +# Signing happens only in the separate trusted step, using sign.ps1 -Required. +# The intermediate's filename cannot satisfy the feed-ready archive contract. +Copy-NightlyNotices $Root $env:CRAFT_FONTS_DIR $Stage +if ((Get-ChildItem -LiteralPath $Stage -Filter '*.exe').Count -ne 1 -or (Test-Path (Join-Path $Stage 'portable.txt'))) { + throw 'nightly stage contains an unexpected executable or portable fallback marker' +} +New-Item -ItemType Directory -Force -Path $Dist | Out-Null +$Zip = Join-Path $Dist $Spec.UnsignedArchive +if (Test-Path -LiteralPath $Zip) { throw 'Nightly output already exists; refusing to replace prepared artifact bytes' } +Compress-Archive -Path (Join-Path $Stage '*') -DestinationPath $Zip +$Archive = [System.IO.Compression.ZipFile]::OpenRead($Zip) +try { + $Names = @($Archive.Entries | ForEach-Object { $_.FullName }) + if ('effectcraft.exe' -notin $Names -or 'effectcraft-cli.exe' -in $Names -or 'portable.txt' -in $Names) { + throw 'nightly ZIP payload violates the GUI-only profile contract' + } +} finally { $Archive.Dispose() } +Write-Output "Nightly build intermediate (not publishable): $Zip ($VersionOutput)" diff --git a/packaging/windows/package.ps1 b/packaging/windows/package.ps1 index e49fde52c..061d92bdd 100644 --- a/packaging/windows/package.ps1 +++ b/packaging/windows/package.ps1 @@ -21,9 +21,12 @@ #> param( [ValidateSet('x64', 'x86', 'arm64')] [string] $Arch = 'x64', - [switch] $SkipBuild + [switch] $SkipBuild, + [switch] $Nightly, + [switch] $BuildOnly ) $ErrorActionPreference = 'Stop' +if ($BuildOnly -and -not $Nightly) { throw '-BuildOnly is only for secret-free nightly compilation' } $Root = (Resolve-Path (Join-Path $PSScriptRoot '..\..')).Path function Invoke-Native([string] $What, [scriptblock] $Block) { @@ -50,12 +53,22 @@ $Dist = if ($env:DIST) { $env:DIST } else { Join-Path $Root 'dist\release' } $TargetDir = if ($env:CARGO_TARGET_DIR) { $env:CARGO_TARGET_DIR } else { Join-Path $Root 'target' } New-Item -ItemType Directory -Force -Path $Dist | Out-Null -if (-not $env:EFFECTCRAFT_BUILD_SHA) { $env:EFFECTCRAFT_BUILD_SHA = (git -C $Root rev-parse HEAD 2>$null) } -if (-not $env:EFFECTCRAFT_BUILD_DATE) { $env:EFFECTCRAFT_BUILD_DATE = (Get-Date).ToUniversalTime().ToString('yyyy-MM-dd') } +# Nightly requires the prepared commit and original run date explicitly; nightly.ps1 checks both. +if (-not $Nightly) { + if (-not $env:EFFECTCRAFT_BUILD_SHA) { $env:EFFECTCRAFT_BUILD_SHA = (git -C $Root rev-parse HEAD 2>$null) } + if (-not $env:EFFECTCRAFT_BUILD_DATE) { $env:EFFECTCRAFT_BUILD_DATE = (Get-Date).ToUniversalTime().ToString('yyyy-MM-dd') } +} Write-Output "EffectCraft $Version for Windows $Arch ($Target)" +if ($Nightly) { + & (Join-Path $PSScriptRoot 'nightly.ps1') -Arch $Arch -Version $Version -Target $Target -TargetDir $TargetDir -Dist $Dist -SkipBuild:$SkipBuild -BuildOnly:$BuildOnly + return +} + if (-not $SkipBuild) { + $env:EFFECTCRAFT_BUILD_CHANNEL = 'stable' + # Static CRT: no VC++ redistributable needed. Scoped to the target so host build scripts and # proc-macros are unaffected. $flagVar = 'CARGO_TARGET_' + ($Target.ToUpper() -replace '-', '_') + '_RUSTFLAGS' @@ -83,6 +96,9 @@ foreach ($check in @(@('effectcraft.exe', 2), @('effectcraft-cli.exe', 3))) { if ($h.Subsystem -ne $check[1]) { throw "$($check[0]) has PE subsystem $($h.Subsystem), expected $($check[1])" } Write-Output "ok $($check[0]): $Arch, PE subsystem $($h.Subsystem)" } +if ((Get-Item -LiteralPath (Join-Path $Bin 'effectcraft.exe')).VersionInfo.ProductName -eq 'EffectCraft Nightly') { + throw 'a nightly executable cannot be packaged as stable' +} $Stage = Join-Path $TargetDir "windows-package\$Arch" Remove-Item -Recurse -Force $Stage -ErrorAction SilentlyContinue New-Item -ItemType Directory -Force -Path $Stage | Out-Null diff --git a/packaging/windows/sign.ps1 b/packaging/windows/sign.ps1 index 7f89586a6..b27bbf29d 100644 --- a/packaging/windows/sign.ps1 +++ b/packaging/windows/sign.ps1 @@ -9,7 +9,9 @@ AZURE_SIGNING_ENDPOINT (e.g. https://eus.codesigning.azure.net), AZURE_SIGNING_ACCOUNT, AZURE_CERT_PROFILE With neither, it prints a warning and leaves the files unsigned (exit code 0), so test builds - still produce installers. + still produce installers. Nightly callers require signing with -Required and can + check signing configuration with -Required -CheckOnly. Compilation uses the + separate -CheckBuildEnvironment mode, without importing signing keys. This is the one place to adapt when the signing setup changes (an HSM/cloud key, a different timestamp server, ...). Optional overrides: WINDOWS_TIMESTAMP_URL, SIGNTOOL (path to signtool.exe). @@ -18,8 +20,11 @@ pwsh packaging/windows/sign.ps1 dist/effectcraft.exe dist/Effectcraft.msi #> param( - [Parameter(Mandatory = $true, ValueFromRemainingArguments = $true)] - [string[]] $Files + [Parameter(Position = 0, ValueFromRemainingArguments = $true)] + [string[]] $Files, + [switch] $Required, + [switch] $CheckOnly, + [switch] $CheckBuildEnvironment ) $ErrorActionPreference = 'Stop' @@ -27,6 +32,12 @@ function Write-Warn([string] $Message) { if ($env:GITHUB_ACTIONS) { Write-Output "::warning::$Message" } else { Write-Warning $Message } } +function Assert-AuthenticodeSignature($Signature) { + if (-not $Signature -or [string]$Signature.Status -cne 'Valid' -or -not $Signature.SignerCertificate) { + throw 'Required signing must produce a valid Authenticode signature and signer certificate' + } +} + function Find-SignTool { if ($env:SIGNTOOL) { return $env:SIGNTOOL } $onPath = Get-Command signtool.exe -ErrorAction SilentlyContinue @@ -44,11 +55,28 @@ function Invoke-SignTool([string[]] $Arguments) { if ($LASTEXITCODE -ne 0) { throw "signtool $($Arguments[0]) failed with exit code $LASTEXITCODE" } } -$Files = $Files | ForEach-Object { (Resolve-Path $_).Path } -$haveCert = [bool]$env:WINDOWS_CERTIFICATE $azureVars = 'AZURE_TENANT_ID', 'AZURE_CLIENT_ID', 'AZURE_CLIENT_SECRET', 'AZURE_SIGNING_ENDPOINT', 'AZURE_SIGNING_ACCOUNT', 'AZURE_CERT_PROFILE' +if ($CheckBuildEnvironment) { + if ($Required -or $CheckOnly -or $Files) { throw '-CheckBuildEnvironment is separate from signing' } + $names = @('WINDOWS_CERTIFICATE', 'WINDOWS_CERTIFICATE_PASSWORD') + $azureVars + if ($names | Where-Object { [Environment]::GetEnvironmentVariable($_) }) { + throw 'Compilation must not receive signing credentials; use a separate trusted signing step' + } + return +} +$haveCert = [bool]$env:WINDOWS_CERTIFICATE $haveAzure = -not ($azureVars | Where-Object { -not [Environment]::GetEnvironmentVariable($_) }) +if ($Required -and -not $haveCert -and -not $haveAzure) { + throw 'Nightly signing is required: configure WINDOWS_CERTIFICATE or the complete existing Azure signing configuration' +} +if ($CheckOnly) { + if ($Files) { throw '-CheckOnly does not sign files' } + return +} +if (-not $Files) { throw 'At least one file is required for signing' } +$Files = $Files | ForEach-Object { (Resolve-Path $_).Path } + if (-not $haveCert -and -not $haveAzure) { Write-Warn "Windows signing secrets not set (WINDOWS_CERTIFICATE or AZURE_*): leaving unsigned: $($Files -join ', ')" exit 0 @@ -96,6 +124,9 @@ try { Invoke-SignTool ($common + @('/tr', $ts, '/dlib', $dlib.FullName, '/dmdf', $metadata) + $Files) } Invoke-SignTool (@('verify', '/pa', '/v') + $Files) + if ($Required) { + foreach ($file in $Files) { Assert-AuthenticodeSignature (Get-AuthenticodeSignature -LiteralPath $file) } + } } finally { Remove-Item -Recurse -Force $tmp -ErrorAction SilentlyContinue diff --git a/sonar-project.properties b/sonar-project.properties index 087d22161..4097bc1b3 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,11 +1,22 @@ sonar.projectKey=storytold_effectcraft sonar.organization=storytold +# Setting sonar.tests below disables the CLI's default sources, so state them: without this Sonar +# indexed only the packaging test runners and the gate meant nothing (PhotoCraft #16335). +sonar.sources=. +# These exact fixture runners are tests, not production code. Do not exclude helpers. +sonar.tests=packaging +sonar.test.inclusions=packaging/nightly-tests.py,packaging/nightly-archive-tests.py,packaging/macos/nightly_plist_tests.py,packaging/macos/nightly_sign_tests.py,packaging/windows/nightly-package-tests.ps1,packaging/windows/nightly-signing-tests.ps1,packaging/nightly-release-tests.py + # crates/aep/tests/fixtures/tools/ holds the contributor's offline generators of the AEP test # corpus (Node and ExtendScript run by hand against a local folder, see its README). They are not # shipped or run by the app or CI, so they are not analysed. sonar.exclusions=crates/aep/tests/fixtures/tools/** +# Packaging test scripts are self-contained unittest suites run directly by CI, not app source +# covered by Rust coverage reports. +sonar.coverage.exclusions=packaging/**/*-tests.py,packaging/**/*_test.py,packaging/** + # S1523 / S2137 (eval, Function): the expression runtime in crates/expr/src/prelude.js replaces # `eval` and `Function` on purpose, with wrappers that check the code they are given before it # runs (After Effects expressions may call them). The rules flag exactly that wrapping. From 656d6c867da8247129550c6dbcef854a30707b1b Mon Sep 17 00:00:00 2001 From: aiongg Date: Wed, 25 Nov 2026 06:33:03 +0000 Subject: [PATCH 434/451] Repin craft-libs to storytold next 16001e7210 and egui to storytold b15ffe9bfc --- Cargo.lock | 178 +++++++++++++++++++------------------- Cargo.toml | 134 ++++++++++++++-------------- crates/effects/Cargo.toml | 2 +- xtask/src/pdf_deps.rs | 2 +- 4 files changed, 158 insertions(+), 158 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 31557f0c8..81a9ae528 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1304,23 +1304,23 @@ dependencies = [ [[package]] name = "craft-aaf" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "craft-audio", "craft-cfb", - "craft-timeline 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba)", + "craft-timeline 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f)", "thiserror 2.0.21", ] [[package]] name = "craft-aep" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" [[package]] name = "craft-appkit" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "block2 0.6.2", "objc2-app-kit 0.3.2", @@ -1330,7 +1330,7 @@ dependencies = [ [[package]] name = "craft-atomic" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "rustix 1.1.6", ] @@ -1338,7 +1338,7 @@ dependencies = [ [[package]] name = "craft-audio" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "craft-media", "craft-xml", @@ -1351,7 +1351,7 @@ dependencies = [ [[package]] name = "craft-behavior" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "accesskit", "bitflags 2.13.2", @@ -1369,12 +1369,12 @@ dependencies = [ [[package]] name = "craft-cfb" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" [[package]] name = "craft-cloud-ui" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "egui", ] @@ -1382,7 +1382,7 @@ dependencies = [ [[package]] name = "craft-cms" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "md-5", "rayon", @@ -1391,12 +1391,12 @@ dependencies = [ [[package]] name = "craft-codepage" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" [[package]] name = "craft-color" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "serde", ] @@ -1404,7 +1404,7 @@ dependencies = [ [[package]] name = "craft-doc" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "craft-ecproj-format", "craft-pcraft-format", @@ -1418,7 +1418,7 @@ dependencies = [ [[package]] name = "craft-docpath" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "serde", ] @@ -1426,7 +1426,7 @@ dependencies = [ [[package]] name = "craft-dpx" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "thiserror 2.0.21", ] @@ -1434,7 +1434,7 @@ dependencies = [ [[package]] name = "craft-ecproj-format" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "serde", "serde_json", @@ -1444,12 +1444,12 @@ dependencies = [ [[package]] name = "craft-eps" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" [[package]] name = "craft-exr" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "exr", "flate2", @@ -1461,7 +1461,7 @@ dependencies = [ [[package]] name = "craft-font-catalog" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "harfrust 0.13.3", "kurbo", @@ -1475,12 +1475,12 @@ dependencies = [ [[package]] name = "craft-fonts-build" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" [[package]] name = "craft-frame" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "craft-color", "craft-time", @@ -1491,7 +1491,7 @@ dependencies = [ [[package]] name = "craft-gif" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "gif", "image", @@ -1500,7 +1500,7 @@ dependencies = [ [[package]] name = "craft-hdr" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "thiserror 2.0.21", ] @@ -1508,7 +1508,7 @@ dependencies = [ [[package]] name = "craft-host" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "bitflags 2.13.2", "craft-i18n", @@ -1521,7 +1521,7 @@ dependencies = [ [[package]] name = "craft-i18n" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "chrono", "fixed_decimal", @@ -1549,7 +1549,7 @@ dependencies = [ [[package]] name = "craft-jpeg" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "thiserror 2.0.21", ] @@ -1557,7 +1557,7 @@ dependencies = [ [[package]] name = "craft-jsonrpc" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "serde_json", ] @@ -1565,7 +1565,7 @@ dependencies = [ [[package]] name = "craft-keymap" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "craft-host", "craft-i18n", @@ -1580,7 +1580,7 @@ dependencies = [ [[package]] name = "craft-lottie" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "craft-zip", "serde_json", @@ -1590,7 +1590,7 @@ dependencies = [ [[package]] name = "craft-media" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "chrono", "thiserror 2.0.21", @@ -1599,7 +1599,7 @@ dependencies = [ [[package]] name = "craft-media-source" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "craft-audio", "craft-color", @@ -1614,7 +1614,7 @@ dependencies = [ [[package]] name = "craft-mesh" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "craft-zip", "miniz_oxide 0.9.1", @@ -1624,7 +1624,7 @@ dependencies = [ [[package]] name = "craft-mime" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "chrono", "craft-codepage", @@ -1634,7 +1634,7 @@ dependencies = [ [[package]] name = "craft-pcraft-format" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "flate2", "serde", @@ -1645,7 +1645,7 @@ dependencies = [ [[package]] name = "craft-pdf" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "hayro-syntax", "serde", @@ -1655,7 +1655,7 @@ dependencies = [ [[package]] name = "craft-platform" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "async-channel", "async-io", @@ -1686,7 +1686,7 @@ dependencies = [ [[package]] name = "craft-ps" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "craft-eps", "kurbo", @@ -1699,7 +1699,7 @@ dependencies = [ [[package]] name = "craft-psd" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "encoding_rs", "flate2", @@ -1710,7 +1710,7 @@ dependencies = [ [[package]] name = "craft-quit" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "dispatch2", "objc2 0.6.5", @@ -1722,7 +1722,7 @@ dependencies = [ [[package]] name = "craft-raw" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "craft-tiff", "miniz_oxide 0.9.1", @@ -1736,7 +1736,7 @@ dependencies = [ [[package]] name = "craft-settings" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "craft-atomic", "craft-host", @@ -1753,12 +1753,12 @@ dependencies = [ [[package]] name = "craft-sniff" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" [[package]] name = "craft-svg" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "craft-xml", "flate2", @@ -1775,7 +1775,7 @@ dependencies = [ [[package]] name = "craft-tga" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "thiserror 2.0.21", ] @@ -1783,7 +1783,7 @@ dependencies = [ [[package]] name = "craft-theme" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "bitflags 2.13.2", "craft-tracked", @@ -1798,7 +1798,7 @@ dependencies = [ [[package]] name = "craft-tiff" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "serde", "thiserror 2.0.21", @@ -1807,12 +1807,22 @@ dependencies = [ [[package]] name = "craft-time" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "serde", "thiserror 2.0.21", ] +[[package]] +name = "craft-timeline" +version = "0.1.0" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +dependencies = [ + "craft-time", + "serde", + "web-time", +] + [[package]] name = "craft-timeline" version = "0.1.0" @@ -1824,25 +1834,15 @@ dependencies = [ "serde_json", ] -[[package]] -name = "craft-timeline" -version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" -dependencies = [ - "craft-time", - "serde", - "web-time", -] - [[package]] name = "craft-tracked" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" [[package]] name = "craft-ui" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "craft-cloud-ui", "craft-ui-canvas", @@ -1856,7 +1856,7 @@ dependencies = [ [[package]] name = "craft-ui-canvas" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "craft-behavior", "craft-i18n", @@ -1872,7 +1872,7 @@ dependencies = [ [[package]] name = "craft-ui-contract" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "accesskit", "craft-behavior", @@ -1910,7 +1910,7 @@ dependencies = [ [[package]] name = "craft-ui-macros" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -1921,7 +1921,7 @@ dependencies = [ [[package]] name = "craft-ui-panels" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "craft-behavior", "craft-host", @@ -1939,7 +1939,7 @@ dependencies = [ [[package]] name = "craft-ui-patterns" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "craft-behavior", "craft-host", @@ -1960,7 +1960,7 @@ dependencies = [ [[package]] name = "craft-ui-shell" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "craft-behavior", "craft-host", @@ -1980,7 +1980,7 @@ dependencies = [ [[package]] name = "craft-ui-widgets" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "craft-behavior", "craft-host", @@ -1999,7 +1999,7 @@ dependencies = [ [[package]] name = "craft-update" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "chrono", "craft-host", @@ -2028,7 +2028,7 @@ dependencies = [ [[package]] name = "craft-vectorcraft-format" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "flate2", "serde", @@ -2039,7 +2039,7 @@ dependencies = [ [[package]] name = "craft-video" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "craft-media", "rav1e", @@ -2050,7 +2050,7 @@ dependencies = [ [[package]] name = "craft-webp" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "image", "thiserror 2.0.21", @@ -2059,7 +2059,7 @@ dependencies = [ [[package]] name = "craft-win32" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "winsafe", ] @@ -2067,7 +2067,7 @@ dependencies = [ [[package]] name = "craft-window" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "craft-appkit", "craft-atomic", @@ -2091,7 +2091,7 @@ dependencies = [ [[package]] name = "craft-xml" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "quick-xml 0.41.0", "serde", @@ -2101,7 +2101,7 @@ dependencies = [ [[package]] name = "craft-y4m" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "thiserror 2.0.21", ] @@ -2109,7 +2109,7 @@ dependencies = [ [[package]] name = "craft-zip" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "flate2", "thiserror 2.0.21", @@ -2403,7 +2403,7 @@ dependencies = [ [[package]] name = "ecolor" version = "0.37.0" -source = "git+https://github.com/aiongg/egui.git?rev=f678ecb710dfb98e4b934f6a8d4176c858606a95#f678ecb710dfb98e4b934f6a8d4176c858606a95" +source = "git+https://github.com/storytold/egui.git?rev=b15ffe9bfc2c8e6748533b32b708e10abaf2afec#b15ffe9bfc2c8e6748533b32b708e10abaf2afec" dependencies = [ "bytemuck", "emath", @@ -2676,7 +2676,7 @@ dependencies = [ name = "effectcraft-interchange" version = "0.25.1" dependencies = [ - "craft-timeline 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba)", + "craft-timeline 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f)", "effectcraft-color", "effectcraft-keyframe", "effectcraft-project", @@ -3043,7 +3043,7 @@ dependencies = [ [[package]] name = "eframe" version = "0.37.0" -source = "git+https://github.com/aiongg/egui.git?rev=f678ecb710dfb98e4b934f6a8d4176c858606a95#f678ecb710dfb98e4b934f6a8d4176c858606a95" +source = "git+https://github.com/storytold/egui.git?rev=b15ffe9bfc2c8e6748533b32b708e10abaf2afec#b15ffe9bfc2c8e6748533b32b708e10abaf2afec" dependencies = [ "ahash", "bytemuck", @@ -3078,7 +3078,7 @@ dependencies = [ [[package]] name = "egui" version = "0.37.0" -source = "git+https://github.com/aiongg/egui.git?rev=f678ecb710dfb98e4b934f6a8d4176c858606a95#f678ecb710dfb98e4b934f6a8d4176c858606a95" +source = "git+https://github.com/storytold/egui.git?rev=b15ffe9bfc2c8e6748533b32b708e10abaf2afec#b15ffe9bfc2c8e6748533b32b708e10abaf2afec" dependencies = [ "accesskit", "ahash", @@ -3097,7 +3097,7 @@ dependencies = [ [[package]] name = "egui-wgpu" version = "0.37.0" -source = "git+https://github.com/aiongg/egui.git?rev=f678ecb710dfb98e4b934f6a8d4176c858606a95#f678ecb710dfb98e4b934f6a8d4176c858606a95" +source = "git+https://github.com/storytold/egui.git?rev=b15ffe9bfc2c8e6748533b32b708e10abaf2afec#b15ffe9bfc2c8e6748533b32b708e10abaf2afec" dependencies = [ "ahash", "bytemuck", @@ -3116,7 +3116,7 @@ dependencies = [ [[package]] name = "egui-winit" version = "0.37.0" -source = "git+https://github.com/aiongg/egui.git?rev=f678ecb710dfb98e4b934f6a8d4176c858606a95#f678ecb710dfb98e4b934f6a8d4176c858606a95" +source = "git+https://github.com/storytold/egui.git?rev=b15ffe9bfc2c8e6748533b32b708e10abaf2afec#b15ffe9bfc2c8e6748533b32b708e10abaf2afec" dependencies = [ "accesskit_winit", "arboard", @@ -3142,7 +3142,7 @@ dependencies = [ [[package]] name = "egui_extras" version = "0.37.0" -source = "git+https://github.com/aiongg/egui.git?rev=f678ecb710dfb98e4b934f6a8d4176c858606a95#f678ecb710dfb98e4b934f6a8d4176c858606a95" +source = "git+https://github.com/storytold/egui.git?rev=b15ffe9bfc2c8e6748533b32b708e10abaf2afec#b15ffe9bfc2c8e6748533b32b708e10abaf2afec" dependencies = [ "ahash", "egui", @@ -3155,7 +3155,7 @@ dependencies = [ [[package]] name = "egui_glow" version = "0.37.0" -source = "git+https://github.com/aiongg/egui.git?rev=f678ecb710dfb98e4b934f6a8d4176c858606a95#f678ecb710dfb98e4b934f6a8d4176c858606a95" +source = "git+https://github.com/storytold/egui.git?rev=b15ffe9bfc2c8e6748533b32b708e10abaf2afec#b15ffe9bfc2c8e6748533b32b708e10abaf2afec" dependencies = [ "bytemuck", "egui", @@ -3168,7 +3168,7 @@ dependencies = [ [[package]] name = "egui_kittest" version = "0.37.0" -source = "git+https://github.com/aiongg/egui.git?rev=f678ecb710dfb98e4b934f6a8d4176c858606a95#f678ecb710dfb98e4b934f6a8d4176c858606a95" +source = "git+https://github.com/storytold/egui.git?rev=b15ffe9bfc2c8e6748533b32b708e10abaf2afec#b15ffe9bfc2c8e6748533b32b708e10abaf2afec" dependencies = [ "eframe", "egui", @@ -3191,7 +3191,7 @@ checksum = "252afb9ae5eaa683babdc6a068b3f5726eb19e05070c731f9b2a23a7c3e8ed34" [[package]] name = "emath" version = "0.37.0" -source = "git+https://github.com/aiongg/egui.git?rev=f678ecb710dfb98e4b934f6a8d4176c858606a95#f678ecb710dfb98e4b934f6a8d4176c858606a95" +source = "git+https://github.com/storytold/egui.git?rev=b15ffe9bfc2c8e6748533b32b708e10abaf2afec#b15ffe9bfc2c8e6748533b32b708e10abaf2afec" dependencies = [ "bytemuck", ] @@ -3284,7 +3284,7 @@ dependencies = [ [[package]] name = "epaint" version = "0.37.0" -source = "git+https://github.com/aiongg/egui.git?rev=f678ecb710dfb98e4b934f6a8d4176c858606a95#f678ecb710dfb98e4b934f6a8d4176c858606a95" +source = "git+https://github.com/storytold/egui.git?rev=b15ffe9bfc2c8e6748533b32b708e10abaf2afec#b15ffe9bfc2c8e6748533b32b708e10abaf2afec" dependencies = [ "ahash", "bytemuck", @@ -3310,7 +3310,7 @@ dependencies = [ [[package]] name = "epaint_default_fonts" version = "0.37.0" -source = "git+https://github.com/aiongg/egui.git?rev=f678ecb710dfb98e4b934f6a8d4176c858606a95#f678ecb710dfb98e4b934f6a8d4176c858606a95" +source = "git+https://github.com/storytold/egui.git?rev=b15ffe9bfc2c8e6748533b32b708e10abaf2afec#b15ffe9bfc2c8e6748533b32b708e10abaf2afec" [[package]] name = "equator" @@ -4247,7 +4247,7 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a" [[package]] name = "hayro-jbig2" version = "0.3.0" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "hayro-ccitt", ] @@ -4261,7 +4261,7 @@ checksum = "c75ab947623ef4ccaa7acf0579edf7cbb5a73838e3839a7be73335e522f433a1" [[package]] name = "hayro-syntax" version = "0.7.2" -source = "git+https://github.com/aiongg/craft-libs?rev=c933a90624b7a5669df284cfdf53726694636bba#c933a90624b7a5669df284cfdf53726694636bba" +source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" dependencies = [ "hayro-jbig2", "hayro-jpeg2000", diff --git a/Cargo.toml b/Cargo.toml index 278a80703..e12851c2b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,28 +11,28 @@ rust-version = "1.95" repository = "https://github.com/storytold/effectcraft" [workspace.dependencies] -craft-timeline = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", default-features = false } -craft-mime = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } -craft-pdf = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", version = "=0.1.0", default-features = false, features = ["read"] } -craft-docpath = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } -craft-jsonrpc = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } -craft-ecproj-format = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } -craft-dpx = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } -craft-ps = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", default-features = false, features = ["read"] } -craft-exr = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } -craft-gif = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } -craft-tga = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } -craft-psd = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } -craft-codepage = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } -craft-svg = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } -craft-webp = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } -craft-lottie = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } -craft-mesh = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", default-features = false, features = ["stl", "obj", "gltf", "fbx"] } -craft-aep = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } -craft-doc = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } -craft-vectorcraft-format = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } +craft-timeline = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", default-features = false } +craft-mime = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } +craft-pdf = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", version = "=0.1.0", default-features = false, features = ["read"] } +craft-docpath = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } +craft-jsonrpc = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } +craft-ecproj-format = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } +craft-dpx = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } +craft-ps = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", default-features = false, features = ["read"] } +craft-exr = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } +craft-gif = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } +craft-tga = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } +craft-psd = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } +craft-codepage = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } +craft-svg = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } +craft-webp = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } +craft-lottie = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } +craft-mesh = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", default-features = false, features = ["stl", "obj", "gltf", "fbx"] } +craft-aep = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } +craft-doc = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } +craft-vectorcraft-format = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } # craft-update: app-specific pretend versions apply to startup and manual checks. -craft-update = { git = "https://github.com/aiongg/craft-libs", version = "=0.1.0", rev = "c933a90624b7a5669df284cfdf53726694636bba", features = ["ui"] } +craft-update = { git = "https://github.com/aiongg/craft-libs", version = "=0.1.0", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", features = ["ui"] } # internal effectcraft-time = { path = "crates/time" } effectcraft-geom = { path = "crates/geom" } @@ -97,13 +97,13 @@ same-file = "1.0" tempfile = "3.27" # codecs + containers shared by the Craft apps (crates/media, crates/export); keep all in sync. -craft-media = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", default-features = false, features = ["isobmff", "matroska"] } -craft-media-source = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } -craft-frame = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } -craft-color = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } -craft-time = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } -craft-audio = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", default-features = false, features = ["aac-decode", "aac-encode", "alac-decode", "opus-decode", "opus-encode", "ac3-decode", "mp3-decode", "mpa-decode"] } -craft-video = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", features = ["h264-decode", "h264-encode", "prores", "hevc-encode", "vp9-encode", "av1", "threads"] } +craft-media = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", default-features = false, features = ["isobmff", "matroska"] } +craft-media-source = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } +craft-frame = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } +craft-color = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } +craft-time = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } +craft-audio = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", default-features = false, features = ["aac-decode", "aac-encode", "alac-decode", "opus-decode", "opus-encode", "ac3-decode", "mp3-decode", "mpa-decode"] } +craft-video = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", features = ["h264-decode", "h264-encode", "prores", "hevc-encode", "vp9-encode", "av1", "threads"] } # footage decoding: FilmCraft's pure-Rust crates, pinned to a revision (plan/adr/0001). # Only `crates/media`, `crates/export` and `crates/interchange` may depend on these. @@ -126,12 +126,12 @@ half = "2.7" # ui # Shared frontend components; keep this dependency above the engine boundary. # Shared UI and the complete egui family select reviewed immutable commits below. -craft-ui = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } -craft-behavior = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } -craft-host = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } -craft-keymap = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } -craft-theme = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } -craft-window = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } +craft-ui = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } +craft-behavior = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } +craft-host = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } +craft-keymap = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } +craft-theme = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } +craft-window = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } # `default_fonts` and `monochrome_emoji_fonts` are explicit: the app's `FontDefinitions::default()` # and its `✔`/`▣` chrome glyphs need both, and kittest's own dev-dependencies do not propagate. egui = { version = "0.37", default-features = false, features = ["default_fonts", "monochrome_emoji_fonts"] } @@ -237,41 +237,41 @@ codegen-units = 1 # filmcraft-media pins storytold craft-libs; the app needs one copy of each crate. [patch."https://github.com/storytold/craft-libs"] -craft-aaf = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", version = "=0.1.0" } -craft-audio = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", version = "=0.1.0" } -craft-cfb = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", version = "=0.1.0" } -craft-color = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", version = "=0.1.0" } -craft-dpx = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", version = "=0.1.0" } -craft-exr = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", version = "=0.1.0" } -craft-frame = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", version = "=0.1.0" } -craft-hdr = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", version = "=0.1.0" } -craft-jpeg = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", version = "=0.1.0" } -craft-media = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", version = "=0.1.0" } -craft-media-source = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", version = "=0.1.0" } -craft-psd = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", version = "=0.1.0" } -craft-raw = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", version = "=0.1.0" } -craft-sniff = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", version = "=0.1.0" } -craft-tga = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", version = "=0.1.0" } -craft-tiff = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", version = "=0.1.0" } -craft-time = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", version = "=0.1.0" } -craft-video = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", version = "=0.1.0" } -craft-xml = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", version = "=0.1.0" } -craft-y4m = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", version = "=0.1.0" } +craft-aaf = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", version = "=0.1.0" } +craft-audio = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", version = "=0.1.0" } +craft-cfb = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", version = "=0.1.0" } +craft-color = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", version = "=0.1.0" } +craft-dpx = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", version = "=0.1.0" } +craft-exr = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", version = "=0.1.0" } +craft-frame = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", version = "=0.1.0" } +craft-hdr = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", version = "=0.1.0" } +craft-jpeg = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", version = "=0.1.0" } +craft-media = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", version = "=0.1.0" } +craft-media-source = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", version = "=0.1.0" } +craft-psd = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", version = "=0.1.0" } +craft-raw = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", version = "=0.1.0" } +craft-sniff = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", version = "=0.1.0" } +craft-tga = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", version = "=0.1.0" } +craft-tiff = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", version = "=0.1.0" } +craft-time = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", version = "=0.1.0" } +craft-video = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", version = "=0.1.0" } +craft-xml = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", version = "=0.1.0" } +craft-y4m = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", version = "=0.1.0" } [patch.crates-io] -hayro-syntax = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", version = "=0.7.2" } -hayro-jbig2 = { git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba", version = "=0.3.0" } -ecolor = { git = "https://github.com/aiongg/egui.git", rev = "f678ecb710dfb98e4b934f6a8d4176c858606a95" } -emath = { git = "https://github.com/aiongg/egui.git", rev = "f678ecb710dfb98e4b934f6a8d4176c858606a95" } -epaint = { git = "https://github.com/aiongg/egui.git", rev = "f678ecb710dfb98e4b934f6a8d4176c858606a95" } -epaint_default_fonts = { git = "https://github.com/aiongg/egui.git", rev = "f678ecb710dfb98e4b934f6a8d4176c858606a95" } -egui = { git = "https://github.com/aiongg/egui.git", rev = "f678ecb710dfb98e4b934f6a8d4176c858606a95" } -egui-winit = { git = "https://github.com/aiongg/egui.git", rev = "f678ecb710dfb98e4b934f6a8d4176c858606a95" } -egui-wgpu = { git = "https://github.com/aiongg/egui.git", rev = "f678ecb710dfb98e4b934f6a8d4176c858606a95" } -egui_glow = { git = "https://github.com/aiongg/egui.git", rev = "f678ecb710dfb98e4b934f6a8d4176c858606a95" } -egui_extras = { git = "https://github.com/aiongg/egui.git", rev = "f678ecb710dfb98e4b934f6a8d4176c858606a95" } -egui_kittest = { git = "https://github.com/aiongg/egui.git", rev = "f678ecb710dfb98e4b934f6a8d4176c858606a95" } -eframe = { git = "https://github.com/aiongg/egui.git", rev = "f678ecb710dfb98e4b934f6a8d4176c858606a95" } +hayro-syntax = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", version = "=0.7.2" } +hayro-jbig2 = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", version = "=0.3.0" } +ecolor = { git = "https://github.com/storytold/egui.git", rev = "b15ffe9bfc2c8e6748533b32b708e10abaf2afec" } +emath = { git = "https://github.com/storytold/egui.git", rev = "b15ffe9bfc2c8e6748533b32b708e10abaf2afec" } +epaint = { git = "https://github.com/storytold/egui.git", rev = "b15ffe9bfc2c8e6748533b32b708e10abaf2afec" } +epaint_default_fonts = { git = "https://github.com/storytold/egui.git", rev = "b15ffe9bfc2c8e6748533b32b708e10abaf2afec" } +egui = { git = "https://github.com/storytold/egui.git", rev = "b15ffe9bfc2c8e6748533b32b708e10abaf2afec" } +egui-winit = { git = "https://github.com/storytold/egui.git", rev = "b15ffe9bfc2c8e6748533b32b708e10abaf2afec" } +egui-wgpu = { git = "https://github.com/storytold/egui.git", rev = "b15ffe9bfc2c8e6748533b32b708e10abaf2afec" } +egui_glow = { git = "https://github.com/storytold/egui.git", rev = "b15ffe9bfc2c8e6748533b32b708e10abaf2afec" } +egui_extras = { git = "https://github.com/storytold/egui.git", rev = "b15ffe9bfc2c8e6748533b32b708e10abaf2afec" } +egui_kittest = { git = "https://github.com/storytold/egui.git", rev = "b15ffe9bfc2c8e6748533b32b708e10abaf2afec" } +eframe = { git = "https://github.com/storytold/egui.git", rev = "b15ffe9bfc2c8e6748533b32b708e10abaf2afec" } # Patch a crate only together with the dependency that needs it: an unused patch makes the Nix # build, which uses vendored sources, fail (`cargo xtask lock-patches`). winit = { git = "https://github.com/storytold/winit.git", rev = "a517b3846ee8457d84ee4975110bfda6797c44dc" } diff --git a/crates/effects/Cargo.toml b/crates/effects/Cargo.toml index 035afb76e..d0b636e6d 100644 --- a/crates/effects/Cargo.toml +++ b/crates/effects/Cargo.toml @@ -10,7 +10,7 @@ rust-version.workspace = true workspace = true [dependencies] -craft-cms = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "c933a90624b7a5669df284cfdf53726694636bba" } +craft-cms = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } effectcraft-geom = { workspace = true } effectcraft-color = { workspace = true } effectcraft-keyframe = { workspace = true } diff --git a/xtask/src/pdf_deps.rs b/xtask/src/pdf_deps.rs index 15da0dac7..0516ab16e 100644 --- a/xtask/src/pdf_deps.rs +++ b/xtask/src/pdf_deps.rs @@ -5,7 +5,7 @@ use std::process::Command; use serde_json::Value; -const REV: &str = "068e079c7be4b100a8a6b305b31ac881e069727e"; +const REV: &str = "16001e7210bee61db60c84fbe18c3c3e2ef4584f"; const PACKAGES: &[(&str, &str)] = &[("craft-pdf", "0.1.0"), ("craft-ps", "0.1.0"), ("hayro-syntax", "0.7.2"), ("hayro-jbig2", "0.3.0")]; pub fn run(root: &Path) -> Result<(), String> { From afb7ee6868bb76574313f384f326813fd8e47943 Mon Sep 17 00:00:00 2001 From: aiongg Date: Wed, 25 Nov 2026 07:30:36 +0000 Subject: [PATCH 435/451] pdf-deps checks craft-libs from the repository Cargo.toml pins --- xtask/src/pdf_deps.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/xtask/src/pdf_deps.rs b/xtask/src/pdf_deps.rs index 0516ab16e..4d42164bf 100644 --- a/xtask/src/pdf_deps.rs +++ b/xtask/src/pdf_deps.rs @@ -5,6 +5,8 @@ use std::process::Command; use serde_json::Value; +// The repository Cargo.toml pins craft-libs from (the aiongg fork while filmcraft-media pins storytold craft-libs). +const REPO: &str = "https://github.com/aiongg/craft-libs"; const REV: &str = "16001e7210bee61db60c84fbe18c3c3e2ef4584f"; const PACKAGES: &[(&str, &str)] = &[("craft-pdf", "0.1.0"), ("craft-ps", "0.1.0"), ("hayro-syntax", "0.7.2"), ("hayro-jbig2", "0.3.0")]; @@ -26,7 +28,7 @@ pub fn run(root: &Path) -> Result<(), String> { fn validate(metadata: &Value) -> Result<(), String> { let packages = metadata.get("packages").and_then(Value::as_array).ok_or("cargo metadata has no packages")?; let nodes = metadata.pointer("/resolve/nodes").and_then(Value::as_array).ok_or("cargo metadata has no resolved nodes")?; - let source = format!("git+https://github.com/storytold/craft-libs?rev={REV}#{REV}"); + let source = format!("git+{REPO}?rev={REV}#{REV}"); for (name, version) in PACKAGES { let matches: Vec<_> = packages.iter().filter(|p| p["name"] == *name).collect(); if matches.len() != 1 || matches[0]["version"] != *version || matches[0]["source"] != source { @@ -57,9 +59,10 @@ mod tests { use serde_json::json; fn metadata() -> Value { - let packages: Vec<_> = PACKAGES.iter().map(|(name, version)| { - json!({"id": name, "name": name, "version": version, "source": format!("git+https://github.com/storytold/craft-libs?rev={REV}#{REV}")}) - }).collect(); + let packages: Vec<_> = PACKAGES + .iter() + .map(|(name, version)| json!({"id": name, "name": name, "version": version, "source": format!("git+{REPO}?rev={REV}#{REV}")})) + .collect(); json!({"packages": packages, "resolve": {"nodes": [ {"id": "hayro-syntax", "features": ["std"]}, {"id": "craft-pdf", "features": ["read"]}, {"id": "craft-ps", "features": ["read"]} From 6a51e00441927ea9f3792d2fee1e5011330b0730 Mon Sep 17 00:00:00 2001 From: aiongg Date: Wed, 25 Nov 2026 13:43:59 +0000 Subject: [PATCH 436/451] Repin craft-libs to storytold next d1bdf8e5da --- Cargo.lock | 156 +++++++++++++++++++------------------- Cargo.toml | 112 +++++++++++++-------------- crates/effects/Cargo.toml | 2 +- xtask/src/pdf_deps.rs | 2 +- 4 files changed, 136 insertions(+), 136 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c18c0b1df..636453897 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1304,23 +1304,23 @@ dependencies = [ [[package]] name = "craft-aaf" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "craft-audio", "craft-cfb", - "craft-timeline 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f)", + "craft-timeline 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e)", "thiserror 2.0.21", ] [[package]] name = "craft-aep" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" [[package]] name = "craft-appkit" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "block2 0.6.2", "objc2-app-kit 0.3.2", @@ -1330,7 +1330,7 @@ dependencies = [ [[package]] name = "craft-atomic" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "rustix 1.1.6", ] @@ -1338,7 +1338,7 @@ dependencies = [ [[package]] name = "craft-audio" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "craft-media", "craft-xml", @@ -1351,7 +1351,7 @@ dependencies = [ [[package]] name = "craft-behavior" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "accesskit", "bitflags 2.13.2", @@ -1369,12 +1369,12 @@ dependencies = [ [[package]] name = "craft-cfb" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" [[package]] name = "craft-cloud-ui" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "egui", ] @@ -1382,7 +1382,7 @@ dependencies = [ [[package]] name = "craft-cms" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "md-5", "rayon", @@ -1391,12 +1391,12 @@ dependencies = [ [[package]] name = "craft-codepage" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" [[package]] name = "craft-color" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "serde", ] @@ -1404,7 +1404,7 @@ dependencies = [ [[package]] name = "craft-doc" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "craft-ecproj-format", "craft-pcraft-format", @@ -1418,7 +1418,7 @@ dependencies = [ [[package]] name = "craft-docpath" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "serde", ] @@ -1426,7 +1426,7 @@ dependencies = [ [[package]] name = "craft-dpx" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "thiserror 2.0.21", ] @@ -1434,7 +1434,7 @@ dependencies = [ [[package]] name = "craft-ecproj-format" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "serde", "serde_json", @@ -1444,12 +1444,12 @@ dependencies = [ [[package]] name = "craft-eps" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" [[package]] name = "craft-exr" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "exr", "flate2", @@ -1461,7 +1461,7 @@ dependencies = [ [[package]] name = "craft-font-catalog" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "harfrust 0.13.3", "kurbo", @@ -1475,12 +1475,12 @@ dependencies = [ [[package]] name = "craft-fonts-build" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" [[package]] name = "craft-frame" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "craft-color", "craft-time", @@ -1491,7 +1491,7 @@ dependencies = [ [[package]] name = "craft-gif" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "gif", "image", @@ -1500,7 +1500,7 @@ dependencies = [ [[package]] name = "craft-hdr" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "thiserror 2.0.21", ] @@ -1508,7 +1508,7 @@ dependencies = [ [[package]] name = "craft-host" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "bitflags 2.13.2", "craft-i18n", @@ -1521,7 +1521,7 @@ dependencies = [ [[package]] name = "craft-i18n" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "chrono", "fixed_decimal", @@ -1549,7 +1549,7 @@ dependencies = [ [[package]] name = "craft-jpeg" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "thiserror 2.0.21", ] @@ -1557,7 +1557,7 @@ dependencies = [ [[package]] name = "craft-jsonrpc" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "serde_json", ] @@ -1565,7 +1565,7 @@ dependencies = [ [[package]] name = "craft-keymap" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "craft-host", "craft-i18n", @@ -1580,7 +1580,7 @@ dependencies = [ [[package]] name = "craft-lottie" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "craft-zip", "serde_json", @@ -1590,7 +1590,7 @@ dependencies = [ [[package]] name = "craft-media" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "chrono", "thiserror 2.0.21", @@ -1599,7 +1599,7 @@ dependencies = [ [[package]] name = "craft-media-source" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "craft-audio", "craft-color", @@ -1614,7 +1614,7 @@ dependencies = [ [[package]] name = "craft-mesh" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "craft-zip", "miniz_oxide 0.9.1", @@ -1624,7 +1624,7 @@ dependencies = [ [[package]] name = "craft-mime" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "chrono", "craft-codepage", @@ -1634,7 +1634,7 @@ dependencies = [ [[package]] name = "craft-pcraft-format" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "flate2", "serde", @@ -1645,7 +1645,7 @@ dependencies = [ [[package]] name = "craft-pdf" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "hayro-syntax", "serde", @@ -1655,7 +1655,7 @@ dependencies = [ [[package]] name = "craft-platform" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "async-channel", "async-io", @@ -1686,7 +1686,7 @@ dependencies = [ [[package]] name = "craft-ps" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "craft-eps", "kurbo", @@ -1699,7 +1699,7 @@ dependencies = [ [[package]] name = "craft-psd" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "encoding_rs", "flate2", @@ -1710,7 +1710,7 @@ dependencies = [ [[package]] name = "craft-quit" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "dispatch2", "objc2 0.6.5", @@ -1722,7 +1722,7 @@ dependencies = [ [[package]] name = "craft-raw" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "craft-tiff", "miniz_oxide 0.9.1", @@ -1736,7 +1736,7 @@ dependencies = [ [[package]] name = "craft-settings" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "craft-atomic", "craft-host", @@ -1753,12 +1753,12 @@ dependencies = [ [[package]] name = "craft-sniff" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" [[package]] name = "craft-svg" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "craft-xml", "flate2", @@ -1775,7 +1775,7 @@ dependencies = [ [[package]] name = "craft-tga" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "thiserror 2.0.21", ] @@ -1783,7 +1783,7 @@ dependencies = [ [[package]] name = "craft-theme" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "bitflags 2.13.2", "craft-tracked", @@ -1798,7 +1798,7 @@ dependencies = [ [[package]] name = "craft-tiff" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "serde", "thiserror 2.0.21", @@ -1807,22 +1807,12 @@ dependencies = [ [[package]] name = "craft-time" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "serde", "thiserror 2.0.21", ] -[[package]] -name = "craft-timeline" -version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" -dependencies = [ - "craft-time", - "serde", - "web-time", -] - [[package]] name = "craft-timeline" version = "0.1.0" @@ -1834,15 +1824,25 @@ dependencies = [ "serde_json", ] +[[package]] +name = "craft-timeline" +version = "0.1.0" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +dependencies = [ + "craft-time", + "serde", + "web-time", +] + [[package]] name = "craft-tracked" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" [[package]] name = "craft-ui" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "craft-cloud-ui", "craft-ui-canvas", @@ -1856,7 +1856,7 @@ dependencies = [ [[package]] name = "craft-ui-canvas" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "craft-behavior", "craft-i18n", @@ -1872,7 +1872,7 @@ dependencies = [ [[package]] name = "craft-ui-contract" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "accesskit", "craft-behavior", @@ -1910,7 +1910,7 @@ dependencies = [ [[package]] name = "craft-ui-macros" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -1921,7 +1921,7 @@ dependencies = [ [[package]] name = "craft-ui-panels" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "craft-behavior", "craft-host", @@ -1939,7 +1939,7 @@ dependencies = [ [[package]] name = "craft-ui-patterns" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "craft-behavior", "craft-host", @@ -1960,7 +1960,7 @@ dependencies = [ [[package]] name = "craft-ui-shell" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "craft-behavior", "craft-host", @@ -1980,7 +1980,7 @@ dependencies = [ [[package]] name = "craft-ui-widgets" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "craft-behavior", "craft-host", @@ -1999,7 +1999,7 @@ dependencies = [ [[package]] name = "craft-update" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "chrono", "craft-host", @@ -2028,7 +2028,7 @@ dependencies = [ [[package]] name = "craft-vectorcraft-format" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "flate2", "serde", @@ -2039,7 +2039,7 @@ dependencies = [ [[package]] name = "craft-video" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "craft-media", "rav1e", @@ -2050,7 +2050,7 @@ dependencies = [ [[package]] name = "craft-webp" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "image", "thiserror 2.0.21", @@ -2059,7 +2059,7 @@ dependencies = [ [[package]] name = "craft-win32" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "winsafe", ] @@ -2067,7 +2067,7 @@ dependencies = [ [[package]] name = "craft-window" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "craft-appkit", "craft-atomic", @@ -2091,7 +2091,7 @@ dependencies = [ [[package]] name = "craft-xml" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "quick-xml 0.41.0", "serde", @@ -2101,7 +2101,7 @@ dependencies = [ [[package]] name = "craft-y4m" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "thiserror 2.0.21", ] @@ -2109,7 +2109,7 @@ dependencies = [ [[package]] name = "craft-zip" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "flate2", "thiserror 2.0.21", @@ -2678,7 +2678,7 @@ dependencies = [ name = "effectcraft-interchange" version = "0.25.1" dependencies = [ - "craft-timeline 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f)", + "craft-timeline 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e)", "effectcraft-color", "effectcraft-keyframe", "effectcraft-project", @@ -4249,7 +4249,7 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a" [[package]] name = "hayro-jbig2" version = "0.3.0" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "hayro-ccitt", ] @@ -4263,7 +4263,7 @@ checksum = "c75ab947623ef4ccaa7acf0579edf7cbb5a73838e3839a7be73335e522f433a1" [[package]] name = "hayro-syntax" version = "0.7.2" -source = "git+https://github.com/aiongg/craft-libs?rev=16001e7210bee61db60c84fbe18c3c3e2ef4584f#16001e7210bee61db60c84fbe18c3c3e2ef4584f" +source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" dependencies = [ "hayro-jbig2", "hayro-jpeg2000", diff --git a/Cargo.toml b/Cargo.toml index e12851c2b..5e696f0b4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,28 +11,28 @@ rust-version = "1.95" repository = "https://github.com/storytold/effectcraft" [workspace.dependencies] -craft-timeline = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", default-features = false } -craft-mime = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } -craft-pdf = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", version = "=0.1.0", default-features = false, features = ["read"] } -craft-docpath = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } -craft-jsonrpc = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } -craft-ecproj-format = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } -craft-dpx = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } -craft-ps = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", default-features = false, features = ["read"] } -craft-exr = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } -craft-gif = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } -craft-tga = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } -craft-psd = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } -craft-codepage = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } -craft-svg = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } -craft-webp = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } -craft-lottie = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } -craft-mesh = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", default-features = false, features = ["stl", "obj", "gltf", "fbx"] } -craft-aep = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } -craft-doc = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } -craft-vectorcraft-format = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } +craft-timeline = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", default-features = false } +craft-mime = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } +craft-pdf = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", version = "=0.1.0", default-features = false, features = ["read"] } +craft-docpath = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } +craft-jsonrpc = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } +craft-ecproj-format = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } +craft-dpx = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } +craft-ps = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", default-features = false, features = ["read"] } +craft-exr = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } +craft-gif = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } +craft-tga = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } +craft-psd = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } +craft-codepage = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } +craft-svg = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } +craft-webp = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } +craft-lottie = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } +craft-mesh = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", default-features = false, features = ["stl", "obj", "gltf", "fbx"] } +craft-aep = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } +craft-doc = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } +craft-vectorcraft-format = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } # craft-update: app-specific pretend versions apply to startup and manual checks. -craft-update = { git = "https://github.com/aiongg/craft-libs", version = "=0.1.0", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", features = ["ui"] } +craft-update = { git = "https://github.com/aiongg/craft-libs", version = "=0.1.0", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", features = ["ui"] } # internal effectcraft-time = { path = "crates/time" } effectcraft-geom = { path = "crates/geom" } @@ -97,13 +97,13 @@ same-file = "1.0" tempfile = "3.27" # codecs + containers shared by the Craft apps (crates/media, crates/export); keep all in sync. -craft-media = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", default-features = false, features = ["isobmff", "matroska"] } -craft-media-source = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } -craft-frame = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } -craft-color = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } -craft-time = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } -craft-audio = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", default-features = false, features = ["aac-decode", "aac-encode", "alac-decode", "opus-decode", "opus-encode", "ac3-decode", "mp3-decode", "mpa-decode"] } -craft-video = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", features = ["h264-decode", "h264-encode", "prores", "hevc-encode", "vp9-encode", "av1", "threads"] } +craft-media = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", default-features = false, features = ["isobmff", "matroska"] } +craft-media-source = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } +craft-frame = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } +craft-color = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } +craft-time = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } +craft-audio = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", default-features = false, features = ["aac-decode", "aac-encode", "alac-decode", "opus-decode", "opus-encode", "ac3-decode", "mp3-decode", "mpa-decode"] } +craft-video = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", features = ["h264-decode", "h264-encode", "prores", "hevc-encode", "vp9-encode", "av1", "threads"] } # footage decoding: FilmCraft's pure-Rust crates, pinned to a revision (plan/adr/0001). # Only `crates/media`, `crates/export` and `crates/interchange` may depend on these. @@ -126,12 +126,12 @@ half = "2.7" # ui # Shared frontend components; keep this dependency above the engine boundary. # Shared UI and the complete egui family select reviewed immutable commits below. -craft-ui = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } -craft-behavior = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } -craft-host = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } -craft-keymap = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } -craft-theme = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } -craft-window = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } +craft-ui = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } +craft-behavior = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } +craft-host = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } +craft-keymap = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } +craft-theme = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } +craft-window = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } # `default_fonts` and `monochrome_emoji_fonts` are explicit: the app's `FontDefinitions::default()` # and its `✔`/`▣` chrome glyphs need both, and kittest's own dev-dependencies do not propagate. egui = { version = "0.37", default-features = false, features = ["default_fonts", "monochrome_emoji_fonts"] } @@ -237,30 +237,30 @@ codegen-units = 1 # filmcraft-media pins storytold craft-libs; the app needs one copy of each crate. [patch."https://github.com/storytold/craft-libs"] -craft-aaf = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", version = "=0.1.0" } -craft-audio = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", version = "=0.1.0" } -craft-cfb = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", version = "=0.1.0" } -craft-color = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", version = "=0.1.0" } -craft-dpx = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", version = "=0.1.0" } -craft-exr = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", version = "=0.1.0" } -craft-frame = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", version = "=0.1.0" } -craft-hdr = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", version = "=0.1.0" } -craft-jpeg = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", version = "=0.1.0" } -craft-media = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", version = "=0.1.0" } -craft-media-source = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", version = "=0.1.0" } -craft-psd = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", version = "=0.1.0" } -craft-raw = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", version = "=0.1.0" } -craft-sniff = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", version = "=0.1.0" } -craft-tga = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", version = "=0.1.0" } -craft-tiff = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", version = "=0.1.0" } -craft-time = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", version = "=0.1.0" } -craft-video = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", version = "=0.1.0" } -craft-xml = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", version = "=0.1.0" } -craft-y4m = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", version = "=0.1.0" } +craft-aaf = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", version = "=0.1.0" } +craft-audio = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", version = "=0.1.0" } +craft-cfb = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", version = "=0.1.0" } +craft-color = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", version = "=0.1.0" } +craft-dpx = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", version = "=0.1.0" } +craft-exr = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", version = "=0.1.0" } +craft-frame = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", version = "=0.1.0" } +craft-hdr = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", version = "=0.1.0" } +craft-jpeg = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", version = "=0.1.0" } +craft-media = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", version = "=0.1.0" } +craft-media-source = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", version = "=0.1.0" } +craft-psd = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", version = "=0.1.0" } +craft-raw = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", version = "=0.1.0" } +craft-sniff = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", version = "=0.1.0" } +craft-tga = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", version = "=0.1.0" } +craft-tiff = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", version = "=0.1.0" } +craft-time = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", version = "=0.1.0" } +craft-video = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", version = "=0.1.0" } +craft-xml = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", version = "=0.1.0" } +craft-y4m = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", version = "=0.1.0" } [patch.crates-io] -hayro-syntax = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", version = "=0.7.2" } -hayro-jbig2 = { git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f", version = "=0.3.0" } +hayro-syntax = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", version = "=0.7.2" } +hayro-jbig2 = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", version = "=0.3.0" } ecolor = { git = "https://github.com/storytold/egui.git", rev = "b15ffe9bfc2c8e6748533b32b708e10abaf2afec" } emath = { git = "https://github.com/storytold/egui.git", rev = "b15ffe9bfc2c8e6748533b32b708e10abaf2afec" } epaint = { git = "https://github.com/storytold/egui.git", rev = "b15ffe9bfc2c8e6748533b32b708e10abaf2afec" } diff --git a/crates/effects/Cargo.toml b/crates/effects/Cargo.toml index d0b636e6d..a14481e5b 100644 --- a/crates/effects/Cargo.toml +++ b/crates/effects/Cargo.toml @@ -10,7 +10,7 @@ rust-version.workspace = true workspace = true [dependencies] -craft-cms = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "16001e7210bee61db60c84fbe18c3c3e2ef4584f" } +craft-cms = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } effectcraft-geom = { workspace = true } effectcraft-color = { workspace = true } effectcraft-keyframe = { workspace = true } diff --git a/xtask/src/pdf_deps.rs b/xtask/src/pdf_deps.rs index 4d42164bf..f9c386cea 100644 --- a/xtask/src/pdf_deps.rs +++ b/xtask/src/pdf_deps.rs @@ -7,7 +7,7 @@ use serde_json::Value; // The repository Cargo.toml pins craft-libs from (the aiongg fork while filmcraft-media pins storytold craft-libs). const REPO: &str = "https://github.com/aiongg/craft-libs"; -const REV: &str = "16001e7210bee61db60c84fbe18c3c3e2ef4584f"; +const REV: &str = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e"; const PACKAGES: &[(&str, &str)] = &[("craft-pdf", "0.1.0"), ("craft-ps", "0.1.0"), ("hayro-syntax", "0.7.2"), ("hayro-jbig2", "0.3.0")]; pub fn run(root: &Path) -> Result<(), String> { From e5bf0ca05af7ecd33b6aad0453a94847e8480339 Mon Sep 17 00:00:00 2001 From: aiongg Date: Wed, 25 Nov 2026 13:45:03 +0000 Subject: [PATCH 437/451] Ask for a new IME reset when the integration retires the request --- crates/ui-egui/src/panels/viewer_text.rs | 8 ++++++++ crates/ui-egui/src/panels/viewer_text/tests.rs | 12 ++++++++++++ 2 files changed, 20 insertions(+) diff --git a/crates/ui-egui/src/panels/viewer_text.rs b/crates/ui-egui/src/panels/viewer_text.rs index d4a5c8ccf..cce2884c3 100644 --- a/crates/ui-egui/src/panels/viewer_text.rs +++ b/crates/ui-egui/src/panels/viewer_text.rs @@ -1112,6 +1112,14 @@ fn keyboard(app: &mut EffectcraftApp, ui: &mut egui::Ui, viewer: Rect) { } continue; } + if let egui::Event::ImeResetRetired { request_id } = &ev { + // The integration dropped the request and no completion will follow: ask again, or the + // composition stays stale forever. + if custom_mutations && read_reset(&ctx).is_some_and(|guard| !guard.suspended && guard.request == Some(*request_id)) { + request_reset(app, &ctx); + } + continue; + } sync_ime_target(ui, app); sync_ime_selection(ui, app); if matches!(&ev, egui::Event::PointerButton { pos, pressed: true, .. } if !viewer.contains(*pos)) { diff --git a/crates/ui-egui/src/panels/viewer_text/tests.rs b/crates/ui-egui/src/panels/viewer_text/tests.rs index 5a9c544ec..dbfec13b7 100644 --- a/crates/ui-egui/src/panels/viewer_text/tests.rs +++ b/crates/ui-egui/src/panels/viewer_text/tests.rs @@ -318,6 +318,18 @@ fn discarded_custom_request_then_home_rearms_the_identical_caret() { assert_eq!(doc_text(&app, lid), "aがbcd"); } +#[test] +fn a_retired_reset_request_is_asked_again() { + let (mut app, _) = editor("abcd", 4, 4); + let mut pass = ImePass::new(egui::ViewportId::ROOT); + let preview = || egui::Event::Ime(egui::ImeEvent::Preedit { text: "é".into(), active_range_chars: None }); + pass.frame(&mut app, vec![preview()], true, false); + app.session.execute("text.setSelection", json!({"caret": 1})).unwrap(); + let first = pass.frame(&mut app, vec![], true, false).unwrap().reset_request.unwrap(); + let again = pass.frame(&mut app, vec![egui::Event::ImeResetRetired { request_id: first }], true, false).unwrap().reset_request; + assert!(again.is_some_and(|id| id != first), "a retired request is replaced by a new one"); +} + #[test] fn viewport_fences_and_duplicate_completion_keep_their_exact_lifetime() { let (mut app, lid) = editor("abcd", 4, 4); From 121be81389416e59dc4d1822bf7fdf99d62f0322 Mon Sep 17 00:00:00 2001 From: aiongg Date: Wed, 25 Nov 2026 14:22:08 +0000 Subject: [PATCH 438/451] The focused Composition viewer leaves the keyboard to the app --- crates/ui-egui/src/framework.rs | 30 ++++++++++++-- crates/ui-egui/src/menus/shortcuts.rs | 4 +- crates/ui-egui/src/native_menu.rs | 4 +- crates/ui-egui/src/panels.rs | 2 +- .../ui-egui/src/panels/camera_tracker_ui.rs | 2 +- crates/ui-egui/src/panels/effects_presets.rs | 2 +- crates/ui-egui/src/panels/flowchart.rs | 2 +- crates/ui-egui/src/panels/project.rs | 6 +-- crates/ui-egui/src/panels/render_queue.rs | 4 +- crates/ui-egui/src/panels/viewer.rs | 6 +-- crates/ui-egui/src/panels/viewer_tools.rs | 2 +- crates/ui-egui/tests/it/ui_viewer.rs | 39 +++++++++++++++++++ 12 files changed, 82 insertions(+), 21 deletions(-) diff --git a/crates/ui-egui/src/framework.rs b/crates/ui-egui/src/framework.rs index 0e54530ae..de2981220 100644 --- a/crates/ui-egui/src/framework.rs +++ b/crates/ui-egui/src/framework.rs @@ -115,12 +115,34 @@ impl EffectcraftApp { } } -/// Declares the Composition viewer `id`, drawn in this pass, as the window's document canvas. With nothing focused it +/// The Composition viewer's widget, its window's document canvas. +pub(crate) fn viewer_id() -> egui::Id { + egui::Id::unique("viewer-interact") +} + +/// Declares the Composition viewer, drawn in this pass, as the window's document canvas. With nothing focused it /// is the window's key target: the edit chords and the clipboard events stay in -/// egui's input for EffectCraft's shortcuts. -pub(crate) fn host_canvas(ctx: &egui::Context, id: egui::Id) { +/// egui's input for EffectCraft's shortcuts. Escape with the viewer focused is the viewer's own: it lets go of the +/// keyboard, as egui's other widgets do. +pub(crate) fn host_canvas(ctx: &egui::Context) { const KEYS: KeyUse = KeyUse::CANVAS.with_edits(EditSet::ALL); - craft_ui::runtime::focus::host_canvas(ctx, id, KEYS); + craft_ui::runtime::focus::host_canvas(ctx, viewer_id(), KEYS); + // Read from the raw input, so an Escape that a popup consumed earlier in the pass counts. + let escape = |event: &egui::Event| matches!(event, egui::Event::Key { key: egui::Key::Escape, pressed: true, modifiers, .. } if !modifiers.any()); + if ctx.input(|i| i.raw.events.iter().any(escape)) { + ctx.memory_mut(|m| m.surrender_focus(viewer_id())); + } +} + +/// The widget other than the Composition viewer that has the keyboard. The viewer as the focused Tab stop leaves the +/// keys to EffectCraft, as with nothing focused. +pub(crate) fn focused_widget(ctx: &egui::Context) -> Option { + ctx.memory(|m| m.focused()).filter(|id| *id != viewer_id()) +} + +/// Whether a widget other than the Composition viewer has the keyboard ([`focused_widget`]). +pub(crate) fn widget_has_keyboard(ctx: &egui::Context) -> bool { + focused_widget(ctx).is_some() } /// Puts the window's Escape (the key the runtime routes to no component while nothing has framework focus) back into diff --git a/crates/ui-egui/src/menus/shortcuts.rs b/crates/ui-egui/src/menus/shortcuts.rs index eaca5568a..655d5c0b9 100644 --- a/crates/ui-egui/src/menus/shortcuts.rs +++ b/crates/ui-egui/src/menus/shortcuts.rs @@ -356,12 +356,12 @@ fn handle_shortcuts_impl(app: &mut EffectcraftApp, ctx: &egui::Context, tab_only } // A mouse button down while Spacebar is held belongs to the Hand tool: its release won't // preview. - if ctx.input(|i| i.pointer.any_down()) || ctx.egui_wants_keyboard_input() { + if ctx.input(|i| i.pointer.any_down()) || crate::framework::widget_has_keyboard(ctx) { ctx.data_mut(|d| d.remove::(space_tap_id())); } // While a menu or popup list is open, keys go to it, not to the app (Space must not start a // preview behind the menu, #279). - if ctx.egui_wants_keyboard_input() || crate::widgets::any_menu_open(ctx) { + if crate::framework::widget_has_keyboard(ctx) || crate::widgets::any_menu_open(ctx) { return; } // Text editing in the viewer takes the clipboard events itself. diff --git a/crates/ui-egui/src/native_menu.rs b/crates/ui-egui/src/native_menu.rs index 440a3a4cd..23e2a3512 100644 --- a/crates/ui-egui/src/native_menu.rs +++ b/crates/ui-egui/src/native_menu.rs @@ -441,12 +441,12 @@ impl MenuSync { /// The window whose text field has the keyboard: a floating panel's own OS window, or the main /// window, where any widget that holds the keyboard counts (the Viewer's text editor is not an -/// egui text field). +/// egui text field) except the Composition viewer itself. pub fn text_field_window(ctx: &egui::Context) -> Option { let host = craft_ui::runtime::windows::WindowHost::of(ctx); let window = host.key_window(); let floating = (window != egui::ViewportId::ROOT && host.typing()).then_some(window); - floating.or_else(|| ctx.egui_wants_keyboard_input().then_some(egui::ViewportId::ROOT)) + floating.or_else(|| crate::framework::widget_has_keyboard(ctx).then_some(egui::ViewportId::ROOT)) } /// Whether a focused text field takes the menu command `command` ([`activate`]): the native menu diff --git a/crates/ui-egui/src/panels.rs b/crates/ui-egui/src/panels.rs index b47492f53..d1bc695c0 100644 --- a/crates/ui-egui/src/panels.rs +++ b/crates/ui-egui/src/panels.rs @@ -184,7 +184,7 @@ pub(crate) fn toggle_time_display(app: &mut EffectcraftApp, resp: &egui::Respons /// Spacebar held outside a text field: the Hand tool (drags pan the viewer and scroll the /// Timeline). pub(crate) fn space_hand(ctx: &egui::Context) -> bool { - ctx.input(|i| i.key_down(egui::Key::Space)) && !ctx.egui_wants_keyboard_input() + ctx.input(|i| i.key_down(egui::Key::Space)) && !crate::framework::widget_has_keyboard(ctx) } /// What a scroll gesture over a viewer (Composition, Layer) does this frame. diff --git a/crates/ui-egui/src/panels/camera_tracker_ui.rs b/crates/ui-egui/src/panels/camera_tracker_ui.rs index fdda5f5d2..75344e79a 100644 --- a/crates/ui-egui/src/panels/camera_tracker_ui.rs +++ b/crates/ui-egui/src/panels/camera_tracker_ui.rs @@ -347,7 +347,7 @@ pub fn viewer_hook( && app.dialog.is_none() && !selected.is_empty() && ui.input(|i| i.key_pressed(egui::Key::Delete) || i.key_pressed(egui::Key::Backspace)) - && !ctx.egui_wants_keyboard_input() + && !crate::framework::widget_has_keyboard(&ctx) { run(app, &ctx, "camera.deletePoints", json!({"layer": a.layer.0, "effect": a.uid, "points": selected})); } diff --git a/crates/ui-egui/src/panels/effects_presets.rs b/crates/ui-egui/src/panels/effects_presets.rs index 165c7fb1b..9d4981a58 100644 --- a/crates/ui-egui/src/panels/effects_presets.rs +++ b/crates/ui-egui/src/panels/effects_presets.rs @@ -422,7 +422,7 @@ fn list_keys(app: &mut EffectcraftApp, ctx: &egui::Context, nav: &Nav, list: Rec ctx.data_mut(|d| d.remove::(cursor_id())); ctx.request_repaint(); } - let focused = ctx.memory(|m| m.focused()); + let focused = crate::framework::focused_widget(ctx); let on_row = focused.is_some_and(|f| nav.rows.iter().any(|r| r.id == f || r.star == Some(f))); // Enter / Space on the star are the star button's (it toggles the favourite), not the row's. let on_star = focused.is_some_and(|f| nav.rows.iter().any(|r| r.star == Some(f))); diff --git a/crates/ui-egui/src/panels/flowchart.rs b/crates/ui-egui/src/panels/flowchart.rs index d6d6fca01..6ad58bbb8 100644 --- a/crates/ui-egui/src/panels/flowchart.rs +++ b/crates/ui-egui/src/panels/flowchart.rs @@ -349,7 +349,7 @@ fn flow_keys( rects: &[Rect], cmds: &mut Vec<(String, Value)>, ) { - let focused = ctx.memory(|m| m.focused()); + let focused = crate::framework::focused_widget(ctx); let on_node = focused.is_some_and(|f| g.nodes.iter().any(|n| node_id(&n.id) == f)); let by_mouse = focused.is_none() && app.ui.focused == crate::dock::PanelKind::Flowchart; if (on_node || by_mouse) && app.dialog.is_none() && !widgets::any_menu_open(ctx) { diff --git a/crates/ui-egui/src/panels/project.rs b/crates/ui-egui/src/panels/project.rs index 3567e2dcc..d22ec7d0e 100644 --- a/crates/ui-egui/src/panels/project.rs +++ b/crates/ui-egui/src/panels/project.rs @@ -293,10 +293,10 @@ fn selection_seen_id() -> egui::Id { egui::Id::unique("proj-sel-seen") } -/// The focused widget is one of the panel's rows, or nothing has keyboard focus: the panel's keys +/// The focused widget is one of the panel's rows, or no widget has the keyboard: the panel's keys /// apply. Any other focused widget (a text field, a button reached with Tab) keeps them. fn keys_reach_rows(app: &EffectcraftApp, ctx: &egui::Context) -> bool { - match ctx.memory(|m| m.focused()) { + match crate::framework::focused_widget(ctx) { None => app.ui.focused == crate::dock::PanelKind::Project, Some(f) => ctx.data(|d| d.get_temp::(focused_row_id())).is_some_and(|row| row_id(row) == f), } @@ -330,7 +330,7 @@ fn keyboard_nav(app: &mut EffectcraftApp, ctx: &egui::Context) -> Option { return None; } - let row_focused = ctx.memory(|m| m.focused()).is_some(); + let row_focused = crate::framework::widget_has_keyboard(ctx); let mut moved = None; for (key, m) in keys { let (plain, shift) = (!m.any(), m.shift_only()); diff --git a/crates/ui-egui/src/panels/render_queue.rs b/crates/ui-egui/src/panels/render_queue.rs index 6c5963908..2b1ac4826 100644 --- a/crates/ui-egui/src/panels/render_queue.rs +++ b/crates/ui-egui/src/panels/render_queue.rs @@ -746,7 +746,7 @@ fn delete_selected(app: &EffectcraftApp, ui: &egui::Ui, allowed: bool, on_row: b && !crate::widgets::any_menu_open(ui.ctx()) && ui.input(|i| i.key_pressed(egui::Key::Delete) || i.key_pressed(egui::Key::Backspace)) // (A focused queue row is not typing; any other focused widget may be.) - && (on_row || !ui.ctx().egui_wants_keyboard_input()) + && (on_row || !crate::framework::widget_has_keyboard(ui.ctx())) { actions.push(("renderQueue.remove", json!({"item": id}))); *selected = None; @@ -767,7 +767,7 @@ fn list_keys( tops: &[(u64, f32)], list_h: f32, ) -> bool { - let focused = ctx.memory(|m| m.focused()); + let focused = crate::framework::focused_widget(ctx); let on_row = focused.is_some_and(|f| queue.iter().any(|i| row_id(i.id) == f)); let by_mouse = focused.is_none() && app.ui.focused == crate::dock::PanelKind::RenderQueue; if (on_row || by_mouse) && can_navigate && app.dialog.is_none() && !widgets::any_menu_open(ctx) { diff --git a/crates/ui-egui/src/panels/viewer.rs b/crates/ui-egui/src/panels/viewer.rs index 41c2f2ab1..45abbc049 100644 --- a/crates/ui-egui/src/panels/viewer.rs +++ b/crates/ui-egui/src/panels/viewer.rs @@ -547,7 +547,7 @@ fn phase_layers(app: &mut EffectcraftApp, ui: &mut egui::Ui, ectx: &EvalCtx, v: let sel_vertices = app.session.state.selected_vertices.clone(); // Pen path in progress ends when the tool changes or its mask is gone; Esc / Enter also end // free transform. - let finish = ui.input(|i| i.key_pressed(egui::Key::Escape) || i.key_pressed(egui::Key::Enter)) && !ctx.egui_wants_keyboard_input(); + let finish = ui.input(|i| i.key_pressed(egui::Key::Escape) || i.key_pressed(egui::Key::Enter)) && !crate::framework::widget_has_keyboard(&ctx); if app.ui.tool != Tool::Pen || finish { ui.data_mut(|d| d.remove::<(LayerId, u64)>(pen_id())); } @@ -884,8 +884,8 @@ fn phase_menu(app: &mut EffectcraftApp, ui: &mut egui::Ui, ectx: &EvalCtx, v: &m super::viewer_drop::show(app, ui, &painter, &map, ectx); // Interaction. - let resp = ui.interact(area, egui::Id::unique("viewer-interact"), Sense::click_and_drag()); - crate::framework::host_canvas(ui.ctx(), resp.id); + let resp = ui.interact(area, crate::framework::viewer_id(), Sense::click_and_drag()); + crate::framework::host_canvas(ui.ctx()); let menu_hits_id = egui::Id::unique(("viewer-menu-hits", cid.0)); // A right-click an overlay took (the Cryptomatte eyedropper's) opens the menu too. let forwarded = ui.data_mut(|d| d.remove_temp::(egui::Id::unique(FORWARDED_SECONDARY))); diff --git a/crates/ui-egui/src/panels/viewer_tools.rs b/crates/ui-egui/src/panels/viewer_tools.rs index 1901eb01b..2bf1df122 100644 --- a/crates/ui-egui/src/panels/viewer_tools.rs +++ b/crates/ui-egui/src/panels/viewer_tools.rs @@ -346,7 +346,7 @@ pub(crate) fn shown_region(ctx: &egui::Context, comp: [f32; 2]) -> [f64; 4] { /// Show Snapshot: the stored snapshot is on screen (button or F5 held). pub(crate) fn showing_snapshot(app: &EffectcraftApp, ctx: &egui::Context) -> bool { - let f5 = ctx.input(|i| i.key_down(egui::Key::F5)) && !ctx.egui_wants_keyboard_input(); + let f5 = ctx.input(|i| i.key_down(egui::Key::F5)) && !crate::framework::widget_has_keyboard(ctx); app.session.snapshot.is_some() && (app.session.state.viewer.show_snapshot || f5) } diff --git a/crates/ui-egui/tests/it/ui_viewer.rs b/crates/ui-egui/tests/it/ui_viewer.rs index ef59cf6cf..7071af7d2 100644 --- a/crates/ui-egui/tests/it/ui_viewer.rs +++ b/crates/ui-egui/tests/it/ui_viewer.rs @@ -278,6 +278,45 @@ fn viewer_double_click_on_a_covered_path_of_the_selected_layer_free_transforms_i assert!(h.state().auto.find("viewer.freeTransform.handle.0").is_some(), "the free-transform box is up"); } +/// The Composition viewer as the focused Tab stop leaves the keys to the app, and Escape also makes it +/// let go of the keyboard. +#[test] +fn the_focused_viewer_leaves_the_keys_to_the_app() { + use craft_ui::runtime::focus::{FocusTarget, request}; + let viewer = egui::Id::unique("viewer-interact"); + let mut h = selection_harness(); + let layer = h.state().session.active_comp().unwrap().layers[0].id; + let s = &mut h.state_mut().session; + s.execute("layer.select", json!({"layers": [layer.0]})).unwrap(); + s.execute("mask.new", json!({"layer": layer.0, "vertices": [[10, 10], [70, 10], [70, 70], [10, 70]], "closed": true})).unwrap(); + h.run_steps(40); + let at = screen(&h, [320.0, 150.0]); + h.input_mut().events.push(Event::PointerMoved(at)); + h.step(); + for _ in 0..2 { + for pressed in [true, false] { + h.input_mut().events.push(Event::PointerButton { pos: at, button: egui::PointerButton::Primary, pressed, modifiers: Default::default() }); + } + h.step(); + } + h.run_steps(3); + assert!(h.state().auto.find("viewer.freeTransform.handle.0").is_some(), "the free-transform box is up"); + let focus_viewer = |h: &mut Harness<'_, EffectcraftApp>| { + request(&h.ctx, FocusTarget::Id(viewer)); + h.run_steps(2); + assert_eq!(h.ctx.memory(|m| m.focused()), Some(viewer)); + }; + focus_viewer(&mut h); + assert_eq!(effectcraft_ui_egui::native_menu::text_field_window(&h.ctx), None, "the Edit menu's commands are the app's"); + key(&mut h, egui::Key::Escape, egui::Modifiers::NONE); + assert!(h.state().auto.find("viewer.freeTransform.handle.0").is_none(), "Escape ends the free transform"); + assert_eq!(h.ctx.memory(|m| m.focused()), None, "and the viewer lets go of the keyboard"); + focus_viewer(&mut h); + key(&mut h, egui::Key::H, egui::Modifiers::NONE); + assert_eq!(h.state().ui.tool, Tool::Hand, "a tool shortcut runs"); + assert_eq!(h.ctx.memory(|m| m.focused()), Some(viewer)); +} + /// A double-click where a precomp layer covers the selected layer opens the precomp: like a single /// click, it acts on the topmost layer, which its first click selects (#1535). #[test] From ea50d791086ea569b889f176e88d0178eea9aca8 Mon Sep 17 00:00:00 2001 From: aiongg Date: Wed, 25 Nov 2026 14:23:42 +0000 Subject: [PATCH 439/451] A floating panel's window hands the main window only the keys and clipboard events no widget has --- crates/ui-egui/src/dock_ui.rs | 45 +++++++++++++----- .../ui-egui/tests/it/native_menu_text_keys.rs | 46 ++++++++++++++++++- 2 files changed, 78 insertions(+), 13 deletions(-) diff --git a/crates/ui-egui/src/dock_ui.rs b/crates/ui-egui/src/dock_ui.rs index 86862885f..d21e790cc 100644 --- a/crates/ui-egui/src/dock_ui.rs +++ b/crates/ui-egui/src/dock_ui.rs @@ -401,7 +401,7 @@ impl EffectcraftApp { let ime = NativeIme::new(&shown.layout().floating, &self.live_dock.windows, &self.unpublished_viewports); let mut child = ui.new_child(egui::UiBuilder::new().max_rect(body).id_salt("effectcraft-dock-area")); child.set_clip_rect(body.intersect(ui.clip_rect())); - let mut panels = EffectPanels { app: &mut *self, tokens: t, locks: Vec::new(), menu: None, bodies: Vec::new(), ime }; + let mut panels = EffectPanels { app: &mut *self, tokens: t, locks: Vec::new(), menu: None, bodies: Vec::new(), ime, focused_windows: Vec::new() }; let output = { let mut area = DockArea::new("Panels", Bind::given(Arc::clone(&shown)), &specs, &mut panels, dock_config()); if let Some(panel) = maximized { @@ -415,7 +415,7 @@ impl EffectcraftApp { } area.show(&mut child) }; - let EffectPanels { locks, menu, bodies, ime, .. } = panels; + let EffectPanels { locks, menu, bodies, ime, focused_windows, .. } = panels; self.live_dock.specs = specs; let DockAreaOutput { actions, requested, events, focused, pressed, picked, error, float_space, windows, window_files, sources, .. } = output; self.dock_rects = bodies; @@ -429,7 +429,7 @@ impl EffectcraftApp { if float_space.is_some() { self.live_dock.float_space = float_space; } - self.forward_window_input(&ctx, &windows, window_files); + self.forward_window_input(&ctx, &windows, &focused_windows, window_files); self.live_dock.windows = windows; // A press in a panel's body, a tab picked, or key focus moving to a group focuses that panel. let moved = focused != self.live_dock.focused; @@ -491,15 +491,22 @@ impl EffectcraftApp { panels::panel_menu_popup(self, ui); } - /// Keys and dropped files that reach a floating panel's own OS window go to the main - /// window's next frame ([`crate::EffectcraftApp::raw_input_hook`]), so its shortcuts and - /// file import handle them. Text is not forwarded, and no key is while a text field has the - /// keyboard. - fn forward_window_input(&mut self, ctx: &egui::Context, windows: &[(PanelKind, egui::ViewportId)], files: Vec>) { - let typing = crate::native_menu::text_field_window(ctx).is_some(); - for (_, viewport) in windows { - let events = ctx.input_for(*viewport, |i| i.events.clone()); - self.forwarded.events.extend(events.into_iter().filter(|event| !typing && !matches!(event, egui::Event::Text(_) | egui::Event::Ime(_)))); + /// Keys, clipboard events and dropped files that reach a floating panel's own OS window go to + /// the main window's next frame ([`crate::EffectcraftApp::raw_input_hook`]), so its shortcuts + /// and file import handle them. No key or clipboard event goes from a window of `focused` + /// (one of its widgets has the keyboard), or while a text field has the keyboard. + fn forward_window_input( + &mut self, + ctx: &egui::Context, + windows: &[(PanelKind, egui::ViewportId)], + focused: &[egui::ViewportId], + files: Vec>, + ) { + if crate::native_menu::text_field_window(ctx).is_none() { + for (_, viewport) in windows.iter().filter(|(_, viewport)| !focused.contains(viewport)) { + let events = ctx.input_for(*viewport, |i| i.events.iter().filter(|event| forwards(event)).cloned().collect::>()); + self.forwarded.events.extend(events); + } } if handed_over_to_the_timeline(files.iter().map(|drop| (drop.panel, !drop.files.is_empty()))) { self.forwarded.dropped_on_timeline = true; @@ -695,6 +702,8 @@ struct EffectPanels<'a> { bodies: Vec<(PanelKind, Rect)>, /// Where each native window's IME descriptor is set up and published. ime: NativeIme, + /// The native windows in which a widget had the keyboard after their last body. + focused_windows: Vec, } impl DockPanels for EffectPanels<'_> { @@ -719,6 +728,12 @@ impl DockPanels for EffectPanels<'_> { if native && self.ime.menu_turn(viewport) { panels::panel_menu_area(self.app, ui); } + if native { + self.focused_windows.retain(|window| *window != viewport); + if crate::framework::widget_has_keyboard(ui.ctx()) { + self.focused_windows.push(viewport); + } + } // The body fills its frame; allocating it lets a floated panel keep its full size. ui.allocate_rect(rect, Sense::hover()); // Painted after the body so child backgrounds cannot hide the focus outline. @@ -882,6 +897,12 @@ fn window_bodies(window: &Floating) -> usize { window.groups().iter().filter(|group| !group.minimized && group.active_panel().is_some()).count() } +/// Whether a floating panel's own window hands `event` to the main window. Every other event is +/// the window's own: typed text is its panels', and the pointer is at its coordinates. +fn forwards(event: &egui::Event) -> bool { + matches!(event, egui::Event::Key { .. } | egui::Event::Copy | egui::Event::Cut | egui::Event::Paste(_)) +} + /// Whether a handed-over *drop* named the Timeline. Only a drop with files counts, so a window /// that only saw a file pass over it never sends the next drop somewhere else. The panel comes /// from the window, which the main window's pointer can never reach (#2661). diff --git a/crates/ui-egui/tests/it/native_menu_text_keys.rs b/crates/ui-egui/tests/it/native_menu_text_keys.rs index b00583f5e..01174a801 100644 --- a/crates/ui-egui/tests/it/native_menu_text_keys.rs +++ b/crates/ui-egui/tests/it/native_menu_text_keys.rs @@ -1,6 +1,7 @@ //! The macOS menu bar takes the Edit menu's key equivalents before any window sees them: while a //! text field has the keyboard, in a docked panel or a floating panel's own OS window, they edit -//! the field and leave the project alone, and the items stay enabled. +//! the field and leave the project alone, and the items stay enabled. The keys a floating panel's +//! window hands to the main window. use effectcraft_engine::Session; use effectcraft_ui_egui::EffectcraftApp; @@ -189,3 +190,46 @@ fn edit_menu_keys_edit_a_docked_text_field() { menu(&mut h, "edit.copy"); assert_eq!(project(h.state()), before, "the project is untouched"); } + +/// Only the keys go from a floating panel's window to the main window, and only while no widget +/// there has the keyboard: its pointer, wheel and typed text are its own. +#[test] +fn a_panel_window_hands_over_only_the_keys_no_widget_has() { + use egui::Key; + let mut app = app(); + menus::invoke(&mut app, &egui::Context::default(), "window.panelWindow", json!({"panel": "Project", "window": true})).unwrap(); + let mut h = Harness::builder().with_size(vec2(1600.0, 1000.0)).with_context_setup(effectcraft_ui_egui::framework::install_headless).build_eframe(|_| app); + let host = native_windows(&mut h); + let handed = |h: &mut Harness<'_, EffectcraftApp>, events: &[Event]| { + let hook = |h: &mut Harness<'_, EffectcraftApp>| { + let ctx = h.ctx.clone(); + let mut raw = egui::RawInput::default(); + eframe::App::raw_input_hook(h.state_mut(), &ctx, &mut raw); + raw.events + }; + hook(h); + for event in events { + to_window(&host, event.clone()); + } + h.step(); + hook(h) + }; + let key = |key| Event::Key { key, physical_key: None, pressed: true, repeat: false, modifiers: Modifiers::NONE }; + let at = center(&h, "project.search"); + let wheel = Event::MouseWheel { + unit: egui::MouseWheelUnit::Point, + delta: vec2(0.0, 10.0), + modifiers: Modifiers::NONE, + phase: egui::TouchPhase::Move, + source: egui::MouseWheelSource::Wheel, + }; + let typed = [Event::PointerMoved(at), wheel, key(Key::J), Event::Text("j".into())]; + assert_eq!(handed(&mut h, &typed), vec![key(Key::J)], "the key alone"); + click(&mut h, at, Some(&host)); + h.run_steps(2); + assert_eq!(handed(&mut h, &typed), Vec::new(), "the search field has the keyboard"); + to_window(&host, key(Key::Tab)); + h.run_steps(3); + assert_ne!(native_menu::text_field_window(&h.ctx), host.borrow().window, "Tab moved on from the field"); + assert_eq!(handed(&mut h, &typed), Vec::new(), "another widget has the keyboard"); +} From 144982d678c24108b59eebafd24f9f72781dee16 Mon Sep 17 00:00:00 2001 From: aiongg Date: Wed, 25 Nov 2026 14:26:45 +0000 Subject: [PATCH 440/451] The focused viewer keeps its focus at Escape --- crates/ui-egui/src/framework.rs | 9 ++------- crates/ui-egui/tests/it/ui_viewer.rs | 15 +++++---------- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/crates/ui-egui/src/framework.rs b/crates/ui-egui/src/framework.rs index de2981220..9a8a3e7de 100644 --- a/crates/ui-egui/src/framework.rs +++ b/crates/ui-egui/src/framework.rs @@ -122,16 +122,11 @@ pub(crate) fn viewer_id() -> egui::Id { /// Declares the Composition viewer, drawn in this pass, as the window's document canvas. With nothing focused it /// is the window's key target: the edit chords and the clipboard events stay in -/// egui's input for EffectCraft's shortcuts. Escape with the viewer focused is the viewer's own: it lets go of the -/// keyboard, as egui's other widgets do. +/// egui's input for EffectCraft's shortcuts. The focused viewer keeps its focus at Escape, which EffectCraft's own +/// handlers read from egui. pub(crate) fn host_canvas(ctx: &egui::Context) { const KEYS: KeyUse = KeyUse::CANVAS.with_edits(EditSet::ALL); craft_ui::runtime::focus::host_canvas(ctx, viewer_id(), KEYS); - // Read from the raw input, so an Escape that a popup consumed earlier in the pass counts. - let escape = |event: &egui::Event| matches!(event, egui::Event::Key { key: egui::Key::Escape, pressed: true, modifiers, .. } if !modifiers.any()); - if ctx.input(|i| i.raw.events.iter().any(escape)) { - ctx.memory_mut(|m| m.surrender_focus(viewer_id())); - } } /// The widget other than the Composition viewer that has the keyboard. The viewer as the focused Tab stop leaves the diff --git a/crates/ui-egui/tests/it/ui_viewer.rs b/crates/ui-egui/tests/it/ui_viewer.rs index 7071af7d2..796208b02 100644 --- a/crates/ui-egui/tests/it/ui_viewer.rs +++ b/crates/ui-egui/tests/it/ui_viewer.rs @@ -278,8 +278,7 @@ fn viewer_double_click_on_a_covered_path_of_the_selected_layer_free_transforms_i assert!(h.state().auto.find("viewer.freeTransform.handle.0").is_some(), "the free-transform box is up"); } -/// The Composition viewer as the focused Tab stop leaves the keys to the app, and Escape also makes it -/// let go of the keyboard. +/// The Composition viewer as the focused Tab stop leaves the keys to the app, and keeps its focus. #[test] fn the_focused_viewer_leaves_the_keys_to_the_app() { use craft_ui::runtime::focus::{FocusTarget, request}; @@ -301,17 +300,13 @@ fn the_focused_viewer_leaves_the_keys_to_the_app() { } h.run_steps(3); assert!(h.state().auto.find("viewer.freeTransform.handle.0").is_some(), "the free-transform box is up"); - let focus_viewer = |h: &mut Harness<'_, EffectcraftApp>| { - request(&h.ctx, FocusTarget::Id(viewer)); - h.run_steps(2); - assert_eq!(h.ctx.memory(|m| m.focused()), Some(viewer)); - }; - focus_viewer(&mut h); + request(&h.ctx, FocusTarget::Id(viewer)); + h.run_steps(2); + assert_eq!(h.ctx.memory(|m| m.focused()), Some(viewer)); assert_eq!(effectcraft_ui_egui::native_menu::text_field_window(&h.ctx), None, "the Edit menu's commands are the app's"); key(&mut h, egui::Key::Escape, egui::Modifiers::NONE); assert!(h.state().auto.find("viewer.freeTransform.handle.0").is_none(), "Escape ends the free transform"); - assert_eq!(h.ctx.memory(|m| m.focused()), None, "and the viewer lets go of the keyboard"); - focus_viewer(&mut h); + assert_eq!(h.ctx.memory(|m| m.focused()), Some(viewer), "and the viewer keeps its focus"); key(&mut h, egui::Key::H, egui::Modifiers::NONE); assert_eq!(h.state().ui.tool, Tool::Hand, "a tool shortcut runs"); assert_eq!(h.ctx.memory(|m| m.focused()), Some(viewer)); From c44f67531d7328e1b09317b1fc6da471b0035f96 Mon Sep 17 00:00:00 2001 From: aiongg Date: Wed, 25 Nov 2026 14:41:33 +0000 Subject: [PATCH 441/451] The IME reset answers are one function beside the viewer's keyboard loop --- crates/ui-egui/src/panels/viewer_text.rs | 36 ++++++++++++++++-------- 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/crates/ui-egui/src/panels/viewer_text.rs b/crates/ui-egui/src/panels/viewer_text.rs index cce2884c3..4ee724f6b 100644 --- a/crates/ui-egui/src/panels/viewer_text.rs +++ b/crates/ui-egui/src/panels/viewer_text.rs @@ -1075,6 +1075,29 @@ pub fn hook( owns } +/// Answers an IME reset that the integration completed or retired, while `custom_mutations` is on: whether `event` is +/// one. +fn reset_ended(app: &EffectcraftApp, ui: &egui::Ui, event: &egui::Event, custom_mutations: bool) -> bool { + match event { + egui::Event::ImeResetCompleted { request_id } => { + if custom_mutations { + complete_reset(app, ui, *request_id); + } + true + } + egui::Event::ImeResetRetired { request_id } => { + // The integration dropped the request and no completion will follow: ask again, or the + // composition stays stale forever. + let ctx = ui.ctx(); + if custom_mutations && read_reset(ctx).is_some_and(|guard| !guard.suspended && guard.request == Some(*request_id)) { + request_reset(app, ctx); + } + true + } + _ => false, + } +} + /// This frame's keys, in order, into the edited text, up to a press outside the `viewer`: the /// panel it lands in decides (after this frame's panels) whether the edit ends, so the keys after /// it in this frame are neither typed nor run as shortcuts (#831). @@ -1106,18 +1129,7 @@ fn keyboard(app: &mut EffectcraftApp, ui: &mut egui::Ui, viewer: Rect) { ctx.input_mut(|input| input.events.retain(|event| !matches!(event, egui::Event::ImeResetCompleted { .. }))); let mut custom_mutations = app.session.state.text_edit.is_some(); for ev in events { - if let egui::Event::ImeResetCompleted { request_id } = &ev { - if custom_mutations { - complete_reset(app, ui, *request_id); - } - continue; - } - if let egui::Event::ImeResetRetired { request_id } = &ev { - // The integration dropped the request and no completion will follow: ask again, or the - // composition stays stale forever. - if custom_mutations && read_reset(&ctx).is_some_and(|guard| !guard.suspended && guard.request == Some(*request_id)) { - request_reset(app, &ctx); - } + if reset_ended(app, ui, &ev, custom_mutations) { continue; } sync_ime_target(ui, app); From 5c8a110c8f644175522f8dcbce112a4c49cb1194 Mon Sep 17 00:00:00 2001 From: aiongg Date: Wed, 25 Nov 2026 15:15:01 +0000 Subject: [PATCH 442/451] Copy, Cut and Paste pressed in a floating panel reach the app --- crates/ui-egui/src/framework.rs | 59 ++++++++++++++++++++++++++- crates/ui-egui/src/lib.rs | 3 ++ crates/ui-egui/src/menus/shortcuts.rs | 8 ++-- 3 files changed, 65 insertions(+), 5 deletions(-) diff --git a/crates/ui-egui/src/framework.rs b/crates/ui-egui/src/framework.rs index 9a8a3e7de..a2194aa97 100644 --- a/crates/ui-egui/src/framework.rs +++ b/crates/ui-egui/src/framework.rs @@ -96,11 +96,13 @@ impl EffectcraftApp { } /// The root values of this frame. EffectCraft registers no commands with the runtime (its own shortcut table runs - /// every key, [`command_overrides`]) and lets it toggle no chrome, so the output carries nothing it acts on. The + /// every key, [`command_overrides`]) and lets it toggle no chrome. The one output it acts on is the clipboard + /// chords of a window with no canvas ([`clipboard_events`]). The /// interface scale is Settings > Appearance > UI Scale; the runtime writes it to the context. While one of /// EffectCraft's own dialogs or a command's file dialog is up, the runtime blocks the panels floated into windows /// of their own. - pub(crate) fn frame_input(&mut self, ctx: &egui::Context, _output: FrameOutput) -> FrameInput { + pub(crate) fn frame_input(&mut self, ctx: &egui::Context, output: FrameOutput) -> FrameInput { + self.forwarded.clips.extend(clipboard_events(&output)); let mode = if self.tokens.kind.is_light() { craft_theme::Mode::Light } else { craft_theme::Mode::Dark }; let scale = self.session.prefs.appearance.ui_scale as f32 / 100.0; let root = RootEnv::new().mode(mode).scale(Scale::new(scale)); @@ -115,6 +117,31 @@ impl EffectcraftApp { } } +/// The Copy, Cut and Paste the runtime took in a window with no canvas, as the clipboard events that window's chord +/// would have been. Only a command a key press fired, and a Paste only with the platform's content, which a key press +/// never carries (so a pasted key press cannot run twice). A Copy or Cut from a synthetic key press that egui kept +/// as well runs twice. Native only: the web sends the key press with the clipboard event. +#[cfg(not(target_arch = "wasm32"))] +fn clipboard_events(output: &FrameOutput) -> Vec { + use craft_ui::runtime::commands::{EditCommands, FirePhase, FireSource}; + output + .fired + .iter() + .filter(|fired| fired.source == FireSource::Key && fired.phase == FirePhase::Press && fired.target.is_none()) + .filter_map(|fired| match fired.command.id.as_str() { + id if id == EditCommands::Copy.id() => Some(egui::Event::Copy), + id if id == EditCommands::Cut.id() => Some(egui::Event::Cut), + id if id == EditCommands::Paste.id() => fired.pasted.as_ref()?.text.as_ref().map(|text| egui::Event::Paste(text.to_string())), + _ => None, + }) + .collect() +} + +#[cfg(target_arch = "wasm32")] +fn clipboard_events(_: &FrameOutput) -> Vec { + Vec::new() +} + /// The Composition viewer's widget, its window's document canvas. pub(crate) fn viewer_id() -> egui::Id { egui::Id::unique("viewer-interact") @@ -167,3 +194,31 @@ fn take_window_intent(ctx: &egui::Context, intent: Intent) -> bool { pub(crate) fn decide(close: bool) -> CloseDecision { if close { CloseDecision::Close } else { CloseDecision::Hold } } + +#[cfg(test)] +mod tests { + use super::*; + use craft_ui::runtime::commands::{ClipContent, CommandRef, FirePhase, FireSource, Fired}; + + fn fired(id: &str, pasted: Option<&str>) -> Fired { + let mut fired = Fired::new(CommandRef::new(id), FireSource::Key, FirePhase::Press, 0.0); + fired.pasted = pasted.map(|text| { + let mut content = ClipContent::default(); + content.text = Some(text.into()); + content + }); + fired + } + + /// Copy pressed in a window with no canvas reaches the shortcuts once; a Paste with no content of its own is a key + /// press the app already reads, and so is any other edit command. + #[test] + fn clipboard_chords_of_a_window_with_no_canvas_queue_once() { + let mut output = FrameOutput::default(); + output.fired = vec![fired("edit.copy", None), fired("edit.paste", None), fired("edit.undo", None), fired("edit.paste", Some("x"))]; + let mut app = EffectcraftApp::new(effectcraft_engine::Session::default()); + let ctx = egui::Context::default(); + app.frame_input(&ctx, output); + assert_eq!(app.forwarded.clips, [egui::Event::Copy, egui::Event::Paste("x".into())]); + } +} diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 158b6d515..423408c28 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -582,6 +582,9 @@ impl FileDialogsUp { #[derive(Default)] pub(crate) struct ForwardedInput { pub(crate) events: Vec, + /// Copy, Cut and Paste the runtime took from a window with no canvas ([`crate::framework`]), for the + /// next pass of the shortcuts to read after that pass's own events. + pub(crate) clips: Vec, pub(crate) files: Vec, /// Files handed over by a floating window whose panel under the pointer was the Timeline. The /// paths lose the window they came from, so this keeps the one thing the import still needs diff --git a/crates/ui-egui/src/menus/shortcuts.rs b/crates/ui-egui/src/menus/shortcuts.rs index 655d5c0b9..703a9cd7c 100644 --- a/crates/ui-egui/src/menus/shortcuts.rs +++ b/crates/ui-egui/src/menus/shortcuts.rs @@ -278,7 +278,7 @@ fn cancel_dialog(app: &mut EffectcraftApp, ctx: &egui::Context) { type KeyEvent = (egui::Key, egui::Modifiers, bool, Option); /// The frame's key presses, with clipboard events mapped back to Ctrl+C / X / V. -fn collect_key_events(ctx: &egui::Context, start: Option, clipboard: bool, project: bool) -> Vec { +fn collect_key_events(ctx: &egui::Context, start: Option, clipboard: bool, project: bool, queued: &[egui::Event]) -> Vec { ctx.input(|i| { // The windowing layer turns Ctrl+C / Ctrl+X / Ctrl+V into clipboard events instead of // key presses: map them back to the keys (with the modifiers held) so Edit ▸ Copy, Cut, @@ -290,7 +290,7 @@ fn collect_key_events(ctx: &egui::Context, start: Option, clipb let mut at = if changed { start } else { Some(i.modifiers) }; let held = |at: Option| at.filter(|m| m.command).unwrap_or(egui::Modifiers::COMMAND); let mut out = Vec::new(); - for e in &i.events { + for e in i.events.iter().chain(queued) { match e { egui::Event::ModifiersChanged(m) => at = Some(*m), // egui forgets the modifiers held when the window loses focus. @@ -349,6 +349,8 @@ fn panel_owns_enter(kind: PanelKind) -> bool { } fn handle_shortcuts_impl(app: &mut EffectcraftApp, ctx: &egui::Context, tab_only: bool) { + // The clipboard chords of a window with no canvas wait for this frame's pass only, whatever stops it. + let queued = if tab_only { Vec::new() } else { std::mem::take(&mut app.forwarded.clips) }; let start = modifiers_at_start(ctx); if !tab_only && app.dialog.is_some() && ctx.input(|i| i.key_pressed(egui::Key::Escape)) { escape_dialog(app, ctx); @@ -370,7 +372,7 @@ fn handle_shortcuts_impl(app: &mut EffectcraftApp, ctx: &egui::Context, tab_only // The paste event's text: Edit ▸ Paste pastes SVG markup as a shape layer. let pasted = if clipboard { ctx.input(|i| i.events.iter().rev().find_map(|e| if let egui::Event::Paste(t) = e { Some(t.clone()) } else { None })) } else { None }; - let mut events = collect_key_events(ctx, start, clipboard, project); + let mut events = collect_key_events(ctx, start, clipboard, project, &queued); events.retain(|(key, _, _, _)| (*key == egui::Key::Tab) == tab_only); if !tab_only && clipboard && app.dialog.is_none() { numpad_star_marker(app, ctx); From b74e746f3f7dba400f85f4e19b85c61146a58af9 Mon Sep 17 00:00:00 2001 From: aiongg Date: Wed, 25 Nov 2026 15:51:18 +0000 Subject: [PATCH 443/451] Repin craft-libs to storytold next aa401985d --- Cargo.lock | 138 +++++++++++++++++++------------------- Cargo.toml | 112 +++++++++++++++---------------- crates/effects/Cargo.toml | 2 +- xtask/src/pdf_deps.rs | 2 +- 4 files changed, 127 insertions(+), 127 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 636453897..589c639b7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1304,23 +1304,23 @@ dependencies = [ [[package]] name = "craft-aaf" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "craft-audio", "craft-cfb", - "craft-timeline 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e)", + "craft-timeline 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b)", "thiserror 2.0.21", ] [[package]] name = "craft-aep" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" [[package]] name = "craft-appkit" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "block2 0.6.2", "objc2-app-kit 0.3.2", @@ -1330,7 +1330,7 @@ dependencies = [ [[package]] name = "craft-atomic" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "rustix 1.1.6", ] @@ -1338,7 +1338,7 @@ dependencies = [ [[package]] name = "craft-audio" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "craft-media", "craft-xml", @@ -1351,7 +1351,7 @@ dependencies = [ [[package]] name = "craft-behavior" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "accesskit", "bitflags 2.13.2", @@ -1369,12 +1369,12 @@ dependencies = [ [[package]] name = "craft-cfb" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" [[package]] name = "craft-cloud-ui" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "egui", ] @@ -1382,7 +1382,7 @@ dependencies = [ [[package]] name = "craft-cms" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "md-5", "rayon", @@ -1391,12 +1391,12 @@ dependencies = [ [[package]] name = "craft-codepage" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" [[package]] name = "craft-color" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "serde", ] @@ -1404,7 +1404,7 @@ dependencies = [ [[package]] name = "craft-doc" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "craft-ecproj-format", "craft-pcraft-format", @@ -1418,7 +1418,7 @@ dependencies = [ [[package]] name = "craft-docpath" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "serde", ] @@ -1426,7 +1426,7 @@ dependencies = [ [[package]] name = "craft-dpx" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "thiserror 2.0.21", ] @@ -1434,7 +1434,7 @@ dependencies = [ [[package]] name = "craft-ecproj-format" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "serde", "serde_json", @@ -1444,12 +1444,12 @@ dependencies = [ [[package]] name = "craft-eps" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" [[package]] name = "craft-exr" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "exr", "flate2", @@ -1461,7 +1461,7 @@ dependencies = [ [[package]] name = "craft-font-catalog" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "harfrust 0.13.3", "kurbo", @@ -1475,12 +1475,12 @@ dependencies = [ [[package]] name = "craft-fonts-build" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" [[package]] name = "craft-frame" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "craft-color", "craft-time", @@ -1491,7 +1491,7 @@ dependencies = [ [[package]] name = "craft-gif" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "gif", "image", @@ -1500,7 +1500,7 @@ dependencies = [ [[package]] name = "craft-hdr" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "thiserror 2.0.21", ] @@ -1508,7 +1508,7 @@ dependencies = [ [[package]] name = "craft-host" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "bitflags 2.13.2", "craft-i18n", @@ -1521,7 +1521,7 @@ dependencies = [ [[package]] name = "craft-i18n" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "chrono", "fixed_decimal", @@ -1549,7 +1549,7 @@ dependencies = [ [[package]] name = "craft-jpeg" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "thiserror 2.0.21", ] @@ -1557,7 +1557,7 @@ dependencies = [ [[package]] name = "craft-jsonrpc" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "serde_json", ] @@ -1565,7 +1565,7 @@ dependencies = [ [[package]] name = "craft-keymap" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "craft-host", "craft-i18n", @@ -1580,7 +1580,7 @@ dependencies = [ [[package]] name = "craft-lottie" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "craft-zip", "serde_json", @@ -1590,7 +1590,7 @@ dependencies = [ [[package]] name = "craft-media" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "chrono", "thiserror 2.0.21", @@ -1599,7 +1599,7 @@ dependencies = [ [[package]] name = "craft-media-source" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "craft-audio", "craft-color", @@ -1614,7 +1614,7 @@ dependencies = [ [[package]] name = "craft-mesh" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "craft-zip", "miniz_oxide 0.9.1", @@ -1624,7 +1624,7 @@ dependencies = [ [[package]] name = "craft-mime" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "chrono", "craft-codepage", @@ -1634,7 +1634,7 @@ dependencies = [ [[package]] name = "craft-pcraft-format" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "flate2", "serde", @@ -1645,7 +1645,7 @@ dependencies = [ [[package]] name = "craft-pdf" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "hayro-syntax", "serde", @@ -1655,7 +1655,7 @@ dependencies = [ [[package]] name = "craft-platform" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "async-channel", "async-io", @@ -1686,7 +1686,7 @@ dependencies = [ [[package]] name = "craft-ps" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "craft-eps", "kurbo", @@ -1699,7 +1699,7 @@ dependencies = [ [[package]] name = "craft-psd" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "encoding_rs", "flate2", @@ -1710,7 +1710,7 @@ dependencies = [ [[package]] name = "craft-quit" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "dispatch2", "objc2 0.6.5", @@ -1722,7 +1722,7 @@ dependencies = [ [[package]] name = "craft-raw" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "craft-tiff", "miniz_oxide 0.9.1", @@ -1736,7 +1736,7 @@ dependencies = [ [[package]] name = "craft-settings" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "craft-atomic", "craft-host", @@ -1753,12 +1753,12 @@ dependencies = [ [[package]] name = "craft-sniff" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" [[package]] name = "craft-svg" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "craft-xml", "flate2", @@ -1775,7 +1775,7 @@ dependencies = [ [[package]] name = "craft-tga" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "thiserror 2.0.21", ] @@ -1783,7 +1783,7 @@ dependencies = [ [[package]] name = "craft-theme" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "bitflags 2.13.2", "craft-tracked", @@ -1798,7 +1798,7 @@ dependencies = [ [[package]] name = "craft-tiff" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "serde", "thiserror 2.0.21", @@ -1807,7 +1807,7 @@ dependencies = [ [[package]] name = "craft-time" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "serde", "thiserror 2.0.21", @@ -1827,7 +1827,7 @@ dependencies = [ [[package]] name = "craft-timeline" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "craft-time", "serde", @@ -1837,12 +1837,12 @@ dependencies = [ [[package]] name = "craft-tracked" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" [[package]] name = "craft-ui" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "craft-cloud-ui", "craft-ui-canvas", @@ -1856,7 +1856,7 @@ dependencies = [ [[package]] name = "craft-ui-canvas" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "craft-behavior", "craft-i18n", @@ -1872,7 +1872,7 @@ dependencies = [ [[package]] name = "craft-ui-contract" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "accesskit", "craft-behavior", @@ -1910,7 +1910,7 @@ dependencies = [ [[package]] name = "craft-ui-macros" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -1921,7 +1921,7 @@ dependencies = [ [[package]] name = "craft-ui-panels" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "craft-behavior", "craft-host", @@ -1939,7 +1939,7 @@ dependencies = [ [[package]] name = "craft-ui-patterns" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "craft-behavior", "craft-host", @@ -1960,7 +1960,7 @@ dependencies = [ [[package]] name = "craft-ui-shell" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "craft-behavior", "craft-host", @@ -1980,7 +1980,7 @@ dependencies = [ [[package]] name = "craft-ui-widgets" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "craft-behavior", "craft-host", @@ -1999,7 +1999,7 @@ dependencies = [ [[package]] name = "craft-update" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "chrono", "craft-host", @@ -2028,7 +2028,7 @@ dependencies = [ [[package]] name = "craft-vectorcraft-format" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "flate2", "serde", @@ -2039,7 +2039,7 @@ dependencies = [ [[package]] name = "craft-video" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "craft-media", "rav1e", @@ -2050,7 +2050,7 @@ dependencies = [ [[package]] name = "craft-webp" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "image", "thiserror 2.0.21", @@ -2059,7 +2059,7 @@ dependencies = [ [[package]] name = "craft-win32" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "winsafe", ] @@ -2067,7 +2067,7 @@ dependencies = [ [[package]] name = "craft-window" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "craft-appkit", "craft-atomic", @@ -2091,7 +2091,7 @@ dependencies = [ [[package]] name = "craft-xml" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "quick-xml 0.41.0", "serde", @@ -2101,7 +2101,7 @@ dependencies = [ [[package]] name = "craft-y4m" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "thiserror 2.0.21", ] @@ -2109,7 +2109,7 @@ dependencies = [ [[package]] name = "craft-zip" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "flate2", "thiserror 2.0.21", @@ -2678,7 +2678,7 @@ dependencies = [ name = "effectcraft-interchange" version = "0.25.1" dependencies = [ - "craft-timeline 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e)", + "craft-timeline 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b)", "effectcraft-color", "effectcraft-keyframe", "effectcraft-project", @@ -4249,7 +4249,7 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a" [[package]] name = "hayro-jbig2" version = "0.3.0" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "hayro-ccitt", ] @@ -4263,7 +4263,7 @@ checksum = "c75ab947623ef4ccaa7acf0579edf7cbb5a73838e3839a7be73335e522f433a1" [[package]] name = "hayro-syntax" version = "0.7.2" -source = "git+https://github.com/aiongg/craft-libs?rev=d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e#d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" +source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" dependencies = [ "hayro-jbig2", "hayro-jpeg2000", diff --git a/Cargo.toml b/Cargo.toml index 5e696f0b4..07fe85bbb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,28 +11,28 @@ rust-version = "1.95" repository = "https://github.com/storytold/effectcraft" [workspace.dependencies] -craft-timeline = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", default-features = false } -craft-mime = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } -craft-pdf = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", version = "=0.1.0", default-features = false, features = ["read"] } -craft-docpath = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } -craft-jsonrpc = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } -craft-ecproj-format = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } -craft-dpx = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } -craft-ps = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", default-features = false, features = ["read"] } -craft-exr = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } -craft-gif = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } -craft-tga = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } -craft-psd = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } -craft-codepage = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } -craft-svg = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } -craft-webp = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } -craft-lottie = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } -craft-mesh = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", default-features = false, features = ["stl", "obj", "gltf", "fbx"] } -craft-aep = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } -craft-doc = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } -craft-vectorcraft-format = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } +craft-timeline = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", default-features = false } +craft-mime = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } +craft-pdf = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", version = "=0.1.0", default-features = false, features = ["read"] } +craft-docpath = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } +craft-jsonrpc = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } +craft-ecproj-format = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } +craft-dpx = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } +craft-ps = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", default-features = false, features = ["read"] } +craft-exr = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } +craft-gif = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } +craft-tga = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } +craft-psd = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } +craft-codepage = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } +craft-svg = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } +craft-webp = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } +craft-lottie = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } +craft-mesh = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", default-features = false, features = ["stl", "obj", "gltf", "fbx"] } +craft-aep = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } +craft-doc = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } +craft-vectorcraft-format = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } # craft-update: app-specific pretend versions apply to startup and manual checks. -craft-update = { git = "https://github.com/aiongg/craft-libs", version = "=0.1.0", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", features = ["ui"] } +craft-update = { git = "https://github.com/aiongg/craft-libs", version = "=0.1.0", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", features = ["ui"] } # internal effectcraft-time = { path = "crates/time" } effectcraft-geom = { path = "crates/geom" } @@ -97,13 +97,13 @@ same-file = "1.0" tempfile = "3.27" # codecs + containers shared by the Craft apps (crates/media, crates/export); keep all in sync. -craft-media = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", default-features = false, features = ["isobmff", "matroska"] } -craft-media-source = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } -craft-frame = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } -craft-color = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } -craft-time = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } -craft-audio = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", default-features = false, features = ["aac-decode", "aac-encode", "alac-decode", "opus-decode", "opus-encode", "ac3-decode", "mp3-decode", "mpa-decode"] } -craft-video = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", features = ["h264-decode", "h264-encode", "prores", "hevc-encode", "vp9-encode", "av1", "threads"] } +craft-media = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", default-features = false, features = ["isobmff", "matroska"] } +craft-media-source = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } +craft-frame = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } +craft-color = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } +craft-time = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } +craft-audio = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", default-features = false, features = ["aac-decode", "aac-encode", "alac-decode", "opus-decode", "opus-encode", "ac3-decode", "mp3-decode", "mpa-decode"] } +craft-video = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", features = ["h264-decode", "h264-encode", "prores", "hevc-encode", "vp9-encode", "av1", "threads"] } # footage decoding: FilmCraft's pure-Rust crates, pinned to a revision (plan/adr/0001). # Only `crates/media`, `crates/export` and `crates/interchange` may depend on these. @@ -126,12 +126,12 @@ half = "2.7" # ui # Shared frontend components; keep this dependency above the engine boundary. # Shared UI and the complete egui family select reviewed immutable commits below. -craft-ui = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } -craft-behavior = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } -craft-host = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } -craft-keymap = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } -craft-theme = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } -craft-window = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } +craft-ui = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } +craft-behavior = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } +craft-host = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } +craft-keymap = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } +craft-theme = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } +craft-window = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } # `default_fonts` and `monochrome_emoji_fonts` are explicit: the app's `FontDefinitions::default()` # and its `✔`/`▣` chrome glyphs need both, and kittest's own dev-dependencies do not propagate. egui = { version = "0.37", default-features = false, features = ["default_fonts", "monochrome_emoji_fonts"] } @@ -237,30 +237,30 @@ codegen-units = 1 # filmcraft-media pins storytold craft-libs; the app needs one copy of each crate. [patch."https://github.com/storytold/craft-libs"] -craft-aaf = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", version = "=0.1.0" } -craft-audio = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", version = "=0.1.0" } -craft-cfb = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", version = "=0.1.0" } -craft-color = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", version = "=0.1.0" } -craft-dpx = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", version = "=0.1.0" } -craft-exr = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", version = "=0.1.0" } -craft-frame = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", version = "=0.1.0" } -craft-hdr = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", version = "=0.1.0" } -craft-jpeg = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", version = "=0.1.0" } -craft-media = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", version = "=0.1.0" } -craft-media-source = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", version = "=0.1.0" } -craft-psd = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", version = "=0.1.0" } -craft-raw = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", version = "=0.1.0" } -craft-sniff = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", version = "=0.1.0" } -craft-tga = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", version = "=0.1.0" } -craft-tiff = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", version = "=0.1.0" } -craft-time = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", version = "=0.1.0" } -craft-video = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", version = "=0.1.0" } -craft-xml = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", version = "=0.1.0" } -craft-y4m = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", version = "=0.1.0" } +craft-aaf = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", version = "=0.1.0" } +craft-audio = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", version = "=0.1.0" } +craft-cfb = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", version = "=0.1.0" } +craft-color = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", version = "=0.1.0" } +craft-dpx = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", version = "=0.1.0" } +craft-exr = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", version = "=0.1.0" } +craft-frame = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", version = "=0.1.0" } +craft-hdr = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", version = "=0.1.0" } +craft-jpeg = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", version = "=0.1.0" } +craft-media = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", version = "=0.1.0" } +craft-media-source = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", version = "=0.1.0" } +craft-psd = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", version = "=0.1.0" } +craft-raw = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", version = "=0.1.0" } +craft-sniff = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", version = "=0.1.0" } +craft-tga = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", version = "=0.1.0" } +craft-tiff = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", version = "=0.1.0" } +craft-time = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", version = "=0.1.0" } +craft-video = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", version = "=0.1.0" } +craft-xml = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", version = "=0.1.0" } +craft-y4m = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", version = "=0.1.0" } [patch.crates-io] -hayro-syntax = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", version = "=0.7.2" } -hayro-jbig2 = { git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e", version = "=0.3.0" } +hayro-syntax = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", version = "=0.7.2" } +hayro-jbig2 = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", version = "=0.3.0" } ecolor = { git = "https://github.com/storytold/egui.git", rev = "b15ffe9bfc2c8e6748533b32b708e10abaf2afec" } emath = { git = "https://github.com/storytold/egui.git", rev = "b15ffe9bfc2c8e6748533b32b708e10abaf2afec" } epaint = { git = "https://github.com/storytold/egui.git", rev = "b15ffe9bfc2c8e6748533b32b708e10abaf2afec" } diff --git a/crates/effects/Cargo.toml b/crates/effects/Cargo.toml index a14481e5b..18dab406c 100644 --- a/crates/effects/Cargo.toml +++ b/crates/effects/Cargo.toml @@ -10,7 +10,7 @@ rust-version.workspace = true workspace = true [dependencies] -craft-cms = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e" } +craft-cms = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } effectcraft-geom = { workspace = true } effectcraft-color = { workspace = true } effectcraft-keyframe = { workspace = true } diff --git a/xtask/src/pdf_deps.rs b/xtask/src/pdf_deps.rs index f9c386cea..aab13260d 100644 --- a/xtask/src/pdf_deps.rs +++ b/xtask/src/pdf_deps.rs @@ -7,7 +7,7 @@ use serde_json::Value; // The repository Cargo.toml pins craft-libs from (the aiongg fork while filmcraft-media pins storytold craft-libs). const REPO: &str = "https://github.com/aiongg/craft-libs"; -const REV: &str = "d1bdf8e5dac7513e4fbc4dab16edaaeda5ebcf5e"; +const REV: &str = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b"; const PACKAGES: &[(&str, &str)] = &[("craft-pdf", "0.1.0"), ("craft-ps", "0.1.0"), ("hayro-syntax", "0.7.2"), ("hayro-jbig2", "0.3.0")]; pub fn run(root: &Path) -> Result<(), String> { From 9776fc722fa8393095beb5bb4be767395463ff39 Mon Sep 17 00:00:00 2001 From: aiongg Date: Wed, 25 Nov 2026 18:28:37 +0000 Subject: [PATCH 444/451] Shift+Escape stays Shift+Escape when Shift is let go at once As before the move to the craft-ui runtime, an Escape shortcut matches the modifiers of its own press, not the ones held when the frame runs. --- crates/ui-egui/src/framework.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/framework.rs b/crates/ui-egui/src/framework.rs index a2194aa97..5e1c8c65f 100644 --- a/crates/ui-egui/src/framework.rs +++ b/crates/ui-egui/src/framework.rs @@ -19,7 +19,7 @@ use craft_ui::runtime::commands::{CommandInput, CommandSet as _, NavCommand, Qui use craft_ui::runtime::env::{RootEnv, Scale}; use craft_ui::runtime::focus::{EditSet, KeyUse}; use craft_ui::runtime::frame::{FrameInput, FrameOutput}; -use craft_ui::runtime::keys::{Intent, with_window_intents}; +use craft_ui::runtime::keys::{Intent, escape_mods, with_window_intents}; use craft_ui::shell::embed::{self, CloseDecision}; use craft_window::system::WindowSystem; use egui::ViewportId; @@ -173,8 +173,9 @@ pub(crate) fn widget_has_keyboard(ctx: &egui::Context) -> bool { /// EffectCraft reads it. pub(crate) fn return_window_keys(ctx: &egui::Context) { if take_window_intent(ctx, Intent::Cancel) { + let held = escape_mods(ctx).unwrap_or_default(); + let modifiers = egui::Modifiers { shift: held.shift, alt: held.alt, ..Default::default() }; ctx.input_mut(|i| { - let modifiers = i.modifiers; i.events.insert(0, egui::Event::Key { key: egui::Key::Escape, physical_key: Some(egui::Key::Escape), pressed: true, repeat: false, modifiers }); }); } From 805848551ff03bf995cfafe527f5c9ee1ec200ab Mon Sep 17 00:00:00 2001 From: aiongg Date: Wed, 25 Nov 2026 19:14:41 +0000 Subject: [PATCH 445/451] Repin craft-libs to storytold next 8fa4db64a9 and egui to b9770908e; the media crates at filmcraft's rev, one craft-timeline --- Cargo.lock | 234 +++++++++++++++++++++----------------- Cargo.toml | 120 ++++++++----------- crates/effects/Cargo.toml | 2 +- xtask/src/pdf_deps.rs | 13 +-- 4 files changed, 186 insertions(+), 183 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 589c639b7..eee4fa3a0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1304,23 +1304,23 @@ dependencies = [ [[package]] name = "craft-aaf" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ "craft-audio", "craft-cfb", - "craft-timeline 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b)", + "craft-timeline", "thiserror 2.0.21", ] [[package]] name = "craft-aep" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21#8fa4db64a9bb943520259ea95331a303ba788f21" [[package]] name = "craft-appkit" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21#8fa4db64a9bb943520259ea95331a303ba788f21" dependencies = [ "block2 0.6.2", "objc2-app-kit 0.3.2", @@ -1330,7 +1330,7 @@ dependencies = [ [[package]] name = "craft-atomic" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21#8fa4db64a9bb943520259ea95331a303ba788f21" dependencies = [ "rustix 1.1.6", ] @@ -1338,10 +1338,10 @@ dependencies = [ [[package]] name = "craft-audio" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ "craft-media", - "craft-xml", + "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", "log", "rayon", "symphonia 0.6.1", @@ -1351,7 +1351,7 @@ dependencies = [ [[package]] name = "craft-behavior" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21#8fa4db64a9bb943520259ea95331a303ba788f21" dependencies = [ "accesskit", "bitflags 2.13.2", @@ -1369,12 +1369,12 @@ dependencies = [ [[package]] name = "craft-cfb" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" [[package]] name = "craft-cloud-ui" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21#8fa4db64a9bb943520259ea95331a303ba788f21" dependencies = [ "egui", ] @@ -1382,7 +1382,7 @@ dependencies = [ [[package]] name = "craft-cms" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21#8fa4db64a9bb943520259ea95331a303ba788f21" dependencies = [ "md-5", "rayon", @@ -1391,12 +1391,12 @@ dependencies = [ [[package]] name = "craft-codepage" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21#8fa4db64a9bb943520259ea95331a303ba788f21" [[package]] name = "craft-color" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ "serde", ] @@ -1404,7 +1404,7 @@ dependencies = [ [[package]] name = "craft-doc" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21#8fa4db64a9bb943520259ea95331a303ba788f21" dependencies = [ "craft-ecproj-format", "craft-pcraft-format", @@ -1418,7 +1418,7 @@ dependencies = [ [[package]] name = "craft-docpath" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21#8fa4db64a9bb943520259ea95331a303ba788f21" dependencies = [ "serde", ] @@ -1426,7 +1426,15 @@ dependencies = [ [[package]] name = "craft-dpx" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" +dependencies = [ + "thiserror 2.0.21", +] + +[[package]] +name = "craft-dpx" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21#8fa4db64a9bb943520259ea95331a303ba788f21" dependencies = [ "thiserror 2.0.21", ] @@ -1434,7 +1442,7 @@ dependencies = [ [[package]] name = "craft-ecproj-format" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21#8fa4db64a9bb943520259ea95331a303ba788f21" dependencies = [ "serde", "serde_json", @@ -1444,12 +1452,21 @@ dependencies = [ [[package]] name = "craft-eps" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21#8fa4db64a9bb943520259ea95331a303ba788f21" [[package]] name = "craft-exr" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" +dependencies = [ + "flate2", + "serde_json", +] + +[[package]] +name = "craft-exr" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21#8fa4db64a9bb943520259ea95331a303ba788f21" dependencies = [ "exr", "flate2", @@ -1461,7 +1478,7 @@ dependencies = [ [[package]] name = "craft-font-catalog" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21#8fa4db64a9bb943520259ea95331a303ba788f21" dependencies = [ "harfrust 0.13.3", "kurbo", @@ -1475,12 +1492,12 @@ dependencies = [ [[package]] name = "craft-fonts-build" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21#8fa4db64a9bb943520259ea95331a303ba788f21" [[package]] name = "craft-frame" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ "craft-color", "craft-time", @@ -1491,7 +1508,7 @@ dependencies = [ [[package]] name = "craft-gif" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21#8fa4db64a9bb943520259ea95331a303ba788f21" dependencies = [ "gif", "image", @@ -1500,7 +1517,7 @@ dependencies = [ [[package]] name = "craft-hdr" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ "thiserror 2.0.21", ] @@ -1508,7 +1525,7 @@ dependencies = [ [[package]] name = "craft-host" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21#8fa4db64a9bb943520259ea95331a303ba788f21" dependencies = [ "bitflags 2.13.2", "craft-i18n", @@ -1521,7 +1538,7 @@ dependencies = [ [[package]] name = "craft-i18n" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21#8fa4db64a9bb943520259ea95331a303ba788f21" dependencies = [ "chrono", "fixed_decimal", @@ -1549,7 +1566,7 @@ dependencies = [ [[package]] name = "craft-jpeg" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ "thiserror 2.0.21", ] @@ -1557,7 +1574,7 @@ dependencies = [ [[package]] name = "craft-jsonrpc" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21#8fa4db64a9bb943520259ea95331a303ba788f21" dependencies = [ "serde_json", ] @@ -1565,13 +1582,13 @@ dependencies = [ [[package]] name = "craft-keymap" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21#8fa4db64a9bb943520259ea95331a303ba788f21" dependencies = [ "craft-host", "craft-i18n", "craft-tracked", "craft-ui-macros", - "craft-xml", + "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21)", "egui", "serde", "serde_json", @@ -1580,7 +1597,7 @@ dependencies = [ [[package]] name = "craft-lottie" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21#8fa4db64a9bb943520259ea95331a303ba788f21" dependencies = [ "craft-zip", "serde_json", @@ -1590,7 +1607,7 @@ dependencies = [ [[package]] name = "craft-media" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ "chrono", "thiserror 2.0.21", @@ -1599,7 +1616,7 @@ dependencies = [ [[package]] name = "craft-media-source" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ "craft-audio", "craft-color", @@ -1614,7 +1631,7 @@ dependencies = [ [[package]] name = "craft-mesh" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21#8fa4db64a9bb943520259ea95331a303ba788f21" dependencies = [ "craft-zip", "miniz_oxide 0.9.1", @@ -1624,7 +1641,7 @@ dependencies = [ [[package]] name = "craft-mime" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21#8fa4db64a9bb943520259ea95331a303ba788f21" dependencies = [ "chrono", "craft-codepage", @@ -1634,7 +1651,7 @@ dependencies = [ [[package]] name = "craft-pcraft-format" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21#8fa4db64a9bb943520259ea95331a303ba788f21" dependencies = [ "flate2", "serde", @@ -1645,7 +1662,7 @@ dependencies = [ [[package]] name = "craft-pdf" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21#8fa4db64a9bb943520259ea95331a303ba788f21" dependencies = [ "hayro-syntax", "serde", @@ -1655,7 +1672,7 @@ dependencies = [ [[package]] name = "craft-platform" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21#8fa4db64a9bb943520259ea95331a303ba788f21" dependencies = [ "async-channel", "async-io", @@ -1686,7 +1703,7 @@ dependencies = [ [[package]] name = "craft-ps" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21#8fa4db64a9bb943520259ea95331a303ba788f21" dependencies = [ "craft-eps", "kurbo", @@ -1699,7 +1716,18 @@ dependencies = [ [[package]] name = "craft-psd" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" +dependencies = [ + "encoding_rs", + "flate2", + "rayon", + "thiserror 2.0.21", +] + +[[package]] +name = "craft-psd" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21#8fa4db64a9bb943520259ea95331a303ba788f21" dependencies = [ "encoding_rs", "flate2", @@ -1710,7 +1738,7 @@ dependencies = [ [[package]] name = "craft-quit" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21#8fa4db64a9bb943520259ea95331a303ba788f21" dependencies = [ "dispatch2", "objc2 0.6.5", @@ -1722,7 +1750,7 @@ dependencies = [ [[package]] name = "craft-raw" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ "craft-tiff", "miniz_oxide 0.9.1", @@ -1736,7 +1764,7 @@ dependencies = [ [[package]] name = "craft-settings" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21#8fa4db64a9bb943520259ea95331a303ba788f21" dependencies = [ "craft-atomic", "craft-host", @@ -1753,14 +1781,14 @@ dependencies = [ [[package]] name = "craft-sniff" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" [[package]] name = "craft-svg" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21#8fa4db64a9bb943520259ea95331a303ba788f21" dependencies = [ - "craft-xml", + "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21)", "flate2", "kurbo", "quick-xml 0.41.0", @@ -1775,7 +1803,7 @@ dependencies = [ [[package]] name = "craft-tga" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ "thiserror 2.0.21", ] @@ -1783,7 +1811,7 @@ dependencies = [ [[package]] name = "craft-theme" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21#8fa4db64a9bb943520259ea95331a303ba788f21" dependencies = [ "bitflags 2.13.2", "craft-tracked", @@ -1798,7 +1826,7 @@ dependencies = [ [[package]] name = "craft-tiff" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ "serde", "thiserror 2.0.21", @@ -1807,7 +1835,7 @@ dependencies = [ [[package]] name = "craft-time" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ "serde", "thiserror 2.0.21", @@ -1819,30 +1847,20 @@ version = "0.1.0" source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ "craft-time", - "craft-xml", + "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", "serde", "serde_json", ] -[[package]] -name = "craft-timeline" -version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" -dependencies = [ - "craft-time", - "serde", - "web-time", -] - [[package]] name = "craft-tracked" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21#8fa4db64a9bb943520259ea95331a303ba788f21" [[package]] name = "craft-ui" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21#8fa4db64a9bb943520259ea95331a303ba788f21" dependencies = [ "craft-cloud-ui", "craft-ui-canvas", @@ -1856,7 +1874,7 @@ dependencies = [ [[package]] name = "craft-ui-canvas" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21#8fa4db64a9bb943520259ea95331a303ba788f21" dependencies = [ "craft-behavior", "craft-i18n", @@ -1872,7 +1890,7 @@ dependencies = [ [[package]] name = "craft-ui-contract" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21#8fa4db64a9bb943520259ea95331a303ba788f21" dependencies = [ "accesskit", "craft-behavior", @@ -1910,7 +1928,7 @@ dependencies = [ [[package]] name = "craft-ui-macros" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21#8fa4db64a9bb943520259ea95331a303ba788f21" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -1921,7 +1939,7 @@ dependencies = [ [[package]] name = "craft-ui-panels" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21#8fa4db64a9bb943520259ea95331a303ba788f21" dependencies = [ "craft-behavior", "craft-host", @@ -1939,7 +1957,7 @@ dependencies = [ [[package]] name = "craft-ui-patterns" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21#8fa4db64a9bb943520259ea95331a303ba788f21" dependencies = [ "craft-behavior", "craft-host", @@ -1960,7 +1978,7 @@ dependencies = [ [[package]] name = "craft-ui-shell" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21#8fa4db64a9bb943520259ea95331a303ba788f21" dependencies = [ "craft-behavior", "craft-host", @@ -1980,7 +1998,7 @@ dependencies = [ [[package]] name = "craft-ui-widgets" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21#8fa4db64a9bb943520259ea95331a303ba788f21" dependencies = [ "craft-behavior", "craft-host", @@ -1999,7 +2017,7 @@ dependencies = [ [[package]] name = "craft-update" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21#8fa4db64a9bb943520259ea95331a303ba788f21" dependencies = [ "chrono", "craft-host", @@ -2028,7 +2046,7 @@ dependencies = [ [[package]] name = "craft-vectorcraft-format" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21#8fa4db64a9bb943520259ea95331a303ba788f21" dependencies = [ "flate2", "serde", @@ -2039,7 +2057,7 @@ dependencies = [ [[package]] name = "craft-video" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ "craft-media", "rav1e", @@ -2050,7 +2068,7 @@ dependencies = [ [[package]] name = "craft-webp" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21#8fa4db64a9bb943520259ea95331a303ba788f21" dependencies = [ "image", "thiserror 2.0.21", @@ -2059,7 +2077,7 @@ dependencies = [ [[package]] name = "craft-win32" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21#8fa4db64a9bb943520259ea95331a303ba788f21" dependencies = [ "winsafe", ] @@ -2067,7 +2085,7 @@ dependencies = [ [[package]] name = "craft-window" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21#8fa4db64a9bb943520259ea95331a303ba788f21" dependencies = [ "craft-appkit", "craft-atomic", @@ -2091,7 +2109,17 @@ dependencies = [ [[package]] name = "craft-xml" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" +dependencies = [ + "quick-xml 0.41.0", + "serde", + "thiserror 2.0.21", +] + +[[package]] +name = "craft-xml" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21#8fa4db64a9bb943520259ea95331a303ba788f21" dependencies = [ "quick-xml 0.41.0", "serde", @@ -2101,7 +2129,7 @@ dependencies = [ [[package]] name = "craft-y4m" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d#33be35625e252cc4f06aa375b3b428521faea37d" dependencies = [ "thiserror 2.0.21", ] @@ -2109,7 +2137,7 @@ dependencies = [ [[package]] name = "craft-zip" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21#8fa4db64a9bb943520259ea95331a303ba788f21" dependencies = [ "flate2", "thiserror 2.0.21", @@ -2403,7 +2431,7 @@ dependencies = [ [[package]] name = "ecolor" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=b15ffe9bfc2c8e6748533b32b708e10abaf2afec#b15ffe9bfc2c8e6748533b32b708e10abaf2afec" +source = "git+https://github.com/storytold/egui.git?rev=b9770908e0f304896f9658d239a7b29cf8af1564#b9770908e0f304896f9658d239a7b29cf8af1564" dependencies = [ "bytemuck", "emath", @@ -2564,7 +2592,7 @@ name = "effectcraft-export" version = "0.25.1" dependencies = [ "craft-audio", - "craft-exr", + "craft-exr 0.1.0 (git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21)", "craft-gif", "craft-media", "craft-tga", @@ -2678,7 +2706,7 @@ dependencies = [ name = "effectcraft-interchange" version = "0.25.1" dependencies = [ - "craft-timeline 0.1.0 (git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b)", + "craft-timeline", "effectcraft-color", "effectcraft-keyframe", "effectcraft-project", @@ -2732,8 +2760,8 @@ dependencies = [ "craft-audio", "craft-color", "craft-docpath", - "craft-dpx", - "craft-exr", + "craft-dpx 0.1.0 (git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21)", + "craft-exr 0.1.0 (git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21)", "craft-frame", "craft-gif", "craft-media", @@ -2844,7 +2872,7 @@ name = "effectcraft-psd" version = "0.25.1" dependencies = [ "craft-codepage", - "craft-psd", + "craft-psd 0.1.0 (git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21)", "miniz_oxide 0.9.1", ] @@ -2852,7 +2880,7 @@ dependencies = [ name = "effectcraft-raster" version = "0.25.1" dependencies = [ - "craft-exr", + "craft-exr 0.1.0 (git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21)", "effectcraft-color", "effectcraft-geom", "rayon", @@ -3045,7 +3073,7 @@ dependencies = [ [[package]] name = "eframe" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=b15ffe9bfc2c8e6748533b32b708e10abaf2afec#b15ffe9bfc2c8e6748533b32b708e10abaf2afec" +source = "git+https://github.com/storytold/egui.git?rev=b9770908e0f304896f9658d239a7b29cf8af1564#b9770908e0f304896f9658d239a7b29cf8af1564" dependencies = [ "ahash", "bytemuck", @@ -3080,7 +3108,7 @@ dependencies = [ [[package]] name = "egui" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=b15ffe9bfc2c8e6748533b32b708e10abaf2afec#b15ffe9bfc2c8e6748533b32b708e10abaf2afec" +source = "git+https://github.com/storytold/egui.git?rev=b9770908e0f304896f9658d239a7b29cf8af1564#b9770908e0f304896f9658d239a7b29cf8af1564" dependencies = [ "accesskit", "ahash", @@ -3099,7 +3127,7 @@ dependencies = [ [[package]] name = "egui-wgpu" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=b15ffe9bfc2c8e6748533b32b708e10abaf2afec#b15ffe9bfc2c8e6748533b32b708e10abaf2afec" +source = "git+https://github.com/storytold/egui.git?rev=b9770908e0f304896f9658d239a7b29cf8af1564#b9770908e0f304896f9658d239a7b29cf8af1564" dependencies = [ "ahash", "bytemuck", @@ -3118,7 +3146,7 @@ dependencies = [ [[package]] name = "egui-winit" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=b15ffe9bfc2c8e6748533b32b708e10abaf2afec#b15ffe9bfc2c8e6748533b32b708e10abaf2afec" +source = "git+https://github.com/storytold/egui.git?rev=b9770908e0f304896f9658d239a7b29cf8af1564#b9770908e0f304896f9658d239a7b29cf8af1564" dependencies = [ "accesskit_winit", "arboard", @@ -3144,7 +3172,7 @@ dependencies = [ [[package]] name = "egui_extras" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=b15ffe9bfc2c8e6748533b32b708e10abaf2afec#b15ffe9bfc2c8e6748533b32b708e10abaf2afec" +source = "git+https://github.com/storytold/egui.git?rev=b9770908e0f304896f9658d239a7b29cf8af1564#b9770908e0f304896f9658d239a7b29cf8af1564" dependencies = [ "ahash", "egui", @@ -3157,7 +3185,7 @@ dependencies = [ [[package]] name = "egui_glow" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=b15ffe9bfc2c8e6748533b32b708e10abaf2afec#b15ffe9bfc2c8e6748533b32b708e10abaf2afec" +source = "git+https://github.com/storytold/egui.git?rev=b9770908e0f304896f9658d239a7b29cf8af1564#b9770908e0f304896f9658d239a7b29cf8af1564" dependencies = [ "bytemuck", "egui", @@ -3170,7 +3198,7 @@ dependencies = [ [[package]] name = "egui_kittest" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=b15ffe9bfc2c8e6748533b32b708e10abaf2afec#b15ffe9bfc2c8e6748533b32b708e10abaf2afec" +source = "git+https://github.com/storytold/egui.git?rev=b9770908e0f304896f9658d239a7b29cf8af1564#b9770908e0f304896f9658d239a7b29cf8af1564" dependencies = [ "eframe", "egui", @@ -3193,7 +3221,7 @@ checksum = "252afb9ae5eaa683babdc6a068b3f5726eb19e05070c731f9b2a23a7c3e8ed34" [[package]] name = "emath" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=b15ffe9bfc2c8e6748533b32b708e10abaf2afec#b15ffe9bfc2c8e6748533b32b708e10abaf2afec" +source = "git+https://github.com/storytold/egui.git?rev=b9770908e0f304896f9658d239a7b29cf8af1564#b9770908e0f304896f9658d239a7b29cf8af1564" dependencies = [ "bytemuck", ] @@ -3286,7 +3314,7 @@ dependencies = [ [[package]] name = "epaint" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=b15ffe9bfc2c8e6748533b32b708e10abaf2afec#b15ffe9bfc2c8e6748533b32b708e10abaf2afec" +source = "git+https://github.com/storytold/egui.git?rev=b9770908e0f304896f9658d239a7b29cf8af1564#b9770908e0f304896f9658d239a7b29cf8af1564" dependencies = [ "ahash", "bytemuck", @@ -3312,7 +3340,7 @@ dependencies = [ [[package]] name = "epaint_default_fonts" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=b15ffe9bfc2c8e6748533b32b708e10abaf2afec#b15ffe9bfc2c8e6748533b32b708e10abaf2afec" +source = "git+https://github.com/storytold/egui.git?rev=b9770908e0f304896f9658d239a7b29cf8af1564#b9770908e0f304896f9658d239a7b29cf8af1564" [[package]] name = "equator" @@ -3537,7 +3565,7 @@ source = "git+https://github.com/storytold/filmcraft?rev=e7345f6e04a9bb921c2613a dependencies = [ "craft-aaf", "craft-audio", - "craft-timeline 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", + "craft-timeline", "filmcraft-cfb", "filmcraft-color", "filmcraft-geom", @@ -3572,12 +3600,12 @@ version = "0.20.1" source = "git+https://github.com/storytold/filmcraft?rev=e7345f6e04a9bb921c2613a6aa92d162edf39b3b#e7345f6e04a9bb921c2613a6aa92d162edf39b3b" dependencies = [ "craft-audio", - "craft-dpx", - "craft-exr", + "craft-dpx 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", + "craft-exr 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", "craft-hdr", "craft-media", "craft-media-source", - "craft-psd", + "craft-psd 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", "craft-sniff", "craft-tga", "craft-tiff", @@ -3611,7 +3639,7 @@ name = "filmcraft-time" version = "0.20.1" source = "git+https://github.com/storytold/filmcraft?rev=e7345f6e04a9bb921c2613a6aa92d162edf39b3b#e7345f6e04a9bb921c2613a6aa92d162edf39b3b" dependencies = [ - "craft-timeline 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33be35625e252cc4f06aa375b3b428521faea37d)", + "craft-timeline", ] [[package]] @@ -4249,7 +4277,7 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a" [[package]] name = "hayro-jbig2" version = "0.3.0" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21#8fa4db64a9bb943520259ea95331a303ba788f21" dependencies = [ "hayro-ccitt", ] @@ -4263,7 +4291,7 @@ checksum = "c75ab947623ef4ccaa7acf0579edf7cbb5a73838e3839a7be73335e522f433a1" [[package]] name = "hayro-syntax" version = "0.7.2" -source = "git+https://github.com/aiongg/craft-libs?rev=aa401985dd4658cdaa272fdccafdcd6e7f4dd60b#aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" +source = "git+https://github.com/storytold/craft-libs?rev=8fa4db64a9bb943520259ea95331a303ba788f21#8fa4db64a9bb943520259ea95331a303ba788f21" dependencies = [ "hayro-jbig2", "hayro-jpeg2000", diff --git a/Cargo.toml b/Cargo.toml index 07fe85bbb..917ff9f77 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,28 +11,28 @@ rust-version = "1.95" repository = "https://github.com/storytold/effectcraft" [workspace.dependencies] -craft-timeline = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", default-features = false } -craft-mime = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } -craft-pdf = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", version = "=0.1.0", default-features = false, features = ["read"] } -craft-docpath = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } -craft-jsonrpc = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } -craft-ecproj-format = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } -craft-dpx = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } -craft-ps = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", default-features = false, features = ["read"] } -craft-exr = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } -craft-gif = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } -craft-tga = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } -craft-psd = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } -craft-codepage = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } -craft-svg = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } -craft-webp = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } -craft-lottie = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } -craft-mesh = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", default-features = false, features = ["stl", "obj", "gltf", "fbx"] } -craft-aep = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } -craft-doc = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } -craft-vectorcraft-format = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } +craft-timeline = { git = "https://github.com/storytold/craft-libs", rev = "33be35625e252cc4f06aa375b3b428521faea37d", default-features = false } +craft-mime = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "8fa4db64a9bb943520259ea95331a303ba788f21" } +craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "8fa4db64a9bb943520259ea95331a303ba788f21", version = "=0.1.0", default-features = false, features = ["read"] } +craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "8fa4db64a9bb943520259ea95331a303ba788f21" } +craft-jsonrpc = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "8fa4db64a9bb943520259ea95331a303ba788f21" } +craft-ecproj-format = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "8fa4db64a9bb943520259ea95331a303ba788f21" } +craft-dpx = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "8fa4db64a9bb943520259ea95331a303ba788f21" } +craft-ps = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "8fa4db64a9bb943520259ea95331a303ba788f21", default-features = false, features = ["read"] } +craft-exr = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "8fa4db64a9bb943520259ea95331a303ba788f21" } +craft-gif = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "8fa4db64a9bb943520259ea95331a303ba788f21" } +craft-tga = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "33be35625e252cc4f06aa375b3b428521faea37d" } +craft-psd = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "8fa4db64a9bb943520259ea95331a303ba788f21" } +craft-codepage = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "8fa4db64a9bb943520259ea95331a303ba788f21" } +craft-svg = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "8fa4db64a9bb943520259ea95331a303ba788f21" } +craft-webp = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "8fa4db64a9bb943520259ea95331a303ba788f21" } +craft-lottie = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "8fa4db64a9bb943520259ea95331a303ba788f21" } +craft-mesh = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "8fa4db64a9bb943520259ea95331a303ba788f21", default-features = false, features = ["stl", "obj", "gltf", "fbx"] } +craft-aep = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "8fa4db64a9bb943520259ea95331a303ba788f21" } +craft-doc = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "8fa4db64a9bb943520259ea95331a303ba788f21" } +craft-vectorcraft-format = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "8fa4db64a9bb943520259ea95331a303ba788f21" } # craft-update: app-specific pretend versions apply to startup and manual checks. -craft-update = { git = "https://github.com/aiongg/craft-libs", version = "=0.1.0", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", features = ["ui"] } +craft-update = { git = "https://github.com/storytold/craft-libs", version = "=0.1.0", rev = "8fa4db64a9bb943520259ea95331a303ba788f21", features = ["ui"] } # internal effectcraft-time = { path = "crates/time" } effectcraft-geom = { path = "crates/geom" } @@ -96,14 +96,15 @@ image = { version = "0.25", default-features = false, features = ["png", "jpeg"] same-file = "1.0" tempfile = "3.27" -# codecs + containers shared by the Craft apps (crates/media, crates/export); keep all in sync. -craft-media = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", default-features = false, features = ["isobmff", "matroska"] } -craft-media-source = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } -craft-frame = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } -craft-color = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } -craft-time = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } -craft-audio = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", default-features = false, features = ["aac-decode", "aac-encode", "alac-decode", "opus-decode", "opus-encode", "ac3-decode", "mp3-decode", "mpa-decode"] } -craft-video = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", features = ["h264-decode", "h264-encode", "prores", "hevc-encode", "vp9-encode", "av1", "threads"] } +# codecs + containers shared by the Craft apps (crates/media, crates/export); keep all in sync, with +# filmcraft-media's craft-libs rev: their types cross between the two. +craft-media = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "33be35625e252cc4f06aa375b3b428521faea37d", default-features = false, features = ["isobmff", "matroska"] } +craft-media-source = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "33be35625e252cc4f06aa375b3b428521faea37d" } +craft-frame = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "33be35625e252cc4f06aa375b3b428521faea37d" } +craft-color = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "33be35625e252cc4f06aa375b3b428521faea37d" } +craft-time = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "33be35625e252cc4f06aa375b3b428521faea37d" } +craft-audio = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "33be35625e252cc4f06aa375b3b428521faea37d", default-features = false, features = ["aac-decode", "aac-encode", "alac-decode", "opus-decode", "opus-encode", "ac3-decode", "mp3-decode", "mpa-decode"] } +craft-video = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "33be35625e252cc4f06aa375b3b428521faea37d", features = ["h264-decode", "h264-encode", "prores", "hevc-encode", "vp9-encode", "av1", "threads"] } # footage decoding: FilmCraft's pure-Rust crates, pinned to a revision (plan/adr/0001). # Only `crates/media`, `crates/export` and `crates/interchange` may depend on these. @@ -126,12 +127,12 @@ half = "2.7" # ui # Shared frontend components; keep this dependency above the engine boundary. # Shared UI and the complete egui family select reviewed immutable commits below. -craft-ui = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } -craft-behavior = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } -craft-host = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } -craft-keymap = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } -craft-theme = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } -craft-window = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } +craft-ui = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "8fa4db64a9bb943520259ea95331a303ba788f21" } +craft-behavior = { git = "https://github.com/storytold/craft-libs", rev = "8fa4db64a9bb943520259ea95331a303ba788f21" } +craft-host = { git = "https://github.com/storytold/craft-libs", rev = "8fa4db64a9bb943520259ea95331a303ba788f21" } +craft-keymap = { git = "https://github.com/storytold/craft-libs", rev = "8fa4db64a9bb943520259ea95331a303ba788f21" } +craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "8fa4db64a9bb943520259ea95331a303ba788f21" } +craft-window = { git = "https://github.com/storytold/craft-libs", rev = "8fa4db64a9bb943520259ea95331a303ba788f21" } # `default_fonts` and `monochrome_emoji_fonts` are explicit: the app's `FontDefinitions::default()` # and its `✔`/`▣` chrome glyphs need both, and kittest's own dev-dependencies do not propagate. egui = { version = "0.37", default-features = false, features = ["default_fonts", "monochrome_emoji_fonts"] } @@ -235,43 +236,20 @@ opt-level = 3 lto = "thin" codegen-units = 1 -# filmcraft-media pins storytold craft-libs; the app needs one copy of each crate. -[patch."https://github.com/storytold/craft-libs"] -craft-aaf = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", version = "=0.1.0" } -craft-audio = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", version = "=0.1.0" } -craft-cfb = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", version = "=0.1.0" } -craft-color = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", version = "=0.1.0" } -craft-dpx = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", version = "=0.1.0" } -craft-exr = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", version = "=0.1.0" } -craft-frame = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", version = "=0.1.0" } -craft-hdr = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", version = "=0.1.0" } -craft-jpeg = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", version = "=0.1.0" } -craft-media = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", version = "=0.1.0" } -craft-media-source = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", version = "=0.1.0" } -craft-psd = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", version = "=0.1.0" } -craft-raw = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", version = "=0.1.0" } -craft-sniff = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", version = "=0.1.0" } -craft-tga = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", version = "=0.1.0" } -craft-tiff = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", version = "=0.1.0" } -craft-time = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", version = "=0.1.0" } -craft-video = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", version = "=0.1.0" } -craft-xml = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", version = "=0.1.0" } -craft-y4m = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", version = "=0.1.0" } - [patch.crates-io] -hayro-syntax = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", version = "=0.7.2" } -hayro-jbig2 = { git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b", version = "=0.3.0" } -ecolor = { git = "https://github.com/storytold/egui.git", rev = "b15ffe9bfc2c8e6748533b32b708e10abaf2afec" } -emath = { git = "https://github.com/storytold/egui.git", rev = "b15ffe9bfc2c8e6748533b32b708e10abaf2afec" } -epaint = { git = "https://github.com/storytold/egui.git", rev = "b15ffe9bfc2c8e6748533b32b708e10abaf2afec" } -epaint_default_fonts = { git = "https://github.com/storytold/egui.git", rev = "b15ffe9bfc2c8e6748533b32b708e10abaf2afec" } -egui = { git = "https://github.com/storytold/egui.git", rev = "b15ffe9bfc2c8e6748533b32b708e10abaf2afec" } -egui-winit = { git = "https://github.com/storytold/egui.git", rev = "b15ffe9bfc2c8e6748533b32b708e10abaf2afec" } -egui-wgpu = { git = "https://github.com/storytold/egui.git", rev = "b15ffe9bfc2c8e6748533b32b708e10abaf2afec" } -egui_glow = { git = "https://github.com/storytold/egui.git", rev = "b15ffe9bfc2c8e6748533b32b708e10abaf2afec" } -egui_extras = { git = "https://github.com/storytold/egui.git", rev = "b15ffe9bfc2c8e6748533b32b708e10abaf2afec" } -egui_kittest = { git = "https://github.com/storytold/egui.git", rev = "b15ffe9bfc2c8e6748533b32b708e10abaf2afec" } -eframe = { git = "https://github.com/storytold/egui.git", rev = "b15ffe9bfc2c8e6748533b32b708e10abaf2afec" } +hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "8fa4db64a9bb943520259ea95331a303ba788f21", version = "=0.7.2" } +hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "8fa4db64a9bb943520259ea95331a303ba788f21", version = "=0.3.0" } +ecolor = { git = "https://github.com/storytold/egui.git", rev = "b9770908e0f304896f9658d239a7b29cf8af1564" } +emath = { git = "https://github.com/storytold/egui.git", rev = "b9770908e0f304896f9658d239a7b29cf8af1564" } +epaint = { git = "https://github.com/storytold/egui.git", rev = "b9770908e0f304896f9658d239a7b29cf8af1564" } +epaint_default_fonts = { git = "https://github.com/storytold/egui.git", rev = "b9770908e0f304896f9658d239a7b29cf8af1564" } +egui = { git = "https://github.com/storytold/egui.git", rev = "b9770908e0f304896f9658d239a7b29cf8af1564" } +egui-winit = { git = "https://github.com/storytold/egui.git", rev = "b9770908e0f304896f9658d239a7b29cf8af1564" } +egui-wgpu = { git = "https://github.com/storytold/egui.git", rev = "b9770908e0f304896f9658d239a7b29cf8af1564" } +egui_glow = { git = "https://github.com/storytold/egui.git", rev = "b9770908e0f304896f9658d239a7b29cf8af1564" } +egui_extras = { git = "https://github.com/storytold/egui.git", rev = "b9770908e0f304896f9658d239a7b29cf8af1564" } +egui_kittest = { git = "https://github.com/storytold/egui.git", rev = "b9770908e0f304896f9658d239a7b29cf8af1564" } +eframe = { git = "https://github.com/storytold/egui.git", rev = "b9770908e0f304896f9658d239a7b29cf8af1564" } # Patch a crate only together with the dependency that needs it: an unused patch makes the Nix # build, which uses vendored sources, fail (`cargo xtask lock-patches`). winit = { git = "https://github.com/storytold/winit.git", rev = "a517b3846ee8457d84ee4975110bfda6797c44dc" } diff --git a/crates/effects/Cargo.toml b/crates/effects/Cargo.toml index 18dab406c..99b562ab4 100644 --- a/crates/effects/Cargo.toml +++ b/crates/effects/Cargo.toml @@ -10,7 +10,7 @@ rust-version.workspace = true workspace = true [dependencies] -craft-cms = { version = "0.1.0", git = "https://github.com/aiongg/craft-libs", rev = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b" } +craft-cms = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "8fa4db64a9bb943520259ea95331a303ba788f21" } effectcraft-geom = { workspace = true } effectcraft-color = { workspace = true } effectcraft-keyframe = { workspace = true } diff --git a/xtask/src/pdf_deps.rs b/xtask/src/pdf_deps.rs index aab13260d..a7dcc6d81 100644 --- a/xtask/src/pdf_deps.rs +++ b/xtask/src/pdf_deps.rs @@ -5,9 +5,7 @@ use std::process::Command; use serde_json::Value; -// The repository Cargo.toml pins craft-libs from (the aiongg fork while filmcraft-media pins storytold craft-libs). -const REPO: &str = "https://github.com/aiongg/craft-libs"; -const REV: &str = "aa401985dd4658cdaa272fdccafdcd6e7f4dd60b"; +const REV: &str = "8fa4db64a9bb943520259ea95331a303ba788f21"; const PACKAGES: &[(&str, &str)] = &[("craft-pdf", "0.1.0"), ("craft-ps", "0.1.0"), ("hayro-syntax", "0.7.2"), ("hayro-jbig2", "0.3.0")]; pub fn run(root: &Path) -> Result<(), String> { @@ -28,7 +26,7 @@ pub fn run(root: &Path) -> Result<(), String> { fn validate(metadata: &Value) -> Result<(), String> { let packages = metadata.get("packages").and_then(Value::as_array).ok_or("cargo metadata has no packages")?; let nodes = metadata.pointer("/resolve/nodes").and_then(Value::as_array).ok_or("cargo metadata has no resolved nodes")?; - let source = format!("git+{REPO}?rev={REV}#{REV}"); + let source = format!("git+https://github.com/storytold/craft-libs?rev={REV}#{REV}"); for (name, version) in PACKAGES { let matches: Vec<_> = packages.iter().filter(|p| p["name"] == *name).collect(); if matches.len() != 1 || matches[0]["version"] != *version || matches[0]["source"] != source { @@ -59,10 +57,9 @@ mod tests { use serde_json::json; fn metadata() -> Value { - let packages: Vec<_> = PACKAGES - .iter() - .map(|(name, version)| json!({"id": name, "name": name, "version": version, "source": format!("git+{REPO}?rev={REV}#{REV}")})) - .collect(); + let packages: Vec<_> = PACKAGES.iter().map(|(name, version)| { + json!({"id": name, "name": name, "version": version, "source": format!("git+https://github.com/storytold/craft-libs?rev={REV}#{REV}")}) + }).collect(); json!({"packages": packages, "resolve": {"nodes": [ {"id": "hayro-syntax", "features": ["std"]}, {"id": "craft-pdf", "features": ["read"]}, {"id": "craft-ps", "features": ["read"]} From 5bdbd2cf89429029885e1a343020e80e2525a1d0 Mon Sep 17 00:00:00 2001 From: aiongg Date: Wed, 25 Nov 2026 20:10:33 +0000 Subject: [PATCH 446/451] The font picker stays on the side it opened on --- crates/ui-egui/src/panels/text_panels.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/panels/text_panels.rs b/crates/ui-egui/src/panels/text_panels.rs index e80f20bfc..358c4ab17 100644 --- a/crates/ui-egui/src/panels/text_panels.rs +++ b/crates/ui-egui/src/panels/text_panels.rs @@ -1105,11 +1105,13 @@ fn header_menu( ) -> Option { egui::Popup::from_response(field) .open_bool(open) + .max_height_from_constrain(true) + .align_alternatives(&[egui::RectAlign::TOP_START]) .width(field.rect.width()) .close_behavior(egui::PopupCloseBehavior::CloseOnClickOutside) .show(|ui| { ui.set_min_width(ui.available_width()); - ui.set_max_height(height); + ui.set_max_height(height.min(ui.available_height())); let header = header(ui); egui::ScrollArea::vertical().max_height(ui.available_height().max(0.0)).show(ui, |ui| list(ui, header)).inner }) From fb5a5fd9101b93638623ddd142bbd466bd159649 Mon Sep 17 00:00:00 2001 From: aiongg Date: Wed, 25 Nov 2026 20:10:33 +0000 Subject: [PATCH 447/451] Floating windows carry the running channel's app id --- crates/ui-egui/src/framework.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/crates/ui-egui/src/framework.rs b/crates/ui-egui/src/framework.rs index 5e1c8c65f..5057ac086 100644 --- a/crates/ui-egui/src/framework.rs +++ b/crates/ui-egui/src/framework.rs @@ -31,9 +31,6 @@ use crate::EffectcraftApp; #[cfg(not(target_arch = "wasm32"))] pub use craft_ui::shell::embed::before_ui; -/// The id every OS window of the app carries, as the desktop entry and the update app name it. -const APP_ID: &str = "ai.storyteller.effectcraft"; - /// The scripts of the interface languages, for the font stack. static SCRIPTS: I18nScripts = I18nScripts; @@ -44,7 +41,7 @@ fn ui_fonts() -> UiFonts<'static> { } fn install_with(ctx: &egui::Context, shell: ShellInfo, windows: Arc) -> Result<(), String> { - let spec = craft_ui::InstallSpec::new(shell, windows).app_id(APP_ID); + let spec = craft_ui::InstallSpec::new(shell, windows).app_id(crate::channel::app_id()); embed::install(ctx, spec, &ui_fonts()).map(drop).map_err(|error| format!("the UI runtime could not be installed: {error}")) } From 984b10c5a66a65e68ed1ae035330ecaf4cb84228 Mon Sep 17 00:00:00 2001 From: aiongg Date: Wed, 25 Nov 2026 20:44:58 +0000 Subject: [PATCH 448/451] Preview keeps its 46-point body under the 28-point tab strip; the examples install the UI runtime --- crates/ui-egui/examples/cache_bench.rs | 5 ++++- crates/ui-egui/examples/snapshot.rs | 1 + crates/ui-egui/src/dock.rs | 2 +- crates/ui-egui/tests/it/ui_tabs.rs | 8 ++++---- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/crates/ui-egui/examples/cache_bench.rs b/crates/ui-egui/examples/cache_bench.rs index 43e937c92..0efcdea21 100644 --- a/crates/ui-egui/examples/cache_bench.rs +++ b/crates/ui-egui/examples/cache_bench.rs @@ -225,7 +225,10 @@ fn main() { fn play(session: effectcraft_engine::Session, cid: ItemId, secs: f64, gpu: bool) { use effectcraft_ui_egui::{ControlRequest, EffectcraftApp}; let (tx, rx) = std::sync::mpsc::channel::(); - let builder = egui_kittest::Harness::builder().with_size(egui::vec2(1920.0, 1200.0)).with_pixels_per_point(1.0); + let builder = egui_kittest::Harness::builder() + .with_size(egui::vec2(1920.0, 1200.0)) + .with_pixels_per_point(1.0) + .with_context_setup(effectcraft_ui_egui::framework::install_headless); let builder = if gpu { builder.wgpu() } else { builder }; let mut h = builder.build_eframe(move |_| EffectcraftApp::new(session).with_control(rx)); { diff --git a/crates/ui-egui/examples/snapshot.rs b/crates/ui-egui/examples/snapshot.rs index e15c135bd..0646e5e79 100644 --- a/crates/ui-egui/examples/snapshot.rs +++ b/crates/ui-egui/examples/snapshot.rs @@ -103,6 +103,7 @@ fn main() { .with_size(egui::vec2(args.size.0, args.size.1)) .with_pixels_per_point(args.scale) .wgpu() + .with_context_setup(effectcraft_ui_egui::framework::install_headless) .build_eframe(move |_cc| EffectcraftApp::new(session).with_control(rx)); settle(&mut harness, args.settle); for step in &args.steps { diff --git a/crates/ui-egui/src/dock.rs b/crates/ui-egui/src/dock.rs index 1addcd88c..32bc6ba98 100644 --- a/crates/ui-egui/src/dock.rs +++ b/crates/ui-egui/src/dock.rs @@ -255,7 +255,7 @@ fn workspace_floating(name: &str) -> Vec> { } /// The height of a frame's tab strip ([`Tokens::tab_h`]). -pub const TAB_STRIP: f32 = 30.0; +pub const TAB_STRIP: f32 = 28.0; /// The height of Default's Preview frame: its tab strip over a 46-point body that fits the /// playback controls. pub const PREVIEW_FRAME: f32 = TAB_STRIP + 46.0; diff --git a/crates/ui-egui/tests/it/ui_tabs.rs b/crates/ui-egui/tests/it/ui_tabs.rs index a9df1b556..56104aef6 100644 --- a/crates/ui-egui/tests/it/ui_tabs.rs +++ b/crates/ui-egui/tests/it/ui_tabs.rs @@ -234,20 +234,20 @@ fn preview_divider(h: &Harness<'_, EffectcraftApp>) -> egui::Rect { .expect("a gutter between Preview and Properties") } -/// Default's right column: a short Preview frame (48 points of body under next's 28-point strip) and the Properties frame +/// Default's right column: a short Preview frame (46 points of body) and the Properties frame /// below it taking the rest of the column, at any window height. #[test] fn the_default_preview_frame_is_short_and_properties_takes_the_rest() { let (mut h, _, _) = harness(); let body = |h: &Harness<'_, EffectcraftApp>| rect(h, "panel.Preview").height(); - assert!((body(&h) - 48.0).abs() < 1.5, "Preview {}", body(&h)); + assert!((body(&h) - 46.0).abs() < 1.5, "Preview {}", body(&h)); let props = rect(&h, "panel.Properties"); assert!(props.height() > 300.0, "Properties {props:?}"); // A taller window gives the room to Properties. let size = h.ctx.content_rect().size(); h.set_size(size + egui::vec2(0.0, 200.0)); h.run_steps(3); - assert!((body(&h) - 48.0).abs() < 1.5, "Preview {}", body(&h)); + assert!((body(&h) - 46.0).abs() < 1.5, "Preview {}", body(&h)); assert!((rect(&h, "panel.Properties").height() - props.height() - 200.0).abs() < 2.0); } @@ -504,7 +504,7 @@ fn open_comps_are_tabs_in_the_timeline_row_and_the_rest_are_in_its_overflow_menu } #[test] -fn an_inactive_comp_tab_shows_its_close_button_on_hover_and_closes_without_showing_its_comp() { +fn an_inactive_comp_tab_shows_its_close_button_and_closes_without_showing_its_comp() { let (mut h, pre, main) = harness(); h.state_mut().session.state.open_comps = vec![ItemId(main), ItemId(pre)]; h.run_steps(3); From 5eccc055ce77e74efa492efe3cb6ad3d2a180c6f Mon Sep 17 00:00:00 2001 From: skylar taylor-barrick Date: Wed, 25 Nov 2026 16:16:58 -0600 Subject: [PATCH 449/451] Use the shared nightly launcher template (#4169) Renders the plain nightly tar's launcher from craft-common-actions' shared template. Independent check: dylanmtaylor compared all 14 app launcher PRs byte for byte with the template rendered from the registry (https://github.com/storytold/craft-common-actions/pull/367#issuecomment-7172085284); this head was re-checked against craft-common-actions main 88148a5. --- packaging/linux/nightly-launch-test.sh | 38 +++++++++++++++++++++----- packaging/linux/nightly-launch.sh | 23 +++++++++------- 2 files changed, 44 insertions(+), 17 deletions(-) diff --git a/packaging/linux/nightly-launch-test.sh b/packaging/linux/nightly-launch-test.sh index 90131c9fb..53b29c862 100755 --- a/packaging/linux/nightly-launch-test.sh +++ b/packaging/linux/nightly-launch-test.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash # Validate the launcher inside the flat Nightly tar without building or opening EffectCraft. +# +# That launcher is the canonical shared template (craft-common-actions scripts/nightly-launcher.sh.in), +# which the nightly producer accepts byte for byte: it starts `effectcraft-bin` beside itself on the +# nightly-v1 profile under the app's package identity, answers a version query with one plain +# `--version`, and wraps every other argument, including a command line that already names a profile. set -euo pipefail HERE="$(cd "$(dirname "$0")" && pwd)" @@ -19,8 +24,9 @@ chmod 755 "$stage/effectcraft" # A fixed profile base keeps the recorded arguments exactly comparable. export XDG_DATA_HOME="$work/xdg-data" +identity=ai.storyteller.effectcraft.nightly profile() { - printf '<%s>\n' --launch-profile nightly-v1 --profile-root "$XDG_DATA_HOME/effectcraft-nightly" -- "$@" + printf '<%s>\n' --launch-profile nightly-v1 --profile-root "$XDG_DATA_HOME/$identity" -- "$@" } expect() { expected="$1" @@ -33,14 +39,23 @@ expect() { } expect "$(profile)" expect "$(profile 'project with spaces.ec' '--other-name.ec')" 'project with spaces.ec' '--other-name.ec' -# A version query and an already selected profile pass through: after `--` both would be files. -expect '<--version>' --version -expect '<-V>' -V -expect "$(printf '<%s>\n' --launch-profile nightly-v1 --profile-root "$work/launcher-root" --version)" \ - --launch-profile nightly-v1 --profile-root "$work/launcher-root" --version +# Both version spellings reach the GUI as one plain `--version`: the template never forwards `-V`. +expect "$(printf '<%s>\n' --launch-profile nightly-v1 --profile-root "$XDG_DATA_HOME/$identity" --version)" --version +expect "$(printf '<%s>\n' --launch-profile nightly-v1 --profile-root "$XDG_DATA_HOME/$identity" --version)" -V +# The ArtCraft Launcher starts the entry point with its own profile pair and per-install root; the +# template hands that line to the GUI unchanged. +supplied=(--launch-profile nightly-v1 --profile-root "$work/launcher-root" --version) +expect "$(printf '<%s>\n' "${supplied[@]}")" "${supplied[@]}" +supplied=(--launch-profile nightly-v1 --profile-root "$work/launcher root" -- 'project.ec') +expect "$(printf '<%s>\n' "${supplied[@]}")" "${supplied[@]}" +# Anything else is wrapped in the template's own profile, including a profile line that does not open +# the arguments and an `=` spelling of the selector. +wrapped=(--profile-root "$work/launcher-root" --) +expect "$(printf '<%s>\n' --launch-profile nightly-v1 --profile-root "$XDG_DATA_HOME/$identity" -- "${wrapped[@]}")" "${wrapped[@]}" +expect "$(printf '<%s>\n' --launch-profile nightly-v1 --profile-root "$XDG_DATA_HOME/$identity" -- --launch-profile=nightly-v1)" --launch-profile=nightly-v1 # HOME is the only other base, and the profile root is never optional. home_run=$(env -u XDG_DATA_HOME HOME="$work/home" "$stage/effectcraft") -expected_home=$(printf '<%s>\n' --launch-profile nightly-v1 --profile-root "$work/home/.local/share/effectcraft-nightly" --) +expected_home=$(printf '<%s>\n' --launch-profile nightly-v1 --profile-root "$work/home/.local/share/$identity" --) if [[ "$home_run" != "$expected_home" ]]; then printf 'expected:\n%s\nactual:\n%s\n' "$expected_home" "$home_run" >&2 exit 1 @@ -49,5 +64,14 @@ if env -u XDG_DATA_HOME -u HOME "$stage/effectcraft" >/dev/null 2>&1; then echo 'a launcher without HOME must refuse rather than start with the stable profile' >&2 exit 1 fi +# The template starts the GUI beside itself or nothing: a missing copy is not looked for elsewhere. +mv "$stage/effectcraft-bin" "$work/moved-aside" +for args in "" "--version"; do + if "$stage/effectcraft" $args >/dev/null 2>&1; then + echo 'the launcher started without its GUI beside it' >&2 + exit 1 + fi +done +mv "$work/moved-aside" "$stage/effectcraft-bin" echo "PASS: the flat Nightly tar's launcher starts the GUI through the Nightly launch profile" diff --git a/packaging/linux/nightly-launch.sh b/packaging/linux/nightly-launch.sh index 7edb84e97..d10e9ebf5 100755 --- a/packaging/linux/nightly-launch.sh +++ b/packaging/linux/nightly-launch.sh @@ -1,13 +1,16 @@ #!/bin/sh -# The launcher inside EffectCraft Nightly's flat tar: an unpacked copy is isolated like the -# packages, so it never falls back to the stable settings folder. The GUI itself is `effectcraft-bin`; -# `effectcraft` is the name people run, and the version query still answers from it. +# Nightly launcher generated by craft-common-actions scripts/nightly-launcher.sh.in. Do not edit: +# the shared nightly producer accepts this file only byte for byte as rendered for the app. set -eu - -here="$(dirname "$0")" -real_bin="$here/effectcraft-bin" -case "${1:-}" in - --version|-V|--launch-profile) exec "$real_bin" "$@" ;; +dir=$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd -P) +readonly dir +target="$dir/effectcraft-bin" +readonly target +profile_root="${XDG_DATA_HOME:-$HOME/.local/share}/ai.storyteller.effectcraft.nightly" +readonly profile_root +case "${1-}" in + # The ArtCraft Launcher passes its own profile and per-install root; the app validates the pair. + --launch-profile) exec "$target" "$@" ;; + --version | -V) exec "$target" --launch-profile nightly-v1 --profile-root "$profile_root" --version ;; esac -profile_base="${XDG_DATA_HOME:-${HOME:?HOME is required}/.local/share}" -exec "$real_bin" --launch-profile nightly-v1 --profile-root "$profile_base/effectcraft-nightly" -- "$@" +exec "$target" --launch-profile nightly-v1 --profile-root "$profile_root" -- "$@" From 9111eaa73c90118586a400d185fe332773a86915 Mon Sep 17 00:00:00 2001 From: skylar taylor-barrick Date: Wed, 25 Nov 2026 21:05:26 -0600 Subject: [PATCH 450/451] 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. --- .github/nightly-signing-policy.json | 10 +- .github/workflows/nightly-sign.yml | 17 +- .github/workflows/nightly.yml | 8 +- docs/nightly-release-preparation.md | 68 ++++-- packaging/nightly-release-tests.py | 326 +++++++++++++++++++++++++++- 5 files changed, 387 insertions(+), 42 deletions(-) diff --git a/.github/nightly-signing-policy.json b/.github/nightly-signing-policy.json index 3bf0f5345..8776812cc 100644 --- a/.github/nightly-signing-policy.json +++ b/.github/nightly-signing-policy.json @@ -2,13 +2,13 @@ "schema": "craft-nightly-release-policy/v3", "repository": "storytold/effectcraft", "repository_id": 1400136506, - "producer_workflow_id": null, + "producer_workflow_id": 429759943, "producer_workflow_path": ".github/workflows/nightly.yml", - "producer_tooling_revision": "605d58766e8f536564da8fc81d3676ac86816dea", - "producer_workflow_ref": "storytold/craft-common-actions/.github/workflows/nightly-unsigned.yml@605d58766e8f536564da8fc81d3676ac86816dea", + "producer_tooling_revision": "be00e5ccd18b68e950c8a08532f2230e7c3d0cba", + "producer_workflow_ref": "storytold/craft-common-actions/.github/workflows/nightly-unsigned.yml@be00e5ccd18b68e950c8a08532f2230e7c3d0cba", "signer_workflow_path": ".github/workflows/nightly-sign.yml", - "signer_tooling_revision": "605d58766e8f536564da8fc81d3676ac86816dea", - "release_branch": "release", + "signer_tooling_revision": "be00e5ccd18b68e950c8a08532f2230e7c3d0cba", + "release_branch": "nightly-signer", "manual_actors": [ "bflatastic", "dylanmtaylor", diff --git a/.github/workflows/nightly-sign.yml b/.github/workflows/nightly-sign.yml index a57713f5a..f718bf90b 100644 --- a/.github/workflows/nightly-sign.yml +++ b/.github/workflows/nightly-sign.yml @@ -1,7 +1,8 @@ name: EffectCraft release-ref nightly signer -# Enabled for supervised manual dispatch on release. Main/release contents must match. -# A reusable callee does not change context; this must be a real top-level release dispatch. +# Enabled for supervised manual dispatch on the dedicated nightly-signer branch, which only ever +# fast-forwards to reviewed main commits (never the stable release branch). +# A reusable callee does not change context; this must be a real top-level signer-branch dispatch. on: workflow_dispatch: inputs: @@ -22,21 +23,23 @@ concurrency: jobs: release: - # Actual context guards: official repository, manual dispatch, real release branch. + # Actual context guards: official repository, manual dispatch, real nightly-signer branch. if: >- github.repository == 'storytold/effectcraft' && github.event_name == 'workflow_dispatch' && - github.ref == 'refs/heads/release' && github.ref_type == 'branch' + github.ref == 'refs/heads/nightly-signer' && github.ref_type == 'branch' permissions: contents: write actions: read checks: read attestations: write id-token: write - uses: storytold/craft-common-actions/.github/workflows/nightly-release.yml@605d58766e8f536564da8fc81d3676ac86816dea + uses: storytold/craft-common-actions/.github/workflows/nightly-release.yml@be00e5ccd18b68e950c8a08532f2230e7c3d0cba with: - tooling-revision: 605d58766e8f536564da8fc81d3676ac86816dea + tooling-revision: be00e5ccd18b68e950c8a08532f2230e7c3d0cba + app-name: effectcraft producer_run_id: ${{ inputs.producer_run_id }} producer_run_attempt: ${{ inputs.producer_run_attempt }} # No secrets: inherit or raw platform values in this caller. Only the isolated native - # callee job may bind the existing release environment and export keys in its signing step. + # callee job may bind the release environment and export its keys; that environment must + # admit nightly-signer alongside release before the first dispatch. diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 068a82a0e..e7f2a2f4c 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -22,13 +22,13 @@ jobs: actions: read attestations: write id-token: write - uses: storytold/craft-common-actions/.github/workflows/nightly-unsigned.yml@605d58766e8f536564da8fc81d3676ac86816dea + uses: storytold/craft-common-actions/.github/workflows/nightly-unsigned.yml@be00e5ccd18b68e950c8a08532f2230e7c3d0cba with: - tooling-revision: 605d58766e8f536564da8fc81d3676ac86816dea + tooling-revision: be00e5ccd18b68e950c8a08532f2230e7c3d0cba app-name: effectcraft manual-actors: '["bflatastic","dylanmtaylor","echelon","FredApps","skylartaylor"]' craft-fonts-ref: b076417b5880bd4154bd22f00695b1d28c6bea83 # One producer run builds every listed platform for one all-or-nothing release. The pin is the - # craft-common-actions main commit that merged #339 (bounded lineage compares), on top of the - # Linux/macOS signer (#342). + # craft-common-actions main commit that merged the exact-analysis admission (#371, after #370, + # #369 and #364). platforms: '["windows-x86_64","linux-x86_64","macos-aarch64"]' diff --git a/docs/nightly-release-preparation.md b/docs/nightly-release-preparation.md index 941e9ba59..1e6936079 100644 --- a/docs/nightly-release-preparation.md +++ b/docs/nightly-release-preparation.md @@ -1,10 +1,10 @@ # Windows, Linux and macOS release-ref nightly: supervised manual go-live **Enabled for supervised manual runs, not yet qualified.** The producer (`nightly.yml`, main) and the -signer (`nightly-sign.yml`, release) keep only their exact context guards and run when one of the reviewed +signer (`nightly-sign.yml`, on the dedicated `nightly-signer` branch) keep only their exact context guards and run when one of the reviewed manual actors dispatches them. There is no schedule yet. The installed policy [`.github/nightly-signing-policy.json`](../.github/nightly-signing-policy.json) is the v3 policy -structure; once `nightly.yml` is registered on `main`, populate `producer_workflow_id` by reading: +structure; `producer_workflow_id` is the registered `nightly.yml` workflow id, read with: ```bash gh api repos/storytold/effectcraft/actions/workflows/nightly.yml --jq .id @@ -13,26 +13,44 @@ gh api repos/storytold/effectcraft/actions/workflows/nightly.yml --jq .id The callers pass no platform secrets. The unsigned reusable caller's maximum OIDC/attestation permissions are for its isolated attester; its compiler narrows to contents and Actions read only, with no OIDC, attestation write, release environment or platform signing secrets. -Shared tooling is pinned to `605d58766e8f536564da8fc81d3676ac86816dea`, the craft-common-actions -main commit that merged [#339](https://github.com/storytold/craft-common-actions/pull/339) (bounded -lineage compares and an issue reread at the end of candidate admission) on top of -[#342](https://github.com/storytold/craft-common-actions/pull/342) (policy v3, the `platforms` input -and the Linux and macOS legs). Both callers name it in `uses` and `tooling-revision`. A pin is reviewed -source availability, not provider, queue, native signing or crypto qualification. +Shared tooling is pinned to `be00e5ccd18b68e950c8a08532f2230e7c3d0cba`, the craft-common-actions +main commit that merged [#371](https://github.com/storytold/craft-common-actions/pull/371) (the +candidate is admitted on the built commit's own Sonar analysis, not main's latest) after +[#370](https://github.com/storytold/craft-common-actions/pull/370) (the Windows and macOS nightly +registry rows for the 14 apps) and +[#369](https://github.com/storytold/craft-common-actions/pull/369) (shared helper checkouts kept out +of the app's clean-source check, and macOS on `macos-15`), following +[#364](https://github.com/storytold/craft-common-actions/pull/364) (the signer may run on the +policy's signer branch) and [#363](https://github.com/storytold/craft-common-actions/pull/363) (the +multi-app pipeline, which makes the signer's `app-name` input required and admits any reviewed +registry app), with #342 (`a4f6fd51`, policy v3 and the `platforms` input) and #339 (`605d5876`) +earlier. Both callers name it in `uses` and `tooling-revision`. A pin is reviewed source +availability, not provider, queue, native signing or crypto qualification. +**Signer branch.** The signer runs on `refs/heads/nightly-signer`, not on the stable `release` +branch, so nightly signer files never need a stable release sync. The policy's `release_branch` +names it, the signer's guard requires it and its caller passes `app-name`. The branch only +fast-forwards to reviewed main commits, through the nightly-signer settings script's `advance` (no +queued signer run, a trust-closure scan, then the full diff of `.github/` and `packaging/`), and the +existing `release` environment must admit `nightly-signer` alongside `release` before the first +dispatch (a repository settings change, not a workflow one). Its trust closure is all of `.github/` +and `packaging/`, including `packaging/env.sh`, which `import-cert.sh` sources with the Apple keys. +On that branch only the pinned `nightly-sign.yml` caller may reach an environment: no app workflow +binds one, nothing else calls `nightly-release.yml`, and the only caller of the shared stable +`release.yml` is `release.yml`, whose callee must carry the stable-only environment guard. The +contract tests check the in-repo part on every main PR; the settings scan also resolves the callee. +Stable releases still come only from `refs/heads/release`. History does not carry over a switch +between `release` and `nightly-signer`, so the switch happens before the first publication. + Existing stable workflows are unchanged. -**The shared-workflow port is a prerequisite.** At this pin both reusable workflows admit only -PhotoCraft: `nightly-unsigned.yml` requires `inputs.app-name == 'photocraft'` and -`github.repository == 'storytold/photocraft'` on its build jobs, and `nightly-release.yml` requires the -same repository in `validate` and every signing job (its concurrency group is -`craft-release-ref-signer-photocraft`). A EffectCraft dispatch therefore builds and signs nothing until -`storytold/craft-common-actions` admits `storytold/effectcraft`. No dispatch can produce a release before -that port, and both callers' `uses`, `tooling-revision` and the policy pins must move to the same -reviewed revision together. The port is craft-common-actions #363 ("run the shared nightly pipeline for any -reviewed registry app"); until it merges these callers are inert. +**The shared pipeline is included.** This pin contains craft-common-actions #363, which runs the +shared nightly pipeline for any reviewed `nightly-apps.json` registry app: the signer passes +`app-name` and the shared scripts derive this app's names from that row, so no shared-workflow port +is still outstanding. The app's registry row is the admission boundary for what the producer may build, and +each platform needs its own reviewed target row there. **First runs.** The first runs are manual dispatches in this order: `nightly.yml` on main (only a -listed manual actor passes the producer's plan step), then `nightly-sign.yml` on `release` with that +listed manual actor passes the producer's plan step), then `nightly-sign.yml` on `nightly-signer` with that producer run ID and attempt, by a listed manual actor. **Manual actors.** `bflatastic`, `dylanmtaylor`, `echelon`, `FredApps` and `skylartaylor`, in the @@ -53,14 +71,13 @@ the signer caller has no platform input. ## Installed policy values and their sources -Read on 2026-11-24; re-read anything that may have moved (and fill in `producer_workflow_id` after -`nightly.yml` reaches `main`) before the policy is promoted to `release`. +Read on 2026-11-24; re-read anything that may have moved before `nightly-signer` is advanced to it. | Field | Value | Source | |---|---|---| | `repository_id` | `1400136506` | `gh api repos/storytold/effectcraft --jq .id` | -| `producer_workflow_id` | `null` (pending main registration) | `gh api repos/storytold/effectcraft/actions/workflows/nightly.yml --jq .id` after `nightly.yml` reaches `main` | -| `producer_tooling_revision`, `signer_tooling_revision`, `producer_workflow_ref` | `605d5876…` (craft-common-actions #339) | The callers' pin | +| `producer_workflow_id` | `429759943` | `gh api repos/storytold/effectcraft/actions/workflows/nightly.yml` (path `.github/workflows/nightly.yml`, state `active`) | +| `producer_tooling_revision`, `signer_tooling_revision`, `producer_workflow_ref` | `be00e5cc…` (craft-common-actions exact-analysis admission, #371 after #370 and #369, following #364) | The callers' pin | | `manual_actors` / `automatic_signer_actors` | the five release managers / `[]` | release-managers team (id 19837241) members who can push; equals the producer caller's `manual-actors` | | `max_age_seconds`, `max_artifact_bytes` | `86400`, `2147483648` | Go-live checklist | | `platforms` | three rows | Storytold stable signing identities (`Learning Machines Inc` Windows Authenticode, Linux OpenPGP `2B76741B414AAD6CD33E631213A005C0B9D7C3ED`, Apple Team `DJ6XS33FX8`) | @@ -78,8 +95,8 @@ those values in the same reviewed change that promotes the policy to `release`. - `.github/workflows/nightly.yml`: default-main registration of the unsigned producer, named `EffectCraft unsigned nightly`, enabled for manual dispatch by `manual-actors`; no signing secrets may be passed or inherited. -- `.github/workflows/nightly-sign.yml`: top-level release registration, enabled for manual dispatch, - and identical on main and release after reviewed promotion. It rejects wrong repository/event/actual branch, +- `.github/workflows/nightly-sign.yml`: top-level signer registration, enabled for manual dispatch + on `nightly-signer`, which carries a reviewed main commit. It rejects wrong repository/event/actual branch, including same-name tags. Its constant whole-run concurrency is distinct from stable, cancellation is off and `queue: max` must be hosted-qualified. The caller itself passes no credentials; only the shared callee's sign jobs bind the `release` environment. @@ -105,3 +122,6 @@ contacting GitHub: installed policy. - Policy platforms match the producer list, carry valid trust anchor shapes, and reference `ci.yml` and `sonar-project.properties` accurately. +- The `nightly-signer` trust-closure scan: no app workflow binds `environment:`, only + `nightly-sign.yml` calls `nightly-release.yml` at a 40-hex SHA, and the only caller of the + shared stable `release.yml` is `release.yml`. diff --git a/packaging/nightly-release-tests.py b/packaging/nightly-release-tests.py index 20ddc4fb2..30f975c83 100755 --- a/packaging/nightly-release-tests.py +++ b/packaging/nightly-release-tests.py @@ -4,11 +4,21 @@ import copy import json from pathlib import Path import re +import textwrap import unittest ROOT = Path(__file__).resolve().parents[1] INSTALLED_POLICY = ROOT / ".github/nightly-signing-policy.json" +DISPATCHER = ROOT / ".github/workflows/nightly-dispatch.yml" +SIGNER_BRANCH = "nightly-signer" + + +def inline_scripts(path): + """Read literal run blocks, not a substitute for YAML/actionlint validation.""" + return [textwrap.dedent(block) for block in re.findall( + r"^ run: \|\n((?: .*\n|\n)+)", path.read_text(), re.MULTILINE)] + def assert_nightly_serialization(source): """Fail closed unless this app's plain root concurrency block retains its contract.""" @@ -256,7 +266,7 @@ class NightlyEnabledCallers(unittest.TestCase): "github.ref_type == 'branch' && (github.event_name == 'schedule' || " "github.event_name == 'workflow_dispatch')", "nightly-sign.yml": "github.repository == 'storytold/effectcraft' && github.event_name == 'workflow_dispatch' && " - "github.ref == 'refs/heads/release' && github.ref_type == 'branch'", + "github.ref == 'refs/heads/nightly-signer' && github.ref_type == 'branch'", } def test_enabled_jobs_keep_exact_context_guards(self): @@ -310,7 +320,7 @@ class NightlyInstalledPolicy(unittest.TestCase): self.assertEqual(set(self.policy), expected) self.assertEqual(self.policy["schema"], "craft-nightly-release-policy/v3") self.assertEqual(self.policy["repository"], "storytold/effectcraft") - self.assertEqual(self.policy["release_branch"], "release") + self.assertEqual(self.policy["release_branch"], SIGNER_BRANCH, "the signer runs on its dedicated branch") self.assertIs(type(self.policy["repository_id"]), int) self.assertGreater(self.policy["repository_id"], 0) # producer_workflow_id may be null until nightly.yml is registered on main. @@ -389,6 +399,318 @@ class NightlyInstalledPolicy(unittest.TestCase): self.assertIn(item["type"], sonar["issue_types"]) self.assertRegex(item["hash"], r"^[0-9a-f]{32}$") + def test_sonar_policy_keeps_the_shared_candidate_contract(self): + """The Sonar shape craft-common-actions' candidate contract() admits, refused here first. + An empty issue scope, an accepted condition outside the reviewed issue types, a metric in both + lists, a missing live gate condition or a widened security bound is refused at admission, so + this suite must catch it before a nightly run can. `debt` stays empty, so any unresolved + vulnerability on main is still refused; accepting the new-code rating only records the + reviewed A threshold instead of demanding a clean rating the live gate does not. + """ + sonar = self.policy["candidate_policy"]["sonar"] + accepted = {"bugs": "BUG", "vulnerabilities": "VULNERABILITY", "code_smells": "CODE_SMELL", + "security_rating": "VULNERABILITY", "new_security_rating": "VULNERABILITY"} + gate = {"new_reliability_rating", "new_security_rating", "new_maintainability_rating", + "new_coverage", "new_duplicated_lines_density", "new_security_hotspots_reviewed"} + self.assertTrue(sonar["issue_types"], "an empty issue scope is refused as unreviewed") + self.assertEqual(len(sonar["issue_types"]), len(set(sonar["issue_types"]))) + metrics = {} + for field in ("accepted_conditions", "required_conditions"): + for condition in sonar[field]: + with self.subTest(field=field, metric=condition.get("metric")): + expected = {"metric", "comparator", "error_threshold"} + if field == "accepted_conditions": + expected.add("maximum") + self.assertEqual(set(condition), expected) + self.assertNotIn(condition["metric"], metrics, "one condition per gate metric") + metrics[condition["metric"]] = condition + self.assertIn(condition["comparator"], ("GT", "LT")) + self.assertRegex(condition["error_threshold"], r"^(?:0|[1-9][0-9]*)(?:\.[0-9]+)?$") + if field != "accepted_conditions": + continue + self.assertIn(condition["metric"], accepted, "an accepted metric outside the reviewed map") + self.assertIn(accepted[condition["metric"]], sonar["issue_types"], + "an accepted failure must lie inside the reviewed issue scope") + self.assertEqual(condition["comparator"], "GT") + self.assertRegex(condition["maximum"], r"^(?:0|[1-9][0-9]*)(?:\.[0-9]+)?$") + maximum = float(condition["maximum"]) + if condition["metric"] in ("security_rating", "new_security_rating"): + self.assertEqual(int(maximum), maximum, "the A..E bound is a whole rating") + self.assertTrue(1 <= maximum <= 5, "the security bound stays A..E") + self.assertEqual(condition["error_threshold"], "1", "the reviewed A threshold stays") + else: + self.assertLessEqual(maximum, len(sonar["debt"]), "accepted failures exceed the reviewed debt") + self.assertEqual({accepted[c["metric"]] for c in sonar["accepted_conditions"]}, set(sonar["issue_types"]), + "accepted conditions and reviewed issue types must cover the same scope") + self.assertEqual(set(metrics), gate, "every live gate condition stays gated exactly once") + + +SHARED = "storytold/craft-common-actions/.github/workflows/" +# App workflows reviewed to call the shared stable release.yml. That callee must carry the +# stable-only environment guard (dry runs and non-release refs bind no environment); the +# nightly-signer settings scan checks the resolved callee before creating or advancing the branch. +REVIEWED_STABLE_RELEASE_CALLERS = {"release.yml"} + + +def app_workflows(): + return {path.name: path.read_text() for path in sorted((ROOT / ".github/workflows").glob("*.y*ml"))} + + +WORKFLOW_KEY = re.compile(r'''("(?:[^"\\]|\\.)*"|'(?:[^']|'')*'|[^\s'"#{}\[\],:&*!|>%@`?-][^:#,{}]*?|-[^\s:#][^:#,{}]*?)\s*:(?:\s+(.*))?$''') + + +def _workflow_key(text): + if text.startswith('"'): + return None if "\\" in text else text[1:-1] + if text.startswith("'"): + return text[1:-1].replace("''", "'") + return text + + +def _workflow_value(text): + """A one-line scalar value without its comment and quotes; None when escaped or unterminated.""" + text = text.strip() + if text.startswith('"'): + quoted = re.match(r'"((?:[^"\\]|\\.)*)"\s*(?:#.*)?$', text) + return None if quoted is None or "\\" in quoted.group(1) else quoted.group(1) + if text.startswith("'"): + quoted = re.match(r"'((?:[^']|'')*)'\s*(?:#.*)?$", text) + return None if quoted is None else quoted.group(1).replace("''", "'") + return re.split(r"\s+#", text, maxsplit=1)[0].strip() + + +def _strip_comment(text): + """(text without its comment, unterminated) using a quote-aware scan. + + As in YAML, a quote opens a quoted scalar only where a scalar starts (line start or after + `:`, `-`, `,`, `{` or `[`), and a `#` starts a comment only outside quotes, at the start or + after whitespace. + """ + quote, index = None, 0 + while index < len(text): + char = text[index] + if quote == '"': + if char == "\\": + index += 2 + continue + if char == '"': + quote = None + elif quote == "'": + if char == "'": + if text[index + 1:index + 2] == "'": + index += 2 + continue + quote = None + elif char in "\"'" and text[:index].rstrip()[-1:] in ("", ":", "-", ",", "{", "["): + quote = char + elif char == "#" and (index == 0 or text[index - 1] in " \t"): + return text[:index].rstrip(), False + index += 1 + return text.rstrip(), quote is not None + + +FLOW_QUOTED = re.compile(r"\"(?:[^\"\\]|\\.)*\"|'(?:[^']|'')*'") +FLOW_FORBIDDEN_KEYS = {"environment", "uses"} + + +def workflow_entries(source): + """Every mapping entry in a workflow, plus the YAML forms this reader refuses. + + A narrow reader, not a YAML parser (none ships with the runner's Python). Each entry is + (line, key, value, multiline): plain, single- and double-quoted keys and one-line values in + block and simple one-line flow mappings. Block scalar bodies are skipped, and an entry whose + value is a block scalar or continues on the next lines is marked multiline. It refuses whatever + could hide a key from it: escaped double-quoted keys, explicit `?` keys, merge keys, anchors, + aliases, tags, tab indentation and nested or multi-line flow. + """ + lines = source.splitlines() + entries, refused, block = [], [], None + + def continues(index, indent): + for follow in lines[index + 1:]: + stripped = follow.strip() + if not stripped or stripped.startswith("#"): + continue + deeper = len(follow) - len(follow.lstrip(" ")) > indent + return deeper and not stripped.startswith("- ") and WORKFLOW_KEY.match(stripped) is None + return False + + for index, raw in enumerate(lines): + number = index + 1 + stripped = raw.strip() + indent = len(raw) - len(raw.lstrip(" ")) + if block is not None: + if not stripped or indent > block: + continue + block = None + if not stripped or stripped.startswith("#"): + continue + if "\t" in raw[:indent + 1]: + refused.append(f"line {number}: tab indentation"); continue + body, unterminated = _strip_comment(stripped) + if unterminated: + refused.append(f"line {number}: unterminated or multi-line quoted scalar"); continue + if not body: + continue + while body.startswith("- "): + body = body[2:].lstrip() + if body == "?" or body.startswith("? "): + refused.append(f"line {number}: explicit key"); continue + match = WORKFLOW_KEY.match(body) + value = body + if match is not None: + key, value = _workflow_key(match.group(1)), match.group(2) or "" + if key is None: + refused.append(f"line {number}: escaped double-quoted key"); continue + if key == "<<": + refused.append(f"line {number}: merge key"); continue + plain = re.sub(r"\$\{\{.*?\}\}", "", value).strip() + bare = re.sub(r"\"(?:[^\"\\]|\\.)*\"|'(?:[^']|'')*'", "''", plain) + if re.match(r"[&*!]", plain): + refused.append(f"line {number}: anchor, alias or tag") + is_block = re.fullmatch(r"[|>][0-9+-]*", plain) is not None + if match is not None: + entries.append((number, key, _workflow_value(value), + is_block or ((value == "" or not is_block) and continues(index, indent)))) + if "{" in bare and bare != "{}": + masked = re.fullmatch(r"\{([^{}\[\]]*)\}", FLOW_QUOTED.sub("''", value.strip())) + flow = re.fullmatch(r"\{([^{}\[\]]*)\}", value.strip()) + if any(set(scalar[1:-1]) & set("#{}[],") for scalar in FLOW_QUOTED.findall(value)): + refused.append(f"line {number}: flow mapping quoted scalar with # or flow punctuation") + elif masked is None or flow is None: + refused.append(f"line {number}: nested or multi-line flow mapping") + else: + # The masked text only proves the shape: a quoted key ("uses", 'environment') keeps + # its identity, so the entries are read from the original mapping text, never ''. + for item in flow.group(1).split(","): + entry = WORKFLOW_KEY.match(item.strip()) + key = _workflow_key(entry.group(1)) if entry else None + if key is None: + refused.append(f"line {number}: unreadable flow mapping entry") + elif key in FLOW_FORBIDDEN_KEYS: + refused.append(f"line {number}: {key} in a flow mapping (must be block style)") + else: + entries.append((number, key, _workflow_value(entry.group(2) or ""), False)) + if match is not None and is_block: + block = indent + return entries, refused + + +def workflow_keys(source): + """(line, key) for every mapping entry, plus the refused YAML forms.""" + entries, refused = workflow_entries(source) + return [(number, key) for number, key, _, _ in entries], refused + + +SHARED_CALLEE = re.compile(r"storytold/craft-common-actions/\.github/workflows/([\w.-]+\.ya?ml)@(\S+)", re.IGNORECASE) +INSPECTED_KEYS = {"environment", "uses"} + + +def trust_closure_problems(workflows): + """The nightly-signer trust-closure scan over app workflow sources; empty when the tree is safe. + + Every key it inspects comes from workflow_entries(), never a regex over the raw text. + """ + problems, stable_callers, signer_calls = [], set(), 0 + for name, source in workflows.items(): + entries, refused = workflow_entries(source) + problems.extend(name + " uses YAML the scan cannot read (" + reason + ")" for reason in refused) + for number, key, value, multiline in entries: + if key not in INSPECTED_KEYS: + continue + if key == "environment": + problems.append(f"{name} binds an environment directly (line {number})") + continue + if value is None or multiline: + problems.append(f"{name} has a uses value the scan cannot read (line {number})") + continue + callee = SHARED_CALLEE.fullmatch(value) + if callee is None: + if re.search(r"craft-common-actions", value, re.IGNORECASE) and re.search(r"workflows/(nightly-)?release\.ya?ml", value, re.IGNORECASE): + problems.append(f"{name} has an unrecognised shared release caller (line {number})") + continue + workflow, ref = callee.group(1), callee.group(2) + if workflow.lower() in ("nightly-release.yml", "nightly-release.yaml"): + if name == "nightly-sign.yml": + signer_calls += 1 + if name != "nightly-sign.yml" or not re.fullmatch(r"[0-9a-f]{40}", ref): + problems.append(name + " calls nightly-release.yml@" + ref) + if workflow.lower() in ("release.yml", "release.yaml"): + stable_callers.add(name) + if ref != "main" and not re.fullmatch(r"[0-9a-f]{40}", ref): + problems.append(name + " calls release.yml@" + ref + "; use @main or a reviewed full SHA") + if stable_callers != REVIEWED_STABLE_RELEASE_CALLERS: + problems.append("shared release.yml callers are " + ", ".join(sorted(stable_callers))) + if signer_calls != 1: + problems.append("nightly-sign.yml must call nightly-release.yml exactly once") + return problems + + +class NightlySignerBranchTrustClosure(unittest.TestCase): + """On refs/heads/nightly-signer, only the pinned signer caller may reach an environment.""" + + def test_trust_closure_scan_passes_on_this_tree(self): + self.assertEqual(trust_closure_problems(app_workflows()), []) + + def test_trust_closure_scan_refuses_each_route_into_an_environment(self): + tree = app_workflows() + bad = { + "a workflow binds an environment": {**tree, "extra.yml": "jobs:\n x:\n runs-on: ubuntu-latest\n environment: release\n"}, + "a double-quoted environment key": {**tree, "extra.yml": 'jobs:\n x:\n runs-on: ubuntu-latest\n "environment": release\n'}, + "a single-quoted environment key": {**tree, "extra.yml": "jobs:\n x:\n runs-on: ubuntu-latest\n 'environment' : release\n"}, + "an environment mapping": {**tree, "extra.yml": "jobs:\n x:\n runs-on: ubuntu-latest\n environment:\n name: release\n"}, + "an environment in a flow mapping": {**tree, "extra.yml": "jobs:\n x: {runs-on: ubuntu-latest, environment: release}\n"}, + "an escaped key": {**tree, "extra.yml": 'jobs:\n x:\n runs-on: ubuntu-latest\n "environ\\u006dent": release\n'}, + "a merge key": {**tree, "extra.yml": "base: &b\n runs-on: ubuntu-latest\njobs:\n x:\n <<: *b\n"}, + "an explicit key": {**tree, "extra.yml": "jobs:\n x:\n ? environment\n : release\n"}, + "a nested flow mapping": {**tree, "extra.yml": "jobs:\n x: {steps: [{run: a}]}\n"}, + "a double-quoted uses key copying the signer": {**tree, "extra.yml": 'jobs:\n x:\n "uses": ' + SHARED + "nightly-release.yml@" + "a" * 40 + "\n"}, + "a single-quoted uses key": {**tree, "extra.yml": "jobs:\n x:\n 'uses': " + SHARED + "nightly-release.yml@" + "a" * 40 + "\n"}, + "a quoted uses value": {**tree, "extra.yml": 'jobs:\n x:\n uses: "' + SHARED + "nightly-release.yml@" + "a" * 40 + '"\n'}, + "uses in a flow mapping": {**tree, "extra.yml": "jobs:\n x: {uses: " + SHARED + "nightly-release.yml@" + "a" * 40 + "}\n"}, + "a differently cased owner": {**tree, "extra.yml": "jobs:\n x:\n uses: Storytold/Craft-Common-Actions/.github/workflows/nightly-release.yml@" + "a" * 40 + "\n"}, + "a folded uses value": {**tree, "extra.yml": "jobs:\n x:\n uses: >-\n " + SHARED + "nightly-release.yml@" + "a" * 40 + "\n"}, + "a continued uses value": {**tree, "extra.yml": "jobs:\n x:\n uses: " + SHARED + "\n nightly-release.yml@" + "a" * 40 + "\n"}, + "a quoted second signer call": {**tree, "nightly-sign.yml": tree["nightly-sign.yml"] + " again:\n \"uses\": " + SHARED + "nightly-release.yml@" + "a" * 40 + "\n"}, + "a hash inside a quoted flow scalar": {**tree, "extra.yml": 'jobs:\n x: {name: "a} # b", runs-on: ubuntu-latest, environment: release, steps: []}\n'}, + "a single-quoted hash in a flow scalar": {**tree, "extra.yml": "jobs:\n x: {name: 'a # b', runs-on: ubuntu-latest}\n"}, + "a comma inside a quoted flow scalar": {**tree, "extra.yml": 'jobs:\n x: {name: "a, environment: release", runs-on: ubuntu-latest}\n'}, + "a bracket inside a quoted flow scalar": {**tree, "extra.yml": 'jobs:\n x: {name: "[a]", runs-on: ubuntu-latest}\n'}, + "an unterminated quote": {**tree, "extra.yml": 'jobs:\n x:\n name: "a\n b"\n runs-on: ubuntu-latest\n'}, + "environment in any flow mapping": {**tree, "extra.yml": "jobs:\n x:\n runs-on: ubuntu-latest\n with: {environment: release}\n"}, + "a double-quoted environment key in a flow mapping": {**tree, "extra.yml": 'jobs:\n x:\n runs-on: ubuntu-latest\n with: {"environment": release}\n'}, + "a single-quoted environment key in a flow mapping": {**tree, "extra.yml": "jobs:\n x:\n runs-on: ubuntu-latest\n with: {'environment': release}\n"}, + "a double-quoted uses key in a flow mapping": {**tree, "extra.yml": 'jobs:\n x: {"uses": ' + SHARED + "nightly-release.yml@" + "a" * 40 + "}\n"}, + "uses in any flow mapping": {**tree, "extra.yml": "jobs:\n x:\n steps:\n - {uses: actions/checkout@v4}\n"}, + "another caller of the signer": {**tree, "extra.yml": "jobs:\n x:\n uses: " + SHARED + "nightly-release.yml@" + "a" * 40 + "\n"}, + "a mutable signer pin": {**tree, "nightly-sign.yml": re.sub(r"nightly-release\.yml@[0-9a-f]{40}", "nightly-release.yml@main", tree["nightly-sign.yml"])}, + "a new stable release caller": {**tree, "extra.yml": "jobs:\n x:\n uses: " + SHARED + "release.yml@main\n"}, + "a stable caller on a branch or tag ref": {**tree, "release.yml": tree["release.yml"].replace(SHARED + "release.yml@main", SHARED + "release.yml@v1")}, + } + for label, workflows in bad.items(): + with self.subTest(case=label): + self.assertTrue(trust_closure_problems(workflows)) + + def test_quoted_keys_in_a_flow_mapping_are_read_not_masked(self): + entries, refused = workflow_entries('jobs:\n x: {runs-on: ubuntu-latest, "name": build}\n') + self.assertEqual(refused, []) + self.assertIn((2, "name", "build", False), entries, "a quoted key keeps its identity") + self.assertIn((2, "runs-on", "ubuntu-latest", False), entries) + _, refused = workflow_entries("jobs:\n x: {runs-on: ubuntu-latest, 'environment': release}\n") + self.assertEqual(refused, ["line 2: environment in a flow mapping (must be block style)"]) + + def test_signer_dispatch_guard_and_policy_name_the_same_branch(self): + sign = (ROOT / ".github/workflows/nightly-sign.yml").read_text() + (_, guard), = job_conditions(sign.split("\njobs:\n", 1)[1]) + self.assertIn("github.ref == 'refs/heads/" + SIGNER_BRANCH + "'", guard) + self.assertNotIn("refs/heads/release", sign, "the signer no longer runs on the stable branch") + self.assertEqual(re.findall(r"(?m)^ app-name: (\S+)$", sign), ["effectcraft"], "the shared signer needs the reviewed registry app") + # This app ships no completion dispatcher yet: that workflow forwards scheduled producers + # only, and no schedule is approved. Adding it is part of a reviewed cadence change. + self.assertFalse(DISPATCHER.exists(), "a completion dispatcher needs its own reviewed activation") + self.assertEqual(json.loads(INSTALLED_POLICY.read_text())["release_branch"], SIGNER_BRANCH) + self.assertFalse((ROOT / "docs/nightly-signing-policy.example.json").exists(), + "a policy example must then name the signer branch") if __name__ == "__main__": unittest.main(verbosity=2) From 89deb981752344b54a83d4df90c875b1d00860f2 Mon Sep 17 00:00:00 2001 From: skylar taylor-barrick Date: Thu, 26 Nov 2026 01:59:20 -0600 Subject: [PATCH 451/451] Nightly: stop blocking a refused launch on macOS (#4177) Nightly launch fix under Skylar's Exec 454: the Launcher's trailing `--` no longer reaches the file list where that applied, and a refused launch no longer blocks on macOS (the reason goes to stderr and the app exits 2). One doc comment was reworded so the app's `rfd`-use guard (#3084) keeps passing. --- apps/effectcraft/src/main.rs | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/apps/effectcraft/src/main.rs b/apps/effectcraft/src/main.rs index 6a5863880..99f8f00ec 100644 --- a/apps/effectcraft/src/main.rs +++ b/apps/effectcraft/src/main.rs @@ -87,13 +87,22 @@ fn initialize_nightly_process_identity() -> Result<(), process_identity::Identit ) } -/// Say why a Nightly launch was refused, through a native dialog where a person is looking at one. +/// Whether a refusal may also open a native message box. Standard error always carries the reason; +/// this only adds a box where one renders without the app's event loop. Never on macOS: the dialog library's alert +/// there needs the AppKit run loop this start has not reached, so a refused nightly launch hung in +/// an invisible modal instead of exiting (GridCraft Mac smoke, 2026-11-26). +fn refusal_dialog(flavor: build_flavor::BuildFlavor, desktop_session: bool, macos: bool) -> bool { + build_flavor::needs_native_error(flavor, desktop_session) && !macos +} + +/// Say why a Nightly launch was refused, through a native dialog where a person is looking at one +/// and a modal renders without the app's run loop (Windows, X11/Wayland; macOS gets the console line). fn report_launch_profile_error(error: &str) { eprintln!("EffectCraft launch profile: {error}"); let desktop_session = cfg!(windows) || cfg!(target_os = "macos") || (cfg!(target_os = "linux") && ["DISPLAY", "WAYLAND_DISPLAY"].into_iter().any(|key| std::env::var_os(key).is_some_and(|v| !v.is_empty()))); - if build_flavor::needs_native_error(build_flavor::COMPILED, desktop_session) { + if refusal_dialog(build_flavor::COMPILED, desktop_session, cfg!(target_os = "macos")) { if let Err(error) = initialize_nightly_process_identity() { eprintln!("EffectCraft launch profile: {error}"); return; @@ -1025,3 +1034,17 @@ mod tests { assert!(app.hooks.file_dialog_async.is_none() && asked.is_none(), "the blocking dialog pumps its own messages here"); } } + +#[cfg(test)] +mod refusal_dialog_tests { + use super::refusal_dialog; + use crate::build_flavor::BuildFlavor; + + #[test] + fn a_refusal_never_blocks_on_a_modal_before_the_event_loop_on_macos() { + assert!(refusal_dialog(BuildFlavor::NightlyV1, true, false), "a desktop refusal still shows the box where one renders"); + assert!(!refusal_dialog(BuildFlavor::NightlyV1, true, true), "macOS has no run loop yet: the modal would hang"); + assert!(!refusal_dialog(BuildFlavor::NightlyV1, false, false), "a headless session has no box"); + assert!(!refusal_dialog(BuildFlavor::Stable, true, false), "only a nightly refusal explains itself in a box"); + } +}