In theory, the process is very simple: for the current pixel, we read the pixel value shifted in the dir direction by a distance of scale*length(dir)*. Strictly speaking, we read in the opposite direction to create the illusion of a shift in the specified direction, but that's unimportant.
I take a white square and feed it as a mask to the distortion node. We take the direction from the = {1,0} parameter (the X axis) and increase the scale. The image in the square shifts to the right, as it should. No questions asked.
Now let's make the same square a vector2, adding 0 to the second component, and feed it as a direction to the dir port. In theory and logic, we should get exactly the same result, right? But we won't! We get three stripes inside the square. The original shift will be limited to some extent and will repeat. Moreover, the size of the permissible shift depends on the size of this square on the direction map. Frankly, I'm racking my brain trying to find some rational explanation or purpose for this behavior. It seems completely senseless and erroneous to me.
Can anyone explain what's going on here and why the shift is so limited?

