lp: stack cache with lazy spilling and tests