-
Notifications
You must be signed in to change notification settings - Fork 162
Description
Describe the bug
After the recent change in HPolytope::is_in() semantics (inside → positive value, outside → 0), uniform_ball_walk still assumes the old return convention.
In include/random_walks/uniform_ball_walk.hpp, candidate points are accepted using:
if (P.is_in(y) != -1) p = y;
With the current semantics of is_in(), this condition evaluates to true for both inside points (1) and outside points (0), causing the walk to accept points that lie outside the polytope.
This leads to silent correctness errors in the Ball Walk sampler, as samples may leave the feasible region without any warning or crash.
Location
include/random_walks/uniform_ball_walk.hpp
Expected behavior
The Ball Walk should update the current point only when the proposed point lies strictly inside the polytope.
Actual behavior
Points outside the polytope can be accepted due to an outdated predicate check.
Additional context
This issue is a logic-level inconsistency and can be identified by inspection. It does not require runtime reproduction, as it follows directly from the mismatch between the updated is_in() return semantics and its usage in uniform_ball_walk.