HLE: implement DirectStorage CancelRequestsWithTag (0x38) and Query (0x58) queue slots #889

Open
opened 2026-11-26 04:14:07 +00:00 by github-bot · 2 comments
Owner

@⁠davi713albano-coder on GitHub · 2026-11-24 13:31 UTC · original

Summary

Implements two unclaimed IDStorageQueueX vtable slots in crates/victory-hle/src/modules/dstorage.rs (leaving 0x48/0x50 untouched to avoid overlap with PR #624):

  • Slot 7 (0x38): CancelRequestsWithTag
  • Slot 11 (0x58): Query (DSTORAGE_QUEUE_INFO)

Because external PR creation is restricted (collaborators_only), the CI-green branch is ready on my fork:

Changes (crates/victory-hle/src/modules/dstorage.rs)

  • cancel_requests_with_tag (0x38): removes unsubmitted and queued-not-yet-started reads matching (request.tag & mask) == value, flushes any newly unblocked status entries without recording cancellation as an error (matching GDK IDStorageQueueX::CancelRequestsWithTag), and notifies waiters blocked on queue capacity.
  • query (0x58): populates the 2020 DSTORAGE_QUEUE_INFO structure (DSTORAGE_QUEUE_DESC, EmptySlotCount, RequestCountUntilAutoSubmit), storing an owned CString for the queue name on Queue so desc.name stays valid across the queue's lifetime (including after Close). Null output pointers are tolerated.

Tests & Verification

Added 2 synthetic Windows unit tests in dstorage::tests:

  • queue_info_layout_and_counts_track_enqueued_and_closed_state (ABI size/offset assertions for QueueDesc2020/QueueInfo, null tolerance, empty/enqueued/submitted/closed counts)
  • cancel_requests_with_tag_drops_matching_reads_without_error (bitmask matching, slot reclamation, non-error status completion, untouched buffers for cancelled reads, closed-queue no-op)

Verified on GitHub Actions (windows-latest) using upstream ci.yml (cargo clippy --workspace --all-targets --locked -- -D warnings, --all-features, and cargo test --workspace --locked including xtask asset-policy check):

Not tested: live title execution.
No game data used. AI-assisted.

**@⁠davi713albano-coder** on GitHub · 2026-11-24 13:31 UTC · [original](https://github.com/Marvisak/VIctory/issues/889) ### Summary Implements two unclaimed `IDStorageQueueX` vtable slots in `crates/victory-hle/src/modules/dstorage.rs` (leaving `0x48`/`0x50` untouched to avoid overlap with PR #624): - **Slot `7` (`0x38`)**: `CancelRequestsWithTag` - **Slot `11` (`0x58`)**: `Query` (`DSTORAGE_QUEUE_INFO`) Because external PR creation is restricted (`collaborators_only`), the CI-green branch is ready on my fork: - **Branch:** https://github.com/davi713albano-coder/VIctory/commits/hle/dstorage-cancel-and-query - **Commit:** `3380e5b` (based on `main` `ffe310e`, `crates/victory-hle/src/modules/dstorage.rs` +261/-10) - **Compare:** https://github.com/Marvisak/VIctory/compare/main...davi713albano-coder:hle/dstorage-cancel-and-query ### Changes (`crates/victory-hle/src/modules/dstorage.rs`) - **`cancel_requests_with_tag` (`0x38`)**: removes unsubmitted and queued-not-yet-started reads matching `(request.tag & mask) == value`, flushes any newly unblocked status entries without recording cancellation as an error (matching GDK `IDStorageQueueX::CancelRequestsWithTag`), and notifies waiters blocked on queue capacity. - **`query` (`0x58`)**: populates the 2020 `DSTORAGE_QUEUE_INFO` structure (`DSTORAGE_QUEUE_DESC`, `EmptySlotCount`, `RequestCountUntilAutoSubmit`), storing an owned `CString` for the queue name on `Queue` so `desc.name` stays valid across the queue's lifetime (including after `Close`). Null output pointers are tolerated. ### Tests & Verification Added 2 synthetic Windows unit tests in `dstorage::tests`: - `queue_info_layout_and_counts_track_enqueued_and_closed_state` (ABI size/offset assertions for `QueueDesc2020`/`QueueInfo`, null tolerance, empty/enqueued/submitted/closed counts) - `cancel_requests_with_tag_drops_matching_reads_without_error` (bitmask matching, slot reclamation, non-error status completion, untouched buffers for cancelled reads, closed-queue no-op) Verified on GitHub Actions (`windows-latest`) using upstream `ci.yml` (`cargo clippy --workspace --all-targets --locked -- -D warnings`, `--all-features`, and `cargo test --workspace --locked` including `xtask` asset-policy check): - `victory-hle`: 96 passed, 0 failed (full workspace: 344 passed, 0 failed, 6 ignored) - CI run: https://github.com/davi713albano-coder/VIctory/actions/runs/45403062855 **Not tested:** live title execution. No game data used. AI-assisted.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:14:07 +00:00
Author
Owner

@⁠LAKSHYA-cmd-tech on GitHub · 2026-11-24 13:53 UTC · original

Verified and merged downstream in PR #27. Both unit tests pass cleanly under Windows 11.

**@⁠LAKSHYA-cmd-tech** on GitHub · 2026-11-24 13:53 UTC · [original](https://github.com/Marvisak/VIctory/issues/889#issuecomment-7133484844) Verified and merged downstream in PR #27. Both unit tests pass cleanly under Windows 11.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 06:53 UTC · original

Automated triage for the maintainers.

On main the two queue slots are still unimplemented: 0x38 (cancel by tag) and 0x58 (queue info) are missing::<7> and missing::<11> in the queue table of crates/victory-hle/src/modules/dstorage.rs, so this fits the project. Pull requests are open to everyone again; open pull request #2086 (fuzeofficlal) already carries this change for review, so please check it against your branch 3380e5b there rather than open a second one. The decision is left to the maintainers.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 06:53 UTC · [original](https://github.com/Marvisak/VIctory/issues/889#issuecomment-7155264183) <!-- victory-issue-triage v1 verdict=tracked seen=2026-11-24T13:53:16Z at=2026-11-25T06:53:22Z --> Automated triage for the maintainers. On `main` the two queue slots are still unimplemented: `0x38` (cancel by tag) and `0x58` (queue info) are `missing::<7>` and `missing::<11>` in the queue table of `crates/victory-hle/src/modules/dstorage.rs`, so this fits the project. Pull requests are open to everyone again; open pull request #2086 (fuzeofficlal) already carries this change for review, so please check it against your branch `3380e5b` there rather than open a second one. The decision is left to the maintainers. --- _Generated by [Claude Code](https://claude.ai/code)_
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory#889
No description provided.