HLE: implement DirectStorage CancelRequestsWithTag and Query queue slots #2086

Closed
github-bot wants to merge 1 commit from gh-pr/2086/head into gh-pr/2086/base
Owner

@⁠fuzeofficlal on GitHub · 2026-11-25 04:32 UTC · original
fuzeofficlal:feat/hle-dstorage-cancel-query-889 → main · +366 −6 · 1 files · 1 commits · closed without merging

Fixes #889.

Summary

  • Slot 7 (0x38, CancelRequestsWithTag): drop unsubmitted and queued-not-yet-started read requests matching (request.tag & mask) == value, flush newly unblocked status entries without recording a failure, and wake full-queue waiters.
  • Slot 11 (0x58, Query): populate the 0x20-byte 2020 DSTORAGE_QUEUE_INFO layout from the queue's creation description (retaining an owned CString for name) and live empty / auto-submit slot counts, reporting (0, 0) once closed and tolerating null output pointers.

Testing

  • Added queue_info_tracks_layout_counts_and_closed_state and cancel_by_tag_drops_matching_reads_without_error in crates/victory-hle/src/modules/dstorage.rs.
  • cargo test -p victory-hle --locked, cargo clippy --workspace --all-targets --all-features -- -D warnings, and cargo xtask policy.
**@⁠fuzeofficlal** on GitHub · 2026-11-25 04:32 UTC · [original](https://github.com/Marvisak/VIctory/pull/2086) `fuzeofficlal:feat/hle-dstorage-cancel-query-889` → `main` · +366 −6 · 1 files · 1 commits · closed without merging Fixes #889. ### Summary - **Slot 7 (`0x38`, `CancelRequestsWithTag`)**: drop unsubmitted and queued-not-yet-started read requests matching `(request.tag & mask) == value`, flush newly unblocked status entries without recording a failure, and wake full-queue waiters. - **Slot 11 (`0x58`, `Query`)**: populate the `0x20`-byte 2020 `DSTORAGE_QUEUE_INFO` layout from the queue's creation description (retaining an owned `CString` for `name`) and live empty / auto-submit slot counts, reporting `(0, 0)` once closed and tolerating null output pointers. ### Testing - Added `queue_info_tracks_layout_counts_and_closed_state` and `cancel_by_tag_drops_matching_reads_without_error` in `crates/victory-hle/src/modules/dstorage.rs`. - `cargo test -p victory-hle --locked`, `cargo clippy --workspace --all-targets --all-features -- -D warnings`, and `cargo xtask policy`.
Wire IDStorageQueueX vtable slot 7 (0x38, CancelRequestsWithTag) and
slot 11 (0x58, Query) in dstorage:

- Drop unsubmitted and queued-not-yet-started read requests matching
  `(request.tag & mask) == value`, flush newly unblocked status entries
  without recording a failure, and notify full-queue waiters.
- Populate the 2020 DSTORAGE_QUEUE_INFO layout (0x20 bytes) from the
  queue's creation description (retaining an owned CString for `name`)
  and live empty/auto-submit slot counts, sharing `Lane::submits_at()`
  between `queue()` and `Query` and reporting `(0, 0)` once closed.

Fixes #889.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:54:27 +00:00
github-bot closed this pull request 2026-11-26 04:54:27 +00:00
Author
Owner

@⁠jeremygold02 on GitHub · 2026-11-25 04:36 UTC · original

Triage verdict — Keep Query and cancellation, share the auto-submit threshold (c931aac)

Evidence

  • @⁠fuzeofficlal’s Query currently reports four entries until auto-submit on an idle capacity-eight queue. That matches the current enqueue policy. #2074 proposes five for the same queue, so taking both changes as written could make Query disagree with the enqueue path. Query calculation · Idle-count assertion · #2074 boundary evidence

Checks and limits

  • Compared both exact-head calculations and test expectations. I did not execute this PR’s cancellation or Query fixtures. The Microsoft documents disagree on the console threshold, as recorded on #2074.

Next step

  • Use the same lane helper for reporting and enforcing whichever threshold maintainers select. Add a status-only check that reads the reported countdown and verifies completion at that exact count, including the smallest supported queue.

This verification was AI-assisted.

**@⁠jeremygold02** on GitHub · 2026-11-25 04:36 UTC · [original](https://github.com/Marvisak/VIctory/pull/2086#issuecomment-7152991266) **Triage verdict — Keep Query and cancellation, share the auto-submit threshold** (`c931aac`) **Evidence** - @⁠fuzeofficlal’s `Query` currently reports four entries until auto-submit on an idle capacity-eight queue. That matches the current enqueue policy. #2074 proposes five for the same queue, so taking both changes as written could make `Query` disagree with the enqueue path. [Query calculation](https://github.com/Marvisak/VIctory/blob/c931aac5c61342403c3a3c5605099050c66b768d/crates/victory-hle/src/modules/dstorage.rs#L864-L895) · [Idle-count assertion](https://github.com/Marvisak/VIctory/blob/c931aac5c61342403c3a3c5605099050c66b768d/crates/victory-hle/src/modules/dstorage.rs#L1754-L1794) · [#2074 boundary evidence](https://git.gtahub.st/github/Marvisak--VIctory/pulls/2074) **Checks and limits** - Compared both exact-head calculations and test expectations. I did not execute this PR’s cancellation or Query fixtures. The Microsoft documents disagree on the console threshold, as recorded on #2074. **Next step** - Use the same lane helper for reporting and enforcing whichever threshold maintainers select. Add a status-only check that reads the reported countdown and verifies completion at that exact count, including the smallest supported queue. This verification was AI-assisted.
Author
Owner

@⁠Dathinel on GitHub · 2026-11-25 04:39 UTC · original

I ran the status-only check suggested above. Before each enqueue I called Query, then enqueued a new status entry and checked whether the first status had completed. No reads or explicit Submit.

Queue capacity #2086 alone: reported / actual enqueues from empty #2086 + #2074: reported / actual
2 1 / 1 1 / 1
4 2 / 2 2 / 3
8 4 / 4 4 / 5
16 8 / 8 8 / 9

At capacity 8 the combined tree reports 4, 3, 2, 1, 0 before the five enqueues; the first status is still pending when the count reaches zero. Using #2074's lane.submits_at() in Query made every step match for all four capacities. With the four countdown expectations updated in the Query and cancellation tests, all 17 DirectStorage module tests passed.

Tested on Windows at c931aac5 and 2ced7715. This verifies reporting against the runtime's actual behavior for either merge decision. AI-assisted.

**@⁠Dathinel** on GitHub · 2026-11-25 04:39 UTC · [original](https://github.com/Marvisak/VIctory/pull/2086#issuecomment-7153050326) I ran the status-only check suggested above. Before each enqueue I called `Query`, then enqueued a new status entry and checked whether the first status had completed. No reads or explicit `Submit`. | Queue capacity | #2086 alone: reported / actual enqueues from empty | #2086 + #2074: reported / actual | |---:|---:|---:| | 2 | 1 / 1 | 1 / 1 | | 4 | 2 / 2 | 2 / 3 | | 8 | 4 / 4 | 4 / 5 | | 16 | 8 / 8 | 8 / 9 | At capacity 8 the combined tree reports `4, 3, 2, 1, 0` before the five enqueues; the first status is still pending when the count reaches zero. Using #2074's `lane.submits_at()` in `Query` made every step match for all four capacities. With the four countdown expectations updated in the Query and cancellation tests, all 17 DirectStorage module tests passed. Tested on Windows at `c931aac5` and `2ced7715`. This verifies reporting against the runtime's actual behavior for either merge decision. AI-assisted.
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-25 05:00 UTC · original

Updated in 45a34efb — thanks @⁠jeremygold02. Factored Lane::submits_at so queue() and Query share a single auto-submit threshold calculation, and added status-only enqueue_status countdown/auto-submit assertions across capacities 2, 4, and 8.

**@⁠fuzeofficlal** on GitHub · 2026-11-25 05:00 UTC · [original](https://github.com/Marvisak/VIctory/pull/2086#issuecomment-7153362180) Updated in `45a34efb` — thanks @⁠jeremygold02. Factored `Lane::submits_at` so `queue()` and `Query` share a single auto-submit threshold calculation, and added status-only `enqueue_status` countdown/auto-submit assertions across capacities `2`, `4`, and `8`.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 10:33 UTC · original · edited 2026-11-25 15:56 UTC

Automated triage for the maintainers.

This pull request no longer merges cleanly into main (conflicts in crates/victory-hle/src/modules/dstorage.rs). It will be reviewed once it is rebased onto the current main. The earlier verdict (needs-work) was for an older state of main.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 10:33 UTC · [original](https://github.com/Marvisak/VIctory/pull/2086#issuecomment-7159854261) · edited 2026-11-25 15:56 UTC <!-- victory-triage v1 head=45a34efbcc6556a4619dff7d3592c0b1bc6a11b9 verdict=needs-rebase at=2026-11-25T15:59:30Z --> Automated triage for the maintainers. This pull request no longer merges cleanly into `main` (conflicts in `crates/victory-hle/src/modules/dstorage.rs`). It will be reviewed once it is rebased onto the current `main`. The earlier verdict (needs-work) was for an older state of `main`. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-25 16:13 UTC · original

Closing per triage feedback: the title only calls queue slots 0x18, 0x20, 0x30, and 0x40, so keeping missing::<7> (0x38) and missing::<11> (0x58) avoids committing to an unverified QueueInfo layout (0x20 vs 0x28 bytes around QueueDesc) until a real call site is observed.

**@⁠fuzeofficlal** on GitHub · 2026-11-25 16:13 UTC · [original](https://github.com/Marvisak/VIctory/pull/2086#issuecomment-7167706646) Closing per triage feedback: the title only calls queue slots `0x18`, `0x20`, `0x30`, and `0x40`, so keeping `missing::<7>` (`0x38`) and `missing::<11>` (`0x58`) avoids committing to an unverified `QueueInfo` layout (`0x20` vs `0x28` bytes around `QueueDesc`) until a real call site is observed.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
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!2086
No description provided.