Guidance for agents working in TheHPXProject/hpx.
HPX is a C++ standard library for concurrency and parallelism. It uses CMake, has a large test suite, and follows Boost-style coding conventions.
- Read
README.rstandCONTRIBUTING.md. - Do not update or rewrite
AGENT.mdunless explicitly asked. - Do not stage, commit, amend, or push unless explicitly asked.
- Do not suggest staging, committing, amending, or pushing unless explicitly asked.
- Prefer small, focused changes.
- Check whether an existing utility in
namespace hpxor the C++ standard library already solves the problem. - If the change touches build or install behavior, look for existing CMake patterns in the repository first.
- Follow Boost coding standards.
- Use 80-character (soft limit) lines that should not exceed 90 characters (hard limit).
- Use spaces only; no tabs.
- Avoid raw pointers, raw loops, and raw threads wherever possible.
- Prefer STL-style identifiers:
my_class, notMyClass. - Use expressive, self-descriptive names.
- Use exceptions for error handling instead of C-style error codes.
- Add doxygen-style comments for API functions. For this, use
///style comments and\prefixed doxygen tags. - Use the repository's
.clang-formatand.editorconfigas guidance.
- Keep formatting-only changes separate from functional changes.
- Do not reformat whole files unless necessary.
- Do not configure auto-format-on-save for source files.
Add the project license header:
// Copyright (c) <year> <your name>
//
// SPDX-License-Identifier: BSL-1.0
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)- Prefer CMake-based builds.
- HPX using C++20 as a minimal requirement.
- Run the smallest relevant test set first.
- For code changes, run targeted tests for the affected component/module.
- For build-system changes, verify at least one configuration that exercises the changed path.
CMakeFiles.txtand*.cmakefiles should be formatted usingcmake-formatbased rules defined in.cmake-format.py(see: https://github.com/cheshirekow/cmake_format).
- Prefer coherent, reviewable slices.
- Keep dependencies minimal.
- Use public APIs unless explicitly told otherwise.
- Keep benchmark and diagnostic code simple and readable.
- Do not hide important timing assumptions.
- Do not create large generated files.
- Make changes on a topic branch.
- Keep commits clear and scoped.
- Mention relevant issue numbers in PR descriptions when applicable.
- If a change is documentation-only, say so explicitly in the PR.
- Match local patterns in nearby files.
- Keep changes minimal.
- Preserve existing APIs and behavior unless the task explicitly asks otherwise.
- Never #include HPX module-internal headers (paths under
libs/<module>/include/hpx/<module>/..., e.g.hpx/serialization/serialize.hpp) from outside that module. Only code that is itself part of a given module may include its internal headers directly. Any other consumer (another module, a test executable, or application code) must include the generated umbrella headerhpx/modules/<module_name>.hppinstead (e.g.#include <hpx/modules/serialization.hpp>).