verify-patch-sanity.py validates every active recipe .patch has internally- consistent hunk line counts — catching the 'malformed patch at line N' failure at commit/CI/preflight time instead of hours into a cook. This cycle hit that class three times (qtwaylandscanner, sddm, xwayland), each only discovered when cookbook tried to apply the patch. Running it across the repo found 29 latent malformed patches (validated against GNU patch: e.g. relibc/P3-sysv-ipc reproduces 'malformed patch at line 22'). They were harmless only because they sit in vendored recipes (baked, not re- applied) — but would fail on any version-bump re-derivation. --fix recounts the hunk headers (body untouched) and repaired all 29. Wired into build-preflight.sh (Phase 1.0D) and redbear-ci.yml, with a unit test (test-patch-sanity.sh). Skips archived/legacy trees and unvalidatable formats (empty placeholders, bare-@@ git hunks).
Standalone Transform Dialect Interpreter
This is an example of using the Transform dialect interpreter functionality standalone, that is, outside of the regular pass pipeline. The example is a
binary capable of processing MLIR source files similar to mlir-opt and other
optimizer drivers, with the entire transformation process driven by a Transform
dialect script. This script can be embedded into the source file or provided in
a separate MLIR source file.
Either the input module or the transform module must contain a top-level symbol
named __transform_main, which is used as the entry point to the transformation
script.
mlir-transform-opt payload_with_embedded_transform.mlir
mlir-transform-opt payload.mlir -transform=transform.mlir
The name of the entry point can be overridden using command-line options.
mlir-transform-opt payload-mlir -transform-entry-point=another_entry_point
Transform scripts can reference symbols defined in other source files, called libraries, which can be supplied to the binary through command-line options. Libraries will be embedded into the main transformation module by the tool and the interpreter will process everything as a single module. A debug option is available to see the contents of the transform module before it goes into the interpreter.
mlir-transform-opt payload.mlir -transform=transform.mlir \
-transform-library=external_definitions_1.mlir \
-transform-library=external_definitions_2.mlir \
-dump-library-module
Check out the Transform dialect tutorial as well as documentation to learn more about the dialect.