Parametric polynomial solution of a single polynomial equation

Let $P$ be a polynomial in $n$ variables with rational coefficients, $P \in {\mathbb Q}[Z_1,Z_2, \ldots ,Z_n]$, and consider the algebraic set
$Z=\lbrace (z_1,z_2,z_3, \ldots ,z_n) \in {\mathbb Q}^n | \ P(z_1,z_2, \ldots ,z_n)=0 \rbrace$

If $r$ is a nonnegative integer, $x_1,x_2, \ldots ,x_r$ are variables, and $Q_1,Q_2, \ldots ,Q_n$ are polynomials in $x_1,x_2, \ldots ,x_r$ such that $(Q_1(x_1, \ldots ,x_r),Q_2(x_1, \ldots ,x_r),\ldots,Q_n(x_1, \ldots ,x_r)) \in Z$ for all $(x_1, \ldots ,x_r) \in {\mathbb Q}^r$, we call $(Q_1,Q_2, \ldots ,Q_n)$ a $r$-dimensional parametric solution of the equation $P(z_1,z_2, \ldots ,z_n)=0$. It is also natural to define a maximal parametric solution as one with the largest possible $r$ (to avoid trivialties, we also impose that there is no variable upon which none of the $Q_i$ depends. I'm not sure that this last condition avoids all degenerate cases, but I'd like to avoid definitions that involve advanced notions such as the dimension of an algebraic variety ).

My questions : is the problem of computing the largest $r$ known to be undecidable in general ? What are the most general cases in which algebraic geometry allows us to compute the largest $r$ (and the associated parametric solutions) ?

-
That last condition can't avoid all degenerate cases because it is not invariant under change of coordinates. You want some kind of condition on the Jacobian, I think. –  Qiaochu Yuan Jan 10 '10 at 16:00

I think the problem of deciding if $r=0$ or $r > 0$ will be related to (but a bit more subtle than) Hilbert's 10th problem over $Q(t)$ so it might already be undecidable. I haven't seen a statement in this direction but I am not an expert on undecidability questions.

For curves, $r=0$ or $1$ and $r=1$ if and only if $Z$ has genus zero and a rational point and this is decidable.

For surfaces, maybe you can decide if $r=2$ or not. It's a matter of deciding if the surface is a rational surface. This can certainly be done over an algebraically closed field but I'm not sure what happens over the rationals. Now, to decide if $r=0$ or $1$ in general, you need to be able to decide if a surface contains rational curves and I believe we don't know how to do that for arbitrary surfaces. Although we do know how to decide if a surface fibered over a rational curve has a section, which would be the situation of Hilbert's 10th problem over $Q(t)$.

-