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
1111| --- | --- |
1212| **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) |
1313| **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) |
1515| **Archive Corpus (`private/samples`) Coverage** | **99.6%** (64,406 / 64,672 nodes across 324 `.comp` files) |
1616| **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
2020| Tool | Probe Suite | Verified MAE | Notes & Fallbacks |
2121| --- | --- | --- | --- |
2222| `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% | |
2424| `Plasma` | `tier1_c` | 0.1%–0.2% | — |
2525| `TextPlus` | `text`, `noise_text` | 0.2%–0.8% | Pure-Rust vector engine (no CoreText). |
2626| `Loader` | All suites | ✅ 0.0% | — |
......@@ -44,7 +44,7 @@ Auto-generated from live engine sources (`crates/engine/src/eval/`, `crates/engi
4444| `BrightnessContrast` | `color_ops`, `tier1_d` | 0.0%–0.1% | — |
4545| `ColorCorrector` | `vortex_cc`, Suite comps | 0.0%–0.4% | Histogram/Match/Suppress tabs not implemented. |
4646| `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% | |
4848| `HueCurves` | `tier1_a` | 0.1%–0.5% | — |
4949| `GamutConvert` | Suite comps | 0.0%–0.2% | — |
5050| `InvertColor` | Suite comps | ✅ 0.0% | — |
......@@ -106,7 +106,7 @@ Auto-generated from live engine sources (`crates/engine/src/eval/`, `crates/engi
106106| `RectangleMask` | `mask`, `mask_softedge` | 0.0%–0.2% | — |
107107| `PolylineMask` | `mask_softedge`, Suite comps | 0.1%–0.4% | — |
108108| `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% | |
110110| `PaintMask` | Unit tests | 0.1%–0.4% | Non-round brush shapes not implemented. |
111111
112112## 2D Vector Shapes
crates/engine/src/eval/io.rs+38-4
......@@ -131,12 +131,12 @@ impl Engine {
131131 .eval_number(node, "MissingFrames", time, 0.0, &self.expr)
132132 .round() as i32;
133133 let out_of_range_missing = missing_frames == 1
134 && !effective_clip.loop_clip
135134 && effective_clip.global_end >= effective_clip.global_start
136135 && (effective_clip.length.unwrap_or(0) > 1
137136 || effective_clip.global_end > effective_clip.global_start)
138137 && (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)));
140140 let loaded = if out_of_range_missing {
141141 None
142142 } else {
......@@ -796,8 +796,10 @@ impl Engine {
796796 u.p[0] = [x_scale, y_scale, detail, contrast];
797797 u.p[1] = [brightness, seethe, disc, center[0] as f32];
798798 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]));
801803 if let Some(hit) = self.cache.get(key, node.id, frame_i) {
802804 stats.cache_hits += 1;
803805 return hit;
......@@ -1248,7 +1250,7 @@ Composition {{
12481250 FormatID = "PNGFormat",
12491251 StartFrame = 1,
12501252 Length = 10,
1251 Loop = 0,
1253 Loop = 1,
12521254 GlobalStart = 0,
12531255 GlobalEnd = 9,
12541256 }}
......@@ -1534,4 +1536,36 @@ Composition {{
15341536 }
15351537 }
15361538 }
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 }
15371571}
crates/engine/src/shaders/keyers_gen.wgsl+15-6
......@@ -28,7 +28,8 @@ fn luma_key_op(@builtin(global_invocation_id) gid: vec3<u32>) {
2828// p[0] = (x_scale, y_scale, detail, contrast)
2929// p[1] = (brightness, seethe, discontinuous, center_x)
3030// 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 value
31// 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
3233// ============================================================================
3334var<private> PERM: array<u32, 256> = array<u32, 256>(
3435 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>) {
138139 val = select((val - 0.5) * contrast + 0.5, val * contrast, disc);
139140 if (gradient && disc) { val = val + 0.25; }
140141 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 premultiplied
144 let lut_n = f32(textureDimensions(src_b).x);
145 let lut_u = (0.5 + clamp(val, 0.0, 1.0) * (lut_n - 1.0)) / lut_n;
146 store_dst(vec2<i32>(gid.xy), textureSampleLevel(src_b, samp_lin, vec2<f32>(lut_u, 0.5), 0.0));
144 // Fusion leaves the ramp color unpremultiplied; downstream Merge treats it as premultiplied.
145 // Two-Color mode (Type == 0) interpolates Color1 -> Color2 without clamping `val`, allowing
146 // Contrast > 1.0 to extrapolate HDR/bright highlights; Gradient mode clamps lookup to [0, 1].
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);
147156}
148157// ============================================================================
149158// 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(
682682 global_end: ct.get_f64("GlobalEnd").unwrap_or(0.0) as i64,
683683 extend_first: ct.get_f64("ExtendFirst").unwrap_or(0.0) as i64,
684684 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),
686688 reverse: ct.get_bool("Reverse").unwrap_or(false),
687689 });
688690 }
scripts/gen_compatibility.py+3-3
......@@ -71,7 +71,7 @@ CATEGORIES: Sequence[str] = (
7171TOOL_METADATA: Sequence[ToolMeta] = (
7272 # Generators
7373 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%", ""),
7575 ToolMeta("Plasma", "Generators", "`tier1_c`", "0.1%–0.2%", "—"),
7676 ToolMeta("TextPlus", "Generators", "`text`, `noise_text`", "0.2%–0.8%", "Pure-Rust vector engine (no CoreText)."),
7777 ToolMeta("Loader", "Generators", "All suites", "0.0%", "—"),
......@@ -89,7 +89,7 @@ TOOL_METADATA: Sequence[ToolMeta] = (
8989 ToolMeta("BrightnessContrast", "Color & Depth", "`color_ops`, `tier1_d`", "0.0%–0.1%", "—"),
9090 ToolMeta("ColorCorrector", "Color & Depth", "`vortex_cc`, Suite comps", "0.0%–0.4%", "Histogram/Match/Suppress tabs not implemented."),
9191 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%", ""),
9393 ToolMeta("HueCurves", "Color & Depth", "`tier1_a`", "0.1%–0.5%", "—"),
9494 ToolMeta("GamutConvert", "Color & Depth", "Suite comps", "0.0%–0.2%", "—"),
9595 ToolMeta("InvertColor", "Color & Depth", "Suite comps", "0.0%", "—"),
......@@ -139,7 +139,7 @@ TOOL_METADATA: Sequence[ToolMeta] = (
139139 ToolMeta("RectangleMask", "Masks", "`mask`, `mask_softedge`", "0.0%–0.2%", "—"),
140140 ToolMeta("PolylineMask", "Masks", "`mask_softedge`, Suite comps", "0.1%–0.4%", "—"),
141141 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%", ""),
143143 ToolMeta("PaintMask", "Masks", "Unit tests", "0.1%–0.4%", "Non-round brush shapes not implemented."),
144144
145145 # 2D Vector Shapes