3D Billiards problem inside a torus I have been trying to simulate the behavior of a light particle being reflected inside of a torus (essentially a 3D billiards problem). I have found that after a few thousand bounces, it converges on "rolling" behavior; that is, the bounces get shorter and shorter and it essentially sticks to the surface. The simulation basically can't progress beyond this point as a result. Below is the part of the trajectory that illustrates this behavior; the trajectory goes from chaotic to convergent along the surface of the torus:

On the left can be seen the discrete bounces, and on the right is where the particle sticks to the surface (until program termination).
It seems counter-intuitive that a the trajectory could become trapped like this after demonstrating chaotic behavior for thousands of prior bounces. Closer examination reveals that the angles become more and more grazing with each bounce, and the distances between bounces shorter, until no progress can be made.
If I had infinite numerical precision to peek past this event horizon, would I eventually find that the particle breaks free again? Or is it possible that this is also a theoretical limit, and the motion of the particle has transitioned from finite segments to a continuous curve constrained to the surface? Can this happen in 3D billiards problems, or does chaos dictate that this behavior would reverse after some unknown amount of time?
 A: These so-called "whispering gallery modes" are familiar from studies of microcavity lasers; they can trap the light indefinitely, only limited by diffraction; this web site by Jens Nöckel nicely summarizes the issues; an efficient way to untrap the trajectory is to introduce flattened portions in the boundary (in 2D this would be a stadium rather than a circle, in 3D it could be an ellipsoidal shape). A research article on these issues, with many pointers to the literature, is Chaotic light: a theory of asymmetric resonant cavities.
A: As to the fact that this improbable scenario arose from chaos, it seems that numerical error really was at fault (my bisection code was faulty).

This behavior is more to be expected.
EDIT: According to the literature, as Carlo Beenakker pointed out, such "whispering gallery modes" wherein trajectories can stay arbitrarily close to the surface can only exist if they trace out a curve with strictly concave curvature everywhere -- a condition often violated in a torus. This, together with $C^6$ regularity, are a sufficient condition for the existence of such caustics. Quite an improvement over the previous result by Lazutkin demanding $C^{553}$ regularity.
Source: https://mat-web.upc.edu/people/rafael.ramirez/res/pdf/oberwolfach10.pdf
