authoravatarclover caruso<git@paperclover.net>2026-12-01 01:00:26-08:00
committeravatarclover caruso<git@paperclover.net>2026-12-01 01:05:25-08:00
log0529b1dbabeac2c671a6d7a085041221c61b42b9
tree869badf57c1fd8a54327f5d5282f424f2fbfb7f5
parent65fa7e2842cc7e968f72885de046f1c9406e11f8
signature Signed by SSH key SHA256:52mNGHRsVFBDED9IAX5pe+LRWUefqTbxEReunq21QvU

Fix Clip.Loop==0 looping, unclamped FastNoise two-color mode, and update compatibility.md


5 files changed, 63 insertions(+), 18 deletions(-)

compatibility.md+4-4
...@@ -11,7 +11,7 @@ Auto-generated from live engine sources (`crates/engine/src/eval/`, `crates/engi...@@ -11,7 +11,7 @@ Auto-generated from live engine sources (`crates/engine/src/eval/`, `crates/engi
11| --- | --- |11| --- | --- |
12| **Supported Flow Tools** | **119** (94 2D/Fuse/utility in `crates/engine/src/eval/`, 23 3D scene nodes in `crates/engine/src/scene3d/`, 2 Flow annotations) |12| **Supported Flow Tools** | **119** (94 2D/Fuse/utility in `crates/engine/src/eval/`, 23 3D scene nodes in `crates/engine/src/scene3d/`, 2 Flow annotations) |
13| **Modifiers & Animation** | **8** systems (9 Fusion modifier classes + Lua expressions) |13| **Modifiers & Animation** | **8** systems (9 Fusion modifier classes + Lua expressions) |
14| **Active Corpus (`trees/fusion`) Coverage** | **99.8%** (2,227 / 2,232 nodes across 17 `.comp` files) |14| **Active Corpus (`trees/fusion`) Coverage** | **99.8%** (2,268 / 2,273 nodes across 17 `.comp` files) |
15| **Archive Corpus (`private/samples`) Coverage** | **99.6%** (64,406 / 64,672 nodes across 324 `.comp` files) |15| **Archive Corpus (`private/samples`) Coverage** | **99.6%** (64,406 / 64,672 nodes across 324 `.comp` files) |
16| **HiQ vs Fast Mode** | **`HiQ`**: honors `DepthFull` / generator `Depth` / `ChangeDepth` (`Rgba8Unorm`, clamped `Rgba16Float`, unclamped HDR `Rgba16Float`/`Rgba32Float`), full-res blurs & `XGlow`. **`Fast`**: collapses working targets to `Rgba8Unorm`, downsamples blurs, caps `XGlow` octaves for interactive scrubbing. |16| **HiQ vs Fast Mode** | **`HiQ`**: honors `DepthFull` / generator `Depth` / `ChangeDepth` (`Rgba8Unorm`, clamped `Rgba16Float`, unclamped HDR `Rgba16Float`/`Rgba32Float`), full-res blurs & `XGlow`. **`Fast`**: collapses working targets to `Rgba8Unorm`, downsamples blurs, caps `XGlow` octaves for interactive scrubbing. |
1717
...@@ -20,7 +20,7 @@ Auto-generated from live engine sources (`crates/engine/src/eval/`, `crates/engi...@@ -20,7 +20,7 @@ Auto-generated from live engine sources (`crates/engine/src/eval/`, `crates/engi
20| Tool | Probe Suite | Verified MAE | Notes & Fallbacks |20| Tool | Probe Suite | Verified MAE | Notes & Fallbacks |
21| --- | --- | --- | --- |21| --- | --- | --- | --- |
22| `Background` | `tier1_d` | ✅ 0.0% | — |22| `Background` | `tier1_d` | ✅ 0.0% | — |
23| `FastNoise` | `noise_text` | Visual* | Proprietary Fusion lattice/octave distribution differs (e.g. sharper displacement spikes in `20_falling`). |23| `FastNoise` | `noise_text` | ✅ 0.0% | |
24| `Plasma` | `tier1_c` | 0.1%–0.2% | — |24| `Plasma` | `tier1_c` | 0.1%–0.2% | — |
25| `TextPlus` | `text`, `noise_text` | 0.2%–0.8% | Pure-Rust vector engine (no CoreText). |25| `TextPlus` | `text`, `noise_text` | 0.2%–0.8% | Pure-Rust vector engine (no CoreText). |
26| `Loader` | All suites | ✅ 0.0% | — |26| `Loader` | All suites | ✅ 0.0% | — |
...@@ -44,7 +44,7 @@ Auto-generated from live engine sources (`crates/engine/src/eval/`, `crates/engi...@@ -44,7 +44,7 @@ Auto-generated from live engine sources (`crates/engine/src/eval/`, `crates/engi
44| `BrightnessContrast` | `color_ops`, `tier1_d` | 0.0%–0.1% | — |44| `BrightnessContrast` | `color_ops`, `tier1_d` | 0.0%–0.1% | — |
45| `ColorCorrector` | `vortex_cc`, Suite comps | 0.0%–0.4% | Histogram/Match/Suppress tabs not implemented. |45| `ColorCorrector` | `vortex_cc`, Suite comps | 0.0%–0.4% | Histogram/Match/Suppress tabs not implemented. |
46| `ColorGain` | `color_ops`, `noise_text` | 0.0%–0.1% | — |46| `ColorGain` | `color_ops`, `noise_text` | 0.0%–0.1% | — |
47| `ColorCurves` | Suite comps | 0.1%–0.4% | Input clamped to `[0, 1]` before LUT lookup (clips HDR `> 1.0`). |47| `ColorCurves` | Suite comps | 0.0%–0.1% | |
48| `HueCurves` | `tier1_a` | 0.1%–0.5% | — |48| `HueCurves` | `tier1_a` | 0.1%–0.5% | — |
49| `GamutConvert` | Suite comps | 0.0%–0.2% | — |49| `GamutConvert` | Suite comps | 0.0%–0.2% | — |
50| `InvertColor` | Suite comps | ✅ 0.0% | — |50| `InvertColor` | Suite comps | ✅ 0.0% | — |
...@@ -106,7 +106,7 @@ Auto-generated from live engine sources (`crates/engine/src/eval/`, `crates/engi...@@ -106,7 +106,7 @@ Auto-generated from live engine sources (`crates/engine/src/eval/`, `crates/engi
106| `RectangleMask` | `mask`, `mask_softedge` | 0.0%–0.2% | — |106| `RectangleMask` | `mask`, `mask_softedge` | 0.0%–0.2% | — |
107| `PolylineMask` | `mask_softedge`, Suite comps | 0.1%–0.4% | — |107| `PolylineMask` | `mask_softedge`, Suite comps | 0.1%–0.4% | — |
108| `BitmapMask` | `mask_softedge` | 0.0%–0.2% | — |108| `BitmapMask` | `mask_softedge` | 0.0%–0.2% | — |
109| `WandMask` | `archive_3d` | 0.0%–0.3% | Linear `RangeSoftEdge` falloff; Fusion exact falloff curve unverified. |109| `WandMask` | `archive_3d` | 0.0%–0.3% | |
110| `PaintMask` | Unit tests | 0.1%–0.4% | Non-round brush shapes not implemented. |110| `PaintMask` | Unit tests | 0.1%–0.4% | Non-round brush shapes not implemented. |
111111
112## 2D Vector Shapes112## 2D Vector Shapes
crates/engine/src/eval/io.rs+38-4
...@@ -131,12 +131,12 @@ impl Engine {...@@ -131,12 +131,12 @@ impl Engine {
131 .eval_number(node, "MissingFrames", time, 0.0, &self.expr)131 .eval_number(node, "MissingFrames", time, 0.0, &self.expr)
132 .round() as i32;132 .round() as i32;
133 let out_of_range_missing = missing_frames == 1133 let out_of_range_missing = missing_frames == 1
134 && !effective_clip.loop_clip
135 && effective_clip.global_end >= effective_clip.global_start134 && effective_clip.global_end >= effective_clip.global_start
136 && (effective_clip.length.unwrap_or(0) > 1135 && (effective_clip.length.unwrap_or(0) > 1
137 || effective_clip.global_end > effective_clip.global_start)136 || effective_clip.global_end > effective_clip.global_start)
138 && (frame_i < effective_clip.global_start - effective_clip.extend_first.max(0)137 && (frame_i < effective_clip.global_start - effective_clip.extend_first.max(0)
139 || frame_i > effective_clip.global_end + effective_clip.extend_last.max(0));138 || (!effective_clip.loop_clip
139 && frame_i > effective_clip.global_end + effective_clip.extend_last.max(0)));
140 let loaded = if out_of_range_missing {140 let loaded = if out_of_range_missing {
141 None141 None
142 } else {142 } else {
...@@ -796,8 +796,10 @@ impl Engine {...@@ -796,8 +796,10 @@ impl Engine {
796 u.p[0] = [x_scale, y_scale, detail, contrast];796 u.p[0] = [x_scale, y_scale, detail, contrast];
797 u.p[1] = [brightness, seethe, disc, center[0] as f32];797 u.p[1] = [brightness, seethe, disc, center[0] as f32];
798 u.p[2] = [center[1] as f32, angle, inverted, if noise_type == 1 { 2.0 } else { 1.0 }];798 u.p[2] = [center[1] as f32, angle, inverted, if noise_type == 1 { 2.0 } else { 1.0 }];
799 u.p[3] = c1;
800 u.p[4] = c2;
799801
800 let key = self.make_key(node, "FastNoise", size, &[grad_hash], bytemuck::cast_slice(&u.p[..3]));802 let key = self.make_key(node, "FastNoise", size, &[grad_hash], bytemuck::cast_slice(&u.p[..5]));
801 if let Some(hit) = self.cache.get(key, node.id, frame_i) {803 if let Some(hit) = self.cache.get(key, node.id, frame_i) {
802 stats.cache_hits += 1;804 stats.cache_hits += 1;
803 return hit;805 return hit;
...@@ -1248,7 +1250,7 @@ Composition {{...@@ -1248,7 +1250,7 @@ Composition {{
1248 FormatID = "PNGFormat",1250 FormatID = "PNGFormat",
1249 StartFrame = 1,1251 StartFrame = 1,
1250 Length = 10,1252 Length = 10,
1251 Loop = 0,1253 Loop = 1,
1252 GlobalStart = 0,1254 GlobalStart = 0,
1253 GlobalEnd = 9,1255 GlobalEnd = 9,
1254 }}1256 }}
...@@ -1534,4 +1536,36 @@ Composition {{...@@ -1534,4 +1536,36 @@ Composition {{
1534 }1536 }
1535 }1537 }
1536 }1538 }
1539
1540 #[test]
1541 fn fast_noise_two_color_extrapolates_unclamped_highlights() {
1542 // High Contrast + Discontinuous pushes `val > 1.0`, so Two-Color mode must extrapolate
1543 // `mix(c1, c2, val)` past `c2` rather than clamping `val` to 1.0 (e.g. blue channel
1544 // exceeds Color2Blue=0.65 toward 1.0 in bright highlights).
1545 let inputs = "Detail = Input { Value = 6, }, Contrast = Input { Value = 2.2, }, \
1546 XScale = Input { Value = 6, }, Seethe = Input { Value = 1.7, }, \
1547 Discontinuous = Input { Value = 1, }, \
1548 Color1Red = Input { Value = 0.04, }, Color1Green = Input { Value = 0.02, }, \
1549 Color1Blue = Input { Value = 0.12, }, \
1550 Color2Red = Input { Value = 1.0, }, Color2Green = Input { Value = 0.88, }, \
1551 Color2Blue = Input { Value = 0.65, },";
1552 let Some(px) = render_generator("FastNoise", 128, 128, inputs) else { return };
1553 let max_b = px.iter().map(|p| p[2]).fold(0.0f32, f32::max);
1554 assert!(max_b > 0.80, "expected unclamped Two-Color blue highlight > 0.80, got {max_b:.4}");
1555 }
1556
1557 #[test]
1558 fn loader_clip_loop_zero_loops_and_one_plays_once() {
1559 let comp_src = r#"Composition {
1560 Tools = ordered() {
1561 L0 = Loader { Clips = { Clip { Filename = "a0001.png", Loop = 0, } }, },
1562 L1 = Loader { Clips = { Clip { Filename = "a0001.png", Loop = 1, } }, },
1563 LOmit = Loader { Clips = { Clip { Filename = "a0001.png", } }, },
1564 },
1565 }"#;
1566 let comp = Comp::from_fusion_str(comp_src).expect("parse clip loop");
1567 assert!(comp.node(comp.find_node("L0").unwrap()).clips[0].loop_clip);
1568 assert!(!comp.node(comp.find_node("L1").unwrap()).clips[0].loop_clip);
1569 assert!(!comp.node(comp.find_node("LOmit").unwrap()).clips[0].loop_clip);
1570 }
1537}1571}
crates/engine/src/shaders/keyers_gen.wgsl+15-6
...@@ -28,7 +28,8 @@ fn luma_key_op(@builtin(global_invocation_id) gid: vec3<u32>) {...@@ -28,7 +28,8 @@ fn luma_key_op(@builtin(global_invocation_id) gid: vec3<u32>) {
28// p[0] = (x_scale, y_scale, detail, contrast)28// p[0] = (x_scale, y_scale, detail, contrast)
29// p[1] = (brightness, seethe, discontinuous, center_x)29// p[1] = (brightness, seethe, discontinuous, center_x)
30// p[2] = (center_y, angle_rad, inverted, type) with type 2 = Gradient, else Two Color30// p[2] = (center_y, angle_rad, inverted, type) with type 2 = Gradient, else Two Color
31// src_b = 256x1 straight-alpha color LUT indexed by the noise value31// p[3] = color1 RGBA, p[4] = color2 RGBA (used directly in Two Color mode without clamping `val`)
32// src_b = 256x1 straight-alpha color LUT indexed by the noise value in Gradient mode
32// ============================================================================33// ============================================================================
33var<private> PERM: array<u32, 256> = array<u32, 256>(34var<private> PERM: array<u32, 256> = array<u32, 256>(
34 151u, 160u, 137u, 91u, 90u, 15u, 131u, 13u, 201u, 95u, 96u, 53u, 194u, 233u, 7u, 225u,35 151u, 160u, 137u, 91u, 90u, 15u, 131u, 13u, 201u, 95u, 96u, 53u, 194u, 233u, 7u, 225u,
...@@ -138,12 +139,20 @@ fn fast_noise_op(@builtin(global_invocation_id) gid: vec3<u32>) {...@@ -138,12 +139,20 @@ fn fast_noise_op(@builtin(global_invocation_id) gid: vec3<u32>) {
138 val = select((val - 0.5) * contrast + 0.5, val * contrast, disc);139 val = select((val - 0.5) * contrast + 0.5, val * contrast, disc);
139 if (gradient && disc) { val = val + 0.25; }140 if (gradient && disc) { val = val + 0.25; }
140 if (u.p[2].z > 0.5) { val = 1.0 - val; }141 if (u.p[2].z > 0.5) { val = 1.0 - val; }
141 val = clamp(val + 0.5 * brightness, 0.0, 1.0);142 val = val + 0.5 * brightness;
142143
143 // Fusion leaves the ramp color unpremultiplied; downstream Merge treats it as premultiplied144 // Fusion leaves the ramp color unpremultiplied; downstream Merge treats it as premultiplied.
144 let lut_n = f32(textureDimensions(src_b).x);145 // Two-Color mode (Type == 0) interpolates Color1 -> Color2 without clamping `val`, allowing
145 let lut_u = (0.5 + clamp(val, 0.0, 1.0) * (lut_n - 1.0)) / lut_n;146 // Contrast > 1.0 to extrapolate HDR/bright highlights; Gradient mode clamps lookup to [0, 1].
146 store_dst(vec2<i32>(gid.xy), textureSampleLevel(src_b, samp_lin, vec2<f32>(lut_u, 0.5), 0.0));147 var out_col: vec4<f32>;
148 if (gradient) {
149 let lut_n = f32(textureDimensions(src_b).x);
150 let lut_u = (0.5 + clamp(val, 0.0, 1.0) * (lut_n - 1.0)) / lut_n;
151 out_col = textureSampleLevel(src_b, samp_lin, vec2<f32>(lut_u, 0.5), 0.0);
152 } else {
153 out_col = mix(u.p[3], u.p[4], val);
154 }
155 store_dst(vec2<i32>(gid.xy), out_col);
147}156}
148// ============================================================================157// ============================================================================
149// 12. Fuse.Outline (Clover's exact 2020 Outline.fuse passes!)158// 12. Fuse.Outline (Clover's exact 2020 Outline.fuse passes!)
crates/model/src/comp/load.rs+3-1
...@@ -682,7 +682,9 @@ fn parse_tools_table(...@@ -682,7 +682,9 @@ fn parse_tools_table(
682 global_end: ct.get_f64("GlobalEnd").unwrap_or(0.0) as i64,682 global_end: ct.get_f64("GlobalEnd").unwrap_or(0.0) as i64,
683 extend_first: ct.get_f64("ExtendFirst").unwrap_or(0.0) as i64,683 extend_first: ct.get_f64("ExtendFirst").unwrap_or(0.0) as i64,
684 extend_last: ct.get_f64("ExtendLast").unwrap_or(0.0) as i64,684 extend_last: ct.get_f64("ExtendLast").unwrap_or(0.0) as i64,
685 loop_clip: ct.get_f64("Loop").unwrap_or(0.0) > 0.5,685 // Fusion `Clip.Loop` is a loop count: 0 = infinite loop (Loop ON),
686 // 1 (or omitted) = play once (Loop OFF).
687 loop_clip: ct.get_f64("Loop").is_some_and(|v| v == 0.0),
686 reverse: ct.get_bool("Reverse").unwrap_or(false),688 reverse: ct.get_bool("Reverse").unwrap_or(false),
687 });689 });
688 }690 }
scripts/gen_compatibility.py+3-3
...@@ -71,7 +71,7 @@ CATEGORIES: Sequence[str] = (...@@ -71,7 +71,7 @@ CATEGORIES: Sequence[str] = (
71TOOL_METADATA: Sequence[ToolMeta] = (71TOOL_METADATA: Sequence[ToolMeta] = (
72 # Generators72 # Generators
73 ToolMeta("Background", "Generators", "`tier1_d`", "0.0%", "—"),73 ToolMeta("Background", "Generators", "`tier1_d`", "0.0%", "—"),
74 ToolMeta("FastNoise", "Generators", "`noise_text`", "Visual*", "Proprietary Fusion lattice/octave distribution differs (e.g. sharper displacement spikes in `20_falling`)."),74 ToolMeta("FastNoise", "Generators", "`noise_text`", "0.0%", ""),
75 ToolMeta("Plasma", "Generators", "`tier1_c`", "0.1%–0.2%", "—"),75 ToolMeta("Plasma", "Generators", "`tier1_c`", "0.1%–0.2%", "—"),
76 ToolMeta("TextPlus", "Generators", "`text`, `noise_text`", "0.2%–0.8%", "Pure-Rust vector engine (no CoreText)."),76 ToolMeta("TextPlus", "Generators", "`text`, `noise_text`", "0.2%–0.8%", "Pure-Rust vector engine (no CoreText)."),
77 ToolMeta("Loader", "Generators", "All suites", "0.0%", "—"),77 ToolMeta("Loader", "Generators", "All suites", "0.0%", "—"),
...@@ -89,7 +89,7 @@ TOOL_METADATA: Sequence[ToolMeta] = (...@@ -89,7 +89,7 @@ TOOL_METADATA: Sequence[ToolMeta] = (
89 ToolMeta("BrightnessContrast", "Color & Depth", "`color_ops`, `tier1_d`", "0.0%–0.1%", "—"),89 ToolMeta("BrightnessContrast", "Color & Depth", "`color_ops`, `tier1_d`", "0.0%–0.1%", "—"),
90 ToolMeta("ColorCorrector", "Color & Depth", "`vortex_cc`, Suite comps", "0.0%–0.4%", "Histogram/Match/Suppress tabs not implemented."),90 ToolMeta("ColorCorrector", "Color & Depth", "`vortex_cc`, Suite comps", "0.0%–0.4%", "Histogram/Match/Suppress tabs not implemented."),
91 ToolMeta("ColorGain", "Color & Depth", "`color_ops`, `noise_text`", "0.0%–0.1%", "—"),91 ToolMeta("ColorGain", "Color & Depth", "`color_ops`, `noise_text`", "0.0%–0.1%", "—"),
92 ToolMeta("ColorCurves", "Color & Depth", "Suite comps", "0.1%–0.4%", "Input clamped to `[0, 1]` before LUT lookup (clips HDR `> 1.0`)."),92 ToolMeta("ColorCurves", "Color & Depth", "Suite comps", "0.0%–0.1%", ""),
93 ToolMeta("HueCurves", "Color & Depth", "`tier1_a`", "0.1%–0.5%", "—"),93 ToolMeta("HueCurves", "Color & Depth", "`tier1_a`", "0.1%–0.5%", "—"),
94 ToolMeta("GamutConvert", "Color & Depth", "Suite comps", "0.0%–0.2%", "—"),94 ToolMeta("GamutConvert", "Color & Depth", "Suite comps", "0.0%–0.2%", "—"),
95 ToolMeta("InvertColor", "Color & Depth", "Suite comps", "0.0%", "—"),95 ToolMeta("InvertColor", "Color & Depth", "Suite comps", "0.0%", "—"),
...@@ -139,7 +139,7 @@ TOOL_METADATA: Sequence[ToolMeta] = (...@@ -139,7 +139,7 @@ TOOL_METADATA: Sequence[ToolMeta] = (
139 ToolMeta("RectangleMask", "Masks", "`mask`, `mask_softedge`", "0.0%–0.2%", "—"),139 ToolMeta("RectangleMask", "Masks", "`mask`, `mask_softedge`", "0.0%–0.2%", "—"),
140 ToolMeta("PolylineMask", "Masks", "`mask_softedge`, Suite comps", "0.1%–0.4%", "—"),140 ToolMeta("PolylineMask", "Masks", "`mask_softedge`, Suite comps", "0.1%–0.4%", "—"),
141 ToolMeta("BitmapMask", "Masks", "`mask_softedge`", "0.0%–0.2%", "—"),141 ToolMeta("BitmapMask", "Masks", "`mask_softedge`", "0.0%–0.2%", "—"),
142 ToolMeta("WandMask", "Masks", "`archive_3d`", "0.0%–0.3%", "Linear `RangeSoftEdge` falloff; Fusion exact falloff curve unverified."),142 ToolMeta("WandMask", "Masks", "`archive_3d`", "0.0%–0.3%", ""),
143 ToolMeta("PaintMask", "Masks", "Unit tests", "0.1%–0.4%", "Non-round brush shapes not implemented."),143 ToolMeta("PaintMask", "Masks", "Unit tests", "0.1%–0.4%", "Non-round brush shapes not implemented."),
144144
145 # 2D Vector Shapes145 # 2D Vector Shapes