VICTORY_OCEAN_READBACK=0 cuts copy-back from 57 MB / 67 ms to 3 MB / 8 ms per frame on an RTX 3080 Ti #413

Open
opened 2026-11-26 17:57:54 +00:00 by github-bot · 2 comments
Owner

@⁠jean-melikian on GitHub · 2026-11-26 17:53 UTC · original

Machine: RTX 3080 Ti 12 GB (driver 32.0.16.2124), Ryzen 7 9800X3D, 64 GB RAM, Windows 11.
Build: victory.exe from main around cd5c44d, release.

Measured: two sessions of the same build in the open world, the second one with only this setting changed (the first one reached the world from the intro, the second from a save made there):

copy-back per frame
VICTORY_OCEAN_READBACK=1 (default) 57 MB, 67 ms
VICTORY_OCEAN_READBACK=0 3 MB, 8 ms

The frame is CPU-bound on this machine (GPU busy ~0 %), so the ~59 ms saved go straight to frame time.

Not checked: what the water looks like without the readback over a long session; I only drove a short distance and noticed nothing.

Idea: make 0 the default in the NVIDIA profile (or document the visual cost), since copy-back is one of the two biggest per-frame costs here.

Write-up done with AI assistance (Claude); measurements from my own runs.

**@⁠jean-melikian** on GitHub · 2026-11-26 17:53 UTC · [original](https://github.com/LooperSalty/AnyXboxX/issues/413) **Machine:** RTX 3080 Ti 12 GB (driver 32.0.16.2124), Ryzen 7 9800X3D, 64 GB RAM, Windows 11. **Build:** `victory.exe` from main around `cd5c44d`, release. **Measured:** two sessions of the same build in the open world, the second one with only this setting changed (the first one reached the world from the intro, the second from a save made there): | | copy-back per frame | |---|---| | `VICTORY_OCEAN_READBACK=1` (default) | 57 MB, 67 ms | | `VICTORY_OCEAN_READBACK=0` | 3 MB, 8 ms | The frame is CPU-bound on this machine (GPU busy ~0 %), so the ~59 ms saved go straight to frame time. **Not checked:** what the water looks like without the readback over a long session; I only drove a short distance and noticed nothing. **Idea:** make `0` the default in the NVIDIA profile (or document the visual cost), since copy-back is one of the two biggest per-frame costs here. *Write-up done with AI assistance (Claude); measurements from my own runs.*
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 17:57:54 +00:00
Author
Owner

@⁠jean-melikian on GitHub · 2026-11-26 22:49 UTC · original

Correction to my own suggestion above: please don't make 0 the default. VICTORY_OCEAN_READBACK=0 breaks boats.

With it set to 0, I reached chapter 1 (Jason on the boat). As soon as control was handed over, the boat sank and Jason was declared drowned. texback.rs says exactly this in its header: the boat physics reads the ocean height and displacement maps that the wave passes write, and "without the texels there the physics sees no water: boats sink". The "visual cost" I hadn't checked is in fact a gameplay blocker.

So the ~59 ms per frame stays the price of correct water. A cheaper way to keep it might be to copy back fewer texture kinds: the default VICTORY_TEXTURE_BACK also lists 64x64f16 and 128x128f36 next to the two 256x256 maps. I haven't measured whether boats still float with only the 256x256 maps; I'll report back if I do.

Write-up done with AI assistance (Claude); observation from my own session.

**@⁠jean-melikian** on GitHub · 2026-11-26 22:49 UTC · [original](https://github.com/LooperSalty/AnyXboxX/issues/413#issuecomment-7205017664) Correction to my own suggestion above: **please don't make `0` the default.** `VICTORY_OCEAN_READBACK=0` breaks boats. With it set to `0`, I reached chapter 1 (Jason on the boat). As soon as control was handed over, the boat sank and Jason was declared drowned. `texback.rs` says exactly this in its header: the boat physics reads the ocean height and displacement maps that the wave passes write, and "without the texels there the physics sees no water: boats sink". The "visual cost" I hadn't checked is in fact a gameplay blocker. So the ~59 ms per frame stays the price of correct water. A cheaper way to keep it might be to copy back fewer texture kinds: the default `VICTORY_TEXTURE_BACK` also lists `64x64f16` and `128x128f36` next to the two 256x256 maps. I haven't measured whether boats still float with only the 256x256 maps; I'll report back if I do. *Write-up done with AI assistance (Claude); observation from my own session.*
Author
Owner

@⁠akimfomin on GitHub · 2026-11-26 23:43 UTC · original

On the merged Vice-Tay base b6d86cf8226b718d1efd80da1131945840d6820d, the switch measured above is no longer read. I checked the exact tree: texback::kinds now uses VICTORY_TEXTURE_BACK. The current default includes the water maps. Your boat test is important evidence to keep them in the baseline. The replacement allocation-invalidation test passed locally on this exact head. It checks lifetime rather than game timing.

If you retest the boat scene on the new base, one baseline with the default format list and aggregate texture readback landed counts/bytes would tell the maintainers whether the old 57 MB load is still present. No reason to repeat the already-demonstrated readback-OFF boat failure. PortBridge · AI-assisted source and test report.

**@⁠akimfomin** on GitHub · 2026-11-26 23:43 UTC · [original](https://github.com/LooperSalty/AnyXboxX/issues/413#issuecomment-7205791034) On the merged Vice-Tay base `b6d86cf8226b718d1efd80da1131945840d6820d`, the switch measured above is no longer read. I checked the exact tree: [`texback::kinds`](https://github.com/LooperSalty/AnyXboxX/blob/b6d86cf8226b718d1efd80da1131945840d6820d/third_party/victory/crates/victory-gpu/src/texback.rs#L28-L53) now uses `VICTORY_TEXTURE_BACK`. The current default includes the water maps. Your boat test is important evidence to keep them in the baseline. The [replacement allocation-invalidation test](https://github.com/LooperSalty/AnyXboxX/blob/b6d86cf8226b718d1efd80da1131945840d6820d/third_party/victory/crates/victory-gpu/src/texback.rs#L253-L282) passed locally on this exact head. It checks lifetime rather than game timing. If you retest the boat scene on the new base, one baseline with the default format list and aggregate `texture readback landed` counts/bytes would tell the maintainers whether the old 57 MB load is still present. No reason to repeat the already-demonstrated readback-OFF boat failure. [PortBridge](https://github.com/akimfomin/PortBridge) · AI-assisted source and test report.
This discussion has been locked. Commenting is limited to contributors.
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/LooperSalty--AnyXboxX#413
No description provided.