DirectStorage byte counter includes failed reads #2049

Open
opened 2026-11-25 02:19:27 +00:00 by YYchainsAw · 2 comments
YYchainsAw commented 2026-11-25 02:19:27 +00:00 (Migrated from github.com)
Contributor

Imported from ivall/xcl. Originally posted by YYchainsAw on 2026-11-25T02:19:27Z.


dstorage::counters() describes its second value as bytes delivered, but a failed read also increases it.

I checked this on Windows 11 build 26300 with Rust 1.100.0 MSVC, using XCL commit 94193f0 and a synthetic 8-byte file. The probe extends error_record_has_the_failed_requests_offset_source_size_and_tag and reads counters().1 before and after each request.

Request Bytes written to destination Counter increase
Successful 8-byte read 8 8
Failed 16-byte read past EOF (0x89240007) 0 16

Should this counter represent requested destination bytes or bytes successfully delivered? I'd like to make a small follow-up change once the intended meaning is clear.

AI use
I ran the existing error-record test. Codex (GPT-6) prepared and ran the counter probe on my machine and helped draft this report.

I'd like to submit a PR once the intended meaning is clear.

<!-- greyfinch-sync:ivall/xcl:issue:6595662841 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/issues/2059). Originally posted by [YYchainsAw](https://github.com/YYchainsAw) on 2026-11-25T02:19:27Z. --- `dstorage::counters()` describes its second value as `bytes delivered`, but a failed read also increases it. I checked this on Windows 11 build 26300 with Rust 1.100.0 MSVC, using XCL commit `94193f0` and a synthetic 8-byte file. The probe extends `error_record_has_the_failed_requests_offset_source_size_and_tag` and reads `counters().1` before and after each request. | Request | Bytes written to destination | Counter increase | | --- | ---: | ---: | | Successful 8-byte read | 8 | 8 | | Failed 16-byte read past EOF (`0x89240007`) | 0 | 16 | Should this counter represent requested destination bytes or bytes successfully delivered? I'd like to make a small follow-up change once the intended meaning is clear. **AI use** I ran the existing error-record test. Codex (GPT-6) prepared and ran the counter probe on my machine and helped draft this report. I'd like to submit a PR once the intended meaning is clear.
luckyteagirl commented 2026-11-25 04:10:18 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-25T03:11:44Z.


I recommend keeping the current second counter as requested destination bytes and correcting its documentation to say that, rather than silently changing its meaning to successful delivery.

On current main cbc296ab65a2661a61e3e2da109134bcd5319f60, execute() calls note_request(r) before the destination and source checks. note_request adds r.destination_size to BYTES for every attempted request. The activity line in host.rs presents the same period's requests, MB, and failed count together. Requested bytes therefore describes the workload the title asked DirectStorage to process, including requests that fail; the failed counter supplies the accompanying error rate. The counters() doc comment's “bytes delivered” wording is the inconsistency.

If successful throughput is also useful, I would add a separately named delivered-byte counter after successful execution, preserving the existing requested-byte diagnostic. That avoids changing historical activity numbers while making the two meanings explicit.

Tested: source review of crates/xcl/src/hle/dstorage.rs and crates/xcl/src/host.rs at the commit above. No new test run or runtime measurement for this comment.

AI use: OpenAI Codex (GPT-6, exact variant not exposed in this session) traced the counter and activity-log paths and drafted this recommendation.

<!-- greyfinch-sync:ivall/xcl:comment:7151682213 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/issues/2059#issuecomment-7151682213). Originally posted by [luckyteagirl](https://github.com/luckyteagirl) on 2026-11-25T03:11:44Z. --- I recommend keeping the current second counter as **requested destination bytes** and correcting its documentation to say that, rather than silently changing its meaning to successful delivery. On current `main` `cbc296ab65a2661a61e3e2da109134bcd5319f60`, `execute()` calls `note_request(r)` before the destination and source checks. `note_request` adds `r.destination_size` to `BYTES` for every attempted request. The activity line in `host.rs` presents the same period's requests, MB, and failed count together. Requested bytes therefore describes the workload the title asked DirectStorage to process, including requests that fail; the failed counter supplies the accompanying error rate. The `counters()` doc comment's “bytes delivered” wording is the inconsistency. If successful throughput is also useful, I would add a separately named delivered-byte counter after successful execution, preserving the existing requested-byte diagnostic. That avoids changing historical activity numbers while making the two meanings explicit. **Tested:** source review of `crates/xcl/src/hle/dstorage.rs` and `crates/xcl/src/host.rs` at the commit above. No new test run or runtime measurement for this comment. **AI use:** OpenAI Codex (GPT-6, exact variant not exposed in this session) traced the counter and activity-log paths and drafted this recommendation.
YYchainsAw commented 2026-11-25 04:10:21 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ivall/xcl. Originally posted by YYchainsAw on 2026-11-25T03:15:11Z.


Thanks, that matches what I observed. I'd like to submit a one-line doc comment fix clarifying that the counter is the requested destination size for requests that reach execution, including ones that later fail. Can a comment-only change in dstorage.rs be reviewed without a retail smoke run?

<!-- greyfinch-sync:ivall/xcl:comment:7151737882 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/issues/2059#issuecomment-7151737882). Originally posted by [YYchainsAw](https://github.com/YYchainsAw) on 2026-11-25T03:15:11Z. --- Thanks, that matches what I observed. I'd like to submit a one-line doc comment fix clarifying that the counter is the requested destination size for requests that reach execution, including ones that later fail. Can a comment-only change in dstorage.rs be reviewed without a retail smoke run?
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl#2049
No description provided.