How subtly can a point fail to be a local minimum of a multivariable polynomial?
Formally, a point $O$ is order $m$ indistinguishable from a local minimum of a function $f$ iff for every $ε>0$, $f(x)+ε|x-O|^m$ attains a local minimum at $O$.
(Equivalently, for $C^m$ functions, taking partial derivatives at $O$ up to order $m$ fails to rule out that $O$ is a local minimum.)
Question: Given $n$ and $d$, what is the minimum $m$ such that for every degree $n$ polynomial in $d$ variables, every point that is order $m$ indistinguishable from a local minimum is a local minimum?
If $d=1$ or $n=2$, then $m=n$, but for higher degree multivariable polynomials, something different can happen.
The simplest example is that $(0,0)$ is not a local minimum of $-x^2 y + y^2$ but becomes a minimum after adding a fourth order term $x^4/4$ (or greater), so for $d=2$ and $n=3$, $m≥4$. Note that $(0,0)$ is a local minimum of $-x^2 y + y^2$ on every straight line that passes through the origin, but since the degree is $>2$, that is not sufficient to be a local minimum.
In fact, for $n=3$ and $d≥2$, $m=4$. Specifically, if the origin is second order indistinguishable from a local minimum, then after a linear coordinate transformation, the third degree polynomial can be made into $c + x_1^2 + x_2^2 + ... + x_k^2 \; (k≤d)$ plus third order terms. A nonzero third order term $x_{i_1}x_{i_2}x_{i_3}$ ($i_1≤i_2≤i_3$) creates a third order departure from a local minimum if $k < i_1$, and a fourth order if $i_1 ≤ k < i_2$, and if there are no such terms, the origin is a local minimum. (To clarify, the outcome depends solely on which third order terms are nonzero; note that if $k>0$, not all third order terms destroy the local minimum.)
We can go further using higher order and more variables. $(0,0,0)$ is not a local minimum of $x^{12} z^{10} + x^{10} y^{12} - x^{10} y^{10} z^{10}$, but by comparing terms, the polynomial can only be negative if $x^2 < y^{10}$ and $y^2 < z^{10}$, and after substituting the bounds on $x$ and $y$ into the third term, we see that around the origin, the polynomial is $≥-z^{310}$; so for $n=30$ and $d=3$, $m≥310$.
Generalizing the above construction, we have $m(d,n) ≥ h(d) n^d$ for some function $h(d)>0$. I expect this is optimal, but I am not sure how to prove the optimality or to compute $m$ exactly.