Skip to content

Conversation

@tdavidcl
Copy link
Member

No description provided.

@github-actions
Copy link
Contributor

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

@gemini-code-assist
Copy link

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 enhances the SPH rendering capabilities by introducing a novel azymuthally integrated rendering mode. This feature allows for the computation of field integrals along ring-shaped paths, which is particularly useful for analyzing systems with cylindrical symmetry or for specific projection techniques. The changes involve defining a new geometric primitive for ring rays, implementing efficient intersection tests, and integrating this into the existing rendering pipeline with Python accessibility.

Highlights

  • New RingRay Structure: Introduced a RingRay struct in shammath/AABB.hpp to represent ring-shaped rays, including its center, radius, and orthonormal basis vectors.
  • AABB Intersection for RingRays: Added an intersect_ring_ray_approx method to the AABB class, enabling approximate intersection testing between Axis-Aligned Bounding Boxes and the new RingRay objects.
  • Azymuthally Integrated Rendering: Implemented compute_azymuthal_integ methods within the CartesianRender class, which perform field integration along RingRay paths using a RadixTree for efficient particle lookup and SPH kernel calculations.
  • Python Bindings: Exposed the new azymuthally integrated rendering functionality to Python users through pybind11, allowing for flexible field type selection and custom getters.
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

@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 an azimuthally integrated render feature. The implementation adds a RingRay struct for intersection testing and the core logic in compute_azymuthal_integ, along with Python bindings. The code is generally well-structured, but I've identified some areas for improvement regarding performance, accuracy, and code duplication. My review includes suggestions to pre-calculate vectors for better performance, increase the precision of a numerical integration, and refactor duplicated code for improved maintainability.

@tdavidcl tdavidcl changed the title [SPH] Implement azymuthally integrated render [SPH] Implement azimuthally integrated render Jan 30, 2026
tdavidcl and others added 2 commits January 30, 2026 02:07
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@github-actions
Copy link
Contributor

Workflow report

workflow report corresponding to commit c078fd6
Commiter email is 41898282+github-actions[bot]@users.noreply.github.com
You are using github private e-mail. This prevent proper tracing of who contributed what, please disable it (see Keep my email addresses private).
GitHub page artifact URL GitHub page artifact link (can expire)

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.

Clang-tidy diff report

No relevant changes found.
Well done!

You should now go back to your normal life and enjoy a hopefully sunny day while waiting for the review.

Doxygen diff with main

Removed warnings : 23
New warnings : 46
Warnings count : 8160 → 8183 (0.3%)

