DirectStorage byte counter includes failed reads #2059

Open
opened 2026-11-26 05:17:00 +00:00 by github-bot · 2 comments
Owner

@⁠YYchainsAw on GitHub · 2026-11-25 02:19 UTC · original

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.

**@⁠YYchainsAw** on GitHub · 2026-11-25 02:19 UTC · [original](https://github.com/xcl-dev/xcl/issues/2059) `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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:17:00 +00:00
Author
Owner

@⁠luckyteagirl on GitHub · 2026-11-25 03:11 UTC · original

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.

**@⁠luckyteagirl** on GitHub · 2026-11-25 03:11 UTC · [original](https://github.com/xcl-dev/xcl/issues/2059#issuecomment-7151682213) 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.
Author
Owner

@⁠YYchainsAw on GitHub · 2026-11-25 03:15 UTC · original

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?

**@⁠YYchainsAw** on GitHub · 2026-11-25 03:15 UTC · [original](https://github.com/xcl-dev/xcl/issues/2059#issuecomment-7151737882) 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?
This discussion has been locked. Commenting is limited to contributors.
No description provided.