Do you want to tile textures? Then you need repeat wrapping in the sampler settings of the texture. This ensures that exactly the continuity break that you get with fract does not occur when repeating.
Mipmaps are calculated by the system like this:
For a pixel with an even index, the difference to its right-hand neighbor pixel is formed in the fragment shader. For a pixel with an even index, the difference to its left neighbor pixel. That’s what dfdx does.
It works similarly with dfdy, pixels from odd columns form the difference to their pixels in the neighboring column below and vice versa.
These are differences in clip space, i.e. the screen coordinates.
This fragment difference is set in relation to the difference of the next texture pixels for these fragments. And the mipmap level follows from the log2 of this value. If you now have a continuity break between neighboring texture pixels because you repeat with fract, i.e. you create an edge without comparable neighboring pixels in the texture so that the difference cannot be formed with the neighboring texture pixels, then it looks like yours.
Repeat wrapping turns your texture to be tiled into a simulated larger texture in which your texture is contained multiple times and continues this process without interruption. The grid tiled with repeat wrapping is seen by the shader as one texture, so to speak, without consuming more memory. With tiles with fract, each fract interval is still a texture uv world in itself with edges.
Tiling textures with fract is unfortunately inherently associated with a break in continuity.
That was a lot of blah blah from me but I hope it helps you understand what the cause is.
