DirectStorage: flush the optional trace on request failure #254

Open
github-bot wants to merge 2 commits from github-bot/gh-254 into a-publier AGit
Owner

@⁠loyodea on GitHub · 2026-11-26 13:14 UTC · original
loyodea:victory-rx9070xt-late-crash → a-publier · +113 −11 · 1 files · 2 commits · open

Related to #239. When DirectStorage tracing is enabled, flush each failed request row after writing it. Also flush the status row that carries the first failure before publishing the status. This keeps the failure context available as soon as completion becomes visible. Successful status rows and polls continue using periodic buffering.

The Windows HLE library suite passed 164 tests with two ignored. The synthetic tests cover the failed request row, the status row, and the ordering of the flush before publication. A file-backed run retained the failed status row after the process exited.

The title-side null read in the report still needs diagnosis. Codex contributed the implementation and verification.

**@⁠loyodea** on GitHub · 2026-11-26 13:14 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/254) `loyodea:victory-rx9070xt-late-crash` → `a-publier` · +113 −11 · 1 files · 2 commits · open Related to #239. When DirectStorage tracing is enabled, flush each failed request row after writing it. Also flush the status row that carries the first failure before publishing the status. This keeps the failure context available as soon as completion becomes visible. Successful status rows and polls continue using periodic buffering. The Windows HLE library suite passed 164 tests with two ignored. The synthetic tests cover the failed request row, the status row, and the ordering of the flush before publication. A file-backed run retained the failed status row after the process exited. The title-side null read in the report still needs diagnosis. Codex contributed the implementation and verification.
Keep the failed record and buffered context before publishing failed completion. Success retains buffered logging. Related to #239.

Co-authored-by: Codex <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 13:14:41 +00:00
Author
Owner

@⁠adrianmjim on GitHub · 2026-11-26 22:43 UTC · original

Checked by reading the code on rx9070xt cd8dfc0 (head 22f1b72); I did not build or run it.

  • Base: rx9070xt was force-pushed. The merge-base of this PR is 0a43566, so the PR also carries 81ebb7b and the files tab shows its 4 victory-gpu files. GitHub reports the PR as not mergeable. A plain merge with cd8dfc0 conflicts in ambient.rs, host.rs and pipeline/make.rs. The real change is 81ebb7b..22f1b72, one file, and git merge-tree of that range onto cd8dfc0 is clean. stream_log::request is the same on cd8dfc0 (dstorage.rs:750-771). So git rebase --onto rx9070xt 81ebb7b should leave only the dstorage.rs change.
  • a-publier is now at 4eb6cfd. dstorage.rs and kernel.rs are unchanged there, and the same range also merges cleanly onto 4eb6cfd. #343 reworked the stack walk in crash.rs but adds no stream_log flush, so the last point below holds on 4eb6cfd too.
  • Ordering: work() calls stream_log::request (dstorage.rs:789) before lanes.finish (dstorage.rs:794). finish is the only place that records a failure (dstorage.rs:877). Outside tests, only work() calls it. So the failed R row is on disk before is_complete can return true.
  • Only the R row is flushed. The S row for the status entry that carries the failure is written later, in Lane::flush (dstorage.rs:956). The P row is written in is_complete (dstorage.rs:499). Both stay in the 1 MiB buffer until the 1 s thread flushes (dstorage.rs:716-724). If those rows matter, Lane::flush could also flush when first is Some.
  • The PR text says a caller exits right after it sees the error. The comment at dstorage.rs:491-492 says the title only polls is_complete and never reads the result. From reading, a failed read would more likely show up later as a crash on bad data. The flush still covers that case, because the row is written before completion is visible.
  • #239 is an access violation in VCRUNTIME140, not a request error. The unhandled-exception path (kernel.rs:272 -> victory_loader crash.rs:496) does not flush stream_log. On that crash, up to about 1 s of rows is still lost, unless an earlier failed request flushed them. kernel.rs:272 is in victory-hle, so a try_lock + flush of the log could go there.

Not checked: the new test, and whether the rows reach disk on a real failure.

**@⁠adrianmjim** on GitHub · 2026-11-26 22:43 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/254#issuecomment-7204929907) Checked by reading the code on rx9070xt cd8dfc0 (head 22f1b72); I did not build or run it. - Base: rx9070xt was force-pushed. The merge-base of this PR is 0a43566, so the PR also carries 81ebb7b and the files tab shows its 4 victory-gpu files. GitHub reports the PR as not mergeable. A plain merge with cd8dfc0 conflicts in `ambient.rs`, `host.rs` and `pipeline/make.rs`. The real change is 81ebb7b..22f1b72, one file, and `git merge-tree` of that range onto cd8dfc0 is clean. `stream_log::request` is the same on cd8dfc0 (dstorage.rs:750-771). So `git rebase --onto rx9070xt 81ebb7b` should leave only the dstorage.rs change. - a-publier is now at 4eb6cfd. dstorage.rs and kernel.rs are unchanged there, and the same range also merges cleanly onto 4eb6cfd. #343 reworked the stack walk in crash.rs but adds no `stream_log` flush, so the last point below holds on 4eb6cfd too. - Ordering: `work()` calls `stream_log::request` (dstorage.rs:789) before `lanes.finish` (dstorage.rs:794). `finish` is the only place that records a failure (dstorage.rs:877). Outside tests, only `work()` calls it. So the failed `R` row is on disk before `is_complete` can return true. - Only the `R` row is flushed. The `S` row for the status entry that carries the failure is written later, in `Lane::flush` (dstorage.rs:956). The `P` row is written in `is_complete` (dstorage.rs:499). Both stay in the 1 MiB buffer until the 1 s thread flushes (dstorage.rs:716-724). If those rows matter, `Lane::flush` could also flush when `first` is `Some`. - The PR text says a caller exits right after it sees the error. The comment at dstorage.rs:491-492 says the title only polls `is_complete` and never reads the result. From reading, a failed read would more likely show up later as a crash on bad data. The flush still covers that case, because the row is written before completion is visible. - #239 is an access violation in VCRUNTIME140, not a request error. The unhandled-exception path (kernel.rs:272 -> victory_loader crash.rs:496) does not flush `stream_log`. On that crash, up to about 1 s of rows is still lost, unless an earlier failed request flushed them. kernel.rs:272 is in victory-hle, so a `try_lock` + flush of the log could go there. Not checked: the new test, and whether the rows reach disk on a real failure.
github-bot changed target branch from rx9070xt to a-publier 2026-11-27 01:33:50 +00:00
github-bot force-pushed github-bot/gh-254 from 22f1b727f8 to b4599b46e4 2026-11-27 01:33:51 +00:00 Compare
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/254/head:github-bot/gh-254'
git switch 'github-bot/gh-254'

Merge

Merge the changes and update on Forgejo.
git switch 'a-publier'
git merge --no-ff 'github-bot/gh-254'
git switch 'github-bot/gh-254'
git rebase 'a-publier'
git switch 'a-publier'
git merge --ff-only 'github-bot/gh-254'
git switch 'github-bot/gh-254'
git rebase 'a-publier'
git switch 'a-publier'
git merge --no-ff 'github-bot/gh-254'
git switch 'a-publier'
git merge --squash 'github-bot/gh-254'
git switch 'a-publier'
git merge --ff-only 'github-bot/gh-254'
git switch 'a-publier'
git merge 'github-bot/gh-254'
git push origin 'a-publier'
This discussion has been locked. Commenting is limited to contributors.
No description provided.