Physics-Aware Robotic Palletization with Online Masking Inference