limit how far we traverse the optree

the thing we're looking for will always be right near the beginning, so
this avoids infinite loops for now