[BUNDLE] Eight more fixes carried from contributors' forks: #745 #776 #787 #805 #845 #852 #915 #918 #1610

Closed
github-bot wants to merge 20 commits from gh-pr/1610/head into gh-pr/1610/base
Owner

@⁠MamaLeVrai on GitHub · 2026-11-24 19:45 UTC · original
MamaLeVrai:bundle/carried-forks-2 → main · +1307 −88 · 12 files · 20 commits · closed without merging

Eight fixes from contributors' forks, in one PR. Each was reported as an issue that points to a fork branch and a commit (written when pull requests were still limited to collaborators), and none of their authors has a pull request. The branches are merged here as they are, with their commits and their authors, onto main (ffe310e); nothing is changed. Same idea as #1603, which carries four fixes of one contributor.

For reviewers and for anyone verifying with an agent (Claude, Codex, a person): this is a [BUNDLE] PR. The re-verification commands are below.

What is inside

Issue Author Fork branch Commit What it fixes
#745 raphael-riesner shader/med3-nan-bits c796377 v_med3 with a NaN operand gives the median on NVIDIA (fcmp uno folded)
#776 schmiticle; follow-up lucaseddd gpu/write-watch-once-per-submission; gpu/write-watch-preserve-partial-results c326bfa; 32ec0f4 write-watch queries repeat over nested buffers (120-180 ms of a world frame); the follow-up keeps the pages a sweep already reported when a later query of the same asking fails (a write could be lost, reproduced on c326bfa by DrDarkDK and lucaseddd)
#787 Pablo-Barros cli/translate-compare 31953ea victory compare: an A/B of two translate --list outputs, program by program
#805 davutsimsekk fix/loadlibrary-datafile-host 343aa42 LOAD_LIBRARY_AS_DATAFILE loads outside HostPolicy fail with ERROR_MOD_NOT_FOUND
#845 Numbers-iwnl fix/idle-receiver-keyboard a6884a3 a receiver answering for a switched-off pad hides the keyboard stand-in (3 commits)
#852 NicolaiVdS shader/atomic-handle-type ae7e0be an image atomic after a size query reuses an f32 handle: invalid SPIR-V, NVIDIA driver crash
#915 talakasse gpu/partial-detile af4fef4 detile only the subresources a texture's changed pages hold
#918 cybx shadow-batched-copy-back 4c0d57d put a run of GPU-written pieces back with one kernel call

The reasoning, the repro and the measurements of each are in its issue; each branch has its own tests where it adds behaviour.

Left out

  • #729 (keyboard input with an XInput pad, from fix/keyboard-beside-xinput-pad): conflicts with #845 in gameinput.rs, both being about the keyboard stand-in next to a pad; they need to be reconciled by their authors.
  • #951 (21 commits, 131 behind main), #728 and #815 (large patch collections), #966 (a 64 MB stack for the pipeline workers, which #1129 already does) are not carried.

Notes

  • #776 has a second commit. 32ec0f4 is lucaseddd's follow-up on top of c326bfa, from the thread of #776 (their branch gpu/write-watch-preserve-partial-results; GitHub denies them a pull request, they say there). It is merged as it is, with its author and its test. EduAzevedo's 3284f19 (one query for a whole allocation) is not included: its author says the frame is not faster with it and leaves it for whoever takes the sweep in.
  • Authorship. The commits are not rewritten. Any author who would rather open their fix as their own pull request can say so and it comes out of this one.
  • Overlap with the other bundles. These branches are built on main; #776, #915 and #918 touch the same files as some GPU bundles (#1418, #1426, #1439, #1542), so after one of them lands the other may need a rebase.

Verification

Windows 11, RX 6950 XT, Rust 1.98.1 (the pinned toolchain):

Check Result
cargo clippy --workspace --all-targets --locked -- -D warnings clean
cargo clippy --workspace --all-targets --all-features --locked -- -D warnings clean
cargo test --workspace --locked 361 passed, 0 failed, 6 ignored (main: 342 passed, 6 ignored), two runs

The title was not run. No game data is used or committed.

Re-verify in one go

git fetch https://github.com/MamaLeVrai/VIctory.git bundle/carried-forks-2
git checkout FETCH_HEAD
cargo clippy --workspace --all-targets --locked -- -D warnings
cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
cargo test --workspace --locked

AI-assisted (Claude Code); no game data.

🤖 Generated with Claude Code

**@⁠MamaLeVrai** on GitHub · 2026-11-24 19:45 UTC · [original](https://github.com/Marvisak/VIctory/pull/1610) `MamaLeVrai:bundle/carried-forks-2` → `main` · +1307 −88 · 12 files · 20 commits · closed without merging **Eight fixes from contributors' forks, in one PR.** Each was reported as an issue that points to a fork branch and a commit (written when pull requests were still limited to collaborators), and none of their authors has a pull request. The branches are merged here as they are, with their commits and their authors, onto `main` (`ffe310e`); nothing is changed. Same idea as #1603, which carries four fixes of one contributor. > For reviewers and for anyone verifying with an agent (Claude, Codex, a person): this is a `[BUNDLE]` PR. The re-verification commands are below. ## What is inside | Issue | Author | Fork branch | Commit | What it fixes | |---|---|---|---|---| | #745 | raphael-riesner | `shader/med3-nan-bits` | `c796377` | `v_med3` with a NaN operand gives the median on NVIDIA (`fcmp uno` folded) | | #776 | schmiticle; follow-up lucaseddd | `gpu/write-watch-once-per-submission`; `gpu/write-watch-preserve-partial-results` | `c326bfa`; `32ec0f4` | write-watch queries repeat over nested buffers (120-180 ms of a world frame); the follow-up keeps the pages a sweep already reported when a later query of the same asking fails (a write could be lost, reproduced on `c326bfa` by DrDarkDK and lucaseddd) | | #787 | Pablo-Barros | `cli/translate-compare` | `31953ea` | `victory compare`: an A/B of two `translate --list` outputs, program by program | | #805 | davutsimsekk | `fix/loadlibrary-datafile-host` | `343aa42` | `LOAD_LIBRARY_AS_DATAFILE` loads outside `HostPolicy` fail with `ERROR_MOD_NOT_FOUND` | | #845 | Numbers-iwnl | `fix/idle-receiver-keyboard` | `a6884a3` | a receiver answering for a switched-off pad hides the keyboard stand-in (3 commits) | | #852 | NicolaiVdS | `shader/atomic-handle-type` | `ae7e0be` | an image atomic after a size query reuses an f32 handle: invalid SPIR-V, NVIDIA driver crash | | #915 | talakasse | `gpu/partial-detile` | `af4fef4` | detile only the subresources a texture's changed pages hold | | #918 | cybx | `shadow-batched-copy-back` | `4c0d57d` | put a run of GPU-written pieces back with one kernel call | The reasoning, the repro and the measurements of each are in its issue; each branch has its own tests where it adds behaviour. ## Left out - **#729** (keyboard input with an XInput pad, from `fix/keyboard-beside-xinput-pad`): conflicts with #845 in `gameinput.rs`, both being about the keyboard stand-in next to a pad; they need to be reconciled by their authors. - **#951** (21 commits, 131 behind `main`), **#728** and **#815** (large patch collections), **#966** (a 64 MB stack for the pipeline workers, which #1129 already does) are not carried. ## Notes - **#776 has a second commit.** `32ec0f4` is lucaseddd's follow-up on top of `c326bfa`, from the thread of #776 (their branch `gpu/write-watch-preserve-partial-results`; GitHub denies them a pull request, they say there). It is merged as it is, with its author and its test. EduAzevedo's `3284f19` (one query for a whole allocation) is not included: its author says the frame is not faster with it and leaves it for whoever takes the sweep in. - **Authorship.** The commits are not rewritten. Any author who would rather open their fix as their own pull request can say so and it comes out of this one. - **Overlap with the other bundles.** These branches are built on `main`; #776, #915 and #918 touch the same files as some GPU bundles (#1418, #1426, #1439, #1542), so after one of them lands the other may need a rebase. ## Verification Windows 11, RX 6950 XT, Rust 1.98.1 (the pinned toolchain): | Check | Result | |---|---| | `cargo clippy --workspace --all-targets --locked -- -D warnings` | clean | | `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings` | clean | | `cargo test --workspace --locked` | 361 passed, 0 failed, 6 ignored (`main`: 342 passed, 6 ignored), two runs | The title was not run. No game data is used or committed. ## Re-verify in one go ```powershell git fetch https://github.com/MamaLeVrai/VIctory.git bundle/carried-forks-2 git checkout FETCH_HEAD cargo clippy --workspace --all-targets --locked -- -D warnings cargo clippy --workspace --all-targets --all-features --locked -- -D warnings cargo test --workspace --locked ``` AI-assisted (Claude Code); no game data. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
v_med3_f32 and v_med3_f16 return the least operand when one is NaN, which
`med3` chose with `fcmp uno`. NVIDIA's driver assumes no NaNs in that
compare and folds it to false, so the NaN case gave the plain median:
v_med3_f32_matches_rdna2_with_nan failed on an RTX 3050 Ti
(`v_med3_f32(1.0, 2.0, NaN) = 2`, want 1). An integer test of the bits
(|x| > +inf) cannot be folded that way.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Nested buffers in the world (several views into one 174 MB block) each
asked GetWriteWatch about largely the same pages, about 20 times a frame:
1,500-1,800 askings a frame, 120-180 ms of it on an RX 9070 XT.

While Host::execute prepares a submission, the title's writes it must
see are already made, so the preparing thread now asks the kernel only
about pages it has not asked about in that submission (watch::Sweep).
A step that writes title memory during the preparation
(Batch::title_written) clears what was asked, so later askings see it.
Askings from other threads, and outside a submission, are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
`victory compare <before> <after>` reads two `translate --list` outputs
and says what the second run gained and lost: each run's pipelines and
validations with the gains and losses, the programs that end differently
by their reason before and after, and every loss with both reasons. The
key is the file's name, offset, record and stage, so copies of the title
in other folders compare.

Testers measure a change against main this way, each with a script of
their own so far.
A wireless receiver answers for its pad while the pad is switched off: the
slot reads connected with an all-zero report. That counted as a pad, so the
keyboard's stand-in pad was never connected and keyboard input went nowhere
with no controller in hand.

Treat a slot as a pad only after it has reported something other than rest.
Once it has, it stays a pad at rest, so a played-with pad does not connect and
disconnect on every button release. The callback test seeds an all-zero pad
and waits for its connect callback; it presses a button now.
Heap handles were cached per block by the first property word only
(kind and UAV flag), not the second (component type and count). A size
query (f32 x4) and then an atomic (u32 x1) on the same image UAV in one
block shared the query's handle, so dxil-spirv declared a float image
and emitted OpAtomicUMax %float. NVIDIA's compiler faults on that
(0xc0000005 in vkCreate*Pipelines under vkd3d-proton). The key now holds
both words; structured buffers read with two strides get their own
handles too.

Offline check (translate --pipelines over shaders.rpf, NVIDIA RTX 5070 Ti,
vkd3d-proton master): 21,566 pipelines, no driver fault, every dumped
SPIR-V module passes spirv-val. In the title, the world loads without
the driver faults.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A slot that reported input, disconnected, and came back neutral kept the flag
set, so a receiver that re-paired without a pad took the keyboard stand-in away
again. Clear it when the host reports the slot disconnected, so it applies to
the current connection only.

Regression test and the case are from andrewpozdnakov7-jpg in #845.

Co-authored-by: andrewpozdnakov7-jpg <[email protected]>
Louisreed's observation in #845: the press that turns an idle slot into a pad
arrives in the same poll as its connect callback, so a title that only starts
reading after that callback could miss it. The reading stays current until the
pad reports something else, so the title sees the press on its next read.

Test: the press is still current after a second poll with no host change, and
the release produces a new reading. A press that starts and ends between two
reads is still lost, which no poll-level fix can avoid.
A change to a title texture's memory detiled every mip and slice again,
and the watched path read the whole memory back first. A streamed
texture filling page by page paid for all of it at every submission
that sampled it.

Layout::extents gives the tiled byte ranges each subresource is detiled
from. Watched memory now reads again only the pages written since the
last detiling; memory that is hashed instead is hashed per 64 KiB page.
Either way only the subresources overlapping a changed page are
detiled. The first detiling, and memory whose read copy is gone, still
take the whole texture, and every subresource is still copied into the
host texture.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copy-back read and wrote title memory one 64 KiB piece at a time. In the
world of a retail game that is ~650 WriteProcessMemory calls a frame, about
300 ms of an ~850 ms frame, though the bytes compared took ~30 ms: a call
costs hundreds of microseconds whatever its size.

Consecutive pieces the GPU changed are now read with one call, and the
consecutive ones the title lacked a GPU byte in are written with one call.
The merge rule per piece is unchanged (GPU bytes only where the copy moved
and the title does not have them; title bytes kept elsewhere), and a run
that cannot be read whole falls back to piece by piece, so unmapped pieces
are still skipped. Measured: copy-back ~350 ms -> ~130 ms a frame.
Merges the fork branches named in those issues onto main (ffe310e), each
with its commits and its author unchanged, no conflicts and no changes of
mine. cargo clippy --workspace --all-targets --locked -- -D warnings, with
and without --all-features, is clean and cargo test --workspace --locked
passes (360 passed, 6 ignored; main has 342 passed, 6 ignored).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The commit sits on top of c326bfa, which is already in this bundle; it is merged as it is, with
its author. It is the fix for the lost write that DrDarkDK and lucaseddd reproduced on c326bfa.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:38:16 +00:00
github-bot closed this pull request 2026-11-26 04:38:16 +00:00
Author
Owner

@⁠pfhandler on GitHub · 2026-11-24 20:54 UTC · original

Local patches for two issues hit while running GTA VI 1.0.2.1 through VIctory on Linux (GE-Proton 11-14, vkd3d-proton 3.2.0, RTX 4060 Ti 8 GB):

  • VICTORY_NO_HOST_PAD=1 — a connected host pad (e.g. DualShock appearing as XInput pad 0) keeps the keyboard stand-in pad from being enumerated. Hiding the host pad lets VICTORY_KEYS drive the title again.
  • VICTORY_MODE=1920x1080 — the DXGI output mode list is fixed at the console's 3840x2160. Reporting 1920x1080 instead keeps the title's render targets and VRAM use down on smaller hosts (Series S profile + 1080p settled around 3.5 GB VRAM here).

Both are local uncommitted diffs, posted here for reuse. Tested only on the configuration above.

diff --git a/crates/victory-gpu/src/dxgi.rs b/crates/victory-gpu/src/dxgi.rs
index c7f7c45..2535b68 100644
--- a/crates/victory-gpu/src/dxgi.rs
+++ b/crates/victory-gpu/src/dxgi.rs
@@ -219,6 +219,19 @@ struct Mode {
 }
 const _: () = assert!(size_of::<Mode>() == 32);
 
+/// The console's fixed output mode, overridable for hosts smaller than the
+/// console's 4K target: `VICTORY_MODE=1920x1080` reports that instead.
+fn mode_size() -> (u32, u32) {
+    const DEFAULT: (u32, u32) = (3840, 2160);
+    let Some(text) = std::env::var_os("VICTORY_MODE") else {
+        return DEFAULT;
+    };
+    let text = text.to_string_lossy();
+    text.split_once('x')
+        .and_then(|(w, h)| Some((w.trim().parse().ok()?, h.trim().parse().ok()?)))
+        .unwrap_or(DEFAULT)
+}
+
 /// The console's mode list: one 4K mode at 60 Hz (Grand Theft Auto VI looks
 /// for a 120 Hz one to allow 120 Hz frame intervals).
 /// shortcut: fixed mode, not the host display's; report the host's rates if
@@ -242,9 +255,10 @@ extern "system" fn modes(
         return MORE_DATA;
     }
     *count = 1;
+    let (width, height) = mode_size();
     let mode = Mode {
-        width: 3840,
-        height: 2160,
+        width,
+        height,
         refresh: [60, 1],
         format: 0,
         scanlines: 1, // progressive
diff --git a/crates/victory-hle/src/modules/gameinput.rs b/crates/victory-hle/src/modules/gameinput.rs
index a411bd0..da8d66c 100644
--- a/crates/victory-hle/src/modules/gameinput.rs
+++ b/crates/victory-hle/src/modules/gameinput.rs
@@ -1134,6 +1134,11 @@ mod host {
 
     impl Source for Host {
         fn pad(&mut self, slot: usize) -> Option<PadState> {
+            // The keyboard stand-in pad only exists while no host pad is
+            // connected; this hides a host pad the title mis-handles.
+            if std::env::var_os("VICTORY_NO_HOST_PAD").is_some() {
+                return None;
+            }
             if self.empty_until[slot].is_some_and(|until| Instant::now() < until) {
                 return None;
             }
**@⁠pfhandler** on GitHub · 2026-11-24 20:54 UTC · [original](https://github.com/Marvisak/VIctory/pull/1610#issuecomment-7144211515) Local patches for two issues hit while running GTA VI 1.0.2.1 through VIctory on Linux (GE-Proton 11-14, vkd3d-proton 3.2.0, RTX 4060 Ti 8 GB): - `VICTORY_NO_HOST_PAD=1` — a connected host pad (e.g. DualShock appearing as XInput pad 0) keeps the keyboard stand-in pad from being enumerated. Hiding the host pad lets `VICTORY_KEYS` drive the title again. - `VICTORY_MODE=1920x1080` — the DXGI output mode list is fixed at the console's 3840x2160. Reporting 1920x1080 instead keeps the title's render targets and VRAM use down on smaller hosts (Series S profile + 1080p settled around 3.5 GB VRAM here). Both are local uncommitted diffs, posted here for reuse. Tested only on the configuration above. ```diff diff --git a/crates/victory-gpu/src/dxgi.rs b/crates/victory-gpu/src/dxgi.rs index c7f7c45..2535b68 100644 --- a/crates/victory-gpu/src/dxgi.rs +++ b/crates/victory-gpu/src/dxgi.rs @@ -219,6 +219,19 @@ struct Mode { } const _: () = assert!(size_of::<Mode>() == 32); +/// The console's fixed output mode, overridable for hosts smaller than the +/// console's 4K target: `VICTORY_MODE=1920x1080` reports that instead. +fn mode_size() -> (u32, u32) { + const DEFAULT: (u32, u32) = (3840, 2160); + let Some(text) = std::env::var_os("VICTORY_MODE") else { + return DEFAULT; + }; + let text = text.to_string_lossy(); + text.split_once('x') + .and_then(|(w, h)| Some((w.trim().parse().ok()?, h.trim().parse().ok()?))) + .unwrap_or(DEFAULT) +} + /// The console's mode list: one 4K mode at 60 Hz (Grand Theft Auto VI looks /// for a 120 Hz one to allow 120 Hz frame intervals). /// shortcut: fixed mode, not the host display's; report the host's rates if @@ -242,9 +255,10 @@ extern "system" fn modes( return MORE_DATA; } *count = 1; + let (width, height) = mode_size(); let mode = Mode { - width: 3840, - height: 2160, + width, + height, refresh: [60, 1], format: 0, scanlines: 1, // progressive diff --git a/crates/victory-hle/src/modules/gameinput.rs b/crates/victory-hle/src/modules/gameinput.rs index a411bd0..da8d66c 100644 --- a/crates/victory-hle/src/modules/gameinput.rs +++ b/crates/victory-hle/src/modules/gameinput.rs @@ -1134,6 +1134,11 @@ mod host { impl Source for Host { fn pad(&mut self, slot: usize) -> Option<PadState> { + // The keyboard stand-in pad only exists while no host pad is + // connected; this hides a host pad the title mis-handles. + if std::env::var_os("VICTORY_NO_HOST_PAD").is_some() { + return None; + } if self.empty_until[slot].is_some_and(|until| Instant::now() < until) { return None; } ```
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 01:21 UTC · original

Automated triage for the maintainers. Closing because this pull request re-packages other open pull requests. Each of those is reviewed on its own, so a bundle cannot be merged.

If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

**@⁠Marvisak** on GitHub · 2026-11-25 01:21 UTC · [original](https://github.com/Marvisak/VIctory/pull/1610#issuecomment-7149467393) Automated triage for the maintainers. Closing because this pull request re-packages other open pull requests. Each of those is reviewed on its own, so a bundle cannot be merged. If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 01:32 UTC · original

Automated triage for the maintainers.

Needs rebase. This pull request conflicts with main (conflicting: README.md, crates/victory-gpu/src/host.rs, crates/victory-gpu/src/shadow.rs, crates/victory-gpu/src/texture.rs, crates/victory-gpu/src/watch.rs). It will be reviewed once it is rebased onto the current main.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 01:32 UTC · [original](https://github.com/Marvisak/VIctory/pull/1610#issuecomment-7149659395) <!-- victory-triage v1 head=47a43871e56265014e44a7a21ba0647a044b6b00 verdict=needs-rebase at=2026-11-25T01:32:13Z --> Automated triage for the maintainers. **Needs rebase.** This pull request conflicts with `main` (conflicting: `README.md`, `crates/victory-gpu/src/host.rs`, `crates/victory-gpu/src/shadow.rs`, `crates/victory-gpu/src/texture.rs`, `crates/victory-gpu/src/watch.rs`). It will be reviewed once it is rebased onto the current `main`. --- _Generated by [Claude Code](https://claude.ai/code)_

Pull request closed

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!1610
No description provided.