Efficiently sampling specific surfaces using MIS in path tracing Apologies for posting two questions in one post, but as they are relevant I kept them in one.

Question 1

In the definition of multi sample estimator that Veach has defined, the integrand is the same for all the n sampling strategies. If this is so, then is it not the case that, in direct lighting, those shadow rays that miss the light geometry are to be considered, as the integrand is not zero (and the PDF is also not zero) but has some value, not from the light of course, but due to the surfaces that have occluded the light? 

Would missing those contributions not be the same as partitioning the integral in sampling the lights and BRDF, whereas MIS claims to give 
a solution without partitioning the integral?

Question 2

My main problem is to sample adequately part of the scene where light comes from the external obstructions (marked as P2 in the image). The only source of light is skylight coming in through the window opening. P1 is PDF for sampling window area (or solid angle) to get direct light; P2 is same PDF but to account for external surfaces contributions; and P3 is BRDF sampling for indirect light from indoor surfaces. I could rely just on BRDF sampling to account for external surfaces but as their contribution is large (illuminance from infinite source) I want to explicitly account for them.  

I don't intend to partition the integral into three regions as it ends up to have recursive calls to get the contribution of external hits; it also slows down and makes the code too complex. I therefore guess I need to use MIS to account for indirect contribution of externals surfaces but am not clear how it is to be done.



I tried to take one sample from BRDF P3 with $W3 = p_3/(p_3+p_2)$, and one from P2 PDF with $W2 = p_2/(p_2+p_3)$. I am not clear how to evaluate the integrand for samples taken from P2 distributions. This is the pseudocode:

for each measurement point x {
    while(1){
        //P1
        //DirectLight routine uses P1 if x is indoor hit or 
        //sampling hemisphere if x is outdoor, to get direct light from sky 
        totalEstimate += DirectLight(x) * throughput

        //P2
        y = Trace one sample from P2
        if y is external surface {
           weight = p2(y) / (p2(y)+p3(y))
           totalestimate += DirectRadiance(y) * weight * brdf(x) * dot(x, Nx) / P2  
        }

        //P3
        z = Trace one sample form P3
        if z is a hit{
            weight = p3(z) / (p3(z)+p2(z))
            throughput *= weight * brdf(x) * dot(x, Nx) / P3  
        }
        else 
            break;

        //using russian roulette to terminate the path.. 
    }
}


I tried this but had increase in variance. The measurement points are few points in room floor area and a contour line is drawn based on a the values. The above gives higher variance than using only P1 and P3 with no MIS weights.

Update:

This excersise in PBRT seems to be relevant to this question. So I post it here
in case it helps.
I will not answer your questions directly, but will try to change your mindset a bit. I hope got your intentions reasonably well... 

The usual way the path tracing is implemented is that the reflection integral is split into direct and indirect illumination and they are estimated separately.

The direct illumination can be estimated using more sampling strategies which are combined together using the multi-sample multiple importance sampling method by Veach. Typically, there is just BSDF sampling and light sampling used, but you can also add things like light portals sampling and other more sophisticated stuff. I guess this is where you are headed.

The indirect illumination is usually estimated by just one sampling strategy (typically BSDF sampling) because you want to avoid exponential growth of recursive paths count. That's the reason why path tracing has poor performance for indirect illumination reflected/refracted through glossy/specular materials.

A nice thing about the split integral is that you can share samples between the direct and indirect integral. If you have two integrals over the same domain and have a sampling strategy that can be used for both, then you can generate a sample to estimate the first integral and then use the same sample for the second integral as well. There is no problem with correlated samples here because we have two separate computations. In practice you generate a BSDF sample with some PDF, shoot a ray in that direction and use the intersection point to estimate both direct and indirect integral separately.



PS: I guess that for indirect illumination estimator you could possibly use the one-sample multiple importance sampling method by Veach to incorporate the light portals and other sampling strategies, but I have some doubts about the efficiency of the resulting estimator, especially when reusing the samples for the direct illumination integral.