Skip to content

Distributed send/recv narrow int64 rank to int without bounds check #116

Description

@ausimian

Severity: very low

dst/src arrive as int64_t from Elixir but are narrowed via static_cast<int> for dist::send/dist::recv (c_src/ops/collective.cpp:131 and :148) with no bounds check.

Scenario: Distributed.send(group, x, dst) with dst >= 2^31 (or negative) silently truncates/wraps to a different or invalid rank. Unrealistic for real rank IDs, but an unchecked narrowing.

Found in code review of the distributed-collectives scaffold (feature/distributed-mlx-scaffold).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions