Bismihi ta'āla
From a shar'i perspective, only penetration and ejaculation would invalidate a fast, but if they know that even less than this will lead to ejaculation, they must be avoided as well.
In general, while fasting, each side should stay away from these things, and focus on preserving the high quality of their fast, which one aspect of it is supressing lust.
And Allah knows best