| author | |
| committer | |
| log | d5f970670c55ec4beb4f3c7c3edfd64bffcdedaa |
| tree | 883fb7aee0cfbd8627e279389eca38e3a7235844 |
| parent | d702f0abe89e0236e840be2dedb07dd5010e5669 |
| signature | Signed by SSH key SHA256:52mNGHRsVFBDED9IAX5pe+LRWUefqTbxEReunq21QvU |
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 | 129 | ToolEntry { kind: "sEllipse", display: "Shape Ellipse", aliases: "sellipse vector circle oval", category: ToolCategory::Shape2D, is_generator: true }, |
| 130 | 130 | ToolEntry { kind: "sRectangle", display: "Shape Rectangle", aliases: "srect vector box rounded", category: ToolCategory::Shape2D, is_generator: true }, |
| 131 | 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 | 133 | ToolEntry { kind: "sMerge", display: "Shape Merge", aliases: "smerge vector combine", category: ToolCategory::Shape2D, is_generator: false }, |
| 134 | 134 | ToolEntry { kind: "sTransform", display: "Shape Transform", aliases: "stransform vector move scale rotate", category: ToolCategory::Shape2D, is_generator: false }, |
| 135 | 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 | 482 | "TimeStretcher", "TimeSpeed", |
| 483 | 483 | "Paint", "PaintMask", "WandMask", "BitmapMask", |
| 484 | 484 | "Drip", "Dent", "DaySky", "GridWarp", "PerspectivePositioner", |
| 485 | "sRender", "sEllipse", "sRectangle", "sNGon", "sBoolean", "sTransform", "sMerge", "sOutline", "sGrid", | |
| 486 | "MtlBlinn", "MtlPhong", "MtlCookTorrance", "MtlWard", | |
| 485 | "sRender", "sEllipse", "sRectangle", "sNGon", "sBoolean", "sTransform", "sOutline", "sGrid", | |
| 486 | "MtlBlinn", "MtlPhong", "MtlCookTorrance", | |
| 487 | 487 | "LightPoint", "LightSpot", "LightDirectional", "LightAmbient", |
| 488 | 488 | "Cube3D", "SurfaceFBXMesh", "Custom", |
| 489 | 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 | 169 | // Paint & Masks |
| 170 | 170 | "Paint", "PaintMask", "EllipseMask", "RectangleMask", "BitmapMask", "WandMask", |
| 171 | 171 | // Vector Shapes |
| 172 | "sRender", "sEllipse", "sRectangle", "sNGon", "sBoolean", "sTransform", "sMerge", "sOutline", "sGrid", | |
| 172 | "sRender", "sEllipse", "sRectangle", "sNGon", "sBoolean", "sTransform", "sOutline", "sGrid", | |
| 173 | 173 | // 3D Scene, Lights & Materials |
| 174 | 174 | "Camera3D", "Shape3D", "Cube3D", "SurfaceFBXMesh", |
| 175 | 175 | "LightPoint", "LightSpot", "LightDirectional", "LightAmbient", |
| 176 | "MtlBlinn", "MtlPhong", "MtlCookTorrance", "MtlWard", | |
| 176 | "MtlBlinn", "MtlPhong", "MtlCookTorrance", | |
| 177 | 177 | ]; |
| 178 | 178 | |
| 179 | 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 | 528 | boolean("Reverse", "Reverse", false), |
| 529 | 529 | ] }, |
| 530 | 530 | "Saver" => const { &[ |
| 531 | boolean("CreateDir", "Create Dir", true), | |
| 532 | 531 | boolean("SetSequenceStart", "Seq Start", false), |
| 533 | 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 | 534 | "TimeStretcher" => const { &[ |
| 538 | 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 | 664 | flt("YSize", "Y Size", 0.0, 5.0, 1.0), |
| 668 | 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 | 667 | "sOutline" => const { &[ |
| 674 | 668 | flt("Thickness", "Thickness", 0.0, 0.2, 0.01), |
| 675 | 669 | int_enum("JoinStyle", "Join", JOIN_STYLES, 2), |
| ... | ... | @@ -788,13 +782,6 @@ pub fn schema_for_kind(kind: &str) -> &'static [ParamSpec] { |
| 788 | 782 | flt("Specular.Intensity", "Spec Int", 0.0, 4.0, 1.0), |
| 789 | 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 | 964 | _ASPECT_CASES = ( |
| 965 | 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 | 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 | 968 | ("EllipseMask_Circle", 'Merge { Inputs = { Background = Input { SourceOp = "BlackBG", Source = "Output", }, Foreground = Input { SourceOp = "WhiteFG", Source = "Output", }, EffectMask = Input { SourceOp = "@MASK@", Source = "Mask", }, }, }', |
| 969 | 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 | 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 | 201 | ) |
| 202 | 202 | |
| 203 | 203 | |
| 204 | def _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 | ||
| 204 | 209 | def bisect_failing_graph( |
| 205 | 210 | graph: FuzzGraph, |
| 206 | 211 | threshold_pct: float, |
| ... | ... | @@ -218,7 +223,7 @@ def bisect_failing_graph( |
| 218 | 223 | st_comp, st_prefix, [graph.eval_frame], {graph.eval_frame: f"seed_{seed}"}, render_gt=render_gt, timeout_sec=timeout_sec |
| 219 | 224 | )[graph.eval_frame] |
| 220 | 225 | orig_mae = st_res["mae_pct"] |
| 221 | if orig_mae <= threshold_pct: | |
| 226 | if not _exceeds_threshold(st_res, threshold_pct): | |
| 222 | 227 | return { |
| 223 | 228 | "seed": seed, |
| 224 | 229 | "reproduced_standalone": False, |
| ... | ... | @@ -238,7 +243,7 @@ def bisect_failing_graph( |
| 238 | 243 | prefix_items, f"bisect_s{seed}_prefixes", render_gt=render_gt, timeout_sec=timeout_sec |
| 239 | 244 | ) |
| 240 | 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 | 247 | cur = graph.prune_to(nd.name) |
| 243 | 248 | print(f" [prefix] trimmed sink to {nd.name} ({len(cur.nodes)} nodes, MAE={pref_res[idx]['mae_pct']:.2f}%)", flush=True) |
| 244 | 249 | break |
| ... | ... | @@ -275,7 +280,7 @@ def bisect_failing_graph( |
| 275 | 280 | failing: List[Tuple[Tuple[int, int, int], str, FuzzGraph, float]] = [] |
| 276 | 281 | for idx, (desc, _act, cg) in enumerate(candidates): |
| 277 | 282 | m = cand_res[idx] |
| 278 | if m["mae_pct"] > threshold_pct: | |
| 283 | if _exceeds_threshold(m, threshold_pct): | |
| 279 | 284 | mask_cnt = sum(1 for x in cg.nodes if x.mask is not None) |
| 280 | 285 | spline_cnt = sum( |
| 281 | 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 | 333 | elif mae_pct > threshold_pct: |
| 329 | 334 | status = "FAIL" |
| 330 | 335 | elif a_pct > threshold_pct: |
| 331 | status = "PASS (ALPHA DIFF)" | |
| 336 | status = "FAIL (ALPHA)" | |
| 332 | 337 | else: |
| 333 | 338 | status = "PASS" |
| 334 | 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 | 22 | SCENE3D_RS = REPO_ROOT / "crates" / "engine" / "src" / "scene3d" / "collect.rs" |
| 23 | 23 | COMP_RS = REPO_ROOT / "crates" / "model" / "src" / "comp.rs" |
| 24 | 24 | ADD_TOOL_RS = REPO_ROOT / "crates" / "app" / "src" / "add_tool.rs" |
| 25 | SCHEMAS_RS = REPO_ROOT / "crates" / "app" / "src" / "inspector" / "schemas.rs" | |
| 25 | 26 | PROBES_PY = REPO_ROOT / "scripts" / "fusion_probes.py" |
| 26 | 27 | DEFAULT_OUTPUT = REPO_ROOT / "compatibility.md" |
| 27 | 28 | |
| ... | ... | @@ -195,7 +196,7 @@ TOOL_METADATA: Sequence[ToolMeta] = ( |
| 195 | 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 | 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 | 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 | 200 | ToolMeta("Fuse.Switch", "Time, Routing & Utility", "Suite comps", "0.0%", "Fuse variant of `Switch` routing `Input1`..`InputN` by `Which`."), |
| 200 | 201 | ToolMeta("PipeRouter", "Time, Routing & Utility", "Suite comps", "0.0%", "Zero-cost graph routing node."), |
| 201 | 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 | 312 | return set(re.findall(r'ToolEntry\s*\{\s*kind:\s*"([^"]+)"', path.read_text(encoding="utf-8"))) |
| 312 | 313 | |
| 313 | 314 | |
| 315 | def 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 | ||
| 314 | 324 | def parse_comp_rs_modifiers(path: Path) -> Tuple[List[str], Set[str]]: |
| 315 | 325 | """Return (declared MODIFIER_TYPES, implemented modifier classes in parse_tools_table).""" |
| 316 | 326 | text = path.read_text(encoding="utf-8") |
| ... | ... | @@ -413,6 +423,7 @@ def build_markdown( |
| 413 | 423 | impl_modifiers: Set[str], |
| 414 | 424 | comp_supported: Set[str], |
| 415 | 425 | catalog_kinds: Set[str], |
| 426 | curated_kinds: Set[str], | |
| 416 | 427 | probe_suites: Set[str], |
| 417 | 428 | active_corpus: Optional[Tuple[int, Counter[str]]], |
| 418 | 429 | archive_corpus: Optional[Tuple[int, Counter[str]]], |
| ... | ... | @@ -470,6 +481,12 @@ def build_markdown( |
| 470 | 481 | for name in sorted(catalog_kinds & ADD_TOOL_EXCLUDED): |
| 471 | 482 | warnings.append(f"add_tool.rs TOOL_CATALOG lists {name} which ADD_TOOL_EXCLUDED omits") |
| 472 | 483 | |
| 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 | 490 | all_supported_tools = live_engine_tools | non_render_tools |
| 474 | 491 | all_supported_classes = all_supported_tools | impl_modifiers |
| 475 | 492 | |
| ... | ... | @@ -619,7 +636,8 @@ def main() -> int: |
| 619 | 636 | parser.add_argument("-o", "--output", type=Path, default=DEFAULT_OUTPUT, help="Output markdown path.") |
| 620 | 637 | parser.add_argument("--active-dir", type=Path, default=ACTIVE_CORPUS_DIR, help="Active Fusion .comp directory.") |
| 621 | 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 | 641 | args = parser.parse_args() |
| 624 | 642 | |
| 625 | 643 | eval_tools = parse_eval_rs(EVAL_RS) |
| ... | ... | @@ -636,13 +654,23 @@ def main() -> int: |
| 636 | 654 | impl_modifiers=impl_modifiers, |
| 637 | 655 | comp_supported=parse_is_supported_tool(COMP_RS), |
| 638 | 656 | catalog_kinds=parse_add_tool_catalog(ADD_TOOL_RS), |
| 657 | curated_kinds=parse_curated_tool_kinds(SCHEMAS_RS), | |
| 639 | 658 | probe_suites=probe_suites, |
| 640 | 659 | active_corpus=active_corpus, |
| 641 | 660 | archive_corpus=archive_corpus, |
| 642 | 661 | ) |
| 643 | 662 | |
| 644 | args.output.write_text(md, encoding="utf-8") | |
| 645 | print(f"Wrote {args.output} ({len(md.splitlines())} lines)") | |
| 663 | out_of_date = False | |
| 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 | 674 | if active_corpus is not None: |
| 647 | 675 | print(f" Active corpus: {active_corpus[0]} comps, {sum(active_corpus[1].values()):,} entries") |
| 648 | 676 | else: |
| ... | ... | @@ -655,7 +683,7 @@ def main() -> int: |
| 655 | 683 | for w in warnings: |
| 656 | 684 | print(f"WARNING: {w}", file=sys.stderr) |
| 657 | 685 | |
| 658 | if args.strict and warnings: | |
| 686 | if (args.strict and warnings) or out_of_date: | |
| 659 | 687 | return 1 |
| 660 | 688 | return 0 |
| 661 | 689 |