As background, remember that I recently posted a Tiny brown bug stuck to a small black beetle..
Here is a small chunk of that image, blown up much bigger than shown before -- 70% of actual pixels:

Now that's a clean image, one that I'm happy with.
But it's also the third stack that I shot of that specimen. My first attempt, using PMax, produced a ghastly "hairball". Not even using DMap would clean things up. Here's what I mean:


Here's the PMax as full frame so you can see the whole context.

You can probably imagine that this piqued my curiosity. Was that one part of the leg really so different from the rest?
I sat for a while contemplating what was the best way to proceed. The first stack had been shot at 10 micron focus steps using a Mitutoyo 10X NA 0.28 objective and what I had intended to be completely diffuse lighting. Here was the setup. The subject is part of that black blob almost centered under the cup.

Using Zerene to play through the frames like a filmstrip, I saw some weird changes in appearance as focus shifted. So I decided that the first thing to do was to re-shoot the critical part of the stack using much finer focus step, 2 microns. I did that, and we'll see some of that stack #2 in a moment.
Then I speculated that the problem was somehow related to illumination, perhaps a reflection off some shiny part of my setup that could be seen directly by the subject, not going through the diffuser.
The simplest way to resolve that was to just drop a Kleenex tissue over the lens and the hole in the foam cup.

A few test images suggested that might have solved the problem, so I shot stack #3 again doing the full depth at 10 microns. That's the one that I showed you as a "final".
OK, so the "hairball" apparently was caused by a bit of undiffused illumination. But what about those "weird changes in appearance" that I mentioned?
Well, let's take a closer look at that. Here is a bit of the short stack, presented as PMax, DMap, then a short animation of individual frames 6 microns apart, sweeping focus back and forth across the area of interest, and finally a chunk of the final well diffused result for comparison




OK, so now again it's abundantly clear that there's something very weird about how the appearance of the bug changes a lot with small changes in focus, again when the illumination is not sufficiently diffused. In contrast, the well diffused image looks great. So surely all is now well under control, right?
Hah -- we should be so lucky!
Here's an animation of that same area, at a little wider scale, this time with well diffused illumination and a 10 micron focus step.

That's right, folks, it tips! Or at least, it appears to tip. Or maybe you perceive it more as a warping.
In any case, what seems to be happening is that as focus shifts, OOF stuff on the right of the image moves left at the same time that OOF stuff on the left of the image is moving right.
This is entirely a local effect. While this one small area is exhibiting large shifts, similar areas far away in the image are exhibiting only the same sorts of shifts depending on their own local geometry. There are no large "rigid body" shifts like you'd see if the specimen were actually moving or the center of perspective were changing significantly.
Quite frankly, I do not understand what's going on here. The illustration above is with a Mitutoyo lens, but a Nikon CFI60 10X NA 0.25 does something similar though apparently less intense:

I've seen similar effects with other lenses, on other subjects, and realtime under a scope. But to see it and to understand it are two very different things.
If anybody can help me understand what's going on here, I would be very grateful.
--Rik