I have HPPD consisting of marihuana-like derealization, LSD-like movements of surfaces, and optical noise.
The LSD-like movements had gotten much better over the course of 7 years until they were barely noticeable, until I took Ritalin. Within two weeks, the LSD effects were almost as bad as in the beginning. The rest of my visual effects were not affected. I discontinued Ritalin. The LSD effects remained unchanged (other than going through their usual cyclical fluctuation over 5 days (IIRC) for the next few weeks.
Then I started taking low-dose Risperidone (2mg, I think).
For the first two days, nothing happened. On day 3, the LSD effects were basically turned off, back to barely noticeable.
It was like flipping a switch. In the morning they were there, in the afternoon they were almost gone.
I continued taking Risperidone for a few weeks, even increased the dosage, but nothing else happened. There was no effect on my other visuals.
After discontinuing Risperidone, the LSD effects did not return, even when I started taking Ritalin again (strange, huh?).
I've been taking Ritalin for a few years now. The HPPD symptoms are stable.
Caffeine never affected my symptoms.