Matrix Calculus utilizes function composition of, at least phenomenologically, several different types. While I've encountered each before in different subjects, synthesizing them all into the same subject produces some friction, and I am not sure how much asymmetry in notation is only surface-deep and how much reflects truly different mathematical concepts of function composition. Some (apparent) truths I've observed are...
The composition (matrix multiplication) of $1$ by $1$ matrices does not appear to be the same as the composition of their scalar elements, despite $1$ by $1$ matrices ordinarily being viewed as isomorphic to scalars, i.e., it is not correct to write $$d(x^3) = 3x^2 dx = 3x^2 \circ dx = 3(dx)^2$$ where $x$ is a scalar.
"Concrete" linear operators such as the trace do appear to compose in the way scalars don't, i.e., it is correct to write (up to the fact that I can't actually find the correct notion to write it)
$$d(\operatorname{tr} (X)) = \operatorname{tr}(\cdot) dX = \operatorname{tr} \circ\ dX = \operatorname{tr}(dX) $$
where $X$ is a matrix of variables and $\cdot$ means "eat the thing to the right" (of course, I have used linearity of the trace to reverse engineer that the Jacobian is $\operatorname{tr}(\cdot)$, but the point is just that $dX$ does get eaten unlike the scalar case).
There appears to be ambiguity in phrases such as "the differential of the composition of $G(X)$ and $H(X)$" and perhaps even $d(G(X) \circ H(X))$, where $X$ is a matrix and $G$, and $H$ are "abstract" linear operators. Such a phrase could mean $d(G(X)H(X))$ which calls for the product rule, or $d(G(H(X)))$ which calls for the chain rule. Both uses appear in the chain rule itself.
Is there a holistic concept of function composition which unifies some or all of these composition notations, or are they fundamentally different mathematical objects? Is there any way to change between them or simplify expressions to use a single type of composition, such as via a generalization of the tree diagram from Multivariable Calculus which incorporates the other types)?