There is something weird going on with stencils on the G400 driver. Compare these two images:
which show the vast difference between hardware and software stencilling on my shadowvolume code. The software stencilling is correct. The hardware...isn't. :) From what I can tell, the stencil bits aren't being cleared between the rendering of each light's pass, since when I have only one light on, the shadows appear the same (and correct) in both hardware and software.
For a bit more information which might be useful: The way that I'm generating the shadow volumes is by downsampling my meshes, creating caps based on the light-wise backfacing triangles, and then generating edges based on the edges of the caps. (This engine is using an experimental mesh storage mechanism which makes these operations all happen in O(n) time for n polygons and put out near-perfect volumes with almost no redundancy. I need to get around to finishing my paper on it, but suffice it to say that it works. :) The shadow volumes are otherwise rendered with a stock OpenGL stencil-based shadow volume technique. In any case, it ALMOST looks like the frontface test (glStencilOp(GL_KEEP, GL_DECR, GL_KEEP)) is what's failing, except that the shadows on the back wall would be completely FUBAR as well (they'd probably be taking up the whole wall).
If there's any specific tests which would help in debugging this problem, please let me know, as I'm sick of testing my algorithms in software Mesa. :) I'm not at a point where I feel comfortable releasing source, though, but aside from that I'd be more than happy to run different checks and show comparisons of what happen in different situations (i.e. all 8 possible combinations of the 3 lights in this particular test scene).
Again, it looks to me like a bug in stencil code (like, it might only be clearing stencil when I clear the zbuffer, while when I clear it mid-frame nothing seems to happen). I know the G400 does interleaving of the stencil buffer with the zbuffer, so this seems pretty likely to me. Any chance it's something that simple?