-
Notifications
You must be signed in to change notification settings - Fork 655
Fix O_DIRECT expected to read number of bytes numpy reader #6148
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
base: main
Are you sure you want to change the base?
Conversation
- Fixes calculation of the amount of data that numpy reader should read in O_DIRECT mode - Adds test for O_DIRECT with 4096-byte aligned numpy file headers that this change should fix Signed-off-by: Janusz Lisiecki <[email protected]>
|
!build |
Greptile SummaryFixed critical bug in numpy reader's O_DIRECT mode where Key Changes:
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Client as Numpy Reader
participant File as ODirectFileStream
participant Memory as Aligned Memory Buffer
Note over Client: Prefetch() called
Client->>Client: Calculate block_start = align_down(data_offset, alignment)
Client->>Client: Calculate block_end = align_up(data_offset + nbytes, alignment)
Client->>Client: Calculate aligned_len
Client->>Client: Calculate target_data_offset = alignment_offset(data_offset, alignment)
Client->>Memory: Allocate aligned memory (aligned_len bytes)
Note over Client: OLD BUG: read_tail = alignment_offset(data_offset + nbytes, chunk_size)
Note over Client: FIX: read_tail = alignment_offset(target_data_offset + nbytes, chunk_size)
loop For each chunk in aligned_len
Client->>Client: Calculate read_size = min(chunk_size, remaining)
Client->>Client: Calculate target_mem pointer
Client->>Client: Calculate file_offset
Client->>File: ReadAt(target_mem, read_size, file_offset)
File-->>Client: Returns bytes read (ret)
Client->>Client: Assert ret >= read_tail (validates sufficient bytes read)
end
Client->>Client: ShareData with target using target_data_offset
|
|
CI MESSAGE: [40716397]: BUILD STARTED |
|
CI MESSAGE: [40716397]: BUILD FAILED |
|
CI MESSAGE: [40716397]: BUILD PASSED |
should read in O_DIRECT mode
that this change should fix
Category:
Other (e.g. Documentation, Tests, Configuration)
Description:
should read in O_DIRECT mode
that this change should fix
Additional information:
Affected modules and functionalities:
Key points relevant for the review:
Tests:
Checklist
Documentation
DALI team only
Requirements
REQ IDs: N/A
JIRA TASK: N/A