HLE: implement DirectStorage CancelRequestsWithTag and Query queue slots #2084

Closed
fuzeofficlal wants to merge 1 commit from upstream-pr/2086 into main
fuzeofficlal commented 2026-11-25 04:32:46 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-25T04:32:46Z.


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.
<!-- greyfinch-sync:Marvisak/VIctory:issue:6597265335 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2086). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-25T04:32:46Z. --- 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`.
DenRakEiw commented 2026-11-25 05:06:05 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-25T04:36:18Z.

Review: APPROVED


Verified locally merged onto origin/main (940d32f, Windows 11 x64, Rust 1.98.1 MSVC):

  • cargo test -p victory-hle --lib dstorage:: — 16 passed, 0 failed (including queue_info_tracks_layout_counts_and_closed_state and the new CancelRequestsWithTag tests)
  • cargo clippy -p victory-hle --all-targets — 0 warnings
  • cargo xtask policy — ok (183 files ok)

Clean implementation of DirectStorage CancelRequestsWithTag and Query queue slots with solid unit test coverage. Looks good.

AI-assisted (Gemini 4 Neon).

<!-- greyfinch-sync:Marvisak/VIctory:review:6051918480 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2086#pullrequestreview-6051918480). Originally posted by [DenRakEiw](https://github.com/DenRakEiw) on 2026-11-25T04:36:18Z. **Review:** APPROVED --- Verified locally merged onto `origin/main` (`940d32f`, Windows 11 x64, Rust 1.98.1 MSVC): - `cargo test -p victory-hle --lib dstorage::` — **16 passed, 0 failed** (including `queue_info_tracks_layout_counts_and_closed_state` and the new `CancelRequestsWithTag` tests) - `cargo clippy -p victory-hle --all-targets` — 0 warnings - `cargo xtask policy` — ok (`183 files ok`) Clean implementation of DirectStorage `CancelRequestsWithTag` and `Query` queue slots with solid unit test coverage. Looks good. AI-assisted (Gemini 4 Neon).
catminou4 commented 2026-11-25 05:06:05 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T05:02:18Z.

Review: COMMENTED


Static review only: victory-hle is Windows-only — nothing compiles or runs on macOS; source review of the diff.

DirectStorage CancelRequestsWithTag + Query queue depth — completes the cancellation surface; check the tag-matching semantics against the real API (cancels ALL matching, not just queued).

<!-- greyfinch-sync:Marvisak/VIctory:review:6052104755 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2086#pullrequestreview-6052104755). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-25T05:02:18Z. **Review:** COMMENTED --- Static review only: victory-hle is Windows-only — nothing compiles or runs on macOS; source review of the diff. DirectStorage CancelRequestsWithTag + Query queue depth — completes the cancellation surface; check the tag-matching semantics against the real API (cancels ALL matching, not just queued).
jeremygold02 commented 2026-11-25 05:06:21 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by jeremygold02 on 2026-11-25T04:36:00Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7152991266 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2086#issuecomment-7152991266). Originally posted by [jeremygold02](https://github.com/jeremygold02) on 2026-11-25T04:36:00Z. --- **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://github.com/Marvisak/VIctory/pull/2074#issuecomment-7152950729) **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.
Dathinel commented 2026-11-25 05:06:22 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Dathinel on 2026-11-25T04:39:50Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7153050326 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2086#issuecomment-7153050326). Originally posted by [Dathinel](https://github.com/Dathinel) on 2026-11-25T04:39:50Z. --- 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.
fuzeofficlal commented 2026-11-25 05:06:27 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-25T05:00:27Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7153362180 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2086#issuecomment-7153362180). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-25T05:00:27Z. --- 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`.
Marvisak commented 2026-11-25 11:05:25 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T10:33:14Z.


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

<!-- greyfinch-sync:Marvisak/VIctory:comment:7159854261 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2086#issuecomment-7159854261). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T10:33:14Z. --- <!-- 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)_
upstream-sync closed this pull request 2026-11-25 17:03:24 +00:00
fuzeofficlal commented 2026-11-25 17:05:01 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-25T16:13:51Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7167706646 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2086#issuecomment-7167706646). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-25T16:13:51Z. --- 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

Sign in to join this conversation.
No reviewers
No labels
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.

Reference
Marvisak/VIctory!2084
No description provided.