  We investigate the effect of longitudinal and transverse calorimeter
segmentation on event-by-event software compensation for hadronic showers. To
factorize out sampling and electronics effects, events are simulated in which a
single charged pion is shot at a homogenous lead glass calorimeter, split into
longitudinal and transverse segments of varying size. As an approximation of an
optimal reconstruction, a neural network-based energy regression is trained.
The architecture is based on blocks of convolutional kernels customized for
shower energy regression using local energy densities; biases at the edges of
the training dataset are mitigated using a histogram technique. With this
approximation, we find that a longitudinal and transverse segment size less
than or equal to 0.5 and 1.3 nuclear interaction lengths, respectively, is
necessary to achieve an optimal energy measurement. In addition, an intrinsic
energy resolution of $8\%/\sqrt{E}$ for pion showers is observed.
