Skip to content

lcmf: accepted_track_quality_warning status is unreachable; quality=='low' shots report plain 'accepted' #173

Description

@dieterolson

Description

At src/openflight/iwr6843/lcmf.py:764 the accepted-status ternary tests shot.quality == "reject":

result = _result_from_track(
    "accepted_track_quality_warning" if shot.quality == "reject" else "accepted",
    shot,
)

But that case can never be reached: shot.quality == "reject" already returned rejected_track_quality earlier in the same function (lcmf.py:677-683). So the accepted_track_quality_warning status is unreachable — any log tooling filtering for it will never see a hit.

Meanwhile quality == "low" (set in shot.py:290) falls through to a plain "accepted" with no warning — which looks like what the dead branch may have meant to flag.

What did you expect to happen? Either the warning status is emittable for the case it was written for (presumably quality == "low"), or the dead branch is removed so the status vocabulary matches reality.

Was "low" the intent? Happy to PR whichever semantics you prefer, with a test pinning the chosen behavior (there is currently no test asserting the accepted-with-warning path, which is how the dead condition survived).

Steps to reproduce

Code inspection: compare lcmf.py:677-683 (early return on quality == "reject") with lcmf.py:764 (same condition tested again on the accepted path). A grep for accepted_track_quality_warning across the repo shows no test or consumer observing it.

Area

Radar / shot detection (IWR6843 LCMF estimator)

Hardware setup

N/A — found by code reading; no hardware required to confirm unreachability.

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