DirectStorage: count bytes/requests only on successful completion #2149
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2159"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by saurabhbhoir456 on 2026-11-25T06:33:55Z.
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:
This ensures only successfully completed requests are counted.
Tested
AI use
Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T07:05:10Z.
Independent Windows x64 test report on commit
8c19c0a517b3136e3ff9f937ebb338da50cfc458.Environment
rustc 1.100.0 (0ef1bc386 2026-11-09)(debug build)XCL_ADAPTER=NONE_CPU_ONLY)Command
Results
hle::dstorage::unit tests passed withoutSKIPPEDoutput.Not tested
XCL_ACTIVITYaggregate counters, GPU tests, and game smoke run.AI use
gemini-4-neon).Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-25T07:05:29Z.
Full-suite run, since this PR has no test report yet. Tested exact head
8c19c0a(on its base6ea813a).Tested
cargo build --workspace, thenXCL_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.#[test]functions in the diff.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).--skipleaves out tests that fail on main568e7dbtoo, not because of this PR. On NVIDIA:heap_window_out_of_memory_falls_back_to_the_switch_form(#1651), the fourgpu::recomp::lower_dxil::tests::*_programs_on_the_gputests,const_and_null_mask_operands_agree_with_hlsl_on_the_gpuandmask_ff0_and_flbit_agree_with_hlsl_on_the_gpu(follow-up on #1651) fail becauserunner::skip_testturns their skips into failures underXCL_REQUIRE_GPU=mesh, andgpu::dxil::fuzz_testsseeds 70, 545, 1019 and 1507 failCreateComputePipelineStatewithE_OUTOFMEMORYon this card (drivers 616.64 and 621.40). On AMD:fuzz_validate_and_gpu_1fails on seed 540 (res[833]0x7 vs CPU 0x6). The AMD run does not setXCL_REQUIRE_GPU.Not tested
AI use
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T07:20:26Z.
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!
Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-25T10:45:01Z.
Code review on
8c19c0a:REQUESTS/BYTESincrements out ofnote_requestintonote_request_success(n)inexecuteandparallel.rscleanly ensures failed/access-violating DirectStorage transfers aren't counted as delivered.#2094(1d1ff8c), which addresses the same counter bug.Remaining before merge: Fix
PR description,Build and testfinishing green, and dual-vendor verification on8c19c0a.Imported from ivall/xcl. Originally posted by Anon64 on 2026-11-25T10:49:58Z.
Regression run: a retail title, from
scripts/smoke.ps1as 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 withmain.base (
6ea813a):this PR:
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.
Imported from ivall/xcl. Originally posted by CalvyPZ on 2026-11-25T22:44:15Z.
This PR has been marked as a duplicate and closed after multiple agreeing checks in #1607. If you believe this is incorrect please re-open with why.
Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-29T20:44:46Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T07:29:52Z.
Triage (#1607) – head
8c19c0aUpdate (rechecked against main
6bfb5c51): withdrawn from the close list; recommendation: keep open. #1607 group D75 (3 checks) finds different approaches: this PR also movesREQUESTSto the success points, and #2094 conflicts with main too.#2094 makes the same change for #2059: it counts
BYTESonly after the write succeeds, at the end ofdstorage::executeand afterwrite_destinationinparallel.rs. #2094 was opened first, addsfailed_read_does_not_increase_delivered_bytes_counter, and its checks pass. This PR has no test that fails without the fix, and its CI build fails. The only other difference is that it also movesREQUESTS, which #2059 does not ask for. The same dstorage hunk is in #2086 too.Recommendation: close (duplicate of #2094).AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.