Skip to content

Discuss a consistent policy for hash collisions #906

Closed

Description

@coderabbitai

Summary

Discuss whether and how Phlex should handle hash collisions consistently. This follow-up does not need to block PR #704.

Context

phlex/core/producer_catalog.cpp uses 64-bit hashes while tracking product suffixes, creator names, and types during producer selection. add_to_tracker detects distinct values that have the same hash in some cases. Other code also relies on hashed values.

Decide whether collision detection, collision-safe equality, or acceptance of the existing risk is appropriate across the project.

Scope

  • Identify locations where hashes act as identity values or map keys in product selection and related logic.
  • Agree on a project-wide policy for hash collisions and document the trade-offs.
  • If changes are required, identify the affected code and tests.

Acceptance criteria

  • The maintainers document the hash-collision policy.
  • The discussion identifies any required follow-up work.

Requested by @knoepfel in #704 (comment)
Related PR: #704

Activity

  1. added this to the Prototype 0.5 milestone on Sep 30, 2026
  2. knoepfel commented on Oct 12, 2026

    @knoepfel
    Member

    This issue was discussed on October 12, 2026 at a Phlex development meeting. The conclusion is that the body of code in question in phlex/core/producer_catalog.cpp (specifically the add_to_tracker(...) functionality) can be replaced with a simple std::set<identifier> solution, thereby avoiding the hash-collision issue.

  3. knoepfel commented on Oct 12, 2026

    @knoepfel
    Member

    See follow-up work at #971.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

discussionWhat choice should we make

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions