Skip to content

Fix id_type future shared-state layout during colocation lookup - #8183

Closed
divyanshitalreja12 wants to merge 1 commit into
TheHPXProject:masterfrom
divyanshitalreja12:fix/colocation-id-future-state
Closed

divyanshitalreja12 wants to merge 1 commit into
TheHPXProject:masterfrom
divyanshitalreja12:fix/colocation-id-future-state

Conversation

@divyanshitalreja12

Copy link
Copy Markdown
Contributor

Proposed changes

  • Include the components umbrella header where asynchronous colocation lookup constructs future<id_type> shared states, so the future_data<id_type> specialization is visible before template instantiation.
  • Declare the matching CMake module dependencies for agas_base and async_colocated.

Background

Hartmut reported a four-locality crash on master in the segmented-sort test while destroying a future<id_type> created during asynchronous locality discovery: #8033 (comment). The ready-future path in get_colocation_id.cpp and the remote action path in primary_namespace.cpp previously included components_base, but the specialized shared state is declared by the full components module. Instantiating the generic shared state in a producer and using the specialization elsewhere can give those translation units incompatible layouts.

This is a focused master fix. It does not change #8033's merge algorithm.

Validation

  • Built partitioned_vector_sort_test and get_colocation_id_test in a distributed Release configuration with AppleClang 21.
  • Passed the four-locality TCP partitioned_vector_sort test and the two-locality TCP get_colocation_id test.
  • Passed clang-format --dry-run --Werror, cmake-format --check, and git diff --check.

The reported GCC 16.1 Linux x86_64 crash could not be reproduced on this macOS arm64 host; CI and a Linux rerun should confirm that environment.

Signed-off-by: Divyanshi Talreja <divyanshitalreja12@gmail.com>
@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Chores
    • Updated module integration for AGAS and colocated asynchronous operations. These changes align build configuration and component access across the two areas, with no user-facing behavior changes noted.

The agas_base and async_colocated modules now declare hpx_components as a module dependency. Their corresponding source files include hpx/modules/components.hpp.

Changes: Components Module Integration

Layer / File(s) Summary
Module dependencies and includes
libs/full/agas_base/CMakeLists.txt, libs/full/agas_base/src/primary_namespace.cpp, libs/full/async_colocated/CMakeLists.txt, libs/full/async_colocated/src/get_colocation_id.cpp
Both modules add hpx_components to their module dependencies. Each corresponding source file includes hpx/modules/components.hpp.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Suggested reviewers: hkaiser, msimberg

Merge Risk: Minimal · up to 8a885

This change makes the id_type future shared-state definition visible in the colocation lookup code that creates these futures, and it declares the module dependencies that requires. No concrete defect remains in the supplied evidence. The remaining step is confirming the reported Linux crash is gone in CI.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: fixing the id_type future shared-state layout during colocation lookup. The raw summary shows the change adds the components umbrella header to get_colocation_id.cpp a…
Description check Passed The description states the change: it adds the components umbrella header to the colocation lookup code, declares the CMake module dependencies for agas_base and async_colocated, gives the crash backg…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: fixing the id_type future shared-state layout during colocation lookup. The raw summary shows the change adds the components umbrella header to get_colocation_id.cpp and primary_namespace.cpp and declares the matching CMake dependencies, which matches the title's subject. The title is specific and short.

Full details: Description check

Explanation

The description states the change: it adds the components umbrella header to the colocation lookup code, declares the CMake module dependencies for agas_base and async_colocated, gives the crash background, and lists build and test validation. It is directly related to the changeset.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 007bfe61-3dce-4ab2-85d2-b3453f8e40ac
Commits

Reviewing files that changed from the base of the PR and between 161df7f and 8a885d4.

Files selected for processing: 4

  • libs/full/agas_base/CMakeLists.txt
  • libs/full/agas_base/src/primary_namespace.cpp
  • libs/full/async_colocated/CMakeLists.txt
  • libs/full/async_colocated/src/get_colocation_id.cpp

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@hkaiser hkaiser left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! #8184 does the same and also declares the specialization next to id_type, which protects every translation unit, so I'd keep that one and close this PR as superseded.

@hkaiser hkaiser added this to the 2.1.0 milestone Nov 21, 2026
@hkaiser hkaiser closed this Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants