refactor: add more SIMD into OAHSet#7478
Conversation
Review Summary by QodoRefactor OAHSet SIMD operations into separate implementation file
WalkthroughsDescription• Extracted inline SIMD probe logic from oah_set.h into separate oah_set.cc implementation file with FORCE_INLINE annotations for better code organization and maintainability • Refactored core search operations (ProbeLanes, FindMatch, RefreshStaleCandidate, ProbeExtensionVector) into dedicated helper functions with clearer separation of concerns • Simplified public API methods (Add, Find, Erase, AddMany) by moving implementation details to private helper functions while maintaining performance through forced inlining • Added comprehensive stress test (SimdFindEraseStress) covering displacement window, extension vectors, lazy-zero hash cache, TTL expiry, and mixed live/erased/expired member resolution • Enhanced SimdOp class with constexpr and noexcept qualifiers for compile-time evaluation support |
Code Review by Qodo
1. Public internal SIMD API
|
🤖 Augment PR SummarySummary: Refactors Changes:
Technical Notes: The new probe path uses SIMD masks to shortlist key-compare candidates (including lazy-zero hash lanes) and applies expiry during probe to keep lookups/erases consistent. 🤖 Was this summary useful? React with 👍 or 👎 |
| } | ||
|
|
||
| static SimdOp Load(const T* ptr) { | ||
| static constexpr SimdOp Load(const T* ptr) noexcept { |
There was a problem hiding this comment.
SimdOp::Load is now declared constexpr but it calls std::memcpy, which is not usable in constant evaluation in C++20 and can make the function definition ill-formed depending on the standard/library implementation. If this project is still built as C++20, this may break compilation (or at least makes the constexpr promise incorrect).
Severity: high
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| reuse_slot = hit; | ||
| } | ||
| } | ||
| // Result of a SIMD probe over a run of OAHEntry lanes. |
There was a problem hiding this comment.
LaneMasks/ProbeLanes look like internal helpers, but they currently live in the class public section, and ProbeLanes is a template only declared in the header (definition is in oah_set.cc). If any other TU ever tries to use it, it will fail to compile/link; consider keeping these helpers private (or fully header-defined) to avoid exposing a fragile API surface.
Severity: low
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
No description provided.