Renderer port 1 takes effect: both halves ask one switch, unset on AMD cards only (RX 7900 XTX: 45 to 37 ms a frame) #3859

Open
duckey-dev wants to merge 4 commits from upstream-pr/3859 into main
duckey-dev commented 2026-11-30 09:32:00 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by duckey-dev on 2026-11-30T09:32:00Z.


Update, 30 Nov (rebased onto main e1251c3). Main moved under this PR after it was opened; where the text below differs, this note holds.

  • Main's ffe92c57 ("port constants off unless set") landed in between. For every card that is not AMD's this PR is now exactly that: off unless VICTORY_PORT_CONSTANTS is set, in both halves. AMD (PCI vendor 0x1002) with the switch unset is the one exception: on, in both halves.
  • The function is main's victory_gpu::port_constants_on() (edb22cfd), not a constants_port_on() of this PR's own.
  • Commit order: one answer; the F1 menu row; unset on for AMD only; xmem follows. No commit taken alone turns the port on for a non-AMD card.
  • A second AMD card: RustyTheDalek's run below on an RX 9070 XT (RDNA 4), switch unset, 34 minutes of play: the region in place, no device loss, nothing wrong in the picture. ColorC's RTX 5070 Ti numbers below (26.4 to 4.1 fps forced on) are the NVIDIA side.
  • Open question, asked below: which card ffe92c57's 3 fps run was on.

The problem

Renderer port 1 (VICTORY_PORT_CONSTANTS, crates/victory-gpu/src/port.rs) keeps the title's 185 MB 32-bit graphics heap, with its 174 MB constants buffer, in place on the card rather than as a host copy. It has two halves, and they read the switch on their own:

  • the GPU half (port::on) has been on with the switch unset since #1223, on every card but an RTX 30 one;
  • the xmem half (arrange in crates/victory-hle/src/modules/xmem.rs) was on only for VICTORY_PORT_CONSTANTS=1. It gives the heap's pages their section's slices in address order. The title maps the heap's five pieces in a different order from their addresses, so without arrange the buffer is three views of its section in a scattered order.

No launcher sets the switch. So in a default run the GPU half asked for a heap that was never laid out for it. It logged "not one stretch of a section: Scattered", left the heap a copy and placed nothing. The port did nothing in any default run, and only one warning line showed it.

The F1 menu row CONSTANTS HEAP IN PLACE had the same kind of fault. Its OFF stored an empty value, which is the same as unset, which is on. So OFF did not turn the port off.

What it changes

  1. One answer. port::on() decides once, from the switch and the host device's card, and logs what it decided: the value it was asked, the card and its vendor. victory_gpu::constants_port_on() passes that answer to other crates.
  2. xmem follows it. arrange runs when VICTORY_XMEM_ADDRESS_ORDER says so (1 always, 0 never). When that is unset it follows constants_port_on(). The switch is read once, at the title's first mapping into a 32-bit graphics reservation. When it is off, the mapping calls do not even look for a reservation, as before. arrange first checks with the page table only read. If every page is already in its place, or no slice is fresh, it returns without taking the write lock. DirectStorage's workers read that table on every request. A new test lays out the heap as the game maps it (two small placeholders, then pieces A, B and C, mapped B first and A last) at a sixteenth of its size. It checks that the views end up as one stretch of the section and that nothing moves once all of it is mapped.
  3. Unset is on for AMD cards only. With both halves asking one answer, an unset switch would have turned the port on for real on every card but an RTX 30. It was measured faster only on AMD, and slower on NVIDIA (see the overlap section). So the default is now on when the host device's card is AMD's (PCI vendor 0x1002) and off on every other card. On those cards nothing changes from what default runs did before, since nothing was placed there. 1 and 0 still force it on or off. The Ampere name list is removed: off is now the default for every card that is not AMD's.
  4. F1 menu. CONSTANTS HEAP IN PLACE has AUTO (unset: on for AMD cards), ON (1) and OFF (0). OFF now really turns the port off.

How it was tested

  • GPU and profile: RX 7900 XTX, Ryzen 7 7800X3D, Windows 11, Series X, no DLSS/FSR, no frame generation, ray tracing off, one fixed indoor scene with the camera still. The runs had VICTORY_PORT_CONSTANTS=1 set, which turned both halves on with the old code. That is what an unset switch now does on an AMD card.
