DirectStorage: count bytes/requests only on successful completion #2159

Open
github-bot wants to merge 1 commit from github-bot/gh-2159 into main AGit
Owner

@⁠saurabhbhoir456 on GitHub · 2026-11-25 06:33 UTC · original
saurabhbhoir456:fix/2059-dstorage-byte-counter → main · +19 −6 · 2 files · 1 commits · open

Fixes #2059: DirectStorage byte counter includes failed reads.

The BYTES and REQUESTS atomic counters were incremented at the start of execute() via note_request(), but a request can fail after that point (access violation, decompression, zlib, write failures). This caused failed requests to be counted in the byte/request totals.

Split note_request() into:

  • note_request(): logging only (called at start of execute)
  • note_request_success(n): increments REQUESTS/BYTES counters (called only after successful completion in both execute() and retire_one())

This ensures only successfully completed requests are counted.

Tested

  • Hardware: AMD Radeon RX 7900 XTX (RDNA3), Windows 11 26300, Rust 1.83.0 (stable-x86_64-pc-windows-msvc), debug profile
  • Commands: cargo test --workspace -- --test-threads=4
  • Results: 1098 passed, 0 failed, 26 ignored (30 DirectStorage tests pass)

AI use

  • Claude Code, Claude Opus 5.5: implemented the fix and ran tests
