Lost device handling is now done. This was a BITCH to code, but in the end I decided to go for the simplest (but not necessarily most elegant) solution and just restart the entire refresh. It means that there is a single code path for everything, and handles resolution changes after an Alt-Tab properly too. It also opens up the possibility of switching everything from the managed to the default pool, which should improve performance a little (although I'm going to need to be a little careful with lightmap uploads).
If you were astute enough you'll have noticed that the models in my last screenshot were rendered fullbright. This wasn't a bug in my shadows code, but was instead a bug in handling a "no hit" R_LightPoint result for the Strogg ships flying past the windows in that room. The solution I chose was to set alias model lights to 0.5 if there is no hit. I'm not sure how well that will work overall, but right now I don't see any conceivable problems with the approach. The only time it should happen is if there are no solid surfs under the model, meaning it's in empty space. Obviously as solutions go it's a bit cheesy, but it seems better than rendering the thing in full black to me.
Speaking of R_LightPoint, I'm really satisfied with how the new aproach worked out. A combination of reading the results of R_BuildLightmap and using LordHavoc's "interpolation" code has given me a really smooth and accurate end result. I've set "gl_lightmap 1" mode to also apply to alias models so that I can do some good testing on the lighting for them, and this is definitely the best I've ever seen.