Skip to content
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

fix: rebuild invalid check pointers in ArrayBuilder #2055

Merged
merged 4 commits into from
Jan 1, 2023

Conversation

agoose77
Copy link
Collaborator

@agoose77 agoose77 commented Jan 1, 2023

This PR fixes #2054, fixes #2053, which occur when a user mixes "fast" and "slow" modes of the record / field builders. The string pointers that are used to implement the fast mechanism are assumed to come from an intern pool, i.e. the same string has the same pointer. This fails when Python strings are used, as they come from different pools, and aren't guaranteed to be stable.

To correct this, we can ensure that the slow-mode invalidates any pointers, and that the fast-mode treats nullptr as a cue to rebuild the pointer.

@agoose77 agoose77 marked this pull request as ready for review January 1, 2023 13:05
@agoose77 agoose77 changed the title fix: rebuild invalid check pointers fix: rebuild invalid check pointers in ArrayBuilder Jan 1, 2023
@codecov
Copy link

codecov bot commented Jan 1, 2023

Codecov Report

Merging #2055 (e66ef79) into main (42ec00b) will increase coverage by 0.04%.
The diff coverage is n/a.

Additional details and impacted files
Impacted Files Coverage Δ
src/awkward/_connect/numba/builder.py 84.91% <0.00%> (+2.08%) ⬆️

@agoose77 agoose77 temporarily deployed to docs-preview January 1, 2023 13:36 — with GitHub Actions Inactive
Copy link
Member

@jpivarski jpivarski left a comment

Choose a reason for hiding this comment

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

This is definitely a different solution than what I had in mind, but it makes a lot of sense. Now _check and _fast are safe to mix (though a _check will slow down _fast).

I see that you've implemented this for both beginrecord_* and field_*.

This will require an increase in the awkward-cpp version.

jpivarski added a commit that referenced this pull request Jan 1, 2023
@agoose77 agoose77 merged commit 6ac3fc5 into main Jan 1, 2023
@agoose77 agoose77 deleted the agoose77/fix-arraybuilder-fast branch January 1, 2023 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants