authoravatarclover caruso<git@paperclover.net>2026-11-30 20:21:21-08:00
committeravatarclover caruso<git@paperclover.net>2026-11-30 20:40:12-08:00
log142f667440ff79b189144d5169789cf9415aa93f
treec102b113d31b9d01c232089135a14c6d2893c368
parenta9e082f3772c8342dd079ae2c2823f4b5e9bf91f
signature Signed by SSH key SHA256:52mNGHRsVFBDED9IAX5pe+LRWUefqTbxEReunq21QvU

Sync compatibility registry and add_tool catalog, add alpha MAE and aspect matrix suite

Assisted-by: claude-sonnet-5.5

5 files changed, 281 insertions(+), 59 deletions(-)

crates/app/src/add_tool.rs+69-1
......@@ -11,6 +11,7 @@ pub enum ToolCategory {
1111 BlurGlow,
1212 TransformWarp,
1313 Mask,
14 Shape2D,
1415 Particle,
1516 Scene3D,
1617 Utility,
......@@ -26,6 +27,7 @@ impl ToolCategory {
2627 Self::BlurGlow => "Blur/Glow",
2728 Self::TransformWarp => "Transform/Warp",
2829 Self::Mask => "Mask",
30 Self::Shape2D => "Shape",
2931 Self::Particle => "Particle",
3032 Self::Scene3D => "3D",
3133 Self::Utility => "Utility",
......@@ -41,6 +43,7 @@ impl ToolCategory {
4143 Self::BlurGlow => [0.94, 0.50, 0.28, 1.0],
4244 Self::TransformWarp => [0.88, 0.72, 0.28, 1.0],
4345 Self::Mask => [0.34, 0.66, 0.98, 1.0],
46 Self::Shape2D => [0.52, 0.78, 0.40, 1.0],
4447 Self::Particle => [0.88, 0.46, 0.78, 1.0],
4548 Self::Scene3D => [0.30, 0.86, 0.92, 1.0],
4649 Self::Utility => [0.56, 0.62, 0.72, 1.0],
......@@ -64,12 +67,14 @@ pub const TOOL_CATALOG: &[ToolEntry] = &[
6467 ToolEntry { kind: "Plasma", display: "Plasma", aliases: "gradient organic", category: ToolCategory::Generator, is_generator: true },
6568 ToolEntry { kind: "TextPlus", display: "Text+", aliases: "textplus title font", category: ToolCategory::Generator, is_generator: true },
6669 ToolEntry { kind: "Loader", display: "Loader", aliases: "ld read media footage image", category: ToolCategory::Generator, is_generator: true },
70 ToolEntry { kind: "DaySky", display: "Day Sky", aliases: "sky sun atmosphere preetham hdri", category: ToolCategory::Generator, is_generator: true },
6771 // Composite
6872 ToolEntry { kind: "Merge", display: "Merge", aliases: "mrg over blend comp", category: ToolCategory::Composite, is_generator: false },
6973 ToolEntry { kind: "Dissolve", display: "Dissolve", aliases: "dx mix crossfade", category: ToolCategory::Composite, is_generator: false },
7074 ToolEntry { kind: "ChannelBoolean", display: "Channel Booleans", aliases: "cb channel matte", category: ToolCategory::Composite, is_generator: false },
7175 ToolEntry { kind: "Switch", display: "Switch", aliases: "sw select", category: ToolCategory::Composite, is_generator: false },
7276 ToolEntry { kind: "Shadow", display: "Shadow", aliases: "drop shadow", category: ToolCategory::Composite, is_generator: false },
77 ToolEntry { kind: "Paint", display: "Paint", aliases: "brush stroke clone retouch", category: ToolCategory::Composite, is_generator: false },
7378 // Color
7479 ToolEntry { kind: "BrightnessContrast", display: "Brightness / Contrast", aliases: "bc gain lift gamma", category: ToolCategory::Color, is_generator: false },
7580 ToolEntry { kind: "ColorCorrector", display: "Color Corrector", aliases: "cc grade wheel saturation", category: ToolCategory::Color, is_generator: false },
......@@ -84,7 +89,7 @@ pub const TOOL_CATALOG: &[ToolEntry] = &[
8489 // Keyer
8590 ToolEntry { kind: "UltraKeyer", display: "Ultra Keyer", aliases: "uk chroma green blue screen", category: ToolCategory::Keyer, is_generator: false },
8691 ToolEntry { kind: "LumaKeyer", display: "Luma Keyer", aliases: "lk luminance key", category: ToolCategory::Keyer, is_generator: false },
87 ToolEntry { kind: "Cryptomatte", display: "Cryptomatte", aliases: "crypto id matte", category: ToolCategory::Keyer, is_generator: false },
92 ToolEntry { kind: "Fuse.Cryptomatte", display: "Cryptomatte", aliases: "cryptomatte crypto id matte", category: ToolCategory::Keyer, is_generator: false },
8893 // Blur / Glow
8994 ToolEntry { kind: "Blur", display: "Blur", aliases: "bl gaussian defocus", category: ToolCategory::BlurGlow, is_generator: false },
9095 ToolEntry { kind: "DirectionalBlur", display: "Directional Blur", aliases: "db radial zoom motion blur", category: ToolCategory::BlurGlow, is_generator: false },
......@@ -106,11 +111,29 @@ pub const TOOL_CATALOG: &[ToolEntry] = &[
106111 ToolEntry { kind: "Displace", display: "Displace", aliases: "dsp refract warp bump", category: ToolCategory::TransformWarp, is_generator: false },
107112 ToolEntry { kind: "Vortex", display: "Vortex", aliases: "swirl twist", category: ToolCategory::TransformWarp, is_generator: false },
108113 ToolEntry { kind: "Fuse.XfChroma", display: "XfChroma", aliases: "chromatic aberration rgb split", category: ToolCategory::TransformWarp, is_generator: false },
114 ToolEntry { kind: "PerspectivePositioner", display: "Perspective Positioner", aliases: "pp rectify quad corner", category: ToolCategory::TransformWarp, is_generator: false },
115 ToolEntry { kind: "GridWarp", display: "Grid Warp", aliases: "gw mesh bezier lattice", category: ToolCategory::TransformWarp, is_generator: false },
116 ToolEntry { kind: "Drip", display: "Drip", aliases: "ripple concentric wave", category: ToolCategory::TransformWarp, is_generator: false },
117 ToolEntry { kind: "Dent", display: "Dent", aliases: "pinch punch bulge lens", category: ToolCategory::TransformWarp, is_generator: false },
118 ToolEntry { kind: "Fuse.Duplicate", display: "Duplicate", aliases: "copies repeat array clone", category: ToolCategory::TransformWarp, is_generator: false },
119 ToolEntry { kind: "Fuse.KScope", display: "Kaleidoscope", aliases: "kscope mirror slices", category: ToolCategory::TransformWarp, is_generator: false },
109120 // Mask
110121 ToolEntry { kind: "EllipseMask", display: "Ellipse Mask", aliases: "el circle oval", category: ToolCategory::Mask, is_generator: true },
111122 ToolEntry { kind: "RectangleMask", display: "Rectangle Mask", aliases: "rect box square", category: ToolCategory::Mask, is_generator: true },
112123 ToolEntry { kind: "PolylineMask", display: "Polygon Mask", aliases: "poly roto spline", category: ToolCategory::Mask, is_generator: true },
113124 ToolEntry { kind: "BitmapMask", display: "Bitmap Mask", aliases: "bmp alpha luma", category: ToolCategory::Mask, is_generator: false },
125 ToolEntry { kind: "WandMask", display: "Wand Mask", aliases: "wand magic select flood", category: ToolCategory::Mask, is_generator: false },
126 ToolEntry { kind: "PaintMask", display: "Paint Mask", aliases: "brush stroke matte", category: ToolCategory::Mask, is_generator: false },
127 // Shape
128 ToolEntry { kind: "sRender", display: "Shape Render", aliases: "srender rasterize vector shapes", category: ToolCategory::Shape2D, is_generator: false },
129 ToolEntry { kind: "sEllipse", display: "Shape Ellipse", aliases: "sellipse vector circle oval", category: ToolCategory::Shape2D, is_generator: true },
130 ToolEntry { kind: "sRectangle", display: "Shape Rectangle", aliases: "srect vector box rounded", category: ToolCategory::Shape2D, is_generator: true },
131 ToolEntry { kind: "sNGon", display: "Shape NGon", aliases: "sngon vector polygon sides", category: ToolCategory::Shape2D, is_generator: true },
132 ToolEntry { kind: "sGrid", display: "Shape Grid", aliases: "sgrid vector cells array", category: ToolCategory::Shape2D, is_generator: true },
133 ToolEntry { kind: "sMerge", display: "Shape Merge", aliases: "smerge vector combine", category: ToolCategory::Shape2D, is_generator: false },
134 ToolEntry { kind: "sTransform", display: "Shape Transform", aliases: "stransform vector move scale rotate", category: ToolCategory::Shape2D, is_generator: false },
135 ToolEntry { kind: "sBoolean", display: "Shape Boolean", aliases: "sbool vector union subtract intersect xor", category: ToolCategory::Shape2D, is_generator: false },
136 ToolEntry { kind: "sOutline", display: "Shape Outline", aliases: "soutline vector stroke", category: ToolCategory::Shape2D, is_generator: false },
114137 // Particle
115138 ToolEntry { kind: "pEmitter", display: "pEmitter", aliases: "pe particle emit", category: ToolCategory::Particle, is_generator: true },
116139 ToolEntry { kind: "pRender", display: "pRender", aliases: "pr particle render", category: ToolCategory::Particle, is_generator: false },
......@@ -121,6 +144,7 @@ pub const TOOL_CATALOG: &[ToolEntry] = &[
121144 ToolEntry { kind: "pFriction", display: "pFriction", aliases: "particle friction", category: ToolCategory::Particle, is_generator: false },
122145 ToolEntry { kind: "pKill", display: "pKill", aliases: "particle kill", category: ToolCategory::Particle, is_generator: false },
123146 ToolEntry { kind: "pMerge", display: "pMerge", aliases: "particle merge", category: ToolCategory::Particle, is_generator: false },
147 ToolEntry { kind: "pBounce", display: "pBounce", aliases: "particle collision rebound", category: ToolCategory::Particle, is_generator: false },
124148 // 3D
125149 ToolEntry { kind: "Renderer3D", display: "Renderer 3D", aliases: "3rn render 3d", category: ToolCategory::Scene3D, is_generator: false },
126150 ToolEntry { kind: "Merge3D", display: "Merge 3D", aliases: "3mg scene 3d", category: ToolCategory::Scene3D, is_generator: false },
......@@ -130,6 +154,22 @@ pub const TOOL_CATALOG: &[ToolEntry] = &[
130154 ToolEntry { kind: "Transform3D", display: "Transform 3D", aliases: "3xf move 3d", category: ToolCategory::Scene3D, is_generator: false },
131155 ToolEntry { kind: "LightAmbient", display: "Ambient Light", aliases: "3la light", category: ToolCategory::Scene3D, is_generator: true },
132156 ToolEntry { kind: "LightDirectional", display: "Directional Light", aliases: "3dl sun light", category: ToolCategory::Scene3D, is_generator: true },
157 ToolEntry { kind: "Cube3D", display: "Cube 3D", aliases: "3cu box", category: ToolCategory::Scene3D, is_generator: true },
158 ToolEntry { kind: "SurfaceFBXMesh", display: "FBX Mesh", aliases: "3fbx obj import model", category: ToolCategory::Scene3D, is_generator: true },
159 ToolEntry { kind: "Text3D", display: "Text 3D", aliases: "3txt extrude title", category: ToolCategory::Scene3D, is_generator: true },
160 ToolEntry { kind: "LightPoint", display: "Point Light", aliases: "3pl omni light", category: ToolCategory::Scene3D, is_generator: true },
161 ToolEntry { kind: "LightSpot", display: "Spot Light", aliases: "3sl cone light", category: ToolCategory::Scene3D, is_generator: true },
162 ToolEntry { kind: "MtlBlinn", display: "Blinn Material", aliases: "blinn specular shader", category: ToolCategory::Scene3D, is_generator: true },
163 ToolEntry { kind: "MtlPhong", display: "Phong Material", aliases: "specular shader", category: ToolCategory::Scene3D, is_generator: true },
164 ToolEntry { kind: "MtlCookTorrance", display: "Cook-Torrance Material", aliases: "pbr roughness shader", category: ToolCategory::Scene3D, is_generator: true },
165 ToolEntry { kind: "Texture2DOperator", display: "Texture 2D", aliases: "3tex image material", category: ToolCategory::Scene3D, is_generator: false },
166 ToolEntry { kind: "TextureTransformOperator", display: "Texture Transform", aliases: "uv tile material", category: ToolCategory::Scene3D, is_generator: false },
167 ToolEntry { kind: "BumpMap", display: "Bump Map", aliases: "height normal relief", category: ToolCategory::Scene3D, is_generator: false },
168 ToolEntry { kind: "ReplaceMaterial3D", display: "Replace Material 3D", aliases: "3rm override shader", category: ToolCategory::Scene3D, is_generator: false },
169 ToolEntry { kind: "Override3D", display: "Override 3D", aliases: "3ov visibility lighting", category: ToolCategory::Scene3D, is_generator: false },
170 ToolEntry { kind: "Duplicate3D", display: "Duplicate 3D", aliases: "3du instance copies", category: ToolCategory::Scene3D, is_generator: false },
171 ToolEntry { kind: "ReplaceNormals3D", display: "Replace Normals 3D", aliases: "3rn flip normals", category: ToolCategory::Scene3D, is_generator: false },
172 ToolEntry { kind: "Displace3D", display: "Displace 3D", aliases: "3dp heightmap vertex", category: ToolCategory::Scene3D, is_generator: false },
133173 // Utility
134174 ToolEntry { kind: "Saver", display: "Saver", aliases: "sv write export png", category: ToolCategory::Utility, is_generator: false },
135175 ToolEntry { kind: "PipeRouter", display: "Pipe Router", aliases: "dot router wire", category: ToolCategory::Utility, is_generator: false },
......@@ -140,6 +180,10 @@ pub const TOOL_CATALOG: &[ToolEntry] = &[
140180 ToolEntry { kind: "Tracker", display: "Tracker", aliases: "tr matchmove", category: ToolCategory::Utility, is_generator: false },
141181 ToolEntry { kind: "Note", display: "Sticky Note", aliases: "comment note", category: ToolCategory::Utility, is_generator: true },
142182 ToolEntry { kind: "Underlay", display: "Underlay", aliases: "backdrop group", category: ToolCategory::Utility, is_generator: true },
183 ToolEntry { kind: "Custom", display: "Custom Tool", aliases: "ct shader expression", category: ToolCategory::Utility, is_generator: false },
184 ToolEntry { kind: "Fuse.Wireless", display: "Wireless Link", aliases: "wireless jump portal", category: ToolCategory::Utility, is_generator: false },
185 ToolEntry { kind: "Dimension.OpticalFlow", display: "Optical Flow", aliases: "flow motion vectors retime", category: ToolCategory::Utility, is_generator: false },
186 ToolEntry { kind: "Dimension.CopyAux", display: "Copy Aux", aliases: "aux channels passthrough", category: ToolCategory::Utility, is_generator: false },
143187];
144188
145189/// Case-insensitive fuzzy/subsequence scoring for tool search.
......@@ -549,6 +593,30 @@ mod tests {
549593 assert!(res_3d.iter().any(|e| e.kind == "Camera3D"));
550594 }
551595
596 #[test]
597 fn catalog_kinds_are_unique_and_supported() {
598 let mut seen = std::collections::HashSet::new();
599 for entry in TOOL_CATALOG {
600 assert!(seen.insert(entry.kind), "duplicate catalog kind {}", entry.kind);
601 assert!(model::is_supported_tool(entry.kind), "{} is not a supported tool", entry.kind);
602 }
603 for kind in [
604 "sRender", "sEllipse", "sBoolean", "Paint", "PaintMask", "DaySky", "Drip", "Dent",
605 "PerspectivePositioner", "GridWarp", "Cube3D", "SurfaceFBXMesh", "MtlBlinn",
606 "MtlPhong", "MtlCookTorrance", "LightPoint", "LightSpot", "WandMask",
607 "Fuse.Duplicate", "Fuse.KScope", "Fuse.Wireless", "Fuse.Cryptomatte",
608 "Dimension.OpticalFlow", "Dimension.CopyAux", "pBounce", "Custom", "Switch",
609 ] {
610 assert!(seen.contains(kind), "catalog is missing {kind}");
611 }
612 }
613
614 #[test]
615 fn cryptomatte_search_yields_exact_fusion_id() {
616 let res = search_tools("cryptomatte");
617 assert_eq!(res[0].kind, "Fuse.Cryptomatte");
618 }
619
552620 #[test]
553621 fn non_matching_query_returns_empty() {
554622 let res = search_tools("zzzznotatool999");
crates/engine/src/bin/render_check.rs+17-13
......@@ -8,7 +8,7 @@ use std::fs::File;
88use std::path::{Path, PathBuf};
99use std::time::Instant;
1010
11fn compute_diff(pixels: &[u8], tex_size: [u32; 2], ref_path: &Path) -> Result<(f64, f64), Box<dyn std::error::Error>> {
11fn compute_diff(pixels: &[u8], tex_size: [u32; 2], ref_path: &Path) -> Result<(f64, f64, f64), Box<dyn std::error::Error>> {
1212 let mut ref_img = image::open(ref_path)?.to_rgba8();
1313 if [ref_img.width(), ref_img.height()] != tex_size {
1414 ref_img = image::imageops::resize(
......@@ -21,17 +21,19 @@ fn compute_diff(pixels: &[u8], tex_size: [u32; 2], ref_path: &Path) -> Result<(f
2121 let rraw = ref_img.into_raw();
2222 let mut sum_abs = 0u64;
2323 let mut sum_sq = 0u64;
24 let n = (tex_size[0] as u64) * (tex_size[1] as u64) * 3;
24 let mut alpha_abs = 0u64;
25 let px = (tex_size[0] as u64) * (tex_size[1] as u64);
2526 for (a, b) in pixels.chunks_exact(4).zip(rraw.chunks_exact(4)) {
2627 for c in 0..3 {
2728 let d = (a[c] as i32 - b[c] as i32).unsigned_abs() as u64;
2829 sum_abs += d;
2930 sum_sq += d * d;
3031 }
32 alpha_abs += (a[3] as i32 - b[3] as i32).unsigned_abs() as u64;
3133 }
32 let mae = sum_abs as f64 / n as f64;
33 let rmse = (sum_sq as f64 / n as f64).sqrt();
34 Ok((mae, rmse))
34 let mae = sum_abs as f64 / (px * 3) as f64;
35 let rmse = (sum_sq as f64 / (px * 3) as f64).sqrt();
36 Ok((mae, rmse, alpha_abs as f64 / px as f64))
3537}
3638
3739fn write_png(path: &Path, size: [u32; 2], pixels: &[u8]) -> Result<(), Box<dyn std::error::Error>> {
......@@ -59,10 +61,10 @@ fn run_suite(manifest_path: &Path, hiq: bool) -> Result<(), Box<dyn std::error::
5961 manifest_path.display()
6062 );
6163 eprintln!(
62 "{:<6} {:<20} {:>6} {:>7} {:>7} {:>8} {:>8} {:>7} {}",
63 "STATUS", "CASE", "FRAME", "MAE%", "RMSE", "WARM_MS", "BUST_MS", "VRAM", "UNSUPPORTED"
64 "{:<6} {:<20} {:>6} {:>7} {:>7} {:>7} {:>8} {:>8} {:>7} {}",
65 "STATUS", "CASE", "FRAME", "MAE%", "A_MAE%", "RMSE", "WARM_MS", "BUST_MS", "VRAM", "UNSUPPORTED"
6466 );
65 eprintln!("{}", "-".repeat(94));
67 eprintln!("{}", "-".repeat(102));
6668
6769 for (lineno, raw) in text.lines().enumerate() {
6870 let line = raw.trim();
......@@ -97,8 +99,9 @@ fn run_suite(manifest_path: &Path, hiq: bool) -> Result<(), Box<dyn std::error::
9799 let (_, bust) = engine.evaluate(comp, target, frame);
98100
99101 let pixels = engine.readback_rgba(&tex)?;
100 let (mae, rmse) = compute_diff(&pixels, tex.size, &ref_path)?;
102 let (mae, rmse, alpha_mae) = compute_diff(&pixels, tex.size, &ref_path)?;
101103 let mae_pct = mae / 2.55;
104 let alpha_mae_pct = alpha_mae / 2.55;
102105
103106 let ok = mae_pct <= max_mae_pct && bust.eval_ms <= max_bust_ms;
104107 if ok {
......@@ -107,11 +110,12 @@ fn run_suite(manifest_path: &Path, hiq: bool) -> Result<(), Box<dyn std::error::
107110 failed += 1;
108111 }
109112 eprintln!(
110 "{:<6} {:<20} {:>6} {:>6.2}% {:>7.2} {:>7.2}ms {:>7.2}ms {:>5.0}MB {:?}",
113 "{:<6} {:<20} {:>6} {:>6.2}% {:>6.2}% {:>7.2} {:>7.2}ms {:>7.2}ms {:>5.0}MB {:?}",
111114 if ok { "PASS" } else { "FAIL" },
112115 case_name,
113116 frame as i64,
114117 mae_pct,
118 alpha_mae_pct,
115119 rmse,
116120 warm.eval_ms,
117121 bust.eval_ms,
......@@ -126,7 +130,7 @@ fn run_suite(manifest_path: &Path, hiq: bool) -> Result<(), Box<dyn std::error::
126130 }
127131 }
128132
129 eprintln!("{}", "-".repeat(94));
133 eprintln!("{}", "-".repeat(102));
130134 eprintln!("Suite summary: {passed} passed, {failed} failed");
131135 if failed > 0 {
132136 std::process::exit(1);
......@@ -661,9 +665,9 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
661665 eprintln!("Wrote {} ({}x{})", out_path.display(), tex.size[0], tex.size[1]);
662666 }
663667 if let Some(rp) = ref_path {
664 let (mae, rmse) = compute_diff(&pixels, tex.size, &rp)?;
668 let (mae, rmse, alpha_mae) = compute_diff(&pixels, tex.size, &rp)?;
665669 eprintln!(
666 "Diff vs {} ({}x{}): MAE={mae:.2}/255 ({:.1}%), RMSE={rmse:.2}/255",
670 "Diff vs {} ({}x{}): MAE={mae:.2}/255 ({:.1}%), A_MAE={alpha_mae:.2}/255, RMSE={rmse:.2}/255",
667671 rp.display(),
668672 tex.size[0],
669673 tex.size[1],
scripts/diff_fuzz/matrix.py+61-1
......@@ -1,4 +1,4 @@
1"""Exhaustive edge-case parameter matrix suites (Merge, HDR, masks, color/blur, warps, 3D, misc, paint)."""
1"""Exhaustive edge-case parameter matrix suites (Merge, HDR, masks, color/blur, warps, 3D, misc, paint, aspect)."""
22
33from typing import Dict, List, Tuple
44
......@@ -955,6 +955,62 @@ def build_matrix_paint(assets: Dict[str, str]):
955955 return comp_path, "matrix_paint", [(c[0], c[1]) for c in cases]
956956
957957
958ASPECT_SIZES = ((320, 180), (180, 320), (321, 181))
959
960_ASPECT_SETUP = """\t\tBlackBG = Background { Inputs = { Width = Input { Value = @W@, }, Height = Input { Value = @H@, }, TopLeftAlpha = Input { Value = 1, }, }, },
961\t\tWhiteFG = Background { Inputs = { Width = Input { Value = @W@, }, Height = Input { Value = @H@, }, TopLeftRed = Input { Value = 0.95, }, TopLeftGreen = Input { Value = 0.75, }, TopLeftBlue = Input { Value = 0.25, }, TopLeftAlpha = Input { Value = 1, }, }, },
962\t\tSmallFG = Background { Inputs = { Width = Input { Value = @HW@, }, Height = Input { Value = @HH@, }, TopLeftRed = Input { Value = 0.2, }, TopLeftGreen = Input { Value = 0.8, }, TopLeftBlue = Input { Value = 0.5, }, TopLeftAlpha = Input { Value = 1, }, }, },"""
963
964_ASPECT_CASES = (
965 ("BG_Horizontal", 'Background { Inputs = { Width = Input { Value = @W@, }, Height = Input { Value = @H@, }, Type = Input { Value = FuID { "Horizontal" }, }, TopLeftRed = Input { Value = 0.9, }, TopLeftGreen = Input { Value = 0.2, }, TopLeftBlue = Input { Value = 0.1, }, TopLeftAlpha = Input { Value = 1, }, TopRightRed = Input { Value = 0.1, }, TopRightGreen = Input { Value = 0.3, }, TopRightBlue = Input { Value = 0.9, }, TopRightAlpha = Input { Value = 1, }, }, }'),
966 ("BG_Vertical", 'Background { Inputs = { Width = Input { Value = @W@, }, Height = Input { Value = @H@, }, Type = Input { Value = FuID { "Vertical" }, }, TopLeftRed = Input { Value = 0.9, }, TopLeftGreen = Input { Value = 0.2, }, TopLeftBlue = Input { Value = 0.1, }, TopLeftAlpha = Input { Value = 1, }, BottomLeftRed = Input { Value = 0.1, }, BottomLeftGreen = Input { Value = 0.3, }, BottomLeftBlue = Input { Value = 0.9, }, BottomLeftAlpha = Input { Value = 1, }, }, }'),
967 ("BG_FourCorner", 'Background { Inputs = { Width = Input { Value = @W@, }, Height = Input { Value = @H@, }, Type = Input { Value = FuID { "Four Corner" }, }, TopLeftRed = Input { Value = 1, }, TopLeftAlpha = Input { Value = 1, }, TopRightGreen = Input { Value = 1, }, TopRightAlpha = Input { Value = 1, }, BottomLeftBlue = Input { Value = 1, }, BottomLeftAlpha = Input { Value = 1, }, BottomRightRed = Input { Value = 1, }, BottomRightGreen = Input { Value = 1, }, BottomRightAlpha = Input { Value = 1, }, }, }'),
968 ("EllipseMask_Circle", 'Merge { Inputs = { Background = Input { SourceOp = "BlackBG", Source = "Output", }, Foreground = Input { SourceOp = "WhiteFG", Source = "Output", }, EffectMask = Input { SourceOp = "@MASK@", Source = "Mask", }, }, }',
969 'EllipseMask { Inputs = { MaskWidth = Input { Value = @W@, }, MaskHeight = Input { Value = @H@, }, Width = Input { Value = 0.5, }, Height = Input { Value = 0.5, }, SoftEdge = Input { Value = 0.02, }, }, }'),
970 ("EllipseMask_Rotated", 'Merge { Inputs = { Background = Input { SourceOp = "BlackBG", Source = "Output", }, Foreground = Input { SourceOp = "WhiteFG", Source = "Output", }, EffectMask = Input { SourceOp = "@MASK@", Source = "Mask", }, }, }',
971 'EllipseMask { Inputs = { MaskWidth = Input { Value = @W@, }, MaskHeight = Input { Value = @H@, }, Center = Input { Value = { 0.4, 0.55 }, }, Width = Input { Value = 0.6, }, Height = Input { Value = 0.3, }, Angle = Input { Value = 30, }, BorderWidth = Input { Value = 0.01, }, }, }'),
972 ("RectangleMask_Rounded", 'Merge { Inputs = { Background = Input { SourceOp = "BlackBG", Source = "Output", }, Foreground = Input { SourceOp = "WhiteFG", Source = "Output", }, EffectMask = Input { SourceOp = "@MASK@", Source = "Mask", }, }, }',
973 'RectangleMask { Inputs = { MaskWidth = Input { Value = @W@, }, MaskHeight = Input { Value = @H@, }, Width = Input { Value = 0.6, }, Height = Input { Value = 0.4, }, CornerRadius = Input { Value = 0.1, }, SoftEdge = Input { Value = 0.02, }, }, }'),
974 ("RectangleMask_Rotated", 'Merge { Inputs = { Background = Input { SourceOp = "BlackBG", Source = "Output", }, Foreground = Input { SourceOp = "WhiteFG", Source = "Output", }, EffectMask = Input { SourceOp = "@MASK@", Source = "Mask", }, }, }',
975 'RectangleMask { Inputs = { MaskWidth = Input { Value = @W@, }, MaskHeight = Input { Value = @H@, }, Center = Input { Value = { 0.55, 0.45 }, }, Width = Input { Value = 0.5, }, Height = Input { Value = 0.3, }, Angle = Input { Value = -25, }, }, }'),
976 ("Transform_Rotation", 'Transform { Inputs = { Input = Input { SourceOp = "Grad", Source = "Output", }, Angle = Input { Value = 30, }, Size = Input { Value = 0.7, }, }, }'),
977 ("Transform_Rotation_Aspect", 'Transform { Inputs = { Input = Input { SourceOp = "Grad", Source = "Output", }, Center = Input { Value = { 0.6, 0.45 }, }, Pivot = Input { Value = { 0.3, 0.6 }, }, Angle = Input { Value = 28, }, Aspect = Input { Value = 1.5, }, Size = Input { Value = 0.8, }, }, }'),
978 ("Merge_Center_Size_Angle", 'Merge { Inputs = { Background = Input { SourceOp = "Grad", Source = "Output", }, Foreground = Input { SourceOp = "SmallFG", Source = "Output", }, Center = Input { Value = { 0.65, 0.4 }, }, Size = Input { Value = 0.8, }, Angle = Input { Value = 35, }, }, }'),
979 ("DVE_Rotation", 'DVE { Inputs = { Input = Input { SourceOp = "Grad", Source = "Output", }, XRotation = Input { Value = 25, }, YRotation = Input { Value = -30, }, ZRotation = Input { Value = 15, }, ZMove = Input { Value = 1.2, }, }, }'),
980 ("TextPlus_Centered", 'TextPlus { Inputs = { Width = Input { Value = @W@, }, Height = Input { Value = @H@, }, Font = Input { Value = "Liberation Sans", }, Style = Input { Value = "Regular", }, StyledText = Input { Value = "Aspect 321", }, Size = Input { Value = 0.18, }, Center = Input { Value = { 0.5, 0.5 }, }, }, }'),
981)
982
983
984def _build_matrix_aspect(w: int, h: int):
985 """Non-square and odd-dimension canvases: gradients, masks, Transform/Merge/DVE geometry and TextPlus at WxH."""
986 sub = {"@W@": str(w), "@H@": str(h), "@HW@": str(w // 2), "@HH@": str(h // 2)}
987
988 def fill(text: str) -> str:
989 for k, v in sub.items():
990 text = text.replace(k, v)
991 return text
992
993 nodes = [
994 fill(_ASPECT_SETUP),
995 fill(f'\t\tGrad = {_ASPECT_CASES[0][1]},'),
996 ]
997 cases: List[Tuple[int, str, str]] = []
998 for f, (label, body, *mask) in enumerate(_ASPECT_CASES):
999 if mask:
1000 nodes.append(fill(f"\t\tMask_{f} = {mask[0]},"))
1001 body = body.replace("@MASK@", f"Mask_{f}")
1002 nodes.append(fill(f"\t\tOp_{f} = {body},"))
1003 cases.append((f, label, f"Op_{f}"))
1004
1005 prefix = f"matrix_aspect_{w}x{h}"
1006 sw_nodes, sw_splines, out_op = build_switch_chain(cases, "BlackBG", "AS")
1007 nodes.extend(sw_nodes)
1008 nodes.append(make_saver(out_op, prefix))
1009 comp_path = ensure_dirs() / "comps" / f"{prefix}.comp"
1010 comp_path.write_text(make_comp("\n".join(nodes + sw_splines), len(cases) - 1, w=w, h=h))
1011 return comp_path, prefix, [(c[0], c[1]) for c in cases]
1012
1013
9581014MATRIX_BUILDERS = {
9591015 "matrix_merge_modes": build_matrix_merge_modes,
9601016 "matrix_hdr_depth": build_matrix_hdr_depth,
......@@ -964,6 +1020,10 @@ MATRIX_BUILDERS = {
9641020 "matrix_3d": build_matrix_3d,
9651021 "matrix_misc": build_matrix_misc,
9661022 "matrix_paint": build_matrix_paint,
1023 **{
1024 f"matrix_aspect_{w}x{h}": (lambda assets, w=w, h=h: _build_matrix_aspect(w, h))
1025 for w, h in ASPECT_SIZES
1026 },
9671027}
9681028
9691029
scripts/diff_fuzz/runner.py+24-4
......@@ -14,6 +14,7 @@ from .assets import (
1414 ensure_render_check,
1515 make_comp,
1616 make_saver,
17 read_png_rgba,
1718 build_switch_chain,
1819 use_smb,
1920)
......@@ -22,6 +23,21 @@ from .fuzzer import FuzzGraph, SplineParam
2223
2324
2425
26def alpha_mae_pct(ours_path: Path, gt_path: Path) -> float:
27 """Mean absolute alpha error as a percentage; GT is nearest-sampled onto our size when they differ."""
28 ow, oh, ob = read_png_rgba(ours_path)
29 gw, gh, gb = read_png_rgba(gt_path)
30 if (ow, oh) == (gw, gh):
31 total = sum(abs(a - b) for a, b in zip(ob[3::4], gb[3::4]))
32 else:
33 total = sum(
34 abs(ob[(y * ow + x) * 4 + 3] - gb[(min(gh - 1, int((y + 0.5) * gh / oh)) * gw + min(gw - 1, int((x + 0.5) * gw / ow))) * 4 + 3])
35 for y in range(oh)
36 for x in range(ow)
37 )
38 return total / (ow * oh) / 2.55
39
40
2541def run_comp_both(
2642 comp_path: Path,
2743 prefix: str,
......@@ -122,6 +138,8 @@ def run_comp_both(
122138 gt_p = root / "gt" / f"{prefix}_{f:04d}.png"
123139 ours_p = ours_sub / f"{f:04d}.png"
124140 m = compute_diff_metrics(ours_p, gt_p)
141 if "error" not in m:
142 m["alpha_mae_pct"] = alpha_mae_pct(ours_p, gt_p)
125143 m["frame"] = f
126144 m["label"] = label
127145 results[f] = m
......@@ -295,11 +313,12 @@ def bisect_failing_graph(
295313
296314def print_table(title: str, rows: List[Dict[str, Any]], threshold_pct: float) -> None:
297315 print(f"\n=== {title} ===")
298 print(f" {'Case':<44s} | {'MAE%':>7s} | {'MAE':>6s} | {'RMSE':>6s} | {'Status'}")
299 print(f" {'-'*44}-+-{'-'*7}-+-{'-'*6}-+-{'-'*6}-+-{'-'*18}")
316 print(f" {'Case':<44s} | {'MAE%':>7s} | {'A_MAE%':>7s} | {'MAE':>6s} | {'RMSE':>6s} | {'Status'}")
317 print(f" {'-'*44}-+-{'-'*7}-+-{'-'*7}-+-{'-'*6}-+-{'-'*6}-+-{'-'*18}")
300318 for r in rows:
301319 label = str(r.get("label", ""))[:44]
302320 mae_pct = r.get("mae_pct", 100.0)
321 a_pct = r.get("alpha_mae_pct", 0.0)
303322 mae = r.get("mae_255", 255.0)
304323 rmse = r.get("rmse_255", 255.0)
305324 if r.get("error"):
......@@ -308,7 +327,8 @@ def print_table(title: str, rows: List[Dict[str, Any]], threshold_pct: float) ->
308327 status = f"SIZE {r.get('dims_ours')}!={r.get('dims_gt')}"
309328 elif mae_pct > threshold_pct:
310329 status = "FAIL"
330 elif a_pct > threshold_pct:
331 status = "PASS (ALPHA DIFF)"
311332 else:
312333 status = "PASS"
313 print(f" {label:<44s} | {mae_pct:6.2f}% | {mae:6.2f} | {rmse:6.2f} | {status}")
314
334 print(f" {label:<44s} | {mae_pct:6.2f}% | {a_pct:6.2f}% | {mae:6.2f} | {rmse:6.2f} | {status}")
scripts/gen_compatibility.py+110-40
......@@ -17,8 +17,11 @@ from typing import Dict, List, Optional, Sequence, Set, Tuple
1717
1818REPO_ROOT = Path(__file__).resolve().parent.parent
1919EVAL_RS = REPO_ROOT / "crates" / "engine" / "src" / "eval" / "mod.rs"
20EVAL_DIR_LABEL = "crates/engine/src/eval/"
21SCENE3D_DIR_LABEL = "crates/engine/src/scene3d/"
2022SCENE3D_RS = REPO_ROOT / "crates" / "engine" / "src" / "scene3d" / "collect.rs"
2123COMP_RS = REPO_ROOT / "crates" / "model" / "src" / "comp.rs"
24ADD_TOOL_RS = REPO_ROOT / "crates" / "app" / "src" / "add_tool.rs"
2225PROBES_PY = REPO_ROOT / "scripts" / "fusion_probes.py"
2326DEFAULT_OUTPUT = REPO_ROOT / "compatibility.md"
2427
......@@ -37,6 +40,16 @@ class ToolMeta:
3740 aliases: Tuple[str, ...] = ()
3841
3942
43# Supported tools intentionally absent from the Add Tool launcher: created by other
44# tools or by grouping, or a duplicate spelling of a listed tool.
45ADD_TOOL_EXCLUDED: Set[str] = {
46 "PolylineStroke", # created by Paint
47 "Multistroke", # created by Paint
48 "MacroOperator", # created by grouping
49 "GroupOperator", # created by grouping
50 "Fuse.Switch", # Switch covers it
51}
52
4053CATEGORIES: Sequence[str] = (
4154 "Generators",
4255 "Compositing & Blending",
......@@ -52,7 +65,7 @@ CATEGORIES: Sequence[str] = (
5265)
5366
5467# Structured metadata for every supported Flow tool.
55# Any tool discovered in eval.rs / scene3d.rs that is missing here will be
68# Any tool discovered in eval/ or scene3d/ that is missing here will be
5669# flagged automatically so compatibility.md never drifts stale.
5770TOOL_METADATA: Sequence[ToolMeta] = (
5871 # Generators
......@@ -190,7 +203,7 @@ TOOL_METADATA: Sequence[ToolMeta] = (
190203 ToolMeta("MacroOperator", "Time, Routing & Utility", "Suite comps", "0.0%", "Unpacks internal `Tools` subgraph and evaluates exported output seamlessly."),
191204 ToolMeta("GroupOperator", "Time, Routing & Utility", "Suite comps", "0.0%", "Unpacks internal `Tools` subgraph and evaluates exported output seamlessly."),
192205 ToolMeta("Custom", "Time, Routing & Utility", "Suite comps", "0.1%–0.6%", "Custom Tool shader evaluation (procedural wave/channel expressions + `UserControls` defaults)."),
193 ToolMeta("Note", "Time, Routing & Utility", "—", "N/A", "Non-rendering Flow sticky note; preserved losslessly on `.comp` roundtrip."),
206 ToolMeta("Note", "Time, Routing & Utility", "—", "N/A", "Non-rendering Flow sticky note; preserved losslessly on `.comp` roundtrip.", aliases=("StickyNote",)),
194207 ToolMeta("Underlay", "Time, Routing & Utility", "—", "N/A", "Non-rendering Flow backdrop/group box; preserved losslessly on `.comp` roundtrip."),
195208)
196209
......@@ -231,7 +244,7 @@ UNSUPPORTED_NOTES: Sequence[UnsupportedMeta] = (
231244
232245
233246def parse_eval_rs(path: Path) -> Set[str]:
234 """Extract all supported tool class names from eval_node_inner in eval.rs."""
247 """Extract all supported tool class names from eval_node_inner in eval/mod.rs."""
235248 text = path.read_text(encoding="utf-8")
236249 m = re.search(r"fn eval_node_inner\b.*?(?=\n fn |\n\})", text, re.S)
237250 if not m:
......@@ -250,24 +263,52 @@ def parse_eval_rs(path: Path) -> Set[str]:
250263 return tools
251264
252265
266def _top_level_match_arms(text: str, header: str) -> Set[str]:
267 """String literals in the arm patterns of the first `match` whose header regex matches.
268
269 Tracks brace depth instead of source indentation, so arms are found at any nesting.
270 """
271 m = re.search(header, text, re.S)
272 if not m:
273 raise RuntimeError(f"Could not locate match header /{header}/")
274 names: Set[str] = set()
275 depth = 1
276 pattern = ""
277 for line in text[m.end():].splitlines():
278 code = re.sub(r'"(?:[^"\\]|\\.)*"', '""', line)
279 if depth == 1:
280 pattern += line + "\n"
281 if "=>" in line:
282 names.update(re.findall(r'"([^"]+)"', pattern.split("=>", 1)[0]))
283 pattern = ""
284 depth += code.count("{") - code.count("}")
285 if depth <= 0:
286 break
287 if depth > 1:
288 pattern = ""
289 return names
290
291
253292def parse_scene3d_rs(path: Path) -> Set[str]:
254 """Extract all supported 3D tool class names from collect_scene & resolve_material in scene3d.rs."""
293 """Extract supported 3D tool class names from the scene collection and material-resolution matches."""
294 text = path.read_text(encoding="utf-8")
295 return _top_level_match_arms(text, r"match node\.kind\.as_str\(\)\s*\{") | _top_level_match_arms(
296 text, r"fn resolve_material_inner\b.*?match n\.kind\.as_str\(\)\s*\{"
297 )
298
299
300def parse_is_supported_tool(path: Path) -> Set[str]:
301 """Return every class name accepted by `is_supported_tool` in comp.rs."""
255302 text = path.read_text(encoding="utf-8")
256 m = re.search(r"match node\.kind\.as_str\(\)\s*\{(.*?)\n _ => \{\}", text, re.S)
303 m = re.search(r"fn is_supported_tool\b.*?matches!\(\s*kind,(.*?)\n \)", text, re.S)
257304 if not m:
258 raise RuntimeError(f"Could not locate collect_scene match in {path}")
259 tools: Set[str] = set()
260 for line in m.group(1).splitlines():
261 if line.startswith(' "') and "=>" in line:
262 lhs = line.split("=>", 1)[0]
263 tools.update(re.findall(r'"([^"]+)"', lhs))
264 mm = re.search(r"match n\.kind\.as_str\(\)\s*\{(.*?)\n _ =>", text, re.S)
265 if mm:
266 for line in mm.group(1).splitlines():
267 if line.startswith(' "') and "=>" in line:
268 lhs = line.split("=>", 1)[0]
269 tools.update(re.findall(r'"([^"]+)"', lhs))
270 return tools
305 raise RuntimeError(f"Could not locate is_supported_tool in {path}")
306 return set(re.findall(r'"([^"]+)"', re.sub(r"//[^\n]*", "", m.group(1))))
307
308
309def parse_add_tool_catalog(path: Path) -> Set[str]:
310 """Return every `kind` listed in TOOL_CATALOG of add_tool.rs."""
311 return set(re.findall(r'ToolEntry\s*\{\s*kind:\s*"([^"]+)"', path.read_text(encoding="utf-8")))
271312
272313
273314def parse_comp_rs_modifiers(path: Path) -> Tuple[List[str], Set[str]]:
......@@ -296,34 +337,45 @@ def parse_probe_suites(path: Path) -> Set[str]:
296337 return set(re.findall(r'"([^"]+)"\s*:', m.group(1)))
297338
298339
299TOOLS_START_RE = re.compile(r"(?m)^\tTools\s*=\s*(?:ordered\(\)\s*)?\{")
300TOP_TOOL_RE = re.compile(
301 r'^\t\t(?:\["[^"]+"\]|[A-Za-z_][A-Za-z0-9_]*)\s*=\s*([A-Za-z_][A-Za-z0-9_.]*)\s*\{'
340TOOL_RE = re.compile(
341 r'^(\t+)(?:\["[^"]+"\]|[A-Za-z_][A-Za-z0-9_]*)\s*=\s*([A-Za-z_][A-Za-z0-9_.]*)\s*\{'
302342)
343TOOLS_BLOCK_RE = re.compile(r"^(\t+)Tools\s*=\s*(?:ordered\(\)\s*)?\{")
344
345
346def count_tool_classes(text: str) -> Counter[str]:
347 """Count tool classes in every `Tools` block, including those nested in Macro/Group operators."""
348 counts: Counter[str] = Counter()
349 block_indents: List[int] = [] # tab depth of each open Tools block
350 for line in text.splitlines():
351 stripped = line.lstrip("\t")
352 depth = len(line) - len(stripped)
353 if block_indents and depth <= block_indents[-1] and stripped.startswith("}"):
354 block_indents.pop()
355 continue
356 if block_indents and depth == block_indents[-1] + 1:
357 tm = TOOL_RE.match(line)
358 if tm:
359 counts[tm.group(2)] += 1
360 continue
361 if TOOLS_BLOCK_RE.match(line):
362 block_indents.append(depth)
363 return counts
303364
304365
305366def scan_comp_corpus(root: Path) -> Optional[Tuple[int, Counter[str]]]:
306 """Lightweight top-level tool-class scanner over all *.comp files under root."""
367 """Tool-class counts over all *.comp files under root."""
307368 if not root.exists():
308369 return None
309 counts: Counter[str] = Counter()
310370 comp_files = sorted(root.rglob("*.comp"))
311371 if not comp_files:
312372 return None
373 counts: Counter[str] = Counter()
313374 for path in comp_files:
314375 try:
315 text = path.read_text(encoding="utf-8", errors="replace")
376 counts += count_tool_classes(path.read_text(encoding="utf-8", errors="replace"))
316377 except OSError:
317378 continue
318 m = TOOLS_START_RE.search(text)
319 if not m:
320 continue
321 for line in text[m.end():].splitlines():
322 if line.startswith("\t}"):
323 break
324 tm = TOP_TOOL_RE.match(line)
325 if tm:
326 counts[tm.group(1)] += 1
327379 return len(comp_files), counts
328380
329381
......@@ -359,6 +411,8 @@ def build_markdown(
359411 eval_tools: Set[str],
360412 scene3d_tools: Set[str],
361413 impl_modifiers: Set[str],
414 comp_supported: Set[str],
415 catalog_kinds: Set[str],
362416 probe_suites: Set[str],
363417 active_corpus: Optional[Tuple[int, Counter[str]]],
364418 archive_corpus: Optional[Tuple[int, Counter[str]]],
......@@ -384,7 +438,7 @@ def build_markdown(
384438 meta_all_names.update(m.aliases)
385439 non_render_tools = {"Note", "Underlay"}
386440
387 # Detect drift: tools in eval.rs / scene3d.rs not in TOOL_METADATA
441 # Detect drift: tools in eval/ or scene3d/ not in TOOL_METADATA
388442 uncategorized = sorted(live_engine_tools - meta_all_names)
389443 for name in uncategorized:
390444 warnings.append(f"Uncategorized tool found in engine source: {name}")
......@@ -392,7 +446,7 @@ def build_markdown(
392446 # Detect stale metadata: tools in TOOL_METADATA no longer in engine source (excluding Note/Underlay)
393447 stale = sorted((set(meta_by_name.keys()) - non_render_tools) - live_engine_tools)
394448 for name in stale:
395 warnings.append(f"Stale tool in metadata not found in eval.rs/scene3d.rs: {name}")
449 warnings.append(f"Stale tool in metadata not found in {EVAL_DIR_LABEL} or {SCENE3D_DIR_LABEL}: {name}")
396450
397451 # Detect uncategorized modifiers
398452 known_mod_classes: Set[str] = set()
......@@ -402,6 +456,20 @@ def build_markdown(
402456 for name in uncategorized_mods:
403457 warnings.append(f"Uncategorized modifier found in comp.rs: {name}")
404458
459 # is_supported_tool() must accept exactly the metadata classes (plus modifier classes).
460 for name in sorted(comp_supported - meta_all_names - known_mod_classes):
461 warnings.append(f"is_supported_tool accepts {name} but TOOL_METADATA has no entry")
462 for name in sorted(((live_engine_tools | non_render_tools) & set(meta_by_name)) - comp_supported):
463 warnings.append(f"is_supported_tool rejects {name} although the engine evaluates it")
464
465 # Add Tool launcher must offer every user-creatable supported tool and nothing unsupported.
466 for name in sorted(set(meta_by_name) - ADD_TOOL_EXCLUDED - catalog_kinds):
467 warnings.append(f"add_tool.rs TOOL_CATALOG is missing {name}")
468 for name in sorted(catalog_kinds - comp_supported):
469 warnings.append(f"add_tool.rs TOOL_CATALOG lists {name} which is not supported")
470 for name in sorted(catalog_kinds & ADD_TOOL_EXCLUDED):
471 warnings.append(f"add_tool.rs TOOL_CATALOG lists {name} which ADD_TOOL_EXCLUDED omits")
472
405473 all_supported_tools = live_engine_tools | non_render_tools
406474 all_supported_classes = all_supported_tools | impl_modifiers
407475
......@@ -409,8 +477,8 @@ def build_markdown(
409477 lines.append("# Fusion 21.1 Compatibility Matrix")
410478 lines.append("")
411479 lines.append(
412 "Auto-generated from live engine sources (`crates/engine/src/eval.rs`, "
413 "`crates/engine/src/scene3d.rs`, `crates/model/src/comp.rs`) and real Fusion `.comp` corpora "
480 f"Auto-generated from live engine sources (`{EVAL_DIR_LABEL}`, "
481 f"`{SCENE3D_DIR_LABEL}`, `crates/model/src/comp.rs`) and real Fusion `.comp` corpora "
414482 "via `python3 scripts/gen_compatibility.py`."
415483 )
416484 lines.append("")
......@@ -427,7 +495,7 @@ def build_markdown(
427495 lines.append("| --- | --- |")
428496 lines.append(
429497 f"| **Supported Flow Tools** | **{len(all_supported_tools)}** "
430 f"({len(eval_tools)} 2D/Fuse/utility in `eval.rs`, {len(scene3d_tools - eval_tools)} 3D scene nodes in `scene3d.rs`, 2 Flow annotations) |"
498 f"({len(eval_tools)} 2D/Fuse/utility in `{EVAL_DIR_LABEL}`, {len(scene3d_tools - eval_tools)} 3D scene nodes in `{SCENE3D_DIR_LABEL}`, 2 Flow annotations) |"
431499 )
432500 lines.append(
433501 f"| **Modifiers & Animation** | **{len(MODIFIER_METADATA)}** systems "
......@@ -470,7 +538,7 @@ def build_markdown(
470538 lines.append("## Uncategorized (New in Engine)")
471539 lines.append("")
472540 lines.append("> [!WARNING]")
473 lines.append("> The following tools were found in `eval.rs` / `scene3d.rs` but are not yet listed in `TOOL_METADATA` in `scripts/gen_compatibility.py`.")
541 lines.append(f"> The following tools were found in `{EVAL_DIR_LABEL}` / `{SCENE3D_DIR_LABEL}` but are not yet listed in `TOOL_METADATA` in `scripts/gen_compatibility.py`.")
474542 lines.append("")
475543 lines.append(f"| Tool | {usage_col} |")
476544 lines.append("| --- | --- |")
......@@ -551,7 +619,7 @@ def main() -> int:
551619 parser.add_argument("-o", "--output", type=Path, default=DEFAULT_OUTPUT, help="Output markdown path.")
552620 parser.add_argument("--active-dir", type=Path, default=ACTIVE_CORPUS_DIR, help="Active Fusion .comp directory.")
553621 parser.add_argument("--archive-dir", type=Path, default=ARCHIVE_CORPUS_DIR, help="Archive Fusion .comp directory.")
554 parser.add_argument("--strict", action="store_true", help="Exit non-zero if uncategorized or stale tools are found.")
622 parser.add_argument("--strict", action="store_true", help="Exit non-zero on any registry drift: engine vs TOOL_METADATA vs is_supported_tool vs add_tool.rs.")
555623 args = parser.parse_args()
556624
557625 eval_tools = parse_eval_rs(EVAL_RS)
......@@ -566,6 +634,8 @@ def main() -> int:
566634 eval_tools=eval_tools,
567635 scene3d_tools=scene3d_tools,
568636 impl_modifiers=impl_modifiers,
637 comp_supported=parse_is_supported_tool(COMP_RS),
638 catalog_kinds=parse_add_tool_catalog(ADD_TOOL_RS),
569639 probe_suites=probe_suites,
570640 active_corpus=active_corpus,
571641 archive_corpus=archive_corpus,