Static shape analysis for MATLAB. Finds matrix dimension mismatches before your code runs. No MATLAB license needed.
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)
The shapes follow into the function.
data is 10x3, weights is 4x1.
Line 2 is where it breaks.
Diagnostics appear as you type. Hover any variable to see its shape.
Arithmetic, concatenation, indexing, struct fields, cell arrays, classdef objects, cross-file
function calls, nested functions, closures, nargin/nargout,
varargin. Dimensions can be symbolic:
zeros(n+1, 2*m) tracks as matrix[(n+1) x (2*m)],
and those expressions carry through the whole program. Loop index bounds are tracked relationally,
so for i=1:n-1; A(i+1) won't false-positive.
--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 the whole team runs the same checks.
--coder flags constructs that MATLAB Coder can't compile.
Output is deterministic.
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 whatever file you have 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 everyone'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. Zero crashes across the full corpus.
The repo also includes a MATLAB-to-Python transpiler. It uses the shape analysis to pick
* vs np.dot, handles 204 builtins,
and converts 1-based indexing to 0-based with constant folding. Work in progress.