Detailed changes :
+ src/shammath/include/shammath/AABB.hpp:153: warning: Member get_radius() const (function) of struct shammath::AABB is not documented.
+ src/shammath/include/shammath/AABB.hpp:67: warning: Member T_prop (typedef) of struct shammath::RingRay is not documented.
+ src/shammath/include/shammath/AABB.hpp:68: warning: Member Tscal (typedef) of struct shammath::RingRay is not documented.
+ src/shammath/include/shammath/AABB.hpp:70: warning: Member center (variable) of struct shammath::RingRay is not documented.
+ src/shammath/include/shammath/AABB.hpp:71: warning: Member radius (variable) of struct shammath::RingRay is not documented.
+ src/shammath/include/shammath/AABB.hpp:72: warning: Member e_x (variable) of struct shammath::RingRay is not documented.
+ src/shammath/include/shammath/AABB.hpp:73: warning: Member e_y (variable) of struct shammath::RingRay is not documented.
+ src/shammath/include/shammath/AABB.hpp:75: warning: Member get_ez() (function) of struct shammath::RingRay is not documented.
+ src/shammath/include/shammath/AABB.hpp:79: warning: The following parameter of shammath::RingRay::RingRay(T center, Tscal radius, T e_x, T e_y) is not documented:
+ src/shammodels/sph/include/shammodels/sph/modules/render/CartesianRender.hpp:105: warning: Member compute_column_integ(std::string field_name, Tvec center, Tvec delta_x, Tvec delta_y, u32 nx, u32 ny, std::optional< std::function< pybind11::array_t< Tfield >(size_t, pybind11::dict &)> > custom_getter) (function) of class shammodels::sph::modules::CartesianRender is not documented.
- src/shammodels/sph/include/shammodels/sph/modules/render/CartesianRender.hpp:105: warning: Member compute_slice(std::string field_name, const std::vector< Tvec > &positions, std::optional< std::function< pybind11::array_t< Tfield >(size_t, pybind11::dict &)> > custom_getter) (function) of class shammodels::sph::modules::CartesianRender is not documented.
+ src/shammodels/sph/include/shammodels/sph/modules/render/CartesianRender.hpp:115: warning: Member compute_slice(std::string field_name, const std::vector< Tvec > &positions, std::optional< std::function< pybind11::array_t< Tfield >(size_t, pybind11::dict &)> > custom_getter) (function) of class shammodels::sph::modules::CartesianRender is not documented.
- src/shammodels/sph/include/shammodels/sph/modules/render/CartesianRender.hpp:116: warning: Member compute_column_integ(std::string field_name, const std::vector< shammath::Ray< Tvec > > &rays, std::optional< std::function< pybind11::array_t< Tfield >(size_t, pybind11::dict &)> > custom_getter) (function) of class shammodels::sph::modules::CartesianRender is not documented.
+ src/shammodels/sph/include/shammodels/sph/modules/render/CartesianRender.hpp:126: warning: Member compute_column_integ(std::string field_name, const std::vector< shammath::Ray< Tvec > > &rays, std::optional< std::function< pybind11::array_t< Tfield >(size_t, pybind11::dict &)> > custom_getter) (function) of class shammodels::sph::modules::CartesianRender is not documented.
+ src/shammodels/sph/include/shammodels/sph/modules/render/CartesianRender.hpp:137: warning: Member compute_azymuthal_integ(std::string field_name, const std::vector< shammath::RingRay< Tvec > > &ring_rays, std::optional< std::function< pybind11::array_t< Tfield >(size_t, pybind11::dict &)> > custom_getter) (function) of class shammodels::sph::modules::CartesianRender is not documented.
+ src/shammodels/sph/include/shammodels/sph/modules/render/CartesianRender.hpp:57: warning: Member compute_azymuthal_integ(std::function< field_getter_t > field_getter, const sham::DeviceBuffer< shammath::RingRay< Tvec > > &ring_rays) (function) of class shammodels::sph::modules::CartesianRender is not documented.
- src/shammodels/sph/include/shammodels/sph/modules/render/CartesianRender.hpp:57: warning: Member compute_slice(std::string field_name, const sham::DeviceBuffer< Tvec > &positions, std::optional< std::function< pybind11::array_t< Tfield >(size_t, pybind11::dict &)> > custom_getter) (function) of class shammodels::sph::modules::CartesianRender is not documented.
+ src/shammodels/sph/include/shammodels/sph/modules/render/CartesianRender.hpp:61: warning: Member compute_slice(std::string field_name, const sham::DeviceBuffer< Tvec > &positions, std::optional< std::function< pybind11::array_t< Tfield >(size_t, pybind11::dict &)> > custom_getter) (function) of class shammodels::sph::modules::CartesianRender is not documented.
- src/shammodels/sph/include/shammodels/sph/modules/render/CartesianRender.hpp:63: warning: Member compute_column_integ(std::string field_name, const sham::DeviceBuffer< shammath::Ray< Tvec > > &rays, std::optional< std::function< pybind11::array_t< Tfield >(size_t, pybind11::dict &)> > custom_getter) (function) of class shammodels::sph::modules::CartesianRender is not documented.
+ src/shammodels/sph/include/shammodels/sph/modules/render/CartesianRender.hpp:67: warning: Member compute_column_integ(std::string field_name, const sham::DeviceBuffer< shammath::Ray< Tvec > > &rays, std::optional< std::function< pybind11::array_t< Tfield >(size_t, pybind11::dict &)> > custom_getter) (function) of class shammodels::sph::modules::CartesianRender is not documented.
- src/shammodels/sph/include/shammodels/sph/modules/render/CartesianRender.hpp:69: warning: Member compute_slice(std::function< field_getter_t > field_getter, Tvec center, Tvec delta_x, Tvec delta_y, u32 nx, u32 ny) (function) of class shammodels::sph::modules::CartesianRender is not documented.
+ src/shammodels/sph/include/shammodels/sph/modules/render/CartesianRender.hpp:73: warning: Member compute_azymuthal_integ(std::string field_name, const sham::DeviceBuffer< shammath::RingRay< Tvec > > &ring_rays, std::optional< std::function< pybind11::array_t< Tfield >(size_t, pybind11::dict &)> > custom_getter) (function) of class shammodels::sph::modules::CartesianRender is not documented.
- src/shammodels/sph/include/shammodels/sph/modules/render/CartesianRender.hpp:77: warning: Member compute_column_integ(std::function< field_getter_t > field_getter, Tvec center, Tvec delta_x, Tvec delta_y, u32 nx, u32 ny) (function) of class shammodels::sph::modules::CartesianRender is not documented.
+ src/shammodels/sph/include/shammodels/sph/modules/render/CartesianRender.hpp:79: warning: Member compute_slice(std::function< field_getter_t > field_getter, Tvec center, Tvec delta_x, Tvec delta_y, u32 nx, u32 ny) (function) of class shammodels::sph::modules::CartesianRender is not documented.
- src/shammodels/sph/include/shammodels/sph/modules/render/CartesianRender.hpp:85: warning: Member compute_slice(std::string field_name, Tvec center, Tvec delta_x, Tvec delta_y, u32 nx, u32 ny, std::optional< std::function< pybind11::array_t< Tfield >(size_t, pybind11::dict &)> > custom_getter) (function) of class shammodels::sph::modules::CartesianRender is not documented.
+ src/shammodels/sph/include/shammodels/sph/modules/render/CartesianRender.hpp:87: warning: Member compute_column_integ(std::function< field_getter_t > field_getter, Tvec center, Tvec delta_x, Tvec delta_y, u32 nx, u32 ny) (function) of class shammodels::sph::modules::CartesianRender is not documented.
- src/shammodels/sph/include/shammodels/sph/modules/render/CartesianRender.hpp:95: warning: Member compute_column_integ(std::string field_name, Tvec center, Tvec delta_x, Tvec delta_y, u32 nx, u32 ny, std::optional< std::function< pybind11::array_t< Tfield >(size_t, pybind11::dict &)> > custom_getter) (function) of class shammodels::sph::modules::CartesianRender is not documented.
+ src/shammodels/sph/include/shammodels/sph/modules/render/CartesianRender.hpp:95: warning: Member compute_slice(std::string field_name, Tvec center, Tvec delta_x, Tvec delta_y, u32 nx, u32 ny, std::optional< std::function< pybind11::array_t< Tfield >(size_t, pybind11::dict &)> > custom_getter) (function) of class shammodels::sph::modules::CartesianRender is not documented.
+ src/shammodels/sph/src/modules/render/CartesianRender.cpp:173: warning: no matching class member found for 
- src/shammodels/sph/src/pySPHModel.cpp:1131: warning: Member add_analysisBarycenter_instance(py::module &m, std::string name_model) (function) of file pySPHModel.cpp is not documented.
- src/shammodels/sph/src/pySPHModel.cpp:1149: warning: Member add_analysisEnergyKinetic_instance(py::module &m, std::string name_model) (function) of file pySPHModel.cpp is not documented.
+ src/shammodels/sph/src/pySPHModel.cpp:1164: warning: Member add_analysisBarycenter_instance(py::module &m, std::string name_model) (function) of file pySPHModel.cpp is not documented.
- src/shammodels/sph/src/pySPHModel.cpp:1165: warning: Member add_analysisEnergyPotential_instance(py::module &m, std::string name_model) (function) of file pySPHModel.cpp is not documented.
- src/shammodels/sph/src/pySPHModel.cpp:1181: warning: Member add_analysisTotalMomentum_instance(py::module &m, std::string name_model) (function) of file pySPHModel.cpp is not documented.
+ src/shammodels/sph/src/pySPHModel.cpp:1182: warning: Member add_analysisEnergyKinetic_instance(py::module &m, std::string name_model) (function) of file pySPHModel.cpp is not documented.
+ src/shammodels/sph/src/pySPHModel.cpp:1198: warning: Member add_analysisEnergyPotential_instance(py::module &m, std::string name_model) (function) of file pySPHModel.cpp is not documented.
- src/shammodels/sph/src/pySPHModel.cpp:1199: warning: Member analysis_impl(shammodels::sph::Model< Tvec, SPHKernel > &model) -> Analysis (function) of file pySPHModel.cpp is not documented.
- src/shammodels/sph/src/pySPHModel.cpp:1204: warning: Member register_analysis_impl_for_each_kernel(py::module &msph, const char *name_class) (function) of file pySPHModel.cpp is not documented.
+ src/shammodels/sph/src/pySPHModel.cpp:1214: warning: Member add_analysisTotalMomentum_instance(py::module &m, std::string name_model) (function) of file pySPHModel.cpp is not documented.
+ src/shammodels/sph/src/pySPHModel.cpp:1232: warning: Member analysis_impl(shammodels::sph::Model< Tvec, SPHKernel > &model) -> Analysis (function) of file pySPHModel.cpp is not documented.
+ src/shammodels/sph/src/pySPHModel.cpp:1237: warning: Member register_analysis_impl_for_each_kernel(py::module &msph, const char *name_class) (function) of file pySPHModel.cpp is not documented.
- src/shammodels/sph/src/pySPHModel.cpp:1265: warning: Member Register_pymod(pysphmodel) (function) of file pySPHModel.cpp is not documented.
+ src/shammodels/sph/src/pySPHModel.cpp:1298: warning: Member Register_pymod(pysphmodel) (function) of file pySPHModel.cpp is not documented.
+ src/shampylib/src/math/pyRay.cpp:46: warning: Member init_shamrock_math_RingRay(py::module &m, std::string name) (function) of namespace shampylib is not documented.
+ src/shampylib/src/math/pyRay.cpp:46: warning: Member init_shamrock_math_RingRay(py::module &m, std::string name) (function) of namespace shampylib is not documented.
+ src/shampylib/src/math/pyRay.cpp:71: warning: Member init_shamrock_math_RingRay< f64_3 >(py::module &m, std::string name) (function) of namespace shampylib is not documented.

@tdavidcl tdavidcl merged commit 2928260 into Shamrock-code:main Jan 31, 2026
62 checks passed
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