  Generalizing Fujita-Odaka invariant, we define a function $\tilde{\delta}$ on
a set of generalized $b$-divisors over a smooth Fano variety. This allows us to
provide a new characterization of uniform $K$-stability. A key role is played
by a new Riemann-Zariski formalism for $K$-stability. For any generalized
$b$-divisor $\mathbf{D}$, we introduce a (uniform) $\mathbf{D}$-log
$K$-stability notion. We prove that the existence of a unique K\"ahler-Einstein
metric with prescribed singularities implies this new $K$-stability notion when
the prescribed singularities are given by the generalized $b$-divisor
$\mathbf{D}$. We connect the existence of a unique K\"ahler-Einstein metric
with prescribed singularities to a uniform $\mathbf{D}$-log Ding-stability
notion which we introduce. We show that these conditions are satisfied exactly
when $\tilde{\delta}(\mathbf{D})>1$, extending to the $\mathbf{D}$-log setting
the $\delta$-valuative criterion of Fujita-Odaka and Blum-Jonsson. Finally we
prove the strong openness of the uniform $\mathbf{D}$-log Ding stability as a
consequence of the strong continuity of $\tilde{\delta}$.
