tr: use SmallIntMap instead of HashMap
tr: use BitvSet instead of HashSet