hle(files): signal overlapped.hEvent when bounced_read completes #3140

Open
github-bot wants to merge 1 commit from github-bot/gh-3140 into main AGit
Owner

@⁠RanoGames on GitHub · 2026-11-29 20:15 UTC · original
RanoGames:fix/files-bounced-read-signal-event → main · +70 −9 · 1 files · 1 commits · open

What it changes

Fixes bounced_read in crates/victory-hle/src/modules/files.rs:

  • When VICTORY_READ_BOUNCE=1 and a non-null overlapped pointer was passed, bounced_read used a local OVERLAPPED with hEvent = 0 and wrote Internal / InternalHigh back to the caller's OVERLAPPED, but never signaled the caller's overlapped.hEvent (offset +24).
  • Callers waiting on hEvent (or GetOverlappedResult(..., TRUE)) could hang after a bounced read.
  • Extracted complete_overlapped(overlapped, total) which writes Internal / InternalHigh and calls SetEvent(hEvent) when hEvent is non-null.
  • Added unit test modules::files::tests::bounced_read_signals_overlapped_event.

How it was tested

  • GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing): N/A (unit-tested HLE ReadFile bounce path)
  • Before: bounced_read wrote Internal and InternalHigh without signaling overlapped.hEvent.
  • After: overlapped.hEvent is signaled via SetEvent when non-null.
  • For shader changes, the wave sizes tested (32 and/or 64 lanes): N/A
  • cargo test passed for the crates it touches: yes (cargo test --locked -p victory-hle --lib -- modules::files::tests: 11 passed, 0 failed; cargo xtask policy --staged passed)

Checked for overlap

  • I searched the open and closed pull requests for bounced_read (0 PRs).
**@⁠RanoGames** on GitHub · 2026-11-29 20:15 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3140) `RanoGames:fix/files-bounced-read-signal-event` → `main` · +70 −9 · 1 files · 1 commits · open ## What it changes Fixes `bounced_read` in `crates/victory-hle/src/modules/files.rs`: - When `VICTORY_READ_BOUNCE=1` and a non-null `overlapped` pointer was passed, `bounced_read` used a local `OVERLAPPED` with `hEvent = 0` and wrote `Internal` / `InternalHigh` back to the caller's `OVERLAPPED`, but never signaled the caller's `overlapped.hEvent` (offset `+24`). - Callers waiting on `hEvent` (or `GetOverlappedResult(..., TRUE)`) could hang after a bounced read. - Extracted `complete_overlapped(overlapped, total)` which writes `Internal` / `InternalHigh` and calls `SetEvent(hEvent)` when `hEvent` is non-null. - Added unit test `modules::files::tests::bounced_read_signals_overlapped_event`. ## How it was tested - GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing): N/A (unit-tested HLE `ReadFile` bounce path) - Before: `bounced_read` wrote `Internal` and `InternalHigh` without signaling `overlapped.hEvent`. - After: `overlapped.hEvent` is signaled via `SetEvent` when non-null. - For shader changes, the wave sizes tested (32 and/or 64 lanes): N/A - `cargo test` passed for the crates it touches: yes (`cargo test --locked -p victory-hle --lib -- modules::files::tests`: 11 passed, 0 failed; `cargo xtask policy --staged` passed) ## Checked for overlap - [x] I searched the open and closed pull requests for `bounced_read` (0 PRs).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 20:18:29 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
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/3140/head:github-bot/gh-3140'
git switch 'github-bot/gh-3140'

Merge

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