Skip to content

[cppyy] Add converters and low-level views for fixed width integers #18492

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aaronj0
Copy link
Contributor

@aaronj0 aaronj0 commented Apr 24, 2025

fixes: #17841

The support for the fixed-width types int16_t and int32_t indeed diverges from upstream cppyy and uses unsigned long which triggers the incorrect numpy view. Despite not having converters for the same, upstream relies on patches (or older behaviour) along the Cppyy::ResolveName -> TClassEdit::ResolveTypedef code path (see ResolveTypeDefImpl) that resolved fixed width integer types to their standard type counterparts (int16_t[][] to short[][] and int32_t[][] to int[][]) when creating converters. Trying to follow the same code branch in ROOT can have a large blast radius in the type system. Two non-intrusive ways to fix this issue are either aliasing to existing short and int converters, or adding the converters and low-level views for both types. This PR performs the latter

@aaronj0 aaronj0 requested review from guitargeek, dpiparo and vepadulano and removed request for dpiparo and vepadulano April 24, 2025 11:59
@aaronj0 aaronj0 self-assigned this Apr 24, 2025
@aaronj0 aaronj0 marked this pull request as draft April 24, 2025 12:13
Copy link

github-actions bot commented Apr 24, 2025

Test Results

    17 files      17 suites   3d 12h 1m 41s ⏱️
 2 731 tests  2 731 ✅ 0 💤 0 ❌
45 042 runs  45 042 ✅ 0 💤 0 ❌

Results for commit 57c2724.

♻️ This comment has been updated with latest results.

@aaronj0 aaronj0 marked this pull request as ready for review April 28, 2025 09:12
Copy link
Contributor

@guitargeek guitargeek left a comment

Choose a reason for hiding this comment

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

Thank you very much for implementing better support for fixed-width integers! Looks good to me, but please also add a test 🙂

@guitargeek
Copy link
Contributor

Oh and don't forget to fix also the compiler warnings, otherwise the debian125 build that treats warnings as errors because of dev=ON will fail

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.

PyROOT multidimenstional int16_t arrays stopped working in 6.34
2 participants