Just a sandbox post, please ignore.
The code iterates through different combinations of jot, baselineskip, lineskip, and create a normal gather
environment and a array
environment. Then for each item use zref-savepos
to measure the vertical distance between the 2 lines, then report the result.
Replace \pretty
with \tl_show
if you want. (will print the log on the terminal)

The log: (there are 2 wrong entries unfortunately...)

%! TEX program = lualatex
\documentclass{article}
\usepackage{amsmath}
\usepackage{prettytok}
\usepackage{zref-savepos}
\setlength{\fboxsep}{0pt}
\setlength{\fboxrule}{.1pt}
\errorcontextlines=100
\begin{document}
\ExplSyntaxOn
\def \__index {0}
\clist_map_variable:nNn {
0sp/0sp/0sp,
0sp/0sp/5sp,
0sp/5sp/0sp,
0sp/5sp/5sp,
5sp/0sp/0sp,
5sp/0sp/5sp,
5sp/5sp/0sp,
5sp/5sp/5sp,
0sp/0sp/1cm,
0sp/1.1cm/0sp,
0sp/1.1cm/1cm,
1.2cm/0sp/0sp,
1.2cm/0sp/1cm,
1.2cm/1.1cm/0sp,
1.2cm/1.1cm/1cm
} \__a {
\edef\__index{\int_eval:n {\__index+1}}
\def \__match #1/#2/#3/ {
\def\jot{#1}
\baselineskip=#2\relax
\lineskip=#3\relax
}
\expandafter \__match \__a/
\begingroup
%\savebox\strutbox {}
\begin{gather*}
a=b \zsavepos{a\__index} \\
\dfrac22 \zsavepos{b\__index}
\end{gather*}
\endgroup
\dim_compare:nNnTF {\baselineskip} = {0sp} {
\edef\customskip{\dim_to_decimal_in_sp:n{\dimexpr\lineskip+\jot\relax} sp}
} {
\let\customskip\jot
}
\[
\renewcommand\arraystretch{0}
%\baselineskip=\baselineskipx\relax
\edef\oldbaselineskip{\the\baselineskip}
\edef\oldlineskip{\the\lineskip}
\begin{array}{c}
%\baselineskip=\normalbaselineskip
a=b \zsavepos{c\__index} \copy\strutbox \rule[\dimexpr-0.3\dimexpr\oldbaselineskip\relax\relax]{0pt}{\dimexpr\oldbaselineskip\relax} \\[0pt] \\[\customskip] \\[0pt]
\dfrac22 \zsavepos{d\__index} \copy\strutbox \rule[\dimexpr-0.3\dimexpr\oldbaselineskip\relax\relax]{0pt}{\dimexpr\oldbaselineskip\relax}
\end{array}
\]
\pretty:x{
case~\__index.~
\int_eval:n{\zposy{a\__index} - \zposy{b\__index}}sp
=
\int_eval:n{\zposy{c\__index} - \zposy{d\__index}}sp
}
\int_compare:nNnTF
{\zposy{a\__index} - \zposy{b\__index}}
=
{\zposy{c\__index} - \zposy{d\__index}}
{
}
{
\pretty:n{ERROR!}
}
}
\ExplSyntaxOff
\end{document}
\
~ <bt><bt>\<bt><bt>;\\
~ <bt>bt>\\<bt><bt>;\
~ <bt><bt>\ <bt><bt>. Here <bt>=`.bt
s has a left angle missing. (thanks for the pointer.)