Repository navigation
DirectStorage: count delivered bytes only upon successful completion (#2059) - #2094
IAmTheSween wants to merge 1 commit into
Conversation
…cl-dev#2059) Previously, note_request() incremented dstorage::counters().1 (BYTES) upon request arrival, prior to read or decompression. Requests that failed (e.g. read past EOF, invalid file handle, decompression corruption, or access violation) delivered 0 bytes to the destination buffer but still inflated the delivered bytes counter. Move byte counting to note_delivered() called only upon successful transfer in serial execute() and parallel decompression retirement. Add a unit test asserting that failed requests do not increment counters().1. Fixes xcl-dev#2059. Assisted-by: Antigravity (Gemini 3.8 Flash)
|
Full-suite run, since this PR has no test report yet. Tested exact head Tested
Not tested
AI use
|
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
A regression run under Wine on Linux on the retail title: no device removal, no crash, frames level with Tested
Regression run main (first run): this PR: The second Not tested
AI use
|
|
Code review on
Remaining before merge: Fix |
luckyteagirl
left a comment
There was a problem hiding this comment.
At exact head 1d1ff8c (base 08db802, current main b49be18), the new byte-counter regression test can fail under the repository's parallel lib-test run even when delivery accounting is correct. This is a source-derived test review; I did not reproduce a scheduling failure.
failed_read_does_not_increase_delivered_bytes_counter samples process-global counters().1 before and after its successful execute, then again after its failed execute, and requires exact deltas of 16 and 0. Other DirectStorage queue tests in the same lib binary submit successful requests through execute/note_delivered; one can increment the global BYTES between either pair of samples. A test-only mutex would not isolate those other producers. The full suite normally runs multiple test threads, so this can report a false failure unrelated to the PR's behavior.
Could the exact-delta assertion run in an isolated subprocess, or use an injected local counter sink for the two requests? A parallel test with a forced competing successful request would make the isolation requirement visible.
AI assistance: GPT-6.2 Sol identified the shared counter; GPT-6.2 Astra verified the exact-head test and other request paths.
Fixes #2059.
Previously, note_request() incremented dstorage::counters().1 (BYTES) upon request arrival, prior to read or decompression. Requests that failed (such as reads past EOF, invalid file handles, corrupted decompression streams, or access violations) delivered 0 bytes to the destination buffer but still inflated the delivered bytes counter.
Move delivered byte tracking to note_delivered(), called strictly upon successful transfer in serial execute() and parallel decompression retirement (retire_one()).
What is in it
Tested
Regression run
scripts/smoke.ps1 on main (cbc296a) and on this PR's head commit (1d1ff8c):
Not tested
AI use