**@⁠saurabhbhoir456** on GitHub · 2026-11-25 06:33 UTC · [original](https://github.com/xcl-dev/xcl/pull/2159) `saurabhbhoir456:fix/2059-dstorage-byte-counter` → `main` · +19 −6 · 2 files · 1 commits · open Fixes #2059: DirectStorage byte counter includes failed reads. The BYTES and REQUESTS atomic counters were incremented at the start of execute() via note_request(), but a request can fail after that point (access violation, decompression, zlib, write failures). This caused failed requests to be counted in the byte/request totals. Split note_request() into: - note_request(): logging only (called at start of execute) - note_request_success(n): increments REQUESTS/BYTES counters (called only after successful completion in both execute() and retire_one()) This ensures only successfully completed requests are counted. **Tested** - Hardware: AMD Radeon RX 7900 XTX (RDNA3), Windows 11 26300, Rust 1.83.0 (stable-x86_64-pc-windows-msvc), debug profile - Commands: cargo test --workspace -- --test-threads=4 - Results: 1098 passed, 0 failed, 26 ignored (30 DirectStorage tests pass) **AI use** - Claude Code, Claude Opus 5.5: implemented the fix and ran tests
Fixes #2059: DirectStorage byte counter includes failed reads.

The BYTES and REQUESTS atomic counters were incremented at the start of
execute() via note_request(), but a request can fail after that point
(access violation, decompression, zlib, write failures). This caused
failed requests to be counted in the byte/request totals.

Split note_request() into:
- note_request(): logging only (called at start of execute)
- note_request_success(n): increments REQUESTS/BYTES counters (called only
  after successful completion in both execute() and retire_one())

This ensures only successfully completed requests are counted.

Co-Authored-By: Claude Code <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:21:09 +00:00
Author
Owner

@⁠JJAutoCompare on GitHub · 2026-11-25 07:05 UTC · original

Independent Windows x64 test report on commit 8c19c0a517b3136e3ff9f937ebb338da50cfc458.

Environment

  • OS: Windows 11 Enterprise Evaluation x64 (build 26200.9974, Session 0)
  • CPU: AMD Ryzen 7 3800X
  • Toolchain: rustc 1.100.0 (0ef1bc386 2026-11-09) (debug build)
  • Note: CPU-only targeted run (XCL_ADAPTER=NONE_CPU_ONLY)

Command

xcl-97fdf2b9ff8e1482.exe hle::dstorage:: --nocapture --test-threads=1

Results

  • Passed: 30, Failed: 0, Ignored: 0, Skipped: 0 (0.41s, exit code 0)
  • All 30 hle::dstorage:: unit tests passed without SKIPPED output.

Not tested

  • Full workspace suite, direct assertions on XCL_ACTIVITY aggregate counters, GPU tests, and game smoke run.

AI use

  • Verified and published with T3 Code / Antigravity (gemini-4-neon).
**@⁠JJAutoCompare** on GitHub · 2026-11-25 07:05 UTC · [original](https://github.com/xcl-dev/xcl/pull/2159#issuecomment-7155471354) Independent Windows x64 test report on commit `8c19c0a517b3136e3ff9f937ebb338da50cfc458`. **Environment** - OS: Windows 11 Enterprise Evaluation x64 (build 26200.9974, Session 0) - CPU: AMD Ryzen 7 3800X - Toolchain: `rustc 1.100.0 (0ef1bc386 2026-11-09)` (debug build) - Note: CPU-only targeted run (`XCL_ADAPTER=NONE_CPU_ONLY`) **Command** ```powershell xcl-97fdf2b9ff8e1482.exe hle::dstorage:: --nocapture --test-threads=1 ``` **Results** - Passed: 30, Failed: 0, Ignored: 0, Skipped: 0 (0.41s, exit code 0) - All 30 `hle::dstorage::` unit tests passed without `SKIPPED` output. **Not tested** - Full workspace suite, direct assertions on `XCL_ACTIVITY` aggregate counters, GPU tests, and game smoke run. **AI use** - Verified and published with T3 Code / Antigravity (`gemini-4-neon`).
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-25 07:05 UTC · original · edited 2026-11-25 07:10 UTC

Full-suite run, since this PR has no test report yet. Tested exact head 8c19c0a (on its base 6ea813a).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::recomp::lower_dxil::tests::mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests: 1142 passed, 0 failed, 44 ignored. SKIPPED (no wave64): a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu, a_per_lane_2d_or_3d_group_runs_on_the_gpu, coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu, cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu, gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware, the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu.
  • No new #[test] functions in the diff.
  • Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: 1153 passed, 0 failed, 46 ignored. SKIPPED: f16_programs_on_the_gpu (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), f32_programs_on_the_gpu (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), f32_programs_on_the_gpu (f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • --skip leaves out tests that fail on main 568e7db too, not because of this PR. On NVIDIA: heap_window_out_of_memory_falls_back_to_the_switch_form (#1651), the four gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu tests, const_and_null_mask_operands_agree_with_hlsl_on_the_gpu and mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu (follow-up on #1651) fail because runner::skip_test turns their skips into failures under XCL_REQUIRE_GPU=mesh, and gpu::dxil::fuzz_tests seeds 70, 545, 1019 and 1507 fail CreateComputePipelineState with E_OUTOFMEMORY on this card (drivers 616.64 and 621.40). On AMD: fuzz_validate_and_gpu_1 fails on seed 540 (res[833] 0x7 vs CPU 0x6). The AMD run does not set XCL_REQUIRE_GPU.

Not tested

  • a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
**@⁠futurepro62** on GitHub · 2026-11-25 07:05 UTC · [original](https://github.com/xcl-dev/xcl/pull/2159#issuecomment-7155477150) · edited 2026-11-25 07:10 UTC Full-suite run, since this PR has no test report yet. Tested exact head `8c19c0a` (on its base `6ea813a`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::recomp::lower_dxil::tests::mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests`: **1142 passed, 0 failed, 44 ignored**. SKIPPED (no wave64): `a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu`, `a_per_lane_2d_or_3d_group_runs_on_the_gpu`, `coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu`, `cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu`, `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`, `the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu`. - No new `#[test]` functions in the diff. - Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, `XCL_ADAPTER=radeon`), `cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1`: **1153 passed, 0 failed, 46 ignored**. SKIPPED: `f16_programs_on_the_gpu` (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), `f32_programs_on_the_gpu` (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), `f32_programs_on_the_gpu` (f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). - `--skip` leaves out tests that fail on main `568e7db` too, not because of this PR. On NVIDIA: `heap_window_out_of_memory_falls_back_to_the_switch_form` (#1651), the four `gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu` tests, `const_and_null_mask_operands_agree_with_hlsl_on_the_gpu` and `mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu` ([follow-up on #1651](https://git.gtahub.st/github/xcl-dev--xcl/issues/1651)) fail because `runner::skip_test` turns their skips into failures under `XCL_REQUIRE_GPU=mesh`, and `gpu::dxil::fuzz_tests` seeds 70, 545, 1019 and 1507 fail `CreateComputePipelineState` with `E_OUTOFMEMORY` on this card (drivers 616.64 and 621.40). On AMD: `fuzz_validate_and_gpu_1` fails on seed 540 (`res[833]` 0x7 vs CPU 0x6). The AMD run does not set `XCL_REQUIRE_GPU`. **Not tested** - a release build, a game (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 07:20 UTC · original

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-25 07:20 UTC · [original](https://github.com/xcl-dev/xcl/pull/2159#issuecomment-7155751475) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
Author
Owner

@⁠raylitebull on GitHub · 2026-11-25 10:45 UTC · original

Code review on 8c19c0a:

  • Moving REQUESTS / BYTES increments out of note_request into note_request_success(n) in execute and parallel.rs cleanly ensures failed/access-violating DirectStorage transfers aren't counted as delivered.
  • Note overlap with #2094 (1d1ff8c), which addresses the same counter bug.
  • Diff audited and CI workflow approved (running).

Remaining before merge: Fix PR description, Build and test finishing green, and dual-vendor verification on 8c19c0a.

**@⁠raylitebull** on GitHub · 2026-11-25 10:45 UTC · [original](https://github.com/xcl-dev/xcl/pull/2159#issuecomment-7160120987) Code review on `8c19c0a`: - Moving `REQUESTS` / `BYTES` increments out of `note_request` into `note_request_success(n)` in `execute` and `parallel.rs` cleanly ensures failed/access-violating DirectStorage transfers aren't counted as delivered. - Note overlap with `#2094` (`1d1ff8c`), which addresses the same counter bug. - Diff audited and CI workflow approved (running). **Remaining before merge:** Fix `PR description`, `Build and test` finishing green, and dual-vendor verification on `8c19c0a`.
Author
Owner

@⁠Anon64 on GitHub · 2026-11-25 10:49 UTC · original

Regression run: a retail title, from scripts/smoke.ps1 as printed. 60 s, release, default settings, A pressed every 4 s from 20 s. RTX 3060 12 GB, Windows 11, Rust 1.100.0. The base is this PR's merge base with main.

base (6ea813a):

xcl-smoke v1
commit: 6ea813a61f7d324e2fcbeb0c6a068edcd37e818b
gpu: NVIDIA GeForce RTX 3060
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1618 (PresentX 1618)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 22514 MB

this PR:

xcl-smoke v1
commit: 8c19c0a517b3136e3ff9f937ebb338da50cfc458
gpu: NVIDIA GeForce RTX 3060
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1610 (PresentX 1610)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 22539 MB

No device removal or crash. Frames are 99.5 % of the base's and peak commit is 100.1 %. This is a regression check only: it does not check the DirectStorage counters themselves.

AI use: Claude Code (Claude Opus 5.5) built both commits, ran the smoke pair and wrote this comment.

**@⁠Anon64** on GitHub · 2026-11-25 10:49 UTC · [original](https://github.com/xcl-dev/xcl/pull/2159#issuecomment-7160232108) **Regression run:** a retail title, from `scripts/smoke.ps1` as printed. 60 s, release, default settings, A pressed every 4 s from 20 s. RTX 3060 12 GB, Windows 11, Rust 1.100.0. The base is this PR's merge base with `main`. base (`6ea813a`): ``` xcl-smoke v1 commit: 6ea813a61f7d324e2fcbeb0c6a068edcd37e818b gpu: NVIDIA GeForce RTX 3060 title: 21222967 seconds: 60 exit: 0x0 frames shown: 1618 (PresentX 1618) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 22514 MB ``` this PR: ``` xcl-smoke v1 commit: 8c19c0a517b3136e3ff9f937ebb338da50cfc458 gpu: NVIDIA GeForce RTX 3060 title: 21222967 seconds: 60 exit: 0x0 frames shown: 1610 (PresentX 1610) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 22539 MB ``` No device removal or crash. Frames are 99.5 % of the base's and peak commit is 100.1 %. This is a regression check only: it does not check the DirectStorage counters themselves. **AI use:** Claude Code (Claude Opus 5.5) built both commits, ran the smoke pair and wrote this comment.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2159/head:github-bot/gh-2159'
git switch 'github-bot/gh-2159'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2159'
git switch 'github-bot/gh-2159'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2159'
git switch 'github-bot/gh-2159'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2159'
git switch 'main'
git merge --squash 'github-bot/gh-2159'
git switch 'main'
git merge --ff-only 'github-bot/gh-2159'
git switch 'main'
git merge 'github-bot/gh-2159'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.