improve robustness of resource buff qty tracking using kahan sum