Skip to content

FUES bounded scan can accept a run of dominated points (n_points_to_scan default under-scans) #387

Description

@hmgaudecker

Summary

refine_envelope's bounded same-segment scan (_find_same_segment_point, src/_lcm/egm/upper_envelope/fues.py:400) inspects only n_points_to_scan candidates (default 10, src/lcm/solvers.py:102). When more than n_points_to_scan off-segment candidates interleave two points of the same segment in sorted-grid order, the scan never sees the segment's continuation, so the intervening dominated candidates are wrongly accepted onto the envelope.

This is finding F4 of the external adversarial FUES correctness audit. Full verification write-up: FUES_AUDIT_VERIFICATION_RESULTS.md (commit a72bb1a).

Reproduction

Upper line A(x)=x (anchors (0,0),(0.1,0.1),(12,12), p=x) plus eleven points 0.5 below it ((i, i-0.5) for i=1..11, p=x-100), at the shipped default n_points_to_scan=10, jump_thresh=2:

| n_points_to_scan | n_kept | max|dev| of interpolated value from A(x)=x |
| --- | --- | --- |
| 10 (default) | 14 | 0.50 |
| 11 | 3 | 0.00 |
| 14 | 3 | 0.00 |

All eleven below-envelope points survive and the interpolated value function sits a uniform 0.5 below the true envelope. Widening the window to cover all candidates recovers the exact envelope — so this is a genuine correctness defect at the shipped default, not just an approximation knob.

Locked as tests/solution/test_fues_upper_envelope_audit.py::test_f4_interleaved_segments_give_analytic_envelope_at_default_scan (xfail(strict=True)), with ::test_f4_failure_resolves_when_scan_window_covers_all_candidates pinning the boundary.

Reachability

Not exercised by the IJRS examples: every candidate row captured from a small IJRS worker-model DC-EGM solve is fully concave (segment_jumps = 0, nearest-same-segment-successor offset 0), so the multi-segment finely-interleaved input never arises there. Triggering F4 needs (a) genuine multi-segment non-concavity and (b) more than n_points_to_scan points of one segment falling between two consecutive points of another — a strong per-segment grid-density asymmetry inside an overlap region. Plausible for strongly non-concave targets (ACA's discrete-choice structure, the Laibson liquid/illiquid model) with the 200-node clustered savings grid; should not be assumed safe there.

Recommended fix

Either:

  1. a correctness-critical mode that scans exhaustively (n_points_to_scan = n_candidates), or
  2. carry explicit segment/bracket ids and jump directly to the next same-segment point (this also closes the related F5 missing-capability gap).

Raising the default n_points_to_scan only pushes the boundary out; it does not close the gap. A fix should remove the xfail(strict=True) marker on the F4 regression test.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions