Top American military commanders in Iraq offered a cautiously optimistic picture of the situation.