Skip to content

uniform_ball_walk accepts points outside polytope due to outdated is_in() semantics #387

@Akash504-ai

Description

@Akash504-ai

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions