trace: adapt to stencil ref changes