OctreeVolume: fail loudly on cell-pool exhaustion instead of hanging
authorSvjatoslav Agejenko <svjatoslav@svjatoslav.eu>
Sun, 20 Sep 2026 09:13:31 +0000 (12:13 +0300)
committerSvjatoslav Agejenko <svjatoslav@svjatoslav.eu>
Sun, 20 Sep 2026 09:13:31 +0000 (12:13 +0300)
commitd0c804d95faad156c651d3ed6e5f71345e110e4a
tree63c12f95a99a27adcfaeeb26f6ef10ffd6aa0219
parentdca4aa4c762cd6e174e10c961e64e786c3c47182
OctreeVolume: fail loudly on cell-pool exhaustion instead of hanging

getNewCellPointer looped forever when the pool was full (wrap-rescan
with no exit). Two guards now: the usedCellsCount fast path (made honest
— the master cell at index 0 is now counted at initWorld) and an
authoritative full-scan-cycle check that throws IllegalStateException
with capacity + remediation in the message. Verified with a tiny-pool
harness: 7 allocations + master fill 8 cells, the 9th throws (was: hang).

Also: class javadoc now states the subsystem's demo-only status and the
traceCell coverage reality; OctreeVolumeTest (2 tests) pins the
exhaustion behavior with a timeout that fails on the old implementation.
src/main/java/eu/svjatoslav/aukio/e3d/renderer/octree/OctreeVolume.java
src/test/java/eu/svjatoslav/aukio/e3d/renderer/octree/OctreeVolumeTest.java [new file with mode: 0644]