Skip to content

feat: verify type of event_index has 8 bytes#65

Merged
jokasimr merged 1 commit intomainfrom
event_index_size
Apr 23, 2026
Merged

feat: verify type of event_index has 8 bytes#65
jokasimr merged 1 commit intomainfrom
event_index_size

Conversation

@jokasimr
Copy link
Copy Markdown
Contributor

event_index references positions in the event_id and event_time_offset arrays.
It's dtype has to be wide enough to contain integers that are the size of the event list.

We expect that some instrument might see more than 2^32=4B events during one experiment, therefore event_index must be 8 bytes.

@jokasimr jokasimr requested a review from jl-wynen April 23, 2026 08:07
@jl-wynen
Copy link
Copy Markdown
Member

Did you get feedback from ECDC about this?
The index can safely be 4 bytes if there are less than INT_MAX events in the file. So I think the test should only require 8 bytes if that is strictly needed in that particular file.

@jokasimr
Copy link
Copy Markdown
Contributor Author

But the type has to be decided when the file is initiated, and at that time the filewriter has no idea about how many events will eventually end up in the file.

In any case, the event_index dataset will never be a lot of data. Per day it will accumulate 8 * 14 * 3600 * 24 bytes per event mode detector, or 10MB, which is negligible.

@jokasimr jokasimr merged commit 4882a0d into main Apr 23, 2026
4 checks passed
@jokasimr jokasimr deleted the event_index_size branch April 23, 2026 14:14
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.

2 participants