// acc128: a two-word two's-complement sum accumulator. Wide enough that an
// int64-valued column summed over any node count the engine can hold never
// overflows it, so the fits-int64 verdict at finalize depends on the true
// total alone -- never on how work was partitioned across goroutines: a
// transient excursion past int64 range that nets back in stays exact.

package chickpeas

import 

// acc128 is the 128-bit signed accumulator; the zero value is 0.
type acc128 struct {
	lo uint64
	hi uint64
}

// add folds one int64 in.
func ( *acc128) ( int64) {
	var  uint64
	.lo,  = bits.Add64(.lo, uint64(), 0)
	.hi += uint64(>>63) + 
}

// merge folds another accumulator in (the parallel partial-merge step).
func ( *acc128) ( acc128) {
	var  uint64
	.lo,  = bits.Add64(.lo, .lo, 0)
	.hi += .hi + 
}

// int64 returns the total and whether it fits int64: the high word must be
// the sign extension of the low word's int64 reading.
func ( acc128) () (int64, bool) {
	 := int64(.lo)
	return , .hi == uint64(>>63)
}