-
Notifications
You must be signed in to change notification settings - Fork 162
Description
Describe the bug
The Gaussian Random Direction Hit-and-Run (RDHR) implementation assumes that the line–polytope intersection along a sampled direction always produces a non-degenerate feasible chord.
This assumption is not validated.
In edge cases (e.g. low-dimensional, thin, or nearly degenerate polytopes, or directions nearly orthogonal to the feasible region), the intersection interval can collapse to near-zero length. In such cases, the Gaussian chord sampler fails to move the current point, leading to silent stagnation of the Markov chain.
In some cases, the rejection sampling loop may also fail to terminate, potentially causing the walk to hang.
This behavior does not raise any runtime error or warning, but results in incorrect or non-terminating sampling behavior.
To Reproduce
- Use gaussian_rdhr_walk.hpp with a low-dimensional or thin polytope
- Sample a direction for which the feasible line–polytope intersection degenerates
- Observe that:
- dbpair.first ≈ dbpair.second
- upper ≈ lower
- the sampled point remains unchanged across steps - Repeat over multiple steps and observe that the chain does not evolve
- In some cases, observe that the rejection sampling loop may not terminate
The issue occurs inside the main apply() loop and is not detected.
Expected behavior
The Gaussian RDHR walk should either:
- validate that the feasible chord has positive length, or
- resample directions when the intersection is degenerate, or
- guard rejection sampling loops with appropriate termination conditions, or
- emit a diagnostic warning when no effective movement occurs.
The Markov chain should not silently stagnate or hang under valid (but edge-case) inputs.
Actual behavior
- No validation of the line–polytope intersection interval
- No retry logic when the feasible chord collapses
- No safeguards on rejection sampling loops
- The walk may silently stagnate or fail to terminate
- Sampling correctness issues occur without warnings or errors
Additional context
Relevant code location:
include/random_walks/gaussian_rdhr_walk.hppKey observations:
- Assumes dbpair.first > dbpair.second
- Does not check for zero- or near-zero-length chords
- Passes degenerate chords into chord_random_point_generator_exp(...)
- Similar in nature to silent stagnation issues observed in uniform RDHR walks