PersistentSum: version 0 is the initial integer array. add(version,index,delta) returns a fresh version; sum(version,l,r) uses half-open bounds. Invalid version/index/range raises IndexError. Old nodes are immutable. Every update clones exactly depth+1 nodes, including delta=0. Empty arrays permit empty sums but no update. Tree work: worst-case O(log(n+1)); Python root-list append adds amortized allocation costs. No disk durability is provided.