functional correctness check for stencil