Before: port not in effect (default) After: port in effect
regions in place 0 ("Scattered") 1, 185 MB
frame time 45 ms 36.7 and 37.6 ms (two runs)
card idle per frame about 10 ms 1.8 ms

There were no device losses, and the captured frames looked right. With the port on, the CPU still reads about 9,500 fills a frame out of the in-place memory. These numbers come from one machine and one scene with the camera still. They are not a measurement of play in motion or of other places in the world.

  • cargo test passed for the crates it touches: no failure that main does not have on this machine (victory-gpu's suite was run five times on main and on this branch; main's a_read_by_range_waits_only_for_a_remapping_that_meets_it fails here with or without this change). Both of CI's clippy runs add no warning over main.

Not tested

  • In the game on this exact branch. It is the measured commits on current main plus the AMD-only default (step 3), which is new here and was built and unit-tested but not run in the game. The default path, with the switch unset on an AMD card, should show "renderer port 1 ... on=true" and "1 regions ... in place" in the log.
  • NVIDIA: not run. With this change the default there is off, as default runs were before. VICTORY_PORT_CONSTANTS=1 now turns both halves on, where before it was the only way to do so.
  • Intel: not run. The default there is off.
  • Other AMD generations: only RDNA 3 (RX 7900 XTX) was measured. RDNA 2 and RDNA 4 get the default too.
  • Linux/Wine: not run (see #2455).

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches.

  • #2923 (open): "keep VICTORY_PORT_CONSTANTS off by default across GPU generations". It makes the GPU half off when unset on every card, so the two halves agree by both being off. It measured the port slower on an RTX 5080 Laptop GPU (136 to 178 ms of card time a frame against 18 to 27 with the host copy). It overlaps this PR's step 3 in port.rs (resolve_port_mode, the Ampere list, its test). Assessment: for NVIDIA its data is the better guide, and this PR follows it: off by default on every card that is not AMD's. But #2923 leaves both halves reading the switch on their own. That keeps the trap this PR removes, where a change to one default silently breaks the port. It also turns the port off on AMD, where it was measured faster. The two cannot merge as they are. If #2923 lands first, this PR's step 3 only needs to add the AMD case back.

  • #3399 (closed by its author, unmerged): "on in both halves by default". It made xmem ask the GPU half (victory_gpu::title_graphics_heap_in_place), which is the same idea as this PR's steps 1 and 2. It also added a scatter description to the "Scattered" refusal line, which this PR does not have and which is worth bringing over. Its author closed it after a controlled comparison on an RTX 4070 Ti SUPER (DLSS performance, frame generation 2x): about 61 ms a frame with the port really on against about 42 ms with it off. That result is the reason this PR does not turn the port on by default on NVIDIA. This PR also differs from #3399 in a few ways: xmem's half can be switched on its own (VICTORY_XMEM_ADDRESS_ORDER), it is not even asked for mappings outside a 32-bit graphics reservation, arrange checks read-only before taking the lock, there is a test of the game's mapping order, and the menu's OFF is fixed.

  • #2455 (open): under Wine, VICTORY_WINE_MAP and VICTORY_PORT_HOME. It builds on the xmem half (home_on() calls xmem's port_on(), which this PR replaces with address_order()). Whichever merges second has to change one line. Otherwise it does not overlap; it does the Wine side, which this PR does not touch.

  • #3650 (open, large): reworks port.rs (constants(), sections(), a new per-frame log line). It keeps both halves reading the switch on their own, so it still has the mismatch this PR fixes. The changes conflict as text in port.rs and do not do the same thing.

  • #3617, #1977 (open): localize the F1 menu's labels, including this row. The conflict is one line on the CONSTANTS HEAP IN PLACE item.

  • #3138 (open, ours): world start and DirectStorage. It touches xmem.rs (places_of) in a different place and shares no commits with this PR.

🤖 Generated with Claude Code

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5562604274 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3859). Originally posted by [duckey-dev](https://github.com/duckey-dev) on 2026-11-30T09:32:00Z. --- > **Update, 30 Nov (rebased onto main e1251c3).** Main moved under this PR after it was opened; where the text below differs, this note holds. > - **Main's ffe92c57 ("port constants off unless set")** landed in between. For every card that is not AMD's this PR is now exactly that: off unless `VICTORY_PORT_CONSTANTS` is set, in both halves. AMD (PCI vendor 0x1002) with the switch unset is the one exception: on, in both halves. > - **The function is main's `victory_gpu::port_constants_on()`** (edb22cfd), not a `constants_port_on()` of this PR's own. > - **Commit order:** one answer; the F1 menu row; unset on for AMD only; xmem follows. No commit taken alone turns the port on for a non-AMD card. > - **A second AMD card:** RustyTheDalek's run below on an RX 9070 XT (RDNA 4), switch unset, 34 minutes of play: the region in place, no device loss, nothing wrong in the picture. ColorC's RTX 5070 Ti numbers below (26.4 to 4.1 fps forced on) are the NVIDIA side. > - **Open question, asked below:** which card ffe92c57's 3 fps run was on. ## The problem Renderer port 1 (`VICTORY_PORT_CONSTANTS`, `crates/victory-gpu/src/port.rs`) keeps the title's 185 MB 32-bit graphics heap, with its 174 MB constants buffer, in place on the card rather than as a host copy. It has two halves, and they read the switch on their own: - the GPU half (`port::on`) has been on with the switch unset since #1223, on every card but an RTX 30 one; - the xmem half (`arrange` in `crates/victory-hle/src/modules/xmem.rs`) was on only for `VICTORY_PORT_CONSTANTS=1`. It gives the heap's pages their section's slices in address order. The title maps the heap's five pieces in a different order from their addresses, so without `arrange` the buffer is three views of its section in a scattered order. No launcher sets the switch. So in a default run the GPU half asked for a heap that was never laid out for it. It logged "not one stretch of a section: Scattered", left the heap a copy and placed nothing. The port did nothing in any default run, and only one warning line showed it. The F1 menu row CONSTANTS HEAP IN PLACE had the same kind of fault. Its OFF stored an empty value, which is the same as unset, which is on. So OFF did not turn the port off. ## What it changes 1. **One answer.** `port::on()` decides once, from the switch and the host device's card, and logs what it decided: the value it was asked, the card and its vendor. `victory_gpu::constants_port_on()` passes that answer to other crates. 2. **xmem follows it.** `arrange` runs when `VICTORY_XMEM_ADDRESS_ORDER` says so (`1` always, `0` never). When that is unset it follows `constants_port_on()`. The switch is read once, at the title's first mapping into a 32-bit graphics reservation. When it is off, the mapping calls do not even look for a reservation, as before. `arrange` first checks with the page table only read. If every page is already in its place, or no slice is fresh, it returns without taking the write lock. DirectStorage's workers read that table on every request. A new test lays out the heap as the game maps it (two small placeholders, then pieces A, B and C, mapped B first and A last) at a sixteenth of its size. It checks that the views end up as one stretch of the section and that nothing moves once all of it is mapped. 3. **Unset is on for AMD cards only.** With both halves asking one answer, an unset switch would have turned the port on for real on every card but an RTX 30. It was measured faster only on AMD, and slower on NVIDIA (see the overlap section). So the default is now on when the host device's card is AMD's (PCI vendor 0x1002) and off on every other card. On those cards nothing changes from what default runs did before, since nothing was placed there. `1` and `0` still force it on or off. The Ampere name list is removed: off is now the default for every card that is not AMD's. 4. **F1 menu.** CONSTANTS HEAP IN PLACE has AUTO (unset: on for AMD cards), ON (`1`) and OFF (`0`). OFF now really turns the port off. ## How it was tested - GPU and profile: RX 7900 XTX, Ryzen 7 7800X3D, Windows 11, Series X, no DLSS/FSR, no frame generation, ray tracing off, one fixed indoor scene with the camera still. The runs had `VICTORY_PORT_CONSTANTS=1` set, which turned both halves on with the old code. That is what an unset switch now does on an AMD card. | | Before: port not in effect (default) | After: port in effect | |---|---|---| | regions in place | 0 ("Scattered") | 1, 185 MB | | frame time | 45 ms | 36.7 and 37.6 ms (two runs) | | card idle per frame | about 10 ms | 1.8 ms | There were no device losses, and the captured frames looked right. With the port on, the CPU still reads about 9,500 fills a frame out of the in-place memory. These numbers come from one machine and one scene with the camera still. They are not a measurement of play in motion or of other places in the world. - `cargo test` passed for the crates it touches: no failure that main does not have on this machine (victory-gpu's suite was run five times on main and on this branch; main's `a_read_by_range_waits_only_for_a_remapping_that_meets_it` fails here with or without this change). Both of CI's clippy runs add no warning over main. ## Not tested - **In the game on this exact branch.** It is the measured commits on current main plus the AMD-only default (step 3), which is new here and was built and unit-tested but not run in the game. The default path, with the switch unset on an AMD card, should show "renderer port 1 ... on=true" and "1 regions ... in place" in the log. - **NVIDIA**: not run. With this change the default there is off, as default runs were before. `VICTORY_PORT_CONSTANTS=1` now turns both halves on, where before it was the only way to do so. - **Intel**: not run. The default there is off. - Other AMD generations: only RDNA 3 (RX 7900 XTX) was measured. RDNA 2 and RDNA 4 get the default too. - Linux/Wine: not run (see #2455). ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. - **#2923** (open): "keep VICTORY_PORT_CONSTANTS off by default across GPU generations". It makes the GPU half off when unset on every card, so the two halves agree by both being off. It measured the port slower on an RTX 5080 Laptop GPU (136 to 178 ms of card time a frame against 18 to 27 with the host copy). It overlaps this PR's step 3 in `port.rs` (`resolve_port_mode`, the Ampere list, its test). Assessment: for NVIDIA its data is the better guide, and this PR follows it: off by default on every card that is not AMD's. But #2923 leaves both halves reading the switch on their own. That keeps the trap this PR removes, where a change to one default silently breaks the port. It also turns the port off on AMD, where it was measured faster. The two cannot merge as they are. If #2923 lands first, this PR's step 3 only needs to add the AMD case back. - **#3399** (closed by its author, unmerged): "on in both halves by default". It made xmem ask the GPU half (`victory_gpu::title_graphics_heap_in_place`), which is the same idea as this PR's steps 1 and 2. It also added a `scatter` description to the "Scattered" refusal line, which this PR does not have and which is worth bringing over. Its author closed it after a controlled comparison on an RTX 4070 Ti SUPER (DLSS performance, frame generation 2x): about 61 ms a frame with the port really on against about 42 ms with it off. That result is the reason this PR does not turn the port on by default on NVIDIA. This PR also differs from #3399 in a few ways: xmem's half can be switched on its own (`VICTORY_XMEM_ADDRESS_ORDER`), it is not even asked for mappings outside a 32-bit graphics reservation, `arrange` checks read-only before taking the lock, there is a test of the game's mapping order, and the menu's OFF is fixed. - **#2455** (open): under Wine, `VICTORY_WINE_MAP` and `VICTORY_PORT_HOME`. It builds on the xmem half (`home_on()` calls xmem's `port_on()`, which this PR replaces with `address_order()`). Whichever merges second has to change one line. Otherwise it does not overlap; it does the Wine side, which this PR does not touch. - **#3650** (open, large): reworks `port.rs` (`constants()`, `sections()`, a new per-frame log line). It keeps both halves reading the switch on their own, so it still has the mismatch this PR fixes. The changes conflict as text in `port.rs` and do not do the same thing. - **#3617**, **#1977** (open): localize the F1 menu's labels, including this row. The conflict is one line on the CONSTANTS HEAP IN PLACE item. - **#3138** (open, ours): world start and DirectStorage. It touches `xmem.rs` (`places_of`) in a different place and shares no commits with this PR. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
ColorC commented 2026-11-30 10:16:04 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by ColorC on 2026-11-30T10:16:04Z.


AI Testing & Posting Disclosure: This cross-validation benchmark was executed, analyzed, and posted by an automated AI agent on local desktop hardware. No game screenshots or title assets are included.

Independent Desktop Blackwell Cross-Validation (RTX 5070 Ti 16 GB + Ryzen 7 9800X3D)

Tested VICTORY_PORT_CONSTANTS=1 vs default off on the same standing ~10k-draw Series X 1440p DLSS Quality + 3× MFG + VICTORY_HW_RT=1 scene (Windows 11 26200, NVIDIA Blackwell driver 621.1.0, PCIe 5.0 x16, ReBAR ON):

Metric Default (PORT_CONSTANTS=0) Forced VICTORY_PORT_CONSTANTS=1 Delta
10k-draw Avg FPS 26.38 fps 4.10 fps -84.5%
Card meter (title lists) ~30.8 ms 224.8 ms +194 ms (7.3× slower on GPU)
Card meter (sync / compare lists) 1.6 ms / 0.2 ms �.8 ms / 0.1 ms -0.9 ms
Submitting thread
efreshes 8.9 ms 4.3 ms -4.6 ms CPU
Submitting thread lists' steps 15.9 ms 9.9 ms -6.0 ms CPU
Submitting thread card copies 2.2 ms �.5 ms -1.7 ms CPU

Takeaway confirming #3859's vendor-gated default:

  1. Confirms the exact same Blackwell behavior noted in port.rs (desktop RTX 5070 Ti hits 224.8 ms GPU time when placing the 185 MB heap in system RAM via OpenExistingHeapFromAddress1), validating that defaulting VICTORY_PORT_CONSTANTS off on NVIDIA / on for AMD only is essential.
  2. Also highlights a useful future architectural clue for NVIDIA + ReBAR GPUs: taking that 185 MB heap off shadow-refresh saved -4.6 ms CPU refreshes / -6.0 ms lists' steps / -1.7 ms card copies — so a future VRAM-backed (D3D12_HEAP_TYPE_GPU_UPLOAD / ReBAR) path could potentially capture that ~6–8 ms CPU win without paying the PCIe GPU read penalty.
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7275358569 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3859#issuecomment-7275358569). Originally posted by [ColorC](https://github.com/ColorC) on 2026-11-30T10:16:04Z. --- > **AI Testing & Posting Disclosure**: This cross-validation benchmark was executed, analyzed, and posted by an automated AI agent on local desktop hardware. No game screenshots or title assets are included. ### Independent Desktop Blackwell Cross-Validation (RTX 5070 Ti 16 GB + Ryzen 7 9800X3D) Tested VICTORY_PORT_CONSTANTS=1 vs default off on the same standing ~10k-draw Series X 1440p DLSS Quality + 3× MFG + VICTORY_HW_RT=1 scene (Windows 11 26200, NVIDIA Blackwell driver 621.1.0, PCIe 5.0 x16, ReBAR ON): | Metric | Default (PORT_CONSTANTS=0) | Forced VICTORY_PORT_CONSTANTS=1 | Delta | |---|---:|---:|---:| | 10k-draw Avg FPS | 26.38 fps | 4.10 fps | **-84.5%** | | Card meter (title lists) | ~30.8 ms | **224.8 ms** | **+194 ms (7.3× slower on GPU)** | | Card meter (sync / compare lists) | 1.6 ms / 0.2 ms | �.8 ms / 0.1 ms | -0.9 ms | | Submitting thread efreshes | 8.9 ms | **4.3 ms** | **-4.6 ms CPU** | | Submitting thread lists' steps | 15.9 ms | **9.9 ms** | **-6.0 ms CPU** | | Submitting thread card copies | 2.2 ms | **�.5 ms** | **-1.7 ms CPU** | **Takeaway confirming #3859's vendor-gated default**: 1. Confirms the exact same Blackwell behavior noted in port.rs (desktop RTX 5070 Ti hits 224.8 ms GPU time when placing the 185 MB heap in system RAM via OpenExistingHeapFromAddress1), validating that defaulting VICTORY_PORT_CONSTANTS **off on NVIDIA / on for AMD only** is essential. 2. Also highlights a useful future architectural clue for NVIDIA + ReBAR GPUs: taking that 185 MB heap off shadow-refresh saved **-4.6 ms CPU refreshes / -6.0 ms lists' steps / -1.7 ms card copies** — so a future VRAM-backed (D3D12_HEAP_TYPE_GPU_UPLOAD / ReBAR) path could potentially capture that ~6–8 ms CPU win without paying the PCIe GPU read penalty.
RustyTheDalek commented 2026-11-30 17:29:26 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by RustyTheDalek on 2026-11-30T17:29:26Z.


Tested in the game on RDNA 4, with the switch unset: Radeon RX 9070 XT 16 GB (Smart Access Memory on), Ryzen 9 5900X, 32 GB RAM, Windows 11, Series S, PC FidelityFX upscaling (FSR 4), no frame generation, ray tracing off. Built from main c71899d9 with this branch's changes applied, plus #3717 (which changes nothing on this card: the light loops translate as native 64-lane programs here) and my own #4189, #4190 and #4191, none of which touches these paths. 34 minutes of play after the prologue: driving in the city, missions, interiors.

  • The default path takes effect on this card:
    renderer port 1 (VICTORY_PORT_CONSTANTS): the title's 32-bit graphics heap in place on=true asked="(unset: on on AMD cards)" adapter="AMD Radeon RX 9070 XT" vendor=0x1002
    the 32-bit graphics heap's pages given their section's slices in address order (VICTORY_XMEM_ADDRESS_ORDER) on=true asked="(unset: as renderer port 1)"
    renderer port 1: the title's 32-bit graphics pages given their section's slices in address order at=0x2610000 pages=752 moved=752 all=752 not_fresh=0
    
    and at the end 1 regions of the title's graphics memory in place (185 MB) ... per frame on the CPU: 281 fills read out of them (113.8 KB). In earlier runs on 41adb551 the same card logged 0 regions ... in place.
  • No device loss, nothing in the picture I could put down to it.
  • Gameplay frame lines (those with more than 1,000 draws): median 22.4 fps, 10th percentile 16.9, the submitting thread preparing 33.3 ms a frame on average. Two earlier runs on 41adb551 without it: 19.4 / 9.6 fps and 39.2 ms, and 17.7 / 11.7 fps and 40.5 ms. Main moved by about 490 commits between those builds, so not all of that is this change, but nothing went the wrong way.
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7286384613 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3859#issuecomment-7286384613). Originally posted by [RustyTheDalek](https://github.com/RustyTheDalek) on 2026-11-30T17:29:26Z. --- Tested in the game on RDNA 4, with the switch unset: Radeon RX 9070 XT 16 GB (Smart Access Memory on), Ryzen 9 5900X, 32 GB RAM, Windows 11, Series S, PC FidelityFX upscaling (FSR 4), no frame generation, ray tracing off. Built from main c71899d9 with this branch's changes applied, plus #3717 (which changes nothing on this card: the light loops translate as native 64-lane programs here) and my own #4189, #4190 and #4191, none of which touches these paths. 34 minutes of play after the prologue: driving in the city, missions, interiors. - The default path takes effect on this card: ``` renderer port 1 (VICTORY_PORT_CONSTANTS): the title's 32-bit graphics heap in place on=true asked="(unset: on on AMD cards)" adapter="AMD Radeon RX 9070 XT" vendor=0x1002 the 32-bit graphics heap's pages given their section's slices in address order (VICTORY_XMEM_ADDRESS_ORDER) on=true asked="(unset: as renderer port 1)" renderer port 1: the title's 32-bit graphics pages given their section's slices in address order at=0x2610000 pages=752 moved=752 all=752 not_fresh=0 ``` and at the end `1 regions of the title's graphics memory in place (185 MB) ... per frame on the CPU: 281 fills read out of them (113.8 KB)`. In earlier runs on 41adb551 the same card logged `0 regions ... in place`. - No device loss, nothing in the picture I could put down to it. - Gameplay frame lines (those with more than 1,000 draws): median 22.4 fps, 10th percentile 16.9, the submitting thread preparing 33.3 ms a frame on average. Two earlier runs on 41adb551 without it: 19.4 / 9.6 fps and 39.2 ms, and 17.7 / 11.7 fps and 40.5 ms. Main moved by about 490 commits between those builds, so not all of that is this change, but nothing went the wrong way.
duckey-dev commented 2026-11-30 18:35:53 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by duckey-dev on 2026-11-30T18:35:53Z.


@RustyTheDalek Thank you, that is the test this PR was missing: a second AMD card, another generation (RDNA 4 where mine is RDNA 3), the switch unset, and real play where I had one still scene. The three lines you quote are the path working as meant (asked unset, on for the AMD card, the pages given in address order, one region of 185 MB in place), and 281 fills read out of the region per frame is far fewer than I see on the 7900 XTX, so the CPU's reads of it cost you less.

@ColorC's numbers on the RTX 5070 Ti above (26.4 to 4.1 fps with it forced on) and the maintainer's ffe92c57 on main since (off unless set, 3 fps read over the bus) are the other half of the same picture: the port is a loss on NVIDIA and a gain on the two AMD cards measured. That is the default this PR proposes, on for AMD when unset and off for every other card, so main's off-unless-set stays exactly as it is for non-AMD cards.

ffe92c57 makes this branch conflict in xmem.rs; I'm rebasing it onto current main now and will say here when it is pushed.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7288085495 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3859#issuecomment-7288085495). Originally posted by [duckey-dev](https://github.com/duckey-dev) on 2026-11-30T18:35:53Z. --- @RustyTheDalek Thank you, that is the test this PR was missing: a second AMD card, another generation (RDNA 4 where mine is RDNA 3), the switch unset, and real play where I had one still scene. The three lines you quote are the path working as meant (asked unset, on for the AMD card, the pages given in address order, one region of 185 MB in place), and 281 fills read out of the region per frame is far fewer than I see on the 7900 XTX, so the CPU's reads of it cost you less. @ColorC's numbers on the RTX 5070 Ti above (26.4 to 4.1 fps with it forced on) and the maintainer's ffe92c57 on main since (off unless set, 3 fps read over the bus) are the other half of the same picture: the port is a loss on NVIDIA and a gain on the two AMD cards measured. That is the default this PR proposes, on for AMD when unset and off for every other card, so main's off-unless-set stays exactly as it is for non-AMD cards. ffe92c57 makes this branch conflict in `xmem.rs`; I'm rebasing it onto current main now and will say here when it is pushed.
duckey-dev commented 2026-11-30 19:10:38 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by duckey-dev on 2026-11-30T19:10:38Z.


Rebased onto current main (e1251c31) and pushed; no conflicts now. Both of CI's clippy runs add no warning over main here, and cargo test --workspace has no failure that main does not have on this machine.

How it sits on main's ffe92c57 ("port constants off unless set"), which landed after this PR was opened:

  • Every card that is not AMD's: exactly ffe92c57. Off unless VICTORY_PORT_CONSTANTS is set, and now in both halves (on main the GPU half still read "on unless RTX 30" by itself). The commits are reordered so that none of them, taken alone, turns the port on for a non-AMD card.
  • AMD (PCI vendor 0x1002) with the switch unset: on, in both halves. This is the one place the PR differs from ffe92c57. The evidence for it is the two AMD runs in this thread: the RX 7900 XTX in the description (45 to 37 ms a frame) and @RustyTheDalek's RX 9070 XT (34 minutes of play, the region in place, nothing wrong).
  • 1 and 0 decide as before; VICTORY_XMEM_ADDRESS_ORDER still overrides xmem's half alone.
  • It uses main's victory_gpu::port_constants_on() (edb22cfd) where it had a function of its own, and keeps main's port log lines.

@trustno1-coder one question the commit message of ffe92c57 leaves open: which card was the 3 fps run on? If it was an NVIDIA card, it agrees with @ColorC's RTX 5070 Ti numbers above and with this PR's default. If it was an AMD card, it contradicts the default proposed here and I would rather know before this goes further.

The description above still names the old function and the old commit order; I'll correct it.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7288963192 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3859#issuecomment-7288963192). Originally posted by [duckey-dev](https://github.com/duckey-dev) on 2026-11-30T19:10:38Z. --- Rebased onto current main (e1251c31) and pushed; no conflicts now. Both of CI's clippy runs add no warning over main here, and `cargo test --workspace` has no failure that main does not have on this machine. How it sits on main's ffe92c57 ("port constants off unless set"), which landed after this PR was opened: - **Every card that is not AMD's: exactly ffe92c57.** Off unless `VICTORY_PORT_CONSTANTS` is set, and now in both halves (on main the GPU half still read "on unless RTX 30" by itself). The commits are reordered so that none of them, taken alone, turns the port on for a non-AMD card. - **AMD (PCI vendor 0x1002) with the switch unset: on, in both halves.** This is the one place the PR differs from ffe92c57. The evidence for it is the two AMD runs in this thread: the RX 7900 XTX in the description (45 to 37 ms a frame) and @RustyTheDalek's RX 9070 XT (34 minutes of play, the region in place, nothing wrong). - `1` and `0` decide as before; `VICTORY_XMEM_ADDRESS_ORDER` still overrides xmem's half alone. - It uses main's `victory_gpu::port_constants_on()` (edb22cfd) where it had a function of its own, and keeps main's port log lines. @trustno1-coder one question the commit message of ffe92c57 leaves open: which card was the 3 fps run on? If it was an NVIDIA card, it agrees with @ColorC's RTX 5070 Ti numbers above and with this PR's default. If it was an AMD card, it contradicts the default proposed here and I would rather know before this goes further. The description above still names the old function and the old commit order; I'll correct it.
saltdam36 commented 2026-11-30 20:43:47 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by saltdam36 on 2026-11-30T20:43:47Z.


A third AMD card: RX 7800 XT 16 GB (RDNA 3), Ryzen 7 7800X3D, 32 GB, Series S, AMD FSR upscaler 720p→1080p, no frame generation. Main at e1251c31 with #1236, #2764, #3681 and this PR at 964bfd72. Before it, every start logged "not one native-import-eligible stretch of a section: Scattered" and placed nothing; with it, "1 regions of the title's graphics memory in place (185 MB)".

Switch unset against VICTORY_PORT_CONSTANTS=0, alternating launches from the same open-world save, standing still, 120 s each, medians of the log's per-second lines:

frame submitting thread refreshes card busy
unset (on), launch 1 33.4 ms 27.4 ms 8.3 ms 97 %
=0, launch 2 38.4 ms 33.7 ms 12.8 ms 87 %
unset (on), launch 3 34.4 ms 28.4 ms 8.8 ms 94 %
=0, launch 4 38.2 ms 33.0 ms 12.6 ms 85 %

About 12 % less frame time (26 → 30–31 fps), and with the port on the card becomes the limit in this scene. No device loss and nothing wrong in the picture, but these are five-minute runs at one spot; I have not played a long session on it yet.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7291383886 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3859#issuecomment-7291383886). Originally posted by [saltdam36](https://github.com/saltdam36) on 2026-11-30T20:43:47Z. --- A third AMD card: RX 7800 XT 16 GB (RDNA 3), Ryzen 7 7800X3D, 32 GB, Series S, AMD FSR upscaler 720p→1080p, no frame generation. Main at e1251c31 with #1236, #2764, #3681 and this PR at 964bfd72. Before it, every start logged "not one native-import-eligible stretch of a section: Scattered" and placed nothing; with it, "1 regions of the title's graphics memory in place (185 MB)". Switch unset against `VICTORY_PORT_CONSTANTS=0`, alternating launches from the same open-world save, standing still, 120 s each, medians of the log's per-second lines: | | frame | submitting thread | refreshes | card busy | |---|---|---|---|---| | unset (on), launch 1 | 33.4 ms | 27.4 ms | 8.3 ms | 97 % | | `=0`, launch 2 | 38.4 ms | 33.7 ms | 12.8 ms | 87 % | | unset (on), launch 3 | 34.4 ms | 28.4 ms | 8.8 ms | 94 % | | `=0`, launch 4 | 38.2 ms | 33.0 ms | 12.6 ms | 85 % | About 12 % less frame time (26 → 30–31 fps), and with the port on the card becomes the limit in this scene. No device loss and nothing wrong in the picture, but these are five-minute runs at one spot; I have not played a long session on it yet.
duckey-dev commented 2026-11-30 21:17:05 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by duckey-dev on 2026-11-30T21:17:05Z.


@saltdam36 Thank you. Alternating launches from one save is the cleanest comparison in this thread. That makes three AMD cards (RX 7900 XTX, RX 9070 XT, RX 7800 XT) where the port is a gain with the switch unset, and "the card becomes the limit" is what I see here too. A longer session on it would still be welcome.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7292181145 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3859#issuecomment-7292181145). Originally posted by [duckey-dev](https://github.com/duckey-dev) on 2026-11-30T21:17:05Z. --- @saltdam36 Thank you. Alternating launches from one save is the cleanest comparison in this thread. That makes three AMD cards (RX 7900 XTX, RX 9070 XT, RX 7800 XT) where the port is a gain with the switch unset, and "the card becomes the limit" is what I see here too. A longer session on it would still be welcome.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/3859:upstream-pr/3859'
git switch 'upstream-pr/3859'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/3859'
git switch 'upstream-pr/3859'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3859'
git switch 'upstream-pr/3859'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3859'
git switch 'main'
git merge --squash 'upstream-pr/3859'
git switch 'main'
git merge --ff-only 'upstream-pr/3859'
git switch 'main'
git merge 'upstream-pr/3859'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
trustno1-coder/VIctory-NVIDIA!3859
No description provided.