Ringing problems on the output of inverter/comparator
Congratulations. You have just discovered a "transmission line". 8 feet away. That's far. Far enough that given the speed an electrical signal propagates down a wire (~0.6c) and a fast rise/fall time, you can no longer assume that the electrical signal (or wave) travels down the wire at instantly, hence a transmission line. In other words, you can't assume the conditions (voltage and current) at both ends of the wire are the same.

It takes "information" or "events" time to travel between each end of the wire. Imagine pouring water down a long pipe that suddenly narrows somewhere or is completely blocked at the far end. When the water reaches the far end, it a wave will travel back towards the inlet and splash water back at you. There was already a volume of water in the pipe with momentum behind it based on the initial width of the pipe. But it took time for the water at the inlet to know what it was like at the far end so it could not adjust right away and something has to happen with the extra water already en route. The longer your pipe, the more excess water is en route and the larger the splash. The splash back is your overshoot. The sloshing after the initial splash between the intet and far end of the pipe is like your ringing and happens while the system takes time to adjust. Just like the pipe, the longer the wire the larger the overshoot, undershoot, and ringing. So the longer the wire is, the worse the effects are at any given frequency component in the signal's bandwidth (with the highest frequency being the first one to be affected, and the highest frequency is determined by the rise/fall time of a digital signal).

Undershoot is more difficult to describe with a mechanical analogy but would be like a narrow pipe sucking in water with a widening down the line. There would be a brief void of water (a vacuum) formed somewhere that tries to draw in more water until the flow rate could be increased. It's not a perfect analogy though.

So how do you solve this with a water pipe? You cut a relief hole at the far end of the pipe so that the flow rate doesn't have to change. Or at least not change so abruptly. Furthermore, if the pipe was infinitely long for that same width you wouldn't get any splash back either. You are basically trying to make the pipe appear as though it is consistent along it's entire length and that it runs on forever...without actually having to make it run on forever. Same idea with "parallel termination resistors at the destination."

There are other kinds of termination, some of which don't translate as well to a mechanical analogy such as "series termination resistors at the source". I guess it's kind of like putting a narrowing right at the inlet of the pipe so that you can't flood the pipe with too much water which reduces the excess and the amount that can splash back. It also reduces the size of the splash coming back towards the inlet which also happens when you electrically terminate this way. Just like how the "second hole-at-the-end" in the water pipe will have better results than narrowing the inlet, "parallel termination" has better results than "series termination" in electricity.

In general, this is called "termination". It is how you solve this problem. You size the termination so the characteristic impedance of the wire does not abruptly change at the far end (just like you add an extra hole to the water pipe so the flow volume/pipe cross section doesn't abruptly change). The cross sectional area of the pipe is equivalent of the characteristic impedance of the wire. You want to make it appear the same all throughout the wire as if it was like that for infinite length, without actually having an infinitely long wire.

This was just a conceptual description so you have an intuition of what's actually happening. You can search for "transmission line" and "termination" and "characteristic impedance" on this website and elsewhere to see what is really going on electrically.