Skip to content
This repository has been archived by the owner on Jun 21, 2022. It is now read-only.

Assumption about TBasket byte for JaggedArray was wrong #482

Merged
merged 1 commit into from
May 6, 2020

Conversation

reikdas
Copy link
Collaborator

@reikdas reikdas commented May 5, 2020

Replace assumption with dummy value that reproduces correct behaviour

Replace assumption with dummy value that reproduces correct behaviour
@reikdas reikdas requested a review from jpivarski May 5, 2020 03:43
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.

I don't see where in that reference "3" is revealed to be a safe value, but okay.

Does this have anything to do with the int8/char problem?

@reikdas
Copy link
Collaborator Author

reikdas commented May 5, 2020

I don't see where in that reference "3" is revealed to be a safe value, but okay.

The primary reason for this PR is to remove the false assumption and instead hardcode a value that we know works. (Even if all values > 2 work, we probably do not want to keep the old items.shape[0] + 1 in the codebase because it makes no sense and might lead to potential confusion when understanding the code or debugging in the future)
Also, all of my assumptions (for eg. about fEntryOffset and fNevBuf) were tested with the byte in question being set to a value that triggers this - https://github.com/root-project/root/blob/master/tree/tree/src/TBasket.cxx#L926-L928. I tested some values manually, and saw that 3 worked so I decided to go with 3.

Does this have anything to do with the int8/char problem?

Unforunately no.

@jpivarski
Copy link
Member

That's definitely a good reason to do it. Misleading code is worse.

@reikdas
Copy link
Collaborator Author

reikdas commented May 6, 2020

@jpivarski Should we merge this? The travis tests are being shown as pending here, but if you click on them (go to the travis website), you will find that all the tests are green.

@jpivarski
Copy link
Member

@jpivarski Should we merge this? The travis tests are being shown as pending here, but if you click on them (go to the travis website), you will find that all the tests are green.

Yeah, they are. I'm getting tired of Travis's quirks—Uproot 4 will either use Azure or GitHub Actions.

@jpivarski jpivarski merged commit 773b6ef into master May 6, 2020
@jpivarski jpivarski deleted the jagged-assume branch May 6, 2020 11:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants