Skip to content

[upstream #1790] DirectStorage: honor DSTORAGE_QUEUE_OPTIONS::AutoSubmitDisabled in CreateQueue1 - #344

Open
ufoptg wants to merge 3 commits into
mainfrom
upstream-pr/1790
Open

ufoptg wants to merge 3 commits into
mainfrom
upstream-pr/1790

Conversation

@ufoptg

@ufoptg ufoptg commented Nov 25, 2026

Copy link
Copy Markdown
Owner

Honor DSTORAGE_QUEUE_OPTIONS::AutoSubmitDisabled (bit 0 of the u64 options field at +0x18 of DSTORAGE_QUEUE_DESC1) in IDStorageFactoryX2::CreateQueue1 instead of discarding it and auto-submitting at half capacity.

A retail Scarlett title calls CreateQueue1 with options = 0x1 (AutoSubmitDisabled). Previously factory_create_queue1 logged the extra qword and forwarded to factory_create_queue, so half-full queues auto-submitted inside EnqueueRequest before the title finished populating destination buffers/page arrays and calling Submit(), and Query() still reported a finite RequestCountUntilAutoSubmit.

What is in it

  • crates/xcl/src/hle/dstorage.rs: parse QUEUE_OPT_AUTO_SUBMIT_DISABLED (1 << 0) from DSTORAGE_QUEUE_DESC1 + 0x18 in factory_create_queue1 (logging unknown option bits once), store auto_submit_disabled on QueueInner, suppress half-full auto-submit in QueueInner::enqueue and QueueInner::enqueue_numbered, and report u16::MAX for RequestCountUntilAutoSubmit in queue_query when disabled.
  • crates/xcl/src/hle/dstorage.rs: add create_queue1_auto_submit_disabled_waits_for_submit covering disabled auto-submit past capacity / 2, late source mutation before Submit(), Close() resolving unsubmitted status slots with E_QUEUE_CLOSED, and the options == 0 auto-submit control case.

Tested

  • NVIDIA GeForce RTX 5070 (driver 32.0.16.1074), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 10 Pro 22H2 (19045.6466), rustc 1.100.0 (0ef1bc386 2026-11-09), debug tests + release smoke runs (XCL_D3D12_DIR Agility SDK v614).
  • cargo test -p xcl --lib hle::dstorage -- --nocapture: 18 passed, 0 failed, 0 ignored.
  • cargo test --workspace -- --test-threads=4: 892 passed, 0 failed, 42 ignored.
    • SKIPPED GPU tests: gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask (no wave64), gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware (no wave64), shaders::tests::pso_measurement_compiles_an_exact_synthetic_record (cannot disable the driver cache), heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • Retail Scarlett title (60 s smoke run): logs DirectStorage: CreateQueue1 (0x20 desc), options = 0x1 (auto_submit_disabled = true), 0 DirectStorage failures, 0 crashes, 0 device removals. Note: the main smoke run had a cold DXIL cache while the PR run ran with the warm cache from main, which accounts for the higher frame count (1685 vs 1185).

Regression run
main:

xcl-smoke v1
commit: 4178e888c0b5be50a2887eda45cdb832763b68a4
gpu: NVIDIA GeForce RTX 5070
title: game
seconds: 60
exit: 0x0
frames shown: 1185 (PresentX 1185)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15105 MB

PR:

xcl-smoke v1
commit: 7a6f47a53975d3c1d5367a7742970bf53c547d33
gpu: NVIDIA GeForce RTX 5070
title: game
seconds: 60
exit: 0x0
frames shown: 1685 (PresentX 1685)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14318 MB

Not tested

  • AMD / Intel GPUs and wave64-only GPU tests.
  • Longer world-load streaming runs past the title's startup/menu phase.

AI use

  • Antigravity with Gemini 4 Neon: wrote the implementation, unit test, and PR description; verified locally with the workspace test suite and retail title smoke runs.

Mirror of xcl-dev#1790 (auto-synced, do not edit).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants