fix: preserve bounced read failures #3658

Open
github-bot wants to merge 7 commits from github-bot/gh-3658 into main AGit
Owner

@⁠igorevv on GitHub · 2026-11-30 03:07 UTC · original
igorevv:fix/bounced-read-error → main · +31 −9 · 3 files · 7 commits · open

fix: preserve bounced read failures

Branch: fix/bounced-read-error
Commit: 449f248d

Summary

Prevent VICTORY_READ_BOUNCE=1 from reporting success when a host read fails after one or more chunks have already been read.

Problem

bounced_read() processes large requests in 8 MiB chunks. When a later chunk failed after earlier chunks had succeeded, the function took this path:

  1. total > 0 caused a break instead of an immediate error return.
  2. The partial byte count was written to the caller.
  3. OVERLAPPED.Internal was set to zero.
  4. The function returned 1, indicating success.

A network, device, or file-system error could therefore turn into a successful truncated read. The title could then consume incomplete shader or package data without seeing the underlying failure.

Fix

The function now records the error captured from the failed host call.

After writing the partial byte count, it:

  • stores the captured error in OVERLAPPED.Internal;
  • restores the same error through SetLastError;
  • returns 0 to report failure.

Partial bytes remain visible to the caller, but they no longer make the request appear successful. Errors on the first chunk retain their previous behavior, and successful or EOF reads are unchanged.

Changed files

  • crates/victory-hle/src/modules/files.rs
    • track a later-chunk failure;
    • propagate its status through OVERLAPPED and GetLastError;
    • return failure instead of accepting a truncated read.

Validation

cargo test -p victory-hle modules::files::tests --locked
10 passed; 0 failed

cargo xtask policy --staged
asset policy: 1 files ok

git diff --check
passed

The test suite was run with TEMP and TMP pointing to a writable directory on D:.

A broader HLE Clippy run still reports pre-existing warnings in unchanged code, including gameinput.rs:960,1006 and victory-loader/src/crash.rs:804. No fault-injection test with a physical failing device or a game run was performed.

**@⁠igorevv** on GitHub · 2026-11-30 03:07 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3658) `igorevv:fix/bounced-read-error` → `main` · +31 −9 · 3 files · 7 commits · open # fix: preserve bounced read failures Branch: `fix/bounced-read-error` Commit: `449f248d` ## Summary Prevent `VICTORY_READ_BOUNCE=1` from reporting success when a host read fails after one or more chunks have already been read. ## Problem `bounced_read()` processes large requests in 8 MiB chunks. When a later chunk failed after earlier chunks had succeeded, the function took this path: 1. `total > 0` caused a `break` instead of an immediate error return. 2. The partial byte count was written to the caller. 3. `OVERLAPPED.Internal` was set to zero. 4. The function returned `1`, indicating success. A network, device, or file-system error could therefore turn into a successful truncated read. The title could then consume incomplete shader or package data without seeing the underlying failure. ## Fix The function now records the error captured from the failed host call. After writing the partial byte count, it: - stores the captured error in `OVERLAPPED.Internal`; - restores the same error through `SetLastError`; - returns `0` to report failure. Partial bytes remain visible to the caller, but they no longer make the request appear successful. Errors on the first chunk retain their previous behavior, and successful or EOF reads are unchanged. ## Changed files - `crates/victory-hle/src/modules/files.rs` - track a later-chunk failure; - propagate its status through `OVERLAPPED` and `GetLastError`; - return failure instead of accepting a truncated read. ## Validation ```text cargo test -p victory-hle modules::files::tests --locked 10 passed; 0 failed cargo xtask policy --staged asset policy: 1 files ok git diff --check passed ``` The test suite was run with `TEMP` and `TMP` pointing to a writable directory on `D:`. A broader HLE Clippy run still reports pre-existing warnings in unchanged code, including `gameinput.rs:960,1006` and `victory-loader/src/crash.rs:804`. No fault-injection test with a physical failing device or a game run was performed.
`--set VICTORY_WARMUP_RESTART=<seconds>` asks for the older warm-up
restart, whose mark is written by the layer
(crates\victory-gpu\src\host\menu.rs, `warmup`). The layer is told the
seconds and nothing else: it reads the mark's path from
`VICTORY_WARMUP_MARK`, and does nothing when that is empty.

Since "First start of a new victory.exe: make every shader first, once"
the launcher names that mark only on the preload branch, which is
skipped whenever `VICTORY_WARMUP_RESTART` is set. So no mark is ever
written, and every start of the same exe warms up and starts again.
Before that commit the two variables were set together.

Set it on that branch too, and keep `warmup_mark` lazy so a start that
needs no mark does not hash the exe.
Configured XOR layouts are addressable on the CPU but have no pattern tables for the GPU detiler. Return no GPU detile parameters for them so the existing CPU fallback is used, and cover the configured case in the detile parameter test.
A host read error after a successful 8 MiB chunk broke out of the loop and returned success with a zero OVERLAPPED status. Keep the partial byte count, but return the captured error through GetLastError and OVERLAPPED so truncated shader or package reads are not accepted as complete.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 03:08:37 +00:00
This pull request has changes conflicting with the target branch.
  • apps/victory/src/play.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

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