Bake: settle the flights in the air before a decoration bake reads title memory (VICTORY_BAKE_SETTLE) #1912

Manually merged
github merged 1 commit from github-bot/gh-1912 into main 2026-11-30 14:17:42 +00:00 AGit
Owner

@⁠erquier on GitHub · 2026-11-29 02:21 UTC · original
erquier:pr/bake-settle → main · +18 −0 · 1 files · 1 commits · merged 2026-11-30 14:12 UTC

Problem

With VICTORY_PLACED_READS and VICTORY_PLACED_ORDER a submission no longer
waits for the flights in the air. The pass before a decoration bake
(bake_sources) reads the title's constants and records on the CPU, and those
flights may still be writing that memory. Seen on our runs (RTX 5070 12 GB /
Ryzen 5800X / 32 GB RAM, 2026-11-28): skin with colour noise like TV static at
night. Together with VICTORY_BAKE_ROOM and a look again at painted textures
(a separate change, see below), black faces in the prologue cutscenes went from
frequent to rare, and bake reads that touched memory still in flight were 0 in
25 dumps. (That measure is of the three changes together; this one is the
smallest of them.)

What changes

Before the bake's CPU reads, settle_for_fence() is called once per bake draw,
as the other CPU readers of title memory in draw.rs do. It is one wait on
flights already in the air, taken on the thread that draws the bake.

Switch and default

VICTORY_BAKE_SETTLE, on by default; VICTORY_BAKE_SETTLE=0 leaves the
settle out, as before.

How it was tested

  • cargo test --release -p victory-gpu --lib -- --test-threads=4: 589 passed,
    0 failed, 44 ignored.
  • The visual effect was seen in play on the fork; this branch was built and
    unit tested only.

Risks

The settle waits for the flights in the air, so a bake draw can cost a short
wait when several are in flight; bake draws are a few per frame at most in the
cutscenes where it matters. Off with VICTORY_BAKE_SETTLE=0.

Left out of this PR

  • Our VICTORY_RECHECK_PAINTED (keep looking at textures found changed with
    nothing to tell of it): the same mechanism is already in open PR #1573
    (VICTORY_PAINTED_EVERY, with the start addresses kept and an F1 menu entry),
    so it is not repeated here.
  • Our change that keeps the look at 400 frames in RECHECK_FRAMES: upstream's
    RECHECK_FRAMES is still [4, 12, 40, 120, 400], so there is nothing to
    keep.

🤖 Generated with Claude Code

**@⁠erquier** on GitHub · 2026-11-29 02:21 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1912) `erquier:pr/bake-settle` → `main` · +18 −0 · 1 files · 1 commits · merged 2026-11-30 14:12 UTC ### Problem With `VICTORY_PLACED_READS` and `VICTORY_PLACED_ORDER` a submission no longer waits for the flights in the air. The pass before a decoration bake (`bake_sources`) reads the title's constants and records on the CPU, and those flights may still be writing that memory. Seen on our runs (RTX 5070 12 GB / Ryzen 5800X / 32 GB RAM, 2026-11-28): skin with colour noise like TV static at night. Together with `VICTORY_BAKE_ROOM` and a look again at painted textures (a separate change, see below), black faces in the prologue cutscenes went from frequent to rare, and bake reads that touched memory still in flight were 0 in 25 dumps. (That measure is of the three changes together; this one is the smallest of them.) ### What changes Before the bake's CPU reads, `settle_for_fence()` is called once per bake draw, as the other CPU readers of title memory in `draw.rs` do. It is one wait on flights already in the air, taken on the thread that draws the bake. ### Switch and default `VICTORY_BAKE_SETTLE`, on by default; `VICTORY_BAKE_SETTLE=0` leaves the settle out, as before. ### How it was tested - `cargo test --release -p victory-gpu --lib -- --test-threads=4`: 589 passed, 0 failed, 44 ignored. - The visual effect was seen in play on the fork; this branch was built and unit tested only. ### Risks The settle waits for the flights in the air, so a bake draw can cost a short wait when several are in flight; bake draws are a few per frame at most in the cutscenes where it matters. Off with `VICTORY_BAKE_SETTLE=0`. ### Left out of this PR - Our `VICTORY_RECHECK_PAINTED` (keep looking at textures found changed with nothing to tell of it): the same mechanism is already in open PR #1573 (`VICTORY_PAINTED_EVERY`, with the start addresses kept and an F1 menu entry), so it is not repeated here. - Our change that keeps the look at 400 frames in `RECHECK_FRAMES`: upstream's `RECHECK_FRAMES` is still `[4, 12, 40, 120, 400]`, so there is nothing to keep. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
With VICTORY_PLACED_READS and VICTORY_PLACED_ORDER a submission no longer
waits for the flights in the air, and the pass before a decoration bake
(bake_sources) reads the title's constants and records on the CPU, which
those flights may still be writing: skin showed colour noise like TV static
at night (2026-11-28). The bake now settles the flights first, as the
other CPU readers of title memory do (settle_for_fence).
VICTORY_BAKE_SETTLE=0 leaves it out, as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 02:23:16 +00:00
Author
Owner

@⁠Dukestar69 on GitHub · 2026-11-29 03:34 UTC · original · approved these changes

Tested locally merged onto main (568c5e5).

  • Merge: Clean 18-line merge in crates/victory-gpu/src/draw.rs.
  • Tests (RTX 5090):
    • cargo test -p victory-gpu --lib bake passed (8 passed; 0 failed).
    • cargo test -p victory-gpu --lib draw:: passed (16 passed; 0 failed; 2 ignored).
  • 0 warnings in draw.rs.

Clean opt-in VICTORY_BAKE_SETTLE synchronization guard before decoration bakes read title memory. LGTM.

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

**@⁠Dukestar69** on GitHub · 2026-11-29 03:34 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1912#pullrequestreview-6101256395) · **approved these changes** Tested locally merged onto `main` (`568c5e5`). - **Merge**: Clean 18-line merge in `crates/victory-gpu/src/draw.rs`. - **Tests (RTX 5090)**: - `cargo test -p victory-gpu --lib bake` passed (`8 passed; 0 failed`). - `cargo test -p victory-gpu --lib draw::` passed (`16 passed; 0 failed; 2 ignored`). - 0 warnings in `draw.rs`. Clean opt-in `VICTORY_BAKE_SETTLE` synchronization guard before decoration bakes read title memory. LGTM. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
github manually merged commit d0ed1e2e15 into main 2026-11-30 14:17:42 +00:00
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!1912
No description provided.