I asked this question on Mathematics stack exchange but didn't get a response, so I ask here too.
Let $\chi$ be the non-trivial quadratic character of $\mathbb{F}_q$, and let $f(x)$ be a square-free polynomial over $\mathbb{F}_q[x]$. Then by the Weil bound, we have the generic estimate $|\sum_{x\in\mathbb{F}_q}\chi(f(x))|\le \deg(f)q^{1/2}$. Say we now deal with a function $f(x,y)\in \mathbb{F}_q[x,y]$, so that we look for a bound on $|\sum_{x,y\in\mathbb{F}_q}\chi(f(x,y))|$. Do we have any similar generic bound, perhaps using the full power of the Weil conjectures? This is basically the number of points on the surface $z^2=f(x,y)$, but I don't know how to use the Weil conjectures to bound the number of points on this surface.
One could approach this by fixing $x$ and showing that the resulting polynomial in $y$ is generically squarefree (or not a square). This gives a bound of order $q^{3/2}$ if works. I wonder if there's some tighter bound, probably with some extra demands on the polynomial $f$. On M.SE., Jyrki Lahtonen suggested that it has something to do with cohomology of the surface. If someone has any good reference to the connection, this would be very helpful too.
Thanks!