Skip to content

[Stagging] Aurora tweaks#1625

Draft
tdavidcl wants to merge 41 commits intoShamrock-code:mainfrom
tdavidcl:aurora_scaling_test
Draft

[Stagging] Aurora tweaks#1625
tdavidcl wants to merge 41 commits intoShamrock-code:mainfrom
tdavidcl:aurora_scaling_test

Conversation

@tdavidcl
Copy link
Member

@tdavidcl tdavidcl commented Feb 8, 2026

No description provided.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @tdavidcl, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on improving the debugging and observability capabilities within the codebase. It introduces an enhancement to the SourceLocation utility by allowing it to carry an optional descriptive message. This new feature is then integrated into the shamalgs::write_buf function to provide more comprehensive and contextual logging during buffer write operations, which will significantly aid in diagnosing issues and understanding data flow.

Highlights

  • Enhanced SourceLocation: The SourceLocation struct has been extended to include an optional std::string message, allowing developers to attach custom contextual information to source code locations for improved debugging.
  • Improved Logging Output: The format_one_line_func method within SourceLocation now conditionally includes the new optional message in its output, providing richer and more descriptive log entries when available.
  • Detailed write_buf Tracing: The shamalgs::write_buf function now leverages the enhanced SourceLocation to capture and log detailed state information, such as buffer length, size, current head, offset, and access pointers, at various critical stages of its execution. This provides deeper insights into buffer operations.
Changelog
  • src/shamalgs/include/shamalgs/serialize.hpp
    • Added std::string info variables to capture detailed state parameters within the write_buf function.
    • Integrated StackEntry objects with the new SourceLocation constructor, passing contextual info messages at multiple points in write_buf.
  • src/shambase/include/shambase/SourceLocation.hpp
    • Included the <optional> header for std::optional.
    • Added std::optional<std::string> message as a new member to the SourceLocation struct.
    • Modified the SourceLocation constructor to accept an optional std::string message as its first argument.
  • src/shambase/src/SourceLocation.cpp
    • Updated SourceLocation::format_one_line_func() to conditionally include the message in the formatted output if it has a value, providing more informative log lines.
Activity
  • No human activity (comments, reviews, approvals) has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces changes to add detailed messages to stack traces, which is used for debugging in serialize.hpp. My review focuses on two main points:

  1. The implementation of the new tracing in serialize.hpp is very verbose and looks like temporary debugging code. I've suggested either removing it or refactoring it into a macro for better readability if it's intended to be a permanent feature.
  2. The constructor for SourceLocation has been modified in a way that breaks backward compatibility. I've proposed a solution using overloaded constructors to add the new functionality without breaking existing code.

std::optional<std::string> message;

inline explicit SourceLocation(srcloc _loc = srcloc::current()) : loc(_loc) {}
inline explicit SourceLocation(std::optional<std::string> _message = std::nullopt,srcloc _loc = srcloc::current()) : loc(_loc), message(_message) {}
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The change to the SourceLocation constructor is a breaking API change. Code that previously compiled, such as SourceLocation(my_srcloc_object), will now fail. To add support for an optional message while maintaining backward compatibility, it's better to use overloaded constructors.

Suggested change
inline explicit SourceLocation(std::optional<std::string> _message = std::nullopt,srcloc _loc = srcloc::current()) : loc(_loc), message(_message) {}
inline explicit SourceLocation(srcloc _loc = srcloc::current()) : loc(_loc), message(std::nullopt) {}
inline explicit SourceLocation(std::string _message, srcloc _loc = srcloc::current()) : loc(_loc), message(std::move(_message)) {}

@github-actions
Copy link
Contributor

github-actions bot commented Feb 8, 2026

Thanks @tdavidcl for opening this PR!

You can do multiple things directly here:
1 - Comment pre-commit.ci run to run pre-commit checks.
2 - Comment pre-commit.ci autofix to apply fixes.
3 - Add label autofix.ci to fix authorship & pre-commit for every commit made.
4 - Add label light-ci to only trigger a reduced & faster version of the CI (need the full one before merge).
5 - Add label trigger-ci to create an empty commit to trigger the CI.

Once the workflow completes a message will appear displaying informations related to the run.

Also the PR gets automatically reviewed by gemini, you can:
1 - Comment /gemini review to trigger a review
2 - Comment /gemini summary for a summary
3 - Tag it using @gemini-code-assist either in the PR or in review comments on files

@github-actions
Copy link
Contributor

Workflow report

workflow report corresponding to commit 10f743a
Commiter email is timothee.davidcleris@proton.me

Light CI is enabled. This will only run the basic tests and not the full tests.
Merging a PR require the job "on PR / all" to pass which is disabled in this case.

Pre-commit check report

Pre-commit check: ✅

trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check for merge conflicts................................................Passed
check that executables have shebangs.....................................Passed
check that scripts with shebangs are executable..........................Passed
check for added large files..............................................Passed
check for case conflicts.................................................Passed
check for broken symlinks................................................Passed
check yaml...............................................................Passed
detect private key.......................................................Passed
No-tabs checker..........................................................Passed
Tabs remover.............................................................Passed
Validate GitHub Workflows................................................Passed
clang-format.............................................................Passed
ruff check...............................................................Passed
ruff format..............................................................Passed
Check doxygen headers....................................................Passed
Check license headers....................................................Passed
Check #pragma once.......................................................Passed
Check SYCL #include......................................................Passed
No ssh in git submodules remote..........................................Passed
No UTF-8 in files (except for authors)...................................Passed

Test pipeline can run.

Doxygen diff with main

Removed warnings : 23
New warnings : 24
Warnings count : 8187 → 8188 (0.0%)

Detailed changes :
- src/shamalgs/include/shamalgs/serialize.hpp:373: warning: Member load_buf(sham::DeviceBuffer< T > &buf, u64 len) (function) of class shamalgs::SerializeHelper is not documented.
+ src/shamalgs/include/shamalgs/serialize.hpp:413: warning: Member load_buf(sham::DeviceBuffer< T > &buf, u64 len) (function) of class shamalgs::SerializeHelper is not documented.
- src/shambase/include/shambase/SourceLocation.hpp:32: warning: Member srcloc (typedef) of struct SourceLocation is not documented.
+ src/shambase/include/shambase/SourceLocation.hpp:33: warning: Member srcloc (typedef) of struct SourceLocation is not documented.
- src/shambase/include/shambase/SourceLocation.hpp:34: warning: Member loc (variable) of struct SourceLocation is not documented.
+ src/shambase/include/shambase/SourceLocation.hpp:35: warning: Member loc (variable) of struct SourceLocation is not documented.
- src/shambase/include/shambase/SourceLocation.hpp:36: warning: Member SourceLocation(srcloc _loc=srcloc::current()) (function) of struct SourceLocation is not documented.
+ src/shambase/include/shambase/SourceLocation.hpp:36: warning: Member message (variable) of struct SourceLocation is not documented.
+ src/shambase/include/shambase/SourceLocation.hpp:38: warning: Member SourceLocation(std::optional< std::string > _message=std::nullopt, srcloc _loc=srcloc::current()) (function) of struct SourceLocation is not documented.
- src/shammodels/sph/include/shammodels/sph/modules/setup/GeneratorLatticeHCP.hpp:29: warning: Compound shammodels::sph::modules::GeneratorLatticeHCP is not documented.
+ src/shammodels/sph/include/shammodels/sph/modules/setup/GeneratorLatticeHCP.hpp:45: warning: Compound shammodels::sph::modules::GeneratorLatticeHCP is not documented.
- src/shammodels/sph/include/shammodels/sph/modules/setup/GeneratorLatticeHCP.hpp:49: warning: Member GeneratorLatticeHCP(ShamrockCtx &context, Tscal dr, std::pair< Tvec, Tvec > box) (function) of class shammodels::sph::modules::GeneratorLatticeHCP is not documented.
+ src/shammodels/sph/include/shammodels/sph/modules/setup/GeneratorLatticeHCP.hpp:65: warning: Member GeneratorLatticeHCP(ShamrockCtx &context, Tscal dr, std::pair< Tvec, Tvec > box) (function) of class shammodels::sph::modules::GeneratorLatticeHCP is not documented.
- src/shamrock/src/scheduler/SchedulerPatchData.cpp:249: warning: Member split_patchdata(shamrock::patch::PatchDataLayer &original_pd, const shamrock::patch::SimulationBoxInfo &sim_box, const std::array< shamrock::patch::Patch, 8 > patches, std::array< std::reference_wrapper< shamrock::patch::PatchDataLayer >, 8 > pdats) (function) of namespace shamrock::scheduler is not documented.
+ src/shamrock/src/scheduler/SchedulerPatchData.cpp:256: warning: Member split_patchdata(shamrock::patch::PatchDataLayer &original_pd, const shamrock::patch::SimulationBoxInfo &sim_box, const std::array< shamrock::patch::Patch, 8 > patches, std::array< std::reference_wrapper< shamrock::patch::PatchDataLayer >, 8 > pdats) (function) of namespace shamrock::scheduler is not documented.
- src/shamrock/src/scheduler/SchedulerPatchData.cpp:272: warning: Member split_patchdata< f32_3 >(shamrock::patch::PatchDataLayer &original_pd, const shamrock::patch::SimulationBoxInfo &sim_box, const std::array< shamrock::patch::Patch, 8 > patches, std::array< std::reference_wrapper< shamrock::patch::PatchDataLayer >, 8 > pdats) (function) of namespace shamrock::scheduler is not documented.
- src/shamrock/src/scheduler/SchedulerPatchData.cpp:278: warning: Member split_patchdata< f64_3 >(shamrock::patch::PatchDataLayer &original_pd, const shamrock::patch::SimulationBoxInfo &sim_box, const std::array< shamrock::patch::Patch, 8 > patches, std::array< std::reference_wrapper< shamrock::patch::PatchDataLayer >, 8 > pdats) (function) of namespace shamrock::scheduler is not documented.
+ src/shamrock/src/scheduler/SchedulerPatchData.cpp:279: warning: Member split_patchdata< f32_3 >(shamrock::patch::PatchDataLayer &original_pd, const shamrock::patch::SimulationBoxInfo &sim_box, const std::array< shamrock::patch::Patch, 8 > patches, std::array< std::reference_wrapper< shamrock::patch::PatchDataLayer >, 8 > pdats) (function) of namespace shamrock::scheduler is not documented.
- src/shamrock/src/scheduler/SchedulerPatchData.cpp:284: warning: Member split_patchdata< u32_3 >(shamrock::patch::PatchDataLayer &original_pd, const shamrock::patch::SimulationBoxInfo &sim_box, const std::array< shamrock::patch::Patch, 8 > patches, std::array< std::reference_wrapper< shamrock::patch::PatchDataLayer >, 8 > pdats) (function) of namespace shamrock::scheduler is not documented.
+ src/shamrock/src/scheduler/SchedulerPatchData.cpp:285: warning: Member split_patchdata< f64_3 >(shamrock::patch::PatchDataLayer &original_pd, const shamrock::patch::SimulationBoxInfo &sim_box, const std::array< shamrock::patch::Patch, 8 > patches, std::array< std::reference_wrapper< shamrock::patch::PatchDataLayer >, 8 > pdats) (function) of namespace shamrock::scheduler is not documented.
- src/shamrock/src/scheduler/SchedulerPatchData.cpp:290: warning: Member split_patchdata< u64_3 >(shamrock::patch::PatchDataLayer &original_pd, const shamrock::patch::SimulationBoxInfo &sim_box, const std::array< shamrock::patch::Patch, 8 > patches, std::array< std::reference_wrapper< shamrock::patch::PatchDataLayer >, 8 > pdats) (function) of namespace shamrock::scheduler is not documented.
+ src/shamrock/src/scheduler/SchedulerPatchData.cpp:291: warning: Member split_patchdata< u32_3 >(shamrock::patch::PatchDataLayer &original_pd, const shamrock::patch::SimulationBoxInfo &sim_box, const std::array< shamrock::patch::Patch, 8 > patches, std::array< std::reference_wrapper< shamrock::patch::PatchDataLayer >, 8 > pdats) (function) of namespace shamrock::scheduler is not documented.
- src/shamrock/src/scheduler/SchedulerPatchData.cpp:296: warning: Member split_patchdata< i64_3 >(shamrock::patch::PatchDataLayer &original_pd, const shamrock::patch::SimulationBoxInfo &sim_box, const std::array< shamrock::patch::Patch, 8 > patches, std::array< std::reference_wrapper< shamrock::patch::PatchDataLayer >, 8 > pdats) (function) of namespace shamrock::scheduler is not documented.
+ src/shamrock/src/scheduler/SchedulerPatchData.cpp:297: warning: Member split_patchdata< u64_3 >(shamrock::patch::PatchDataLayer &original_pd, const shamrock::patch::SimulationBoxInfo &sim_box, const std::array< shamrock::patch::Patch, 8 > patches, std::array< std::reference_wrapper< shamrock::patch::PatchDataLayer >, 8 > pdats) (function) of namespace shamrock::scheduler is not documented.
+ src/shamrock/src/scheduler/SchedulerPatchData.cpp:303: warning: Member split_patchdata< i64_3 >(shamrock::patch::PatchDataLayer &original_pd, const shamrock::patch::SimulationBoxInfo &sim_box, const std::array< shamrock::patch::Patch, 8 > patches, std::array< std::reference_wrapper< shamrock::patch::PatchDataLayer >, 8 > pdats) (function) of namespace shamrock::scheduler is not documented.
- src/shamrock/src/scheduler/SchedulerPatchData.cpp:39: warning: Compound shamrock::scheduler::Message is not documented.
+ src/shamrock/src/scheduler/SchedulerPatchData.cpp:40: warning: Compound shamrock::scheduler::Message is not documented.
- src/shamrock/src/scheduler/SchedulerPatchData.cpp:40: warning: Member buf (variable) of struct shamrock::scheduler::Message is not documented.
+ src/shamrock/src/scheduler/SchedulerPatchData.cpp:41: warning: Member buf (variable) of struct shamrock::scheduler::Message is not documented.
- src/shamrock/src/scheduler/SchedulerPatchData.cpp:41: warning: Member rank (variable) of struct shamrock::scheduler::Message is not documented.
+ src/shamrock/src/scheduler/SchedulerPatchData.cpp:42: warning: Member rank (variable) of struct shamrock::scheduler::Message is not documented.
- src/shamrock/src/scheduler/SchedulerPatchData.cpp:42: warning: Member tag (variable) of struct shamrock::scheduler::Message is not documented.
+ src/shamrock/src/scheduler/SchedulerPatchData.cpp:43: warning: Member tag (variable) of struct shamrock::scheduler::Message is not documented.
- src/shamrock/src/scheduler/SchedulerPatchData.cpp:45: warning: Member send_messages(std::vector< Message > &msgs, std::vector< MPI_Request > &rqs) (function) of namespace shamrock::scheduler is not documented.
+ src/shamrock/src/scheduler/SchedulerPatchData.cpp:46: warning: Member send_messages(std::vector< Message > &msgs, std::vector< MPI_Request > &rqs) (function) of namespace shamrock::scheduler is not documented.
- src/shamrock/src/scheduler/SchedulerPatchData.cpp:73: warning: Member recv_probe_messages(std::vector< Message > &msgs, std::vector< MPI_Request > &rqs) (function) of namespace shamrock::scheduler is not documented.
+ src/shamrock/src/scheduler/SchedulerPatchData.cpp:74: warning: Member recv_probe_messages(std::vector< Message > &msgs, std::vector< MPI_Request > &rqs) (function) of namespace shamrock::scheduler is not documented.
+ src/shamsys/src/SignalCatch.cpp:106: warning: Member register_signals() (function) of namespace shamsys is not documented.
+ src/shamsys/src/SignalCatch.cpp:106: warning: Member register_signals() (function) of namespace shamsys is not documented.
+ src/shamsys/src/SignalCatch.cpp:106: warning: Member register_signals() (function) of namespace shamsys is not documented.
- src/shamsys/src/SignalCatch.cpp:24: warning: Member signal_callback_handler(int signum) (function) of namespace shamsys::details is not documented.
- src/shamsys/src/SignalCatch.cpp:24: warning: Member signal_callback_handler(int signum) (function) of namespace shamsys::details is not documented.
- src/shamsys/src/SignalCatch.cpp:54: warning: Member register_signals() (function) of namespace shamsys is not documented.
- src/shamsys/src/SignalCatch.cpp:54: warning: Member register_signals() (function) of namespace shamsys is not documented.
- src/shamsys/src/SignalCatch.cpp:54: warning: Member register_signals() (function) of namespace shamsys is not documented.
+ src/shamsys/src/SignalCatch.cpp:83: warning: Member signal_callback_handler(int signum) (function) of namespace shamsys::details is not documented.
+ src/shamsys/src/SignalCatch.cpp:83: warning: Member signal_callback_handler(int signum) (function) of namespace shamsys::details is not documented.

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.

1 participant