M11-PT-001: wildlife steering stays within the intent length limit
Foundation / checks (checks) (push) Successful in 45m24s
Foundation / checks (deploy) (push) Successful in 4m8s
Foundation / checks (ecs) (push) Successful in 2m18s
Foundation / checks (network) (push) Successful in 19m39s
Foundation / checks (postgres) (push) Successful in 44m48s
Foundation / checks (tsan) (push) Successful in 11m26s
Foundation / checks (client) (push) Successful in 17m4s
Foundation / postgres-tools (push) Successful in 21s
Foundation / server-image (push) Successful in 3m10s
Foundation / image (push) Successful in 3m18s
Foundation / checks (checks) (push) Successful in 45m24s
Foundation / checks (deploy) (push) Successful in 4m8s
Foundation / checks (ecs) (push) Successful in 2m18s
Foundation / checks (network) (push) Successful in 19m39s
Foundation / checks (postgres) (push) Successful in 44m48s
Foundation / checks (tsan) (push) Successful in 11m26s
Foundation / checks (client) (push) Successful in 17m4s
Foundation / postgres-tools (push) Successful in 21s
Foundation / server-image (push) Successful in 3m10s
Foundation / image (push) Successful in 3m18s
DEV region 6 stopped at tick 7144 (stall log: append error=13 lives=10, region_step).
The wildlife controller steered toward food by scaling the larger component to 1000, so
a diagonal heading such as {1000, 800} was longer than a cellular intent may be; the
owner refused it, failing the tick, and the deterministic controller asked again every
tick. Earlier tests only had buds already touching food, so none moved.
wildlife_toward scales each component by the exact length, truncates toward zero and
pulls in any rounding excess. A regression test reproduces the refusal and accepts the
steered intent; another checks length, direction and speed over a grid of offsets.
No history changes: the refused ticks were never committed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -998,6 +998,39 @@ void suspended_parent_of_a_bud_resumes() {
|
||||
for (int tick = 0; tick < 20; ++tick)
|
||||
CHECK(owner.advance_tick(with_wildlife({1, feed})));
|
||||
CHECK(owner.current_total() == owner.opening_total());
|
||||
|
||||
// M11-PT-001 (DEV region 6 stalled at tick 7144): a wildlife bud steering diagonally
|
||||
// to food asked for {1000, 800}, longer than an intent may be; the owner refused it and
|
||||
// so every later tick. Steering now keeps the length within the limit.
|
||||
const auto bud_id = owner.lives()[1].identity.life;
|
||||
evo::biology::CellularStepIntent too_long{};
|
||||
too_long.movement = {1'000, 800};
|
||||
CHECK(owner
|
||||
.advance_tick(
|
||||
std::array{CellularLifeIntent{1, feed}, CellularLifeIntent{bud_id, too_long}})
|
||||
.error() == CellularLivesError::region_step);
|
||||
evo::biology::CellularStepIntent steered{};
|
||||
steered.movement = wildlife_toward(1'000, 800);
|
||||
CHECK(owner.advance_tick(
|
||||
std::array{CellularLifeIntent{1, feed}, CellularLifeIntent{bud_id, steered}}));
|
||||
}
|
||||
// Every steering direction is a valid intent: within the length limit, pointing at the
|
||||
// target, and full speed along an axis.
|
||||
void wildlife_steering_stays_within_the_intent_limit() {
|
||||
constexpr std::int64_t limit = 1'000;
|
||||
CHECK(wildlife_toward(0, 0) == evo::biology::CellularIntent{});
|
||||
CHECK(wildlife_toward(5'000, 0) == evo::biology::CellularIntent{1'000, 0});
|
||||
CHECK(wildlife_toward(0, -3) == evo::biology::CellularIntent{0, -1'000});
|
||||
for (const std::int64_t dx :
|
||||
{-1'000'000LL, -9'000LL, -707LL, -1LL, 0LL, 1LL, 800LL, 1'000LL, 4'500LL, 1'000'000LL})
|
||||
for (const std::int64_t dy : {-1'000'000LL, -4'500LL, -800LL, -1LL, 0LL, 1LL, 707LL,
|
||||
1'000LL, 9'000LL, 1'000'000LL}) {
|
||||
const auto intent = wildlife_toward(dx, dy);
|
||||
const std::int64_t x = intent.x, y = intent.y;
|
||||
CHECK(x * x + y * y <= limit * limit);
|
||||
CHECK((dx == 0 && dy == 0) || x * x + y * y >= (limit - 2) * (limit - 2));
|
||||
CHECK((x == 0 || (x > 0) == (dx > 0)) && (y == 0 || (y > 0) == (dy > 0)));
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
|
||||
@@ -1012,6 +1045,7 @@ int main() {
|
||||
rules_five_owner_freezes_lingers_suspends_and_resumes();
|
||||
rules_six_found_cheaper_cells_with_finer_mutations();
|
||||
suspended_parent_of_a_bud_resumes();
|
||||
wildlife_steering_stays_within_the_intent_limit();
|
||||
std::puts(
|
||||
"PASS cellular lives: feeding, tick ownership, terminal closure, rules 3, budding");
|
||||
} catch (const std::exception& error) {
|
||||
|
||||
Reference in New Issue
Block a user