Official implementation for the Paper "OptScale: Probabilistic Optimality for Inference-time Scaling" (AAAI'2026)