Skip to content

direct_io test: open the buffered reference without O_DIRECT - #500

Closed
BobClawblaw wants to merge 1 commit into
ashhart:mainfrom
BobClawblaw:direct-io-test-plain-fd
Closed

BobClawblaw wants to merge 1 commit into
ashhart:mainfrom
BobClawblaw:direct-io-test-plain-fd

Conversation

@BobClawblaw

Copy link
Copy Markdown
Contributor

direct reads return the same bytes as buffered reads fails on Linux on main: the buffered reference comes from File.open, which opens with O_DIRECT when the file system allows it, and then only sets plain.direct = false. The descriptor stays direct, so the reference's unaligned 1-byte pread returns -1 (EINVAL):

error: 'direct_io.test.direct reads return the same bytes as buffered reads' failed:
       expected 1, found -1

The test skips on macOS, so Metal runs never saw it. The fix opens the reference descriptor without O_DIRECT. Test only; File and the loader are unchanged.

Receipts

NVIDIA GB10 (DGX Spark), Linux aarch64, ext4, Zig 0.17.0, base f8fe17d, clean .zig-cache.

zig build test
main 15/17 steps, 75/76 tests (this test fails)
This PR 17/17 steps, 76/76 tests

zig fmt --check clean on the touched file. Not run: macOS (the test skips there). Found while checking #497 on a Spark.

The test set plain.direct = false on a descriptor File.open had opened with
O_DIRECT, so its unaligned 1-byte pread failed with EINVAL on Linux.
@jschmied

jschmied commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Duplicate of #486 (opened 2026-10-07), which fixes the same direct_io test failure the same way: the buffered reference descriptor is opened without O_DIRECT. Happy to close either one.

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