authoravatarclover caruso<git@paperclover.net>2026-11-30 21:06:08-08:00
committeravatarclover caruso<git@paperclover.net>2026-11-30 21:16:22-08:00
logd5f970670c55ec4beb4f3c7c3edfd64bffcdedaa
tree883fb7aee0cfbd8627e279389eca38e3a7235844
parentd702f0abe89e0236e840be2dedb07dd5010e5669
signature Signed by SSH key SHA256:52mNGHRsVFBDED9IAX5pe+LRWUefqTbxEReunq21QvU

Fix schemas/add_tool mismatches, harden gen_compatibility --strict, fix matrix_aspect and alpha gating


6 files changed, 48 insertions(+), 28 deletions(-)

crates/app/src/add_tool.rs+1-1
...@@ -129,7 +129,7 @@ pub const TOOL_CATALOG: &[ToolEntry] = &[...@@ -129,7 +129,7 @@ pub const TOOL_CATALOG: &[ToolEntry] = &[
129 ToolEntry { kind: "sEllipse", display: "Shape Ellipse", aliases: "sellipse vector circle oval", category: ToolCategory::Shape2D, is_generator: true },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 },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 },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 },132 ToolEntry { kind: "sGrid", display: "Shape Grid", aliases: "sgrid vector cells array", category: ToolCategory::Shape2D, is_generator: false },
133 ToolEntry { kind: "sMerge", display: "Shape Merge", aliases: "smerge vector combine", category: ToolCategory::Shape2D, is_generator: false },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 },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 },135 ToolEntry { kind: "sBoolean", display: "Shape Boolean", aliases: "sbool vector union subtract intersect xor", category: ToolCategory::Shape2D, is_generator: false },
crates/app/src/inspector/mod.rs+2-2
...@@ -482,8 +482,8 @@ mod tests {...@@ -482,8 +482,8 @@ mod tests {
482 "TimeStretcher", "TimeSpeed",482 "TimeStretcher", "TimeSpeed",
483 "Paint", "PaintMask", "WandMask", "BitmapMask",483 "Paint", "PaintMask", "WandMask", "BitmapMask",
484 "Drip", "Dent", "DaySky", "GridWarp", "PerspectivePositioner",484 "Drip", "Dent", "DaySky", "GridWarp", "PerspectivePositioner",
485 "sRender", "sEllipse", "sRectangle", "sNGon", "sBoolean", "sTransform", "sMerge", "sOutline", "sGrid",485 "sRender", "sEllipse", "sRectangle", "sNGon", "sBoolean", "sTransform", "sOutline", "sGrid",
486 "MtlBlinn", "MtlPhong", "MtlCookTorrance", "MtlWard",486 "MtlBlinn", "MtlPhong", "MtlCookTorrance",
487 "LightPoint", "LightSpot", "LightDirectional", "LightAmbient",487 "LightPoint", "LightSpot", "LightDirectional", "LightAmbient",
488 "Cube3D", "SurfaceFBXMesh", "Custom",488 "Cube3D", "SurfaceFBXMesh", "Custom",
489 "ErodeDilate", "DirectionalBlur", "VariBlur", "Sharpen", "Shadow",489 "ErodeDilate", "DirectionalBlur", "VariBlur", "Sharpen", "Shadow",
crates/app/src/inspector/schemas.rs+2-15
...@@ -169,11 +169,11 @@ pub const CURATED_TOOL_KINDS: &[&str] = &[...@@ -169,11 +169,11 @@ pub const CURATED_TOOL_KINDS: &[&str] = &[
169 // Paint & Masks169 // Paint & Masks
170 "Paint", "PaintMask", "EllipseMask", "RectangleMask", "BitmapMask", "WandMask",170 "Paint", "PaintMask", "EllipseMask", "RectangleMask", "BitmapMask", "WandMask",
171 // Vector Shapes171 // Vector Shapes
172 "sRender", "sEllipse", "sRectangle", "sNGon", "sBoolean", "sTransform", "sMerge", "sOutline", "sGrid",172 "sRender", "sEllipse", "sRectangle", "sNGon", "sBoolean", "sTransform", "sOutline", "sGrid",
173 // 3D Scene, Lights & Materials173 // 3D Scene, Lights & Materials
174 "Camera3D", "Shape3D", "Cube3D", "SurfaceFBXMesh",174 "Camera3D", "Shape3D", "Cube3D", "SurfaceFBXMesh",
175 "LightPoint", "LightSpot", "LightDirectional", "LightAmbient",175 "LightPoint", "LightSpot", "LightDirectional", "LightAmbient",
176 "MtlBlinn", "MtlPhong", "MtlCookTorrance", "MtlWard",176 "MtlBlinn", "MtlPhong", "MtlCookTorrance",
177];177];
178178
179/// Curated Fusion 21.1 parameter schemas for major compositor tools.179/// Curated Fusion 21.1 parameter schemas for major compositor tools.
...@@ -528,11 +528,8 @@ pub fn schema_for_kind(kind: &str) -> &'static [ParamSpec] {...@@ -528,11 +528,8 @@ pub fn schema_for_kind(kind: &str) -> &'static [ParamSpec] {
528 boolean("Reverse", "Reverse", false),528 boolean("Reverse", "Reverse", false),
529 ] },529 ] },
530 "Saver" => const { &[530 "Saver" => const { &[
531 boolean("CreateDir", "Create Dir", true),
532 boolean("SetSequenceStart", "Seq Start", false),531 boolean("SetSequenceStart", "Seq Start", false),
533 flt("SequenceStartFrame", "Start Frame", 0.0, 10000.0, 0.0),532 flt("SequenceStartFrame", "Start Frame", 0.0, 10000.0, 0.0),
534 boolean("ProcessWhenBlendIs00", "Proc Blend 0", false),
535 flt("Blend", "Blend", 0.0, 1.0, 1.0),
536 ] },533 ] },
537 "TimeStretcher" => const { &[534 "TimeStretcher" => const { &[
538 flt("SourceTime", "Source Time", 0.0, 10000.0, 0.0),535 flt("SourceTime", "Source Time", 0.0, 10000.0, 0.0),
...@@ -667,9 +664,6 @@ pub fn schema_for_kind(kind: &str) -> &'static [ParamSpec] {...@@ -667,9 +664,6 @@ pub fn schema_for_kind(kind: &str) -> &'static [ParamSpec] {
667 flt("YSize", "Y Size", 0.0, 5.0, 1.0),664 flt("YSize", "Y Size", 0.0, 5.0, 1.0),
668 flt("ZRotation", "Rotation", -360.0, 360.0, 0.0),665 flt("ZRotation", "Rotation", -360.0, 360.0, 0.0),
669 ] },666 ] },
670 "sMerge" => const { &[
671 flt("Blend", "Blend", 0.0, 1.0, 1.0),
672 ] },
673 "sOutline" => const { &[667 "sOutline" => const { &[
674 flt("Thickness", "Thickness", 0.0, 0.2, 0.01),668 flt("Thickness", "Thickness", 0.0, 0.2, 0.01),
675 int_enum("JoinStyle", "Join", JOIN_STYLES, 2),669 int_enum("JoinStyle", "Join", JOIN_STYLES, 2),
...@@ -788,13 +782,6 @@ pub fn schema_for_kind(kind: &str) -> &'static [ParamSpec] {...@@ -788,13 +782,6 @@ pub fn schema_for_kind(kind: &str) -> &'static [ParamSpec] {
788 flt("Specular.Intensity", "Spec Int", 0.0, 4.0, 1.0),782 flt("Specular.Intensity", "Spec Int", 0.0, 4.0, 1.0),
789 flt("Specular.Roughness", "Roughness", 0.05, 1.0, 0.6),783 flt("Specular.Roughness", "Roughness", 0.05, 1.0, 0.6),
790 ] },784 ] },
791 "MtlWard" => const { &[
792 rgba("Diffuse", "Diffuse", "Diffuse.Color.Red", "Diffuse.Color.Green", "Diffuse.Color.Blue", Some("Diffuse.Opacity"), [1.0, 1.0, 1.0, 1.0]),
793 rgba("Specular", "Specular", "Specular.Color.Red", "Specular.Color.Green", "Specular.Color.Blue", None, [1.0, 1.0, 1.0, 1.0]),
794 flt("Specular.Intensity", "Spec Int", 0.0, 4.0, 1.0),
795 flt("Specular.SpreadU", "Spread U", 0.01, 1.0, 0.25),
796 flt("Specular.SpreadV", "Spread V", 0.01, 1.0, 0.25),
797 ] },
798 _ => &[],785 _ => &[],
799 }786 }
800}787}
scripts/diff_fuzz/matrix.py+1-1
...@@ -964,7 +964,7 @@ _ASPECT_SETUP = """\t\tBlackBG = Background { Inputs = { Width = Input { Value =...@@ -964,7 +964,7 @@ _ASPECT_SETUP = """\t\tBlackBG = Background { Inputs = { Width = Input { Value =
964_ASPECT_CASES = (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, }, }, }'),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, }, }, }'),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, }, }, }'),967 ("BG_FourCorner", 'Background { Inputs = { Width = Input { Value = @W@, }, Height = Input { Value = @H@, }, Type = Input { Value = FuID { "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", }, }, }',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, }, }, }'),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", }, }, }',970 ("EllipseMask_Rotated", 'Merge { Inputs = { Background = Input { SourceOp = "BlackBG", Source = "Output", }, Foreground = Input { SourceOp = "WhiteFG", Source = "Output", }, EffectMask = Input { SourceOp = "@MASK@", Source = "Mask", }, }, }',
scripts/diff_fuzz/runner.py+9-4
...@@ -201,6 +201,11 @@ def run_multi_graph_batch(...@@ -201,6 +201,11 @@ def run_multi_graph_batch(
201 )201 )
202202
203203
204def _exceeds_threshold(m: Dict[str, Any], threshold_pct: float) -> bool:
205 """Return True if either RGB MAE% or Alpha MAE% exceeds threshold_pct."""
206 return m["mae_pct"] > threshold_pct or m.get("alpha_mae_pct", 0.0) > threshold_pct
207
208
204def bisect_failing_graph(209def bisect_failing_graph(
205 graph: FuzzGraph,210 graph: FuzzGraph,
206 threshold_pct: float,211 threshold_pct: float,
...@@ -218,7 +223,7 @@ def bisect_failing_graph(...@@ -218,7 +223,7 @@ def bisect_failing_graph(
218 st_comp, st_prefix, [graph.eval_frame], {graph.eval_frame: f"seed_{seed}"}, render_gt=render_gt, timeout_sec=timeout_sec223 st_comp, st_prefix, [graph.eval_frame], {graph.eval_frame: f"seed_{seed}"}, render_gt=render_gt, timeout_sec=timeout_sec
219 )[graph.eval_frame]224 )[graph.eval_frame]
220 orig_mae = st_res["mae_pct"]225 orig_mae = st_res["mae_pct"]
221 if orig_mae <= threshold_pct:226 if not _exceeds_threshold(st_res, threshold_pct):
222 return {227 return {
223 "seed": seed,228 "seed": seed,
224 "reproduced_standalone": False,229 "reproduced_standalone": False,
...@@ -238,7 +243,7 @@ def bisect_failing_graph(...@@ -238,7 +243,7 @@ def bisect_failing_graph(
238 prefix_items, f"bisect_s{seed}_prefixes", render_gt=render_gt, timeout_sec=timeout_sec243 prefix_items, f"bisect_s{seed}_prefixes", render_gt=render_gt, timeout_sec=timeout_sec
239 )244 )
240 for idx, nd in enumerate(non_src):245 for idx, nd in enumerate(non_src):
241 if pref_res[idx]["mae_pct"] > threshold_pct:246 if _exceeds_threshold(pref_res[idx], threshold_pct):
242 cur = graph.prune_to(nd.name)247 cur = graph.prune_to(nd.name)
243 print(f" [prefix] trimmed sink to {nd.name} ({len(cur.nodes)} nodes, MAE={pref_res[idx]['mae_pct']:.2f}%)", flush=True)248 print(f" [prefix] trimmed sink to {nd.name} ({len(cur.nodes)} nodes, MAE={pref_res[idx]['mae_pct']:.2f}%)", flush=True)
244 break249 break
...@@ -275,7 +280,7 @@ def bisect_failing_graph(...@@ -275,7 +280,7 @@ def bisect_failing_graph(
275 failing: List[Tuple[Tuple[int, int, int], str, FuzzGraph, float]] = []280 failing: List[Tuple[Tuple[int, int, int], str, FuzzGraph, float]] = []
276 for idx, (desc, _act, cg) in enumerate(candidates):281 for idx, (desc, _act, cg) in enumerate(candidates):
277 m = cand_res[idx]282 m = cand_res[idx]
278 if m["mae_pct"] > threshold_pct:283 if _exceeds_threshold(m, threshold_pct):
279 mask_cnt = sum(1 for x in cg.nodes if x.mask is not None)284 mask_cnt = sum(1 for x in cg.nodes if x.mask is not None)
280 spline_cnt = sum(285 spline_cnt = sum(
281 1 for x in cg.nodes for v in x.params.values() if isinstance(v, SplineParam)286 1 for x in cg.nodes for v in x.params.values() if isinstance(v, SplineParam)
...@@ -328,7 +333,7 @@ def print_table(title: str, rows: List[Dict[str, Any]], threshold_pct: float) ->...@@ -328,7 +333,7 @@ def print_table(title: str, rows: List[Dict[str, Any]], threshold_pct: float) ->
328 elif mae_pct > threshold_pct:333 elif mae_pct > threshold_pct:
329 status = "FAIL"334 status = "FAIL"
330 elif a_pct > threshold_pct:335 elif a_pct > threshold_pct:
331 status = "PASS (ALPHA DIFF)"336 status = "FAIL (ALPHA)"
332 else:337 else:
333 status = "PASS"338 status = "PASS"
334 print(f" {label:<44s} | {mae_pct:6.2f}% | {a_pct:6.2f}% | {mae:6.2f} | {rmse:6.2f} | {status}")339 print(f" {label:<44s} | {mae_pct:6.2f}% | {a_pct:6.2f}% | {mae:6.2f} | {rmse:6.2f} | {status}")
scripts/gen_compatibility.py+33-5
...@@ -22,6 +22,7 @@ SCENE3D_DIR_LABEL = "crates/engine/src/scene3d/"...@@ -22,6 +22,7 @@ SCENE3D_DIR_LABEL = "crates/engine/src/scene3d/"
22SCENE3D_RS = REPO_ROOT / "crates" / "engine" / "src" / "scene3d" / "collect.rs"22SCENE3D_RS = REPO_ROOT / "crates" / "engine" / "src" / "scene3d" / "collect.rs"
23COMP_RS = REPO_ROOT / "crates" / "model" / "src" / "comp.rs"23COMP_RS = REPO_ROOT / "crates" / "model" / "src" / "comp.rs"
24ADD_TOOL_RS = REPO_ROOT / "crates" / "app" / "src" / "add_tool.rs"24ADD_TOOL_RS = REPO_ROOT / "crates" / "app" / "src" / "add_tool.rs"
25SCHEMAS_RS = REPO_ROOT / "crates" / "app" / "src" / "inspector" / "schemas.rs"
25PROBES_PY = REPO_ROOT / "scripts" / "fusion_probes.py"26PROBES_PY = REPO_ROOT / "scripts" / "fusion_probes.py"
26DEFAULT_OUTPUT = REPO_ROOT / "compatibility.md"27DEFAULT_OUTPUT = REPO_ROOT / "compatibility.md"
2728
...@@ -195,7 +196,7 @@ TOOL_METADATA: Sequence[ToolMeta] = (...@@ -195,7 +196,7 @@ TOOL_METADATA: Sequence[ToolMeta] = (
195 ToolMeta("Dimension.CopyAux", "Time, Routing & Utility", "Unit tests", "Visual*", "Passes the RGBA `Input` through unchanged in both `Mode`s. *The engine carries no auxiliary planes (`Z`, `Coverage`, `ObjectID`, `Vector`, ...), so `Channel` is ignored and aux-to-color output is not produced."),196 ToolMeta("Dimension.CopyAux", "Time, Routing & Utility", "Unit tests", "Visual*", "Passes the RGBA `Input` through unchanged in both `Mode`s. *The engine carries no auxiliary planes (`Z`, `Coverage`, `ObjectID`, `Vector`, ...), so `Channel` is ignored and aux-to-color output is not produced."),
196 ToolMeta("TimeStretcher", "Time, Routing & Utility", "Suite comps", "0.0%–0.2%", "Keyframed/expression `SourceTime` remapping with `Nearest` (`0`), `Blend` (`1`), and GPU `OpticalFlow` (`2`) bidirectional warped interpolation."),197 ToolMeta("TimeStretcher", "Time, Routing & Utility", "Suite comps", "0.0%–0.2%", "Keyframed/expression `SourceTime` remapping with `Nearest` (`0`), `Blend` (`1`), and GPU `OpticalFlow` (`2`) bidirectional warped interpolation."),
197 ToolMeta("TimeSpeed", "Time, Routing & Utility", "Suite comps", "0.0%", "Constant/animated `Speed` and `Delay` time remapping."),198 ToolMeta("TimeSpeed", "Time, Routing & Utility", "Suite comps", "0.0%", "Constant/animated `Speed` and `Delay` time remapping."),
198 ToolMeta("Switch", "Time, Routing & Utility", "Suite comps", "0.0%", "Dynamic input routing by `Which` index (`Input1`..`InputN`)."),199 ToolMeta("Switch", "Time, Routing & Utility", "Suite comps", "0.0%", "Dynamic input routing by `Source` index (`Input0`..`InputN`)."),
199 ToolMeta("Fuse.Switch", "Time, Routing & Utility", "Suite comps", "0.0%", "Fuse variant of `Switch` routing `Input1`..`InputN` by `Which`."),200 ToolMeta("Fuse.Switch", "Time, Routing & Utility", "Suite comps", "0.0%", "Fuse variant of `Switch` routing `Input1`..`InputN` by `Which`."),
200 ToolMeta("PipeRouter", "Time, Routing & Utility", "Suite comps", "0.0%", "Zero-cost graph routing node."),201 ToolMeta("PipeRouter", "Time, Routing & Utility", "Suite comps", "0.0%", "Zero-cost graph routing node."),
201 ToolMeta("Fuse.Wireless", "Time, Routing & Utility", "Suite comps", "0.0%", "Wireless link passthrough node."),202 ToolMeta("Fuse.Wireless", "Time, Routing & Utility", "Suite comps", "0.0%", "Wireless link passthrough node."),
...@@ -311,6 +312,15 @@ def parse_add_tool_catalog(path: Path) -> Set[str]:...@@ -311,6 +312,15 @@ def parse_add_tool_catalog(path: Path) -> Set[str]:
311 return set(re.findall(r'ToolEntry\s*\{\s*kind:\s*"([^"]+)"', path.read_text(encoding="utf-8")))312 return set(re.findall(r'ToolEntry\s*\{\s*kind:\s*"([^"]+)"', path.read_text(encoding="utf-8")))
312313
313314
315def parse_curated_tool_kinds(path: Path) -> Set[str]:
316 """Return every tool kind listed in CURATED_TOOL_KINDS of inspector/schemas.rs."""
317 text = path.read_text(encoding="utf-8")
318 m = re.search(r"const CURATED_TOOL_KINDS:\s*&\[&str\]\s*=\s*&\[(.*?)\];", text, re.S)
319 if not m:
320 raise RuntimeError(f"Could not locate CURATED_TOOL_KINDS in {path}")
321 return set(re.findall(r'"([^"]+)"', re.sub(r"//[^\n]*", "", m.group(1))))
322
323
314def parse_comp_rs_modifiers(path: Path) -> Tuple[List[str], Set[str]]:324def parse_comp_rs_modifiers(path: Path) -> Tuple[List[str], Set[str]]:
315 """Return (declared MODIFIER_TYPES, implemented modifier classes in parse_tools_table)."""325 """Return (declared MODIFIER_TYPES, implemented modifier classes in parse_tools_table)."""
316 text = path.read_text(encoding="utf-8")326 text = path.read_text(encoding="utf-8")
...@@ -413,6 +423,7 @@ def build_markdown(...@@ -413,6 +423,7 @@ def build_markdown(
413 impl_modifiers: Set[str],423 impl_modifiers: Set[str],
414 comp_supported: Set[str],424 comp_supported: Set[str],
415 catalog_kinds: Set[str],425 catalog_kinds: Set[str],
426 curated_kinds: Set[str],
416 probe_suites: Set[str],427 probe_suites: Set[str],
417 active_corpus: Optional[Tuple[int, Counter[str]]],428 active_corpus: Optional[Tuple[int, Counter[str]]],
418 archive_corpus: Optional[Tuple[int, Counter[str]]],429 archive_corpus: Optional[Tuple[int, Counter[str]]],
...@@ -470,6 +481,12 @@ def build_markdown(...@@ -470,6 +481,12 @@ def build_markdown(
470 for name in sorted(catalog_kinds & ADD_TOOL_EXCLUDED):481 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")482 warnings.append(f"add_tool.rs TOOL_CATALOG lists {name} which ADD_TOOL_EXCLUDED omits")
472483
484 # Inspector curated schemas must only reference supported tools in TOOL_METADATA.
485 for name in sorted(curated_kinds - comp_supported):
486 warnings.append(f"inspector/schemas.rs CURATED_TOOL_KINDS lists {name} which is not in is_supported_tool()")
487 for name in sorted(curated_kinds - meta_all_names):
488 warnings.append(f"inspector/schemas.rs CURATED_TOOL_KINDS lists {name} which is not in TOOL_METADATA")
489
473 all_supported_tools = live_engine_tools | non_render_tools490 all_supported_tools = live_engine_tools | non_render_tools
474 all_supported_classes = all_supported_tools | impl_modifiers491 all_supported_classes = all_supported_tools | impl_modifiers
475492
...@@ -619,7 +636,8 @@ def main() -> int:...@@ -619,7 +636,8 @@ def main() -> int:
619 parser.add_argument("-o", "--output", type=Path, default=DEFAULT_OUTPUT, help="Output markdown path.")636 parser.add_argument("-o", "--output", type=Path, default=DEFAULT_OUTPUT, help="Output markdown path.")
620 parser.add_argument("--active-dir", type=Path, default=ACTIVE_CORPUS_DIR, help="Active Fusion .comp directory.")637 parser.add_argument("--active-dir", type=Path, default=ACTIVE_CORPUS_DIR, help="Active Fusion .comp directory.")
621 parser.add_argument("--archive-dir", type=Path, default=ARCHIVE_CORPUS_DIR, help="Archive Fusion .comp directory.")638 parser.add_argument("--archive-dir", type=Path, default=ARCHIVE_CORPUS_DIR, help="Archive Fusion .comp directory.")
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.")639 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 vs inspector/schemas.rs.")
640 parser.add_argument("--check", action="store_true", help="Check if compatibility.md is up to date without rewriting it; exit non-zero if out of date.")
623 args = parser.parse_args()641 args = parser.parse_args()
624642
625 eval_tools = parse_eval_rs(EVAL_RS)643 eval_tools = parse_eval_rs(EVAL_RS)
...@@ -636,13 +654,23 @@ def main() -> int:...@@ -636,13 +654,23 @@ def main() -> int:
636 impl_modifiers=impl_modifiers,654 impl_modifiers=impl_modifiers,
637 comp_supported=parse_is_supported_tool(COMP_RS),655 comp_supported=parse_is_supported_tool(COMP_RS),
638 catalog_kinds=parse_add_tool_catalog(ADD_TOOL_RS),656 catalog_kinds=parse_add_tool_catalog(ADD_TOOL_RS),
657 curated_kinds=parse_curated_tool_kinds(SCHEMAS_RS),
639 probe_suites=probe_suites,658 probe_suites=probe_suites,
640 active_corpus=active_corpus,659 active_corpus=active_corpus,
641 archive_corpus=archive_corpus,660 archive_corpus=archive_corpus,
642 )661 )
643662
644 args.output.write_text(md, encoding="utf-8")663 out_of_date = False
645 print(f"Wrote {args.output} ({len(md.splitlines())} lines)")664 if args.check:
665 existing = args.output.read_text(encoding="utf-8") if args.output.exists() else None
666 if existing == md:
667 print(f"{args.output} is up to date ({len(md.splitlines())} lines)")
668 else:
669 out_of_date = True
670 print(f"{args.output} is out of date; run python3 scripts/gen_compatibility.py to update.", file=sys.stderr)
671 else:
672 args.output.write_text(md, encoding="utf-8")
673 print(f"Wrote {args.output} ({len(md.splitlines())} lines)")
646 if active_corpus is not None:674 if active_corpus is not None:
647 print(f" Active corpus: {active_corpus[0]} comps, {sum(active_corpus[1].values()):,} entries")675 print(f" Active corpus: {active_corpus[0]} comps, {sum(active_corpus[1].values()):,} entries")
648 else:676 else:
...@@ -655,7 +683,7 @@ def main() -> int:...@@ -655,7 +683,7 @@ def main() -> int:
655 for w in warnings:683 for w in warnings:
656 print(f"WARNING: {w}", file=sys.stderr)684 print(f"WARNING: {w}", file=sys.stderr)
657685
658 if args.strict and warnings:686 if (args.strict and warnings) or out_of_date:
659 return 1687 return 1
660 return 0688 return 0
661689