Track nscratches and save ctx only if filter program contains COP insns.