Skip to content

Initial Numba support#626

Open
wlav wants to merge 18 commits into
Framework-R-D:mainfrom
wlav:numba-support
Open

Initial Numba support#626
wlav wants to merge 18 commits into
Framework-R-D:mainfrom
wlav:numba-support

Conversation

@wlav

@wlav wlav commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

This PR adds "native" Numba support to phlex.

Numba was usable out-of-the-box already, through Python, but even if the Numba function itself didn't use the GIL, it still needed it at the start of every call (through the wrapper) and all Python/C++ converters required them, too. The implementation in this PR allows for calling the Numba JITed C-function directly, using converters that do not involve Python, and a dispatch through libffi. That sets up a workflow that doesn't require the GIL anywhere beyond configuration/registration time, thus enabling strong scaling (as far as Phlex is concerned) during graph execution.

This PR is for transforms only (observers and providers to follow) and only supports builtin types. Arrays and PODs (by member copy) should be doable as well, but Numba does not support arbitrary C++ classes.

The code in the module wrapper was significantly refactored, to maximize code reuse.

Note: it requires libffi, which will be available on most Linux boxes, but probably needs to be installed with spack in other places, so the spack recipe would need updating as well.

@greenc-FNAL

greenc-FNAL commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

✅ 7 CodeQL alerts resolved compared to main

  • Warning # 182 actions/unpinned-tag at .github/actions/prepare-check-outputs/action.yaml:47:13 — Unpinned 3rd party Action 'action.yaml' step Uses Step: get_pr uses 'Framework-R-D/phlex/.github/actions/get-pr-info' with ref 'main', not a pinned commit hash
  • Warning # 183 actions/unpinned-tag at .github/actions/prepare-check-outputs/action.yaml:51:13 — Unpinned 3rd party Action 'action.yaml' step Uses Step: detect_act uses 'Framework-R-D/phlex/.github/actions/detect-act-env' with ref 'main', not a pinned commit hash
  • Warning # 184 actions/unpinned-tag at .github/actions/prepare-fix-outputs/action.yaml:29:13 — Unpinned 3rd party Action 'action.yaml' step Uses Step: get_pr uses 'Framework-R-D/phlex/.github/actions/get-pr-info' with ref 'main', not a pinned commit hash
  • Warning # 185 actions/unpinned-tag at .github/actions/run-change-detection/action.yaml:62:13 — Unpinned 3rd party Action 'action.yaml' step Uses Step: filter uses 'Framework-R-D/phlex/.github/actions/detect-relevant-changes' with ref 'main', not a pinned commit hash
  • Warning # 186 actions/unpinned-tag at .github/actions/workflow-setup/action.yaml:68:13 — Unpinned 3rd party Action 'action.yaml' step Uses Step: prepare_check uses 'Framework-R-D/phlex/.github/actions/prepare-check-outputs' with ref 'main', not a pinned commit hash
  • Warning # 187 actions/unpinned-tag at .github/actions/workflow-setup/action.yaml:79:13 — Unpinned 3rd party Action 'action.yaml' step Uses Step: prepare_fix uses 'Framework-R-D/phlex/.github/actions/prepare-fix-outputs' with ref 'main', not a pinned commit hash
  • Warning # 188 actions/unpinned-tag at .github/actions/workflow-setup/action.yaml:128:13 — Unpinned 3rd party Action 'action.yaml' step Uses Step: detect uses 'Framework-R-D/phlex/.github/actions/run-change-detection' with ref 'main', not a pinned commit hash

Review the full CodeQL report for details.

@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Clang-Tidy Check Results

55 new issue(s) introduced by this patch (5842 total).

New issues on modified lines:

  • /__w/phlex/phlex/phlex-src/plugins/python/src/dyncall.cpp:17: warning: variable 'ffi_t' is non-const and globally accessible, consider making it const
  • /__w/phlex/phlex/phlex-src/plugins/python/src/dyncall.cpp:62: warning: do not use array subscript when the index is not an integer constant expression
  • /__w/phlex/phlex/phlex-src/plugins/python/src/dyncall.cpp:67: warning: variable 'status' is not initialized
  • /__w/phlex/phlex/phlex-src/plugins/python/src/dyncall.cpp:69: warning: do not use array subscript when the index is not an integer constant expression
  • /__w/phlex/phlex/phlex-src/plugins/python/src/dyncall.cpp:71: warning: do not use array subscript when the index is not an integer constant expression
  • /__w/phlex/phlex/phlex-src/plugins/python/src/dyncall.cpp:76: warning: do not use C-style cast to convert between unrelated types
  • /__w/phlex/phlex/phlex-src/plugins/python/src/dyncall.hpp:72: warning: do not access members of unions; consider using (boost::)variant instead
  • /__w/phlex/phlex/phlex-src/plugins/python/src/dyncall.hpp:73: warning: do not access members of unions; consider using (boost::)variant instead
  • /__w/phlex/phlex/phlex-src/plugins/python/src/dyncall.hpp:74: warning: do not access members of unions; consider using (boost::)variant instead
  • /__w/phlex/phlex/phlex-src/plugins/python/src/dyncall.hpp:75: warning: do not access members of unions; consider using (boost::)variant instead
  • /__w/phlex/phlex/phlex-src/plugins/python/src/dyncall.hpp:76: warning: do not access members of unions; consider using (boost::)variant instead
  • /__w/phlex/phlex/phlex-src/plugins/python/src/dyncall.hpp:77: warning: do not access members of unions; consider using (boost::)variant instead
  • /__w/phlex/phlex/phlex-src/plugins/python/src/dyncall.hpp:78: warning: do not access members of unions; consider using (boost::)variant instead
  • /__w/phlex/phlex/phlex-src/plugins/python/src/dyncall.hpp:79: warning: do not access members of unions; consider using (boost::)variant instead
  • /__w/phlex/phlex/phlex-src/plugins/python/src/dyncall.hpp:80: warning: do not access members of unions; consider using (boost::)variant instead
  • /__w/phlex/phlex/phlex-src/plugins/python/src/dyncall.hpp:81: warning: do not access members of unions; consider using (boost::)variant instead
  • /__w/phlex/phlex/phlex-src/plugins/python/src/dyncall.hpp:82: warning: do not access members of unions; consider using (boost::)variant instead
  • /__w/phlex/phlex/phlex-src/plugins/python/src/dyncall.hpp:83: warning: do not access members of unions; consider using (boost::)variant instead
  • /__w/phlex/phlex/phlex-src/plugins/python/src/dyncall.hpp:84: warning: do not access members of unions; consider using (boost::)variant instead
  • /__w/phlex/phlex/phlex-src/plugins/python/src/dyncall.hpp:89: warning: do not access members of unions; consider using (boost::)variant instead
  • /__w/phlex/phlex/phlex-src/plugins/python/src/dyncall.hpp:90: warning: do not access members of unions; consider using (boost::)variant instead
  • /__w/phlex/phlex/phlex-src/plugins/python/src/dyncall.hpp:91: warning: do not access members of unions; consider using (boost::)variant instead
  • /__w/phlex/phlex/phlex-src/plugins/python/src/dyncall.hpp:92: warning: do not access members of unions; consider using (boost::)variant instead
  • /__w/phlex/phlex/phlex-src/plugins/python/src/dyncall.hpp:93: warning: do not access members of unions; consider using (boost::)variant instead
  • /__w/phlex/phlex/phlex-src/plugins/python/src/dyncall.hpp:94: warning: do not access members of unions; consider using (boost::)variant instead
  • /__w/phlex/phlex/phlex-src/plugins/python/src/dyncall.hpp:95: warning: do not access members of unions; consider using (boost::)variant instead
  • /__w/phlex/phlex/phlex-src/plugins/python/src/dyncall.hpp:96: warning: do not access members of unions; consider using (boost::)variant instead
  • /__w/phlex/phlex/phlex-src/plugins/python/src/dyncall.hpp:96: warning: integer literal has suffix 'l', which is not uppercase
  • /__w/phlex/phlex/phlex-src/plugins/python/src/dyncall.hpp:97: warning: do not access members of unions; consider using (boost::)variant instead
  • /__w/phlex/phlex/phlex-src/plugins/python/src/dyncall.hpp:98: warning: do not access members of unions; consider using (boost::)variant instead
  • /__w/phlex/phlex/phlex-src/plugins/python/src/dyncall.hpp:99: warning: do not access members of unions; consider using (boost::)variant instead
  • /__w/phlex/phlex/phlex-src/plugins/python/src/dyncall.hpp:100: warning: do not access members of unions; consider using (boost::)variant instead
  • /__w/phlex/phlex/phlex-src/plugins/python/src/dyncall.hpp:108: warning: multilevel pointer conversion from 'void **' to 'void *', please use explicit cast
  • /__w/phlex/phlex/phlex-src/plugins/python/src/dyncall.hpp:108: warning: do not access members of unions; consider using (boost::)variant instead
  • /__w/phlex/phlex/phlex-src/plugins/python/src/dyncall.hpp:110: warning: do not access members of unions; consider using (boost::)variant instead
  • /__w/phlex/phlex/phlex-src/plugins/python/src/dyncall.hpp:112: warning: do not access members of unions; consider using (boost::)variant instead
  • /__w/phlex/phlex/phlex-src/plugins/python/src/dyncall.hpp:114: warning: do not access members of unions; consider using (boost::)variant instead
  • /__w/phlex/phlex/phlex-src/plugins/python/src/dyncall.hpp:116: warning: do not access members of unions; consider using (boost::)variant instead
  • /__w/phlex/phlex/phlex-src/plugins/python/src/dyncall.hpp:118: warning: do not access members of unions; consider using (boost::)variant instead
  • /__w/phlex/phlex/phlex-src/plugins/python/src/dyncall.hpp:120: warning: do not access members of unions; consider using (boost::)variant instead
  • /__w/phlex/phlex/phlex-src/plugins/python/src/dyncall.hpp:122: warning: do not access members of unions; consider using (boost::)variant instead
  • /__w/phlex/phlex/phlex-src/plugins/python/src/dyncall.hpp:124: warning: do not access members of unions; consider using (boost::)variant instead
  • /__w/phlex/phlex/phlex-src/plugins/python/src/dyncall.hpp:126: warning: do not access members of unions; consider using (boost::)variant instead
  • /__w/phlex/phlex/phlex-src/plugins/python/src/dyncall.hpp:128: warning: do not access members of unions; consider using (boost::)variant instead
  • /__w/phlex/phlex/phlex-src/plugins/python/src/dyncall.hpp:130: warning: do not access members of unions; consider using (boost::)variant instead
  • /__w/phlex/phlex/phlex-src/plugins/python/src/modulewrap.cpp:110: warning: do not access members of unions; consider using (boost::)variant instead
  • /__w/phlex/phlex/phlex-src/plugins/python/src/modulewrap.cpp:169: warning: do not use C-style cast to convert between unrelated types
  • /__w/phlex/phlex/phlex-src/plugins/python/src/modulewrap.cpp:187: warning: do not access members of unions; consider using (boost::)variant instead
  • /__w/phlex/phlex/phlex-src/plugins/python/src/modulewrap.cpp:200: warning: do not use C-style cast to convert between unrelated types
  • /__w/phlex/phlex/phlex-src/plugins/python/src/modulewrap.cpp:200: warning: do not access members of unions; consider using (boost::)variant instead
  • /__w/phlex/phlex/phlex-src/plugins/python/src/modulewrap.cpp:208: warning: do not access members of unions; consider using (boost::)variant instead
  • /__w/phlex/phlex/phlex-src/plugins/python/src/modulewrap.cpp:222: warning: 'm_rtype' should be initialized in a member initializer of the constructor
  • /__w/phlex/phlex/phlex-src/plugins/python/src/modulewrap.cpp:602: warning: do not access members of unions; consider using (boost::)variant instead
  • /__w/phlex/phlex/phlex-src/plugins/python/src/modulewrap.cpp:603: warning: do not access members of unions; consider using (boost::)variant instead
  • /__w/phlex/phlex/phlex-src/plugins/python/src/modulewrap.cpp:976: warning: 'func' used after it was forwarded

All issues by check:

  • readability-identifier-naming: 1826
  • readability-redundant-typename: 1217
  • readability-redundant-member-init: 1138
  • performance-unnecessary-value-param: 478
  • readability-avoid-const-params-in-decls: 239
  • modernize-pass-by-value: 199
  • readability-braces-around-statements: 129
  • cppcoreguidelines-pro-type-union-access: 91
  • readability-convert-member-functions-to-static: 79
  • modernize-use-designated-initializers: 72
  • readability-const-return-type: 47
  • modernize-avoid-c-style-cast: 33
  • modernize-use-auto: 28
  • readability-inconsistent-ifelse-braces: 21
  • readability-qualified-auto: 20
  • modernize-use-using: 19
  • readability-redundant-control-flow: 19
  • modernize-avoid-c-arrays: 18
  • readability-math-missing-parentheses: 17
  • modernize-use-equals-default: 14
  • readability-function-size: 13
  • readability-static-definition-in-anonymous-namespace: 13
  • modernize-return-braced-init-list: 10
  • modernize-concat-nested-namespaces: 10
  • cppcoreguidelines-pro-type-cstyle-cast: 9
  • readability-isolate-declaration: 8
  • readability-inconsistent-declaration-parameter-name: 7
  • cppcoreguidelines-special-member-functions: 7
  • readability-container-contains: 7
  • modernize-use-starts-ends-with: 6
  • readability-redundant-casting: 5
  • readability-redundant-access-specifiers: 5
  • modernize-use-ranges: 5
  • readability-container-size-empty: 5
  • bugprone-branch-clone: 3
  • cppcoreguidelines-pro-bounds-constant-array-index: 3
  • modernize-use-std-numbers: 3
  • readability-else-after-return: 2
  • cert-dcl16-c: 2
  • bugprone-multi-level-implicit-pointer-conversion: 2
  • clang-analyzer-security.ArrayBound: 2
  • modernize-make-shared: 1
  • cppcoreguidelines-avoid-non-const-global-variables: 1
  • cppcoreguidelines-init-variables: 1
  • modernize-use-emplace: 1
  • cppcoreguidelines-prefer-member-initializer: 1
  • readability-simplify-boolean-expr: 1
  • modernize-use-integer-sign-comparison: 1
  • readability-use-anyofallof: 1
  • bugprone-use-after-move: 1
  • modernize-redundant-void-arg: 1
  • readability-redundant-string-init: 1

See inline comments for details. Comment @phlexbot tidy-fix to auto-fix.

@codecov

codecov Bot commented Jun 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 58.64662% with 110 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
plugins/python/src/modulewrap.cpp 66.66% 34 Missing and 28 partials ⚠️
plugins/python/src/dyncall.cpp 43.10% 31 Missing and 2 partials ⚠️
plugins/python/src/dyncall.hpp 13.33% 13 Missing ⚠️
plugins/python/python/phlex/_typing.py 71.42% 2 Missing ⚠️

❌ Your patch check has failed because the patch coverage (58.64%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

@@            Coverage Diff             @@
##             main     #626      +/-   ##
==========================================
- Coverage   82.66%   81.33%   -1.34%     
==========================================
  Files         161      165       +4     
  Lines        5920     6016      +96     
  Branches      681      703      +22     
==========================================
- Hits         4894     4893       -1     
- Misses        806      885      +79     
- Partials      220      238      +18     
Flag Coverage Δ
scripts 76.36% <ø> (ø)
unittests 83.84% <58.64%> (-2.09%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
plugins/python/python/phlex/_typing.py 92.30% <71.42%> (-2.06%) ⬇️
plugins/python/src/dyncall.hpp 13.33% <13.33%> (ø)
plugins/python/src/dyncall.cpp 43.10% <43.10%> (ø)
plugins/python/src/modulewrap.cpp 73.78% <66.66%> (-6.85%) ⬇️

... and 21 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a2e948b...913391c. Read the comment docs.

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

@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Clang-Tidy Check Results

3 new issue(s) introduced by this patch (5777 total).

New issues on modified lines:

  • /__w/phlex/phlex/phlex-src/plugins/python/src/dyncall.hpp:35: warning: declaration uses identifier '_object', which is reserved in the global namespace
  • /__w/phlex/phlex/phlex-src/plugins/python/src/modulewrap.cpp:969: warning: forwarding reference parameter 'func' is never forwarded inside the function body
  • /__w/phlex/phlex/phlex-src/plugins/python/src/dyncall.cpp:66: warning: repeated branch body in conditional chain

All issues by check:

  • readability-identifier-naming: 1807
  • readability-redundant-typename: 1217
  • readability-redundant-member-init: 1138
  • performance-unnecessary-value-param: 479
  • readability-avoid-const-params-in-decls: 257
  • modernize-pass-by-value: 200
  • readability-braces-around-statements: 116
  • readability-convert-member-functions-to-static: 80
  • modernize-use-designated-initializers: 72
  • readability-use-concise-preprocessor-directives: 60
  • readability-const-return-type: 47
  • modernize-avoid-c-style-cast: 27
  • modernize-use-auto: 26
  • modernize-use-using: 21
  • readability-inconsistent-ifelse-braces: 21
  • readability-qualified-auto: 20
  • readability-redundant-control-flow: 19
  • readability-math-missing-parentheses: 17
  • modernize-avoid-c-arrays: 16
  • modernize-use-equals-default: 14
  • readability-static-definition-in-anonymous-namespace: 14
  • readability-function-size: 12
  • modernize-concat-nested-namespaces: 10
  • modernize-return-braced-init-list: 10
  • readability-isolate-declaration: 8
  • readability-inconsistent-declaration-parameter-name: 7
  • readability-container-contains: 7
  • cppcoreguidelines-special-member-functions: 7
  • modernize-use-starts-ends-with: 6
  • modernize-use-ranges: 5
  • readability-redundant-casting: 5
  • readability-container-size-empty: 5
  • readability-redundant-access-specifiers: 5
  • bugprone-branch-clone: 4
  • modernize-use-std-numbers: 3
  • readability-else-after-return: 2
  • clang-analyzer-security.ArrayBound: 2
  • bugprone-reserved-identifier: 2
  • modernize-redundant-void-arg: 1
  • modernize-make-shared: 1
  • readability-redundant-string-init: 1
  • modernize-use-emplace: 1
  • readability-simplify-boolean-expr: 1
  • modernize-use-integer-sign-comparison: 1
  • readability-use-anyofallof: 1
  • cppcoreguidelines-missing-std-forward: 1
  • performance-move-const-arg: 1

See inline comments for details. Comment @phlexbot tidy-fix to auto-fix.

@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Clang-Tidy Check Results

2 new issue(s) introduced by this patch (5769 total).

New issues on modified lines:

  • /__w/phlex/phlex/phlex-src/plugins/python/src/dyncall.cpp:67: warning: repeated branch body in conditional chain
  • /__w/phlex/phlex/phlex-src/plugins/python/src/modulewrap.cpp:978: warning: 'func' used after it was forwarded

All issues by check:

  • readability-identifier-naming: 1804
  • readability-redundant-typename: 1217
  • readability-redundant-member-init: 1138
  • performance-unnecessary-value-param: 479
  • readability-avoid-const-params-in-decls: 257
  • modernize-pass-by-value: 200
  • readability-braces-around-statements: 116
  • readability-convert-member-functions-to-static: 80
  • modernize-use-designated-initializers: 72
  • readability-use-concise-preprocessor-directives: 60
  • readability-const-return-type: 47
  • modernize-avoid-c-style-cast: 27
  • modernize-use-auto: 26
  • readability-inconsistent-ifelse-braces: 21
  • readability-qualified-auto: 20
  • modernize-use-using: 19
  • readability-redundant-control-flow: 19
  • readability-math-missing-parentheses: 17
  • modernize-avoid-c-arrays: 15
  • readability-static-definition-in-anonymous-namespace: 14
  • modernize-use-equals-default: 14
  • readability-function-size: 12
  • modernize-return-braced-init-list: 10
  • modernize-concat-nested-namespaces: 10
  • readability-isolate-declaration: 8
  • readability-inconsistent-declaration-parameter-name: 7
  • cppcoreguidelines-special-member-functions: 7
  • readability-container-contains: 7
  • modernize-use-starts-ends-with: 6
  • readability-redundant-casting: 5
  • readability-redundant-access-specifiers: 5
  • modernize-use-ranges: 5
  • readability-container-size-empty: 5
  • bugprone-branch-clone: 4
  • modernize-use-std-numbers: 3
  • readability-else-after-return: 2
  • clang-analyzer-security.ArrayBound: 2
  • readability-redundant-string-init: 1
  • performance-move-const-arg: 1
  • modernize-make-shared: 1
  • modernize-use-emplace: 1
  • readability-simplify-boolean-expr: 1
  • modernize-use-integer-sign-comparison: 1
  • readability-use-anyofallof: 1
  • bugprone-use-after-move: 1
  • modernize-redundant-void-arg: 1

See inline comments for details. Comment @phlexbot tidy-fix to auto-fix.

@wlav

wlav commented Jun 3, 2026

Copy link
Copy Markdown
Contributor Author

@phlexbot header-guards-fix

@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Automatic header-guards fixes pushed (commit ea7dff7).
⚠️ Note: Some issues may require manual review and fixing.

@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Clang-Tidy Check Results

2 new issue(s) introduced by this patch (5767 total).

New issues on modified lines:

  • /__w/phlex/phlex/phlex-src/plugins/python/src/dyncall.cpp:67: warning: repeated branch body in conditional chain
  • /__w/phlex/phlex/phlex-src/plugins/python/src/modulewrap.cpp:978: warning: 'func' used after it was forwarded

All issues by check:

  • readability-identifier-naming: 1802
  • readability-redundant-typename: 1217
  • readability-redundant-member-init: 1138
  • performance-unnecessary-value-param: 479
  • readability-avoid-const-params-in-decls: 257
  • modernize-pass-by-value: 200
  • readability-braces-around-statements: 116
  • readability-convert-member-functions-to-static: 80
  • modernize-use-designated-initializers: 72
  • readability-use-concise-preprocessor-directives: 60
  • readability-const-return-type: 47
  • modernize-avoid-c-style-cast: 27
  • modernize-use-auto: 26
  • readability-inconsistent-ifelse-braces: 21
  • readability-qualified-auto: 20
  • modernize-use-using: 19
  • readability-redundant-control-flow: 19
  • readability-math-missing-parentheses: 17
  • modernize-avoid-c-arrays: 15
  • modernize-use-equals-default: 14
  • readability-static-definition-in-anonymous-namespace: 14
  • readability-function-size: 12
  • modernize-concat-nested-namespaces: 10
  • modernize-return-braced-init-list: 10
  • readability-isolate-declaration: 8
  • readability-container-contains: 7
  • readability-inconsistent-declaration-parameter-name: 7
  • cppcoreguidelines-special-member-functions: 7
  • modernize-use-starts-ends-with: 6
  • readability-redundant-access-specifiers: 5
  • modernize-use-ranges: 5
  • readability-container-size-empty: 5
  • readability-redundant-casting: 5
  • bugprone-branch-clone: 4
  • modernize-use-std-numbers: 3
  • clang-analyzer-security.ArrayBound: 2
  • readability-else-after-return: 2
  • modernize-redundant-void-arg: 1
  • modernize-use-emplace: 1
  • readability-simplify-boolean-expr: 1
  • modernize-use-integer-sign-comparison: 1
  • readability-use-anyofallof: 1
  • bugprone-use-after-move: 1
  • modernize-make-shared: 1
  • performance-move-const-arg: 1
  • readability-redundant-string-init: 1

See inline comments for details. Comment @phlexbot tidy-fix to auto-fix.

@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Clang-Tidy Check Results

Found 5765 issue(s); none are newly introduced by this patch.

All issues by check:

  • readability-identifier-naming: 1802
  • readability-redundant-typename: 1217
  • readability-redundant-member-init: 1138
  • performance-unnecessary-value-param: 479
  • readability-avoid-const-params-in-decls: 257
  • modernize-pass-by-value: 200
  • readability-braces-around-statements: 116
  • readability-convert-member-functions-to-static: 80
  • modernize-use-designated-initializers: 72
  • readability-use-concise-preprocessor-directives: 60
  • readability-const-return-type: 47
  • modernize-avoid-c-style-cast: 27
  • modernize-use-auto: 26
  • readability-inconsistent-ifelse-braces: 21
  • readability-qualified-auto: 20
  • readability-redundant-control-flow: 19
  • modernize-use-using: 19
  • readability-math-missing-parentheses: 17
  • modernize-avoid-c-arrays: 15
  • modernize-use-equals-default: 14
  • readability-static-definition-in-anonymous-namespace: 14
  • readability-function-size: 12
  • modernize-concat-nested-namespaces: 10
  • modernize-return-braced-init-list: 10
  • readability-isolate-declaration: 8
  • readability-container-contains: 7
  • readability-inconsistent-declaration-parameter-name: 7
  • cppcoreguidelines-special-member-functions: 7
  • modernize-use-starts-ends-with: 6
  • readability-redundant-access-specifiers: 5
  • modernize-use-ranges: 5
  • readability-container-size-empty: 5
  • readability-redundant-casting: 5
  • bugprone-branch-clone: 3
  • modernize-use-std-numbers: 3
  • readability-else-after-return: 2
  • clang-analyzer-security.ArrayBound: 2
  • readability-redundant-string-init: 1
  • modernize-make-shared: 1
  • modernize-use-emplace: 1
  • readability-simplify-boolean-expr: 1
  • modernize-use-integer-sign-comparison: 1
  • readability-use-anyofallof: 1
  • modernize-redundant-void-arg: 1
  • performance-move-const-arg: 1

See inline comments for details. Comment @phlexbot tidy-fix to auto-fix.

}

template <size_t N, typename Cf>
static bool unroll_switch(size_t rt_size, Cf&& func)

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.

I think this function is essentially mp_with_index from MP11. Using that should hopefully shut up clang-tidy.

I wouldn't be surprised if the whole n_arg logic could be expressed somewhat concisely in MP11 but I'd have to think about it a bit more.

@wlav wlav Jun 3, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Looks like it, but the fact remains that clang-tidy is wrong b/c it simply doesn't analyze the predicate deeply enough. Note that I considered removing the forward, but func being a lambda function itself, I'm not sure whether that's appropriate (it would be for just a function pointer) and anyway, then you get a different clang-tidy warning (can't have a move without a forward; it does still run fine, of course, since it's only used once).

Aside, the implementation of mp_with_index simply spells everything out up to an index of 16 using template specializations. :} Likely more efficient (not sure what the compiler makes of it), but also fugly (which is fine if hidden in the boost header; not so much if I take the same approach in modulewrap.cpp). It would be clang-tidy approved, however.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants