GPU: fills of upload memory wait for flights by default (the café's blurred oval, #1025) #1205

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

@⁠tippythetaidum on GitHub · 2026-11-26 00:01 UTC · original
tippythetaidum:gpu/fills-wait-by-default → main · +41 −12 · 2 files · 1 commits · open

Fixes the blurred oval of #1025.

What

Fills of upload memory and read-only buffer copies that read title memory a flight may write now wait for that flight again by default. VICTORY_FILL_WAIT=0 turns reading ahead back on. Until now, reading ahead was the default and VICTORY_FILL_WAIT=1 turned it off.

The whole change is the default in fill_ahead::on, a small parser for the switch with a unit test, and the doc comment, log line and README entry that name the switch.

Why

Reading ahead is built to let the first stale fill through and only then wait. That one submission is visible:

  • Where: in the opening café flashback, every run reads a fixed 2 KiB block ahead of the flight that changes it, as the scene begins. Shaders write the block and later draws read it as constants. The address was 0xdc07ea300 in six runs and the next 2 KiB in a seventh, and each run logs the "a fill of upload memory read 2048 bytes ... ahead of a flight whose shaders changed them" warning.
  • What it does: a blurred oval then stays over the middle of the picture until the next scene. That's d0dev's report in #1025 and ours.
RTX 5080, release builds, same save Oval
default (reading ahead), 7 runs 6
VICTORY_FILL_WAIT=1, 2 runs, same exe as the last oval run 0
VICTORY_FILL_WAIT=1, 1 run, mesh f5e50eb2108c425b drawn again 0

On the console the card reads those bytes only after the work before them, so waiting is its behaviour.

What it costs: about one frame per second here (a median of 4.7 against 5.7 fps). The two medians come from different stretches of the runs, so it's a rough figure. Anyone who prefers speed can set VICTORY_FILL_WAIT=0.

Tested

  • cargo test -p victory-gpu --lib fill_ahead: the new fills_wait_unless_the_switch_is_zero passes.
  • cargo clippy -p victory-gpu --all-targets: nothing new. The ten warnings it shows are the ones main already has (placed_filler_twins, depth_written, is_multiple_of and others).
  • The in-game runs above used VICTORY_FILL_WAIT=1 on a build of main d827419 plus open pull requests. This branch is on today's main dc4c0fc and changes only the default, so with the switch unset it behaves as those =1 runs did.

#860 holds back only the 64 KiB pieces a miss touched, and its hold starts after the miss, so the first one would still get through. With fills waiting by default, #860's narrower holds matter only with VICTORY_FILL_WAIT=0.

🤖 Generated with Claude Code

**@⁠tippythetaidum** on GitHub · 2026-11-26 00:01 UTC · [original](https://github.com/fxceless/victory-fork/pull/1205) `tippythetaidum:gpu/fills-wait-by-default` → `main` · +41 −12 · 2 files · 1 commits · open Fixes the blurred oval of #1025. ## What Fills of upload memory and read-only buffer copies that read title memory a flight may write now wait for that flight again by default. `VICTORY_FILL_WAIT=0` turns reading ahead back on. Until now, reading ahead was the default and `VICTORY_FILL_WAIT=1` turned it off. The whole change is the default in `fill_ahead::on`, a small parser for the switch with a unit test, and the doc comment, log line and README entry that name the switch. ## Why Reading ahead is built to let the first stale fill through and only then wait. That one submission is visible: - **Where:** in the opening café flashback, every run reads a fixed 2 KiB block ahead of the flight that changes it, as the scene begins. Shaders write the block and later draws read it as constants. The address was `0xdc07ea300` in six runs and the next 2 KiB in a seventh, and each run logs the "a fill of upload memory read 2048 bytes ... ahead of a flight whose shaders changed them" warning. - **What it does:** a blurred oval then stays over the middle of the picture until the next scene. That's d0dev's report in #1025 and ours. | RTX 5080, release builds, same save | Oval | |---|---| | default (reading ahead), 7 runs | 6 | | `VICTORY_FILL_WAIT=1`, 2 runs, same exe as the last oval run | 0 | | `VICTORY_FILL_WAIT=1`, 1 run, mesh `f5e50eb2108c425b` drawn again | 0 | On the console the card reads those bytes only after the work before them, so waiting is its behaviour. **What it costs:** about one frame per second here (a median of 4.7 against 5.7 fps). The two medians come from different stretches of the runs, so it's a rough figure. Anyone who prefers speed can set `VICTORY_FILL_WAIT=0`. ## Tested - `cargo test -p victory-gpu --lib fill_ahead`: the new `fills_wait_unless_the_switch_is_zero` passes. - `cargo clippy -p victory-gpu --all-targets`: nothing new. The ten warnings it shows are the ones `main` already has (`placed_filler_twins`, `depth_written`, `is_multiple_of` and others). - The in-game runs above used `VICTORY_FILL_WAIT=1` on a build of `main` `d827419` plus open pull requests. This branch is on today's `main` `dc4c0fc` and changes only the default, so with the switch unset it behaves as those `=1` runs did. ## Related #860 holds back only the 64 KiB pieces a miss touched, and its hold starts after the miss, so the first one would still get through. With fills waiting by default, #860's narrower holds matter only with `VICTORY_FILL_WAIT=0`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Fills (and read-only buffer copies) that read title memory flights may
write no longer read ahead of those flights unless VICTORY_FILL_WAIT=0.
Reading ahead let one submission a run draw with old constants: a fixed
2 KiB block shaders write and later draws read as constants, read as the
opening café flashback began. A blurred oval then stayed over the middle
of the picture until the next scene in 6 of 7 runs; with fills waiting
from the start, 0 of 3 (RTX 5080). The console's card reads those bytes
after the work before them, so waiting is its behaviour. The cost here
is about one frame per second.

Test: fills_wait_unless_the_switch_is_zero (the switch's parsing).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:59: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/1205/head:github-bot/gh-1205'
git switch 'github-bot/gh-1205'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1205'
git switch 'github-bot/gh-1205'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1205'
git switch 'github-bot/gh-1205'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1205'
git switch 'main'
git merge --squash 'github-bot/gh-1205'
git switch 'main'
git merge --ff-only 'github-bot/gh-1205'
git switch 'main'
git merge 'github-bot/gh-1205'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.