Files
aevolution/tests
dingoandClaude Opus 5 fd6faeb7f8 Stop the availability bound wrapping to zero
The helper summing available material added four unrestricted u64
channels without a check. With 2^62 in each, the sum reaches exactly 2^64
and wraps to zero, so the bound read as no material at all and both
planning and budgeting refused growth that a billion femtograms per
channel funds.

The sum now saturates. That is also the right answer rather than merely a
safe one: no step can need more than u64 femtograms, so a saturated bound
is correctly permissive.

Regressions in both suites use the exact 2^62 case and a single saturated
channel, and require the step that an ordinary supply funds. Both were
confirmed to fail without saturation.

The equivalent helper in metabolism.cpp is applied only to inventories
derived from bounded phenotype masses, never to caller input, so it is
left alone rather than given a branch no test could reach. That is
recorded in the validation report.

Native Release, clang-tidy analysis, ASan and format checks pass 19/19.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-23 13:19:29 -04:00
..