Diagnostics: trace a DirectStorage request from submission to decoder outcome #1178

Open
github-bot wants to merge 2 commits from github-bot/gh-1178 into main AGit
Owner

@⁠Razdva122 on GitHub · 2026-11-24 16:21 UTC · original
Razdva122:diagnostics/streaming-refusals → main · +174 −28 · 2 files · 2 commits · open

For #1063, this adds an opt-in DirectStorage request trace. Each enqueue receives an ID that follows the request through admission, file reads and worker completion. The trace records input and destination sizes, decoder outcome, and bytes written or the failure code. The five-second throughput counters also use actual output bytes. Tests cover identical concurrent submissions, short successful output, and insufficient capacity.

On an earlier revision, the reporter traced 9,819 enqueues on a GTX 1660 SUPER. None carried 46,586 as a size, and 5,651 requests completed with 65,536 bytes written. The per-size stack capture answered its original question, so this revision removes the filter and the loader API added solely for it. The general trace remains available for other streaming reports. Reporter’s results

The README now has one row for the trace target. The diagnostic build command, PowerShell invocation and fields to compare are in the issue. Reproduction instructions

AI-assisted with Codex.

Windows CI passed both workspace Clippy configurations, the full workspace suite and the diagnostics-mode DirectStorage tests at 40dac06. Windows job · Download the Windows x64 diagnostic build

**@⁠Razdva122** on GitHub · 2026-11-24 16:21 UTC · [original](https://github.com/Marvisak/VIctory/pull/1178) `Razdva122:diagnostics/streaming-refusals` → `main` · +174 −28 · 2 files · 2 commits · open For #1063, this adds an opt-in DirectStorage request trace. Each enqueue receives an ID that follows the request through admission, file reads and worker completion. The trace records input and destination sizes, decoder outcome, and bytes written or the failure code. The five-second throughput counters also use actual output bytes. Tests cover identical concurrent submissions, short successful output, and insufficient capacity. On an earlier revision, the reporter traced 9,819 enqueues on a GTX 1660 SUPER. None carried 46,586 as a size, and 5,651 requests completed with 65,536 bytes written. The per-size stack capture answered its original question, so this revision removes the filter and the loader API added solely for it. The general trace remains available for other streaming reports. [Reporter’s results](https://git.gtahub.st/github/Marvisak--VIctory/pulls/1178) The README now has one row for the trace target. The diagnostic build command, PowerShell invocation and fields to compare are in the issue. [Reproduction instructions](https://git.gtahub.st/github/Marvisak--VIctory/issues/1063) AI-assisted with Codex. Windows CI passed both workspace Clippy configurations, the full workspace suite and the diagnostics-mode DirectStorage tests at `40dac06`. [Windows job](https://github.com/Razdva122/VIctory/actions/runs/45818274261/job/139905737227) · [Download the Windows x64 diagnostic build](https://github.com/Razdva122/VIctory/actions/runs/45818274261/artifacts/15116284867)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:22:33 +00:00
Author
Owner

@⁠roon9e on GitHub · 2026-11-24 17:51 UTC · original

Ran the #1178 diagnostics on a reporting-class machine — the 46,586 value does not reach VIctory's DirectStorage boundary. No request matches the filter.

Setup: Windows 11, GTX 1660 SUPER 6 GB, own 1.0.2.1 copy (SHA-256 e95020b2…), Xbox Series build, win-x64, --profile diag --features diagnostics at 9b8949f, run without the local int3 workaround (the stop is the raw 0x80000003 at title+0x1330a44). VICTORY_LOG=info,victory_dstorage=trace, VICTORY_DSTORAGE_CALLER_SIZE=46586.

Result:

enqueue requests:            9819
  options=0x1 (zlib):        6532
  options=0x0 (raw):         3287
  bcpack ≠ 0:                0        (bcpack=0 in all 29,457 read lines)
completed written=65536:     5651
completed written=16:        1402
(size fields equal to 46586: 0)
  • No request carries 46,586 as source_size, destination_size, intermediate_size or written. The literal 46586 occurs in the log only as a substring of an offset (…4658672), never a size. The size filter therefore appended no caller stack to any request (the only caller= lines are the unrelated device slot 0x218/0x1c8 warnings).
  • The streaming decode is entirely zlib (options=0x1, e.g. source_size≈44k → destination_size=65536, read=source_size hr=0, completed written=65536) or raw (0x0). VIctory's side of the pair — 65,536 — is exactly what it decodes and completes.
  • No BCPack crosses the boundary at all (bcpack=0 in every read), so the texture/BС decode is not a DirectStorage request here.

So the 64 KiB/46,586 pair you were tracking does not reach VIctory's DirectStorage API as a request shape. At the same stop, reading the faulting thread's stream state directly shows where the pair actually lives:

[walk rsi] inst=[stream+0x10020]
[inst]  +0x8=0x10000 (65536)   +0x58=0x70817 (codec id)
[inst+0x40] -> descriptor, +8=46586, +0x20=4096 ; [inst+8]=65536
[prov]  vtable = <title>+0x62fd480
        +0x3f0 = <title>+0x28ce0a0   (the codec-capability query)

vt[0x3f0] (0x28ce0a0) is an adjustor thunk to <title>+0x28ce1b0, which searches the provider's own registry for the 64-bit interface key and then title+0x144db65b0 reads a per-codec entry (title+0x144db6600; a 0xffff/0xff entry = "absent") → returns 0 → test al,al / je → int3 at 0x1330a44. The provider and its registry are title code over title data (vtable in the title's .rdata), and the codec id there is 0x70817.

The trace is still the right instrument — it cleanly confirms VIctory's boundary is healthy and that the size pair is title-internal. What would pin it next, if useful: the same trace keyed on the codec id (0x70817) rather than a size, or on requests whose output the title later re-reads and rejects; and a snapshot of the provider registry ([prov+0x28] → +0x20 key table, +0x28/+0x38 codec tables) taken while the thread is suspended. If that registry is expected to be filled from a device call, note that device slots 0x218/0x1c8 are currently E_NOTIMPL (caller="+0x24800db" / "+0x247757e", the +0x2478440 bring-up group) — possible registration steps, though they also fire in every menu run.

AI-assisted; run on my machine, no game data quoted.

**@⁠roon9e** on GitHub · 2026-11-24 17:51 UTC · [original](https://github.com/Marvisak/VIctory/pull/1178#issuecomment-7139806415) **Ran the #1178 diagnostics on a reporting-class machine — the 46,586 value does *not* reach VIctory's DirectStorage boundary. No request matches the filter.** Setup: Windows 11, **GTX 1660 SUPER 6 GB**, own 1.0.2.1 copy (SHA-256 `e95020b2…`), Xbox Series build, `win-x64`, `--profile diag --features diagnostics` at `9b8949f`, run **without** the local `int3` workaround (the stop is the raw `0x80000003` at `title+0x1330a44`). `VICTORY_LOG=info,victory_dstorage=trace`, `VICTORY_DSTORAGE_CALLER_SIZE=46586`. Result: ```text enqueue requests: 9819 options=0x1 (zlib): 6532 options=0x0 (raw): 3287 bcpack ≠ 0: 0 (bcpack=0 in all 29,457 read lines) completed written=65536: 5651 completed written=16: 1402 (size fields equal to 46586: 0) ``` - **No request carries 46,586** as `source_size`, `destination_size`, `intermediate_size` or `written`. The literal `46586` occurs in the log only as a *substring of an offset* (`…4658672`), never a size. The size filter therefore appended **no caller stack** to any request (the only `caller=` lines are the unrelated `device slot 0x218/0x1c8` warnings). - The streaming decode is entirely **zlib** (`options=0x1`, e.g. `source_size≈44k → destination_size=65536`, `read=source_size hr=0`, `completed written=65536`) or raw (`0x0`). VIctory's side of the pair — 65,536 — is exactly what it decodes and completes. - **No BCPack** crosses the boundary at all (`bcpack=0` in every read), so the texture/BС decode is not a DirectStorage request here. So the 64 KiB/46,586 pair you were tracking does not reach VIctory's DirectStorage API as a request shape. At the same stop, reading the faulting thread's stream state directly shows where the pair actually lives: ```text [walk rsi] inst=[stream+0x10020] [inst] +0x8=0x10000 (65536) +0x58=0x70817 (codec id) [inst+0x40] -> descriptor, +8=46586, +0x20=4096 ; [inst+8]=65536 [prov] vtable = <title>+0x62fd480 +0x3f0 = <title>+0x28ce0a0 (the codec-capability query) ``` `vt[0x3f0]` (`0x28ce0a0`) is an adjustor thunk to `<title>+0x28ce1b0`, which searches the provider's own registry for the 64-bit interface key and then `title+0x144db65b0` reads a per-codec entry (`title+0x144db6600`; a `0xffff`/`0xff` entry = "absent") → returns 0 → `test al,al / je → int3` at `0x1330a44`. **The provider and its registry are title code over title data** (vtable in the title's `.rdata`), and the codec id there is `0x70817`. The trace is still the right instrument — it cleanly confirms VIctory's boundary is healthy and that the size pair is title-internal. What would pin it next, if useful: the same trace keyed on the **codec id** (`0x70817`) rather than a size, or on requests whose output the title later re-reads and rejects; and a snapshot of the provider registry (`[prov+0x28]` → `+0x20` key table, `+0x28`/`+0x38` codec tables) taken while the thread is suspended. If that registry is expected to be filled from a device call, note that `device` slots `0x218`/`0x1c8` are currently `E_NOTIMPL` (`caller="+0x24800db"` / `"+0x247757e"`, the `+0x2478440` bring-up group) — possible registration steps, though they also fire in every menu run. AI-assisted; run on my machine, no game data quoted.
Author
Owner

@⁠Zipettte on GitHub · 2026-11-24 18:00 UTC · original

Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 9b8949f: cargo test -p victory-hle -p victory-loader passes, 121 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).

Tested with AI assistance (Claude).

**@⁠Zipettte** on GitHub · 2026-11-24 18:00 UTC · [original](https://github.com/Marvisak/VIctory/pull/1178#issuecomment-7140027018) Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 9b8949f: `cargo test -p victory-hle -p victory-loader` passes, 121 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed). _Tested with AI assistance (Claude)._
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 01:18 UTC · original · edited 2026-11-25 16:01 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 (merge-candidate) was for an older state of main.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 01:18 UTC · [original](https://github.com/Marvisak/VIctory/pull/1178#issuecomment-7149406179) · edited 2026-11-25 16:01 UTC <!-- victory-triage v1 head=f475df13ac2f5f2e11babe34ae4e67b19f9a3b78 verdict=needs-rebase at=2026-11-25T16:00:10Z --> 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 (merge-candidate) was for an older state of `main`. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠Razdva122 on GitHub · 2026-11-25 06:55 UTC · original

@⁠Marvisak, could you re-review f475df1 and update the triage: needs work label if the revised scope addresses your feedback?

The reporter found no request carrying 46,586 as a size across 9,819 enqueues. I removed the size filter, the caller-stack capture and its loader API. The general request ID and actual bytes written remain available. The README now has one row for the trace target, and the reproduction procedure is in #1063.

Both Clippy configurations, the workspace suite and the diagnostics-mode DirectStorage tests passed on Windows. Changes since triage · Windows CI

**@⁠Razdva122** on GitHub · 2026-11-25 06:55 UTC · [original](https://github.com/Marvisak/VIctory/pull/1178#issuecomment-7155305097) @⁠Marvisak, could you re-review `f475df1` and update the `triage: needs work` label if the revised scope addresses your feedback? The reporter found no request carrying 46,586 as a size across 9,819 enqueues. I removed the size filter, the caller-stack capture and its loader API. The general request ID and actual bytes written remain available. The README now has one row for the trace target, and the reproduction procedure is in [#1063](https://git.gtahub.st/github/Marvisak--VIctory/issues/1063). Both Clippy configurations, the workspace suite and the diagnostics-mode DirectStorage tests passed on Windows. [Changes since triage](https://github.com/Marvisak/VIctory/compare/9d357e862365ebf9fa099388e90d6fb7b06a052e...f475df13ac2f5f2e11babe34ae4e67b19f9a3b78) · [Windows CI](https://github.com/Razdva122/VIctory/actions/runs/45563455856/job/139032459796)
github-bot force-pushed github-bot/gh-1178 from f475df13ac to 40dac069cb 2026-11-26 12:19:29 +00:00 Compare
Author
Owner

@⁠Razdva122 on GitHub · 2026-11-26 12:28 UTC · original

Could you re-review the DirectStorage trace at 40dac06 and refresh the rebase label? The branch now merges cleanly with main at 63bcca4 and keeps the upstream request-admission changes. Both Clippy configurations, the full workspace suite and the diagnostics-mode DirectStorage tests passed on Windows. The diagnostic build in the PR description has also been rebuilt at this commit. Windows verification

**@⁠Razdva122** on GitHub · 2026-11-26 12:28 UTC · [original](https://github.com/Marvisak/VIctory/pull/1178#issuecomment-7192050002) Could you re-review the DirectStorage trace at `40dac06` and refresh the rebase label? The branch now merges cleanly with `main` at `63bcca4` and keeps the upstream request-admission changes. Both Clippy configurations, the full workspace suite and the diagnostics-mode DirectStorage tests passed on Windows. The diagnostic build in the PR description has also been rebuilt at this commit. [Windows verification](https://github.com/Razdva122/VIctory/actions/runs/45818274261/job/139905737227)
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1178/head:github-bot/gh-1178'
git switch 'github-bot/gh-1178'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1178'
git switch 'github-bot/gh-1178'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1178'
git switch 'github-bot/gh-1178'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1178'
git switch 'main'
git merge --squash 'github-bot/gh-1178'
git switch 'main'
git merge --ff-only 'github-bot/gh-1178'
git switch 'main'
git merge 'github-bot/gh-1178'
git push origin 'main'
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!1178
No description provided.