I came across this paper
On Finding Lowest Common Ancestors: Simplification and Parallelization by Baruch Schieber, Uzi Vishkin April, 1987
so naturally I tried to code golf it
lca https://judge.yosupo.jp/submission/304942
rmq https://judge.yosupo.jp/submission/304936
edit: minor golf



