  In this paper we investigate the critical collapse of an ultrarelativistic
perfect fluid with the equation of state $P=(\Gamma-1)\rho$ in the limit of
$\Gamma\to 1$. We calculate the limiting continuously self similar (CSS)
solution and the limiting scaling exponent by exploiting self-similarity of the
solution. We also solve the complete set of equations governing the
gravitational collapse numerically for $(\Gamma-1) = 10^{-2},...,10^{-6}$ and
compare them with the CSS solutions. We also investigate the supercritical
regime and discuss the hypothesis of naked singularity formation in a generic
gravitational collapse. The numerical calculations make use of advanced methods
such as high resolution shock capturing evolution scheme for the matter
evolution, adaptive mesh refinement, and quadruple precision arithmetic. The
treatment of vacuum is also non standard. We were able to tune the critical
parameter up to 30 significant digits and to calculate the scaling exponents
accurately. The numerical results agree very well with those calculated using
the CSS ansatz. The analysis of the collapse in the supercritical regime
supports the hypothesis of the existence of naked singularities formed during a
generic gravitational collapse.
