SSAO edge cases, how to handle them?

I have what I think is a pretty decent SSAO system setup, but I get some odd artifacts near the edges where the random samples are off of the pre-rendered depth/normal buffer. In this screen shot I merely reject those samples, but you can see that at times they are all of the samples available given that there are a limited number of samples being taken. Anyway, you can see that the occlusion goes away toward the screen edges.

I was wondering if anyone had a better way of handling this? I also have tried clamping the samples and also if the screen x or y is negative, just negating it. All have had some rather unfortunate artifacts.

Do you have a link to the technique you’re using handy?

Sight unseen I’d probably just render a slightly larger view of the scene then crop it to the viewport. Otherwise, looks like good old fashioned variance to me - if you’re random sampling, that’s to be expected.

Have you tried using repeating or mirroring texture sampling.

What about rendering to a little larger texture and omitting the margins according to your kernel size?