Conformal is a free static code analyzer for the MATLAB language. It tracks shapes across functions and files, resolves symbolic dimensions, and reports the exact line where a mismatch originates. Size errors are found deterministically using path-sensitive analysis and relational loop bounds. Conformal does not require a MATLAB license.
function result = process(data, weights)
scaled = data .* weights;
result = scaled' * scaled;
end
A = rand(10, 3);
w = rand(4, 1); % wrong size
R = process(A, w);
W_ELEMENTWISE_MISMATCH line 2:
data .* weights:
matrix[10 x 3] vs matrix[4 x 1]
(in process, called from line 8)
Shapes follow into the function
data dimensions are 10x3 and weights dimensions are 4x1
Line 2 is the location of the bug
The playground runs the Conformal analyzer on a single file in your own browser without needing to install it. Paste in code of your own, or try one of the examples there. Examples were chosen to cover a broad range of applications to show how Conformal can work for any discipline that uses MATLAB. Change variable values in place to see how Conformal reacts to new shapes and dimensions. Note: the playground runs entirely in your browser, so your code is never uploaded and the page cannot read or write files on your computer.
Diagnostics appear as you type. Hover any variable to see its shape.
| Where | What you get |
|---|---|
| VS Code | Squiggles as you type, and variable sizes on hover |
| MATLAB command window | Checks the file open in the editor, without leaving the IDE |
| Terminal | One file, or a whole folder in a single pass |
| A build system | A machine-readable report, so a bad merge fails the build |
Conformal ships as a standalone CLI binary. To use it from MATLAB's command window:
conformal binary for your OS from
GitHub Releases
and put it on your system PATH. It's a single native executable with no dependencies.
>> conformal_check to analyze the file that is currently open in the editor.>> conformal_check('ekf_update.m') to analyze a specific file.
For a team: put both files on a shared drive and add it in each individual's startup.m.
15,085 .m files from 34 public projects, including chebfun (3,435 files), PlatEMO (2,416), MATPOWER (979), NASA's MUSCAT spacecraft toolkit, the KU CReSIS polar radar toolbox, LADAC aircraft dynamics, eeglab, and ecg-kit.
Shapes are inferred over a small lattice and carried across function calls, files, nested
functions, and closures. This allows mismatches deep in a call chain to trace back to where they
were introduced. Struct fields, cell contents, classdef properties, and the
nargin/nargout/varargin
forms are all tracked. Dimensions can stay symbolic throughout the abstract interpretation, so
zeros(n+1, 2*m) is held as matrix[(n+1) x (2*m)]
and the algebraic expression survives the rest of the program instead of collapsing to unknown. Loop
index bounds are tracked relationally, which is why
for i=1:n-1; A(i+1) raises no false alarm. The analysis is
path-sensitive, so shapes that only differ on a branch that can't run stay silent.
--format sarif produces SARIF 2.1.0 with SHA-256 file hashes for
traceability. --batch dir/ sweeps a directory in one process.
.conformal.json locks per-repo settings so a team can run the
same checks. --coder flags constructs that MATLAB Coder can't
compile. --fixpoint switches to widening-based iteration
to analyze loops beyond a single-pass.