Artificial intelligent assistant

Flatlander on torus Suppose you are a $2$-dimensional being living on an ideal torus made of a cylinder of radius $a$, curled together such it exactly fits inside a sphere/circle of radius $b$, is it possible to determine $a$ and $b$ by walking a finite length, if you can only measure the local distance you walk, but you are allowed to identify places you have been before and the length you had walked at this point? What is the maximum length you need to walk to determine $a$ and $b$ with optimal strategy?

Assume the flatlander is dropped on a point $p\in T$. By doing very precise length measurements he is able to determine the Gaussian curvature $\kappa(p)$ of $T$ at $p$ (this is the Theorema Egregium), and doing the same thing for all points on a tiny circle of radius $\epsilon>0$ around $p$ he will be able to determine the direction of the level line of $\kappa$ through $p$. There is a unique geodesic $\gamma$ through $p$ which intersects this level line orthogonally. He then should proceed along $\gamma$ and make curvature measurements continuously until he is back at $p$. From the minimum and maximum of the curvature he has found underway it is easy to compute $a$ and $b$. (The ${\rm min}$ and the ${\max}$ of $\kappa$ can be determined even if $\gamma$ is slightly "off track".)

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 436b103f17cc43f48fd4f8cbeaee43f7