Skip to content

Fix the metadata deduplication #1165

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

Merged
merged 7 commits into from
Mar 21, 2025
Merged

Conversation

jiel-nv
Copy link
Contributor

@jiel-nv jiel-nv commented Mar 3, 2025

The llvmlite debug metadata cache does not work as expected due to the encoding value using address of DIToken instance and serves as part of the key.

Solution is to extract the string value from the encoding object.

Since the DIToken class is designed to be a wrapper of enumeration value, e.g. the DW_* enumerations, that should appear bare in the emitted metadata, in this change, stringify DIToken is made to fix the problem.

This solves llvmlite issue #1164

jiel-nv added 4 commits March 3, 2025 09:30
The llvmlite debug metadata cache does not work as expected due to
the encoding value using address of DIToken instance and serves as
part of the key.

Solutions could be either singleton the DIToken class, or extract
the string value from the encoding object.

Since the DIToken class is designed to be a wrapper of enumeration
value, e.g. the DW_* enumerations, that should appear bare in the
emitted metadata, in this change, singleton DIToken is made to fix
the problem.

This solves llvmlit issue numba#1164
numba#1164
The llvmlite debug metadata cache does not work as expected due to
the encoding value using address of DIToken instance and serves as
part of the key.

Solution is to extract the string value from the encoding object.

Since the DIToken class is designed to be a wrapper of enumeration
value, e.g. the DW_* enumerations, that should appear bare in the
emitted metadata, in this change, stringify DIToken is made to fix
the problem.

This solved llvmlite issue numba#1164
@gmarkall
Copy link
Member

gmarkall commented Mar 4, 2025

Could you add a test please?

@jiel-nv
Copy link
Contributor Author

jiel-nv commented Mar 4, 2025

Could you add a test please?

Yes, done.

Copy link
Member

@gmarkall gmarkall left a comment

Choose a reason for hiding this comment

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

Thanks for the PR - this looks good to me.

I have tested it with the Numba and Numba-CUDA debuginfo tests locally as well, with no issues.

@gmarkall gmarkall added this to the v0.45.0 milestone Mar 17, 2025
@gmarkall gmarkall linked an issue Mar 19, 2025 that may be closed by this pull request
@kc611 kc611 merged commit 75e6fb2 into numba:main Mar 21, 2025
26 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.

Duplicate debug metadata for DIBasicType
3 participants