  We discuss a two-parameter renormalization group (RG) flow when parameters
are organized in a single complex variable, $\tau$, with modular properties.
Throughout the work we consider a special limit when the imaginary part of
$\tau$ characterizing the disorder strength tends to zero. We argue that
generalized Riemann-Thomae (gRT) function and the corresponding generalized
Devil's staircase emerge naturally in a variety of physical models providing a
universal behavior. In 1D we study the Anderson-like probe hopping in a weakly
disordered lattice, recognize the origin of the gRT function in the spectral
density of the probe and formulate specific RG procedure which gets mapped onto
the discrete flow in the fundamental domain of the modular group $SL(2,Z)$. In
2D we consider the generalization of the phyllotaxis crystal model proposed by
L. Levitov and suggest the explicit form of the effective potential for the
probe particle propagating in the symmetric and asymmetric 2D lattice of
defects. Analyzing the structure of RG flow equations in the vicinity of saddle
points we claim emergence of BKT-like transitions at ${\rm Im}\,\tau\to 0$. We
show that the RG-like dynamics in the fundamental domain of $SL(2,Z)$ for
asymmetric lattices asymptotically approaches the "Silver ratio". For a Hubbard
model of particles on a ring interacting via long-ranged potentials we
investigate the dependence of the ground state energy on the potential and
demonstrate by combining numerical and analytical tools the emergence of the
generalized Devil's staircase. Also we conjecture a bridge between a Hubbard
model and a phyllotaxis.
