Skip to content

Cleanup/includes#289

Open
ape33 wants to merge 6 commits into
devfrom
cleanup/includes
Open

Cleanup/includes#289
ape33 wants to merge 6 commits into
devfrom
cleanup/includes

Conversation

@ape33

@ape33 ape33 commented Jun 30, 2026

Copy link
Copy Markdown
Member

This PR solves issue #285

@ape33
ape33 requested review from 97gamjak and galjos June 30, 2026 12:03
@ape33 ape33 added the cleanup label Jun 30, 2026
@ape33 ape33 linked an issue Jun 30, 2026 that may be closed by this pull request
@pq-perf-bot

pq-perf-bot Bot commented Jun 30, 2026

Copy link
Copy Markdown

⚡ Performance (instruction count) — ✅ no regressions

per-benchmark breakdown
benchmark base Ir PR Ir Δ
bondedForces 41.46M 41.46M -0.00%
boxTransforms 10.67M 10.67M +0.01%
constraints 11.38M 11.38M +0.00%
coulombKernel 5.80M 5.80M +0.00%
forceKernel 15.33M 15.33M -0.00%
integrator 32.17M 32.17M +0.00%
kinetics 9.53M 9.53M +0.00%
linearAlgebra 2.08M 2.07M -0.40%
nonCoulombPairs 5.48M 5.48M -0.00%
shiftVector 5.81M 5.81M +0.02%
virial 11.63M 11.63M +0.00%

Deterministic callgrind instruction counts vs the base branch; gated at ±2%. Not wall-clock.

@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.44%. Comparing base (bafd47e) to head (e151a8b).
⚠️ Report is 4 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #289      +/-   ##
==========================================
+ Coverage   88.26%   88.44%   +0.17%     
==========================================
  Files         284      284              
  Lines       10983    11013      +30     
  Branches     3421     3435      +14     
==========================================
+ Hits         9694     9740      +46     
+ Misses       1249     1233      -16     
  Partials       40       40              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@galjos galjos left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@ape33 added some tests so this PR gets more coverage. Otherwise, I approve...

@ape33

ape33 commented Jul 2, 2026

Copy link
Copy Markdown
Member Author

@ape33 added some tests so this PR gets more coverage. Otherwise, I approve...

@galjos
your last two commits cancel each other out perfectly, so no changes??

@galjos

galjos commented Jul 2, 2026

Copy link
Copy Markdown
Member

@ape33 added some tests so this PR gets more coverage. Otherwise, I approve...

@galjos your last two commits cancel each other out perfectly, so no changes??

Yes sorry, they don't fit.

Comment thread include/config/defaults.hpp Outdated
Comment thread include/engine/engine.hpp

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

make a decl of the destructor in this file and its impl in the .cpp file to get rid of the pragma: keep

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Only of interest for molecularVirial.hpp and potentialBruteForce.hpp, because all other includes are participating in return types. Furthermore, the two mentioned includes need to be seen due to the conversion to their base class...

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I dont get this comment? the pragma keep definitely indocates somewhere a bug.

Why exactly do we need this here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

okay, lets consider PotentialBruteForce as example: when I remove the line
#include "potentialBruteForce.hpp" // IWYU pragma: keep
The following error is flagged on line 71:
No viable conversion from 'shared_ptr<_NonArray<potential::PotentialBruteForce>>' to 'shared_ptr<potential::Potential>'clang(typecheck_nonviable_condition)
so the include is needed. However, also the // IWYU pragma: keep is needed, otherwise clangd complains. Why? Because the alias pq::BruteForcePot defined in typeAliases.hpp is used and not potential::PotentialBruteForce, which would be defined in potentialBruteForce.hpp

} // namespace forceField

#include "forcefield.tpp.hpp" // DO NOT MOVE THIS LINE
#include "forcefield.tpp.hpp" // IWYU pragma: keep - DO NOT MOVE THIS LINE

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

#ifndef _FORCE_FIELD_TPP_
#include "forcefield.tpp.hpp"   // IWYU pragma: keep - DO NOT MOVE THIS LINE
#endif // _FORCE_FIELD_TPP_

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@97gamjak does not work on my end, clangd keeps flagging that the include is not directly used...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

try using a .clang-tidy file to handle this

Comment thread include/config/defaults.hpp Outdated
Comment thread .clangd Outdated
- typecheck_expression_not_modifiable_lvalue No newline at end of file
Suppress:
- pp_including_mainfile_in_preamble
- typecheck_expression_not_modifiable_lvalue

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

i think none of these suppressions should be needed... why are they here?

@ape33 ape33 Jul 21, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

- typecheck_expression_not_modifiable_lvalue is needed to suppress an error that occurs in unicode.h, which is used indirectly by the chrono header, which is in turn used by typeAliases.hpp, which is everywhere...
the error that is flagged:

In included file: expression is not assignableclang(typecheck_expression_not_modifiable_lvalue)
unicode.h(807, 4): Error occurred here

- pp_file_not_found is needed to suppress this error:

In included file: 'Eigen/Dense' file not found
matrixClass.hpp(29, 10): Error occurred here

- pp_including_mainfile_in_preamble enables us to add an .hpp file into the associated .tpp.hpp file without this kind of error being flagged:

In included file: main file cannot be included recursively when building a preamble
vector3dClass.hpp(150, 10): Error occurred here

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

first error should je suppressed by suppressibg external dependencies

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

second error leans we have a problem in our cmake

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

third error needs to be investigated

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

first error should je suppressed by suppressibg external dependencies

I haven't found a way to easily do this. However, I found the root cause, which is a bug in gcc/14 and lower. Using gcc/15.2.0 resolved the error flagged by clangd and I will remove the associated line in the .clangd file.

Comment thread include/engine/engine.hpp

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I dont get this comment? the pragma keep definitely indocates somewhere a bug.

Why exactly do we need this here?

@ape33
ape33 requested a review from 97gamjak July 21, 2026 13:33

@97gamjak 97gamjak left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

see comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove Redundant Includes

3 participants