Port face-relocation Wave32 per-wave meetings from cool_fox #378

Merged
liuhVIP merged 4 commits from upstream-pr/378 into main 2026-11-28 19:39:39 +00:00
liuhVIP commented 2026-11-27 21:42:42 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by liuhVIP on 2026-11-27T21:42:42Z.


What this does

Ports the face-relocation Wave32 work from DoubleGhosty/cool_fox into the current NVIDIA fork, adapted to latest main (df2daaf, including PR #58).

The source changes are from:

  • c36f9f4 — lower the face-relocation compute to Wave32 by meeting each console wave on its own.
  • ca7e21a — publish each meet from a single lane, use a volatile wait, and add diagnostics.

The original code is GPL-3.0-or-later and remains under this repository's GPL-3.0-or-later licence.

Why

CS_DefragHeap_ComputeRelocations uses a 128-thread group holding two 64-thread console waves. Its divergent LDS region previously required group-wide synchronization even when only one console wave reached it. That made the default launcher skip the face-relocation compute for performance, which left the face mesh missing while eyes, teeth and hair still rendered.

This change gives each 32-lane host wave its own meet pair:

  • one lane publishes a generation counter;
  • the other half reads it with a volatile LDS load;
  • consecutive reads in one block reuse the same meet;
  • writes still meet so aliasing LDS writes keep their order;
  • a group barrier is still used when every thread reaches the block.

A diagnostic SLOT_MEET UAV records meetings and wait iterations, and VICTORY_DEFRAG=0 provides an off switch for A/B testing.

Integration with current NVIDIA main

The port preserves the fork's existing multi-console-wave pair meetings. The new path is selected only for the known 128-thread face-relocation program, so other shaders keep their current lowering.

Also included:

  • FaceMeshFix launcher option;
  • PLAY_FACES_FIX.cmd [mode 1-6];
  • the F1 label corrected from “decal defrag” to “face relocation”;
  • VICTORY_DEFRAG=0 for comparison runs.

Validation

Merged and tested on top of origin/main at df2daaf.

  • cargo check --workspace — passed.
  • cargo test -p victory-shader --lib — 289 passed, 0 failed, 4 ignored.
  • cargo test -p victory-gpu --lib descriptor — 61 passed, 0 failed, 1 ignored.
  • cargo build --release --locked -p victory — passed.
  • Full shader warm-up: 2957 used pipelines made, 0 failures.
  • Launcher smoke-tested on Windows 11, Ryzen 7 9800X3D, RTX 5090 D 32 GB, GTA VI Xbox build 1.0.2.1.

The GPU timing difference against the old group-barrier path still needs independent measurement on other RTX cards. The PR focuses on correctness and removing the previous need to skip the compute.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5533448682 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/378). Originally posted by [liuhVIP](https://github.com/liuhVIP) on 2026-11-27T21:42:42Z. --- ## What this does Ports the face-relocation Wave32 work from `DoubleGhosty/cool_fox` into the current NVIDIA fork, adapted to latest `main` (`df2daaf`, including PR #58). The source changes are from: - `c36f9f4` — lower the face-relocation compute to Wave32 by meeting each console wave on its own. - `ca7e21a` — publish each meet from a single lane, use a volatile wait, and add diagnostics. The original code is GPL-3.0-or-later and remains under this repository's GPL-3.0-or-later licence. ## Why `CS_DefragHeap_ComputeRelocations` uses a 128-thread group holding two 64-thread console waves. Its divergent LDS region previously required group-wide synchronization even when only one console wave reached it. That made the default launcher skip the face-relocation compute for performance, which left the face mesh missing while eyes, teeth and hair still rendered. This change gives each 32-lane host wave its own meet pair: - one lane publishes a generation counter; - the other half reads it with a volatile LDS load; - consecutive reads in one block reuse the same meet; - writes still meet so aliasing LDS writes keep their order; - a group barrier is still used when every thread reaches the block. A diagnostic `SLOT_MEET` UAV records meetings and wait iterations, and `VICTORY_DEFRAG=0` provides an off switch for A/B testing. ## Integration with current NVIDIA main The port preserves the fork's existing multi-console-wave pair meetings. The new path is selected only for the known 128-thread face-relocation program, so other shaders keep their current lowering. Also included: - `FaceMeshFix` launcher option; - `PLAY_FACES_FIX.cmd [mode 1-6]`; - the F1 label corrected from “decal defrag” to “face relocation”; - `VICTORY_DEFRAG=0` for comparison runs. ## Validation Merged and tested on top of `origin/main` at `df2daaf`. - `cargo check --workspace` — passed. - `cargo test -p victory-shader --lib` — 289 passed, 0 failed, 4 ignored. - `cargo test -p victory-gpu --lib descriptor` — 61 passed, 0 failed, 1 ignored. - `cargo build --release --locked -p victory` — passed. - Full shader warm-up: 2957 used pipelines made, 0 failures. - Launcher smoke-tested on Windows 11, Ryzen 7 9800X3D, RTX 5090 D 32 GB, GTA VI Xbox build 1.0.2.1. The GPU timing difference against the old group-barrier path still needs independent measurement on other RTX cards. The PR focuses on correctness and removing the previous need to skip the compute.
liuhVIP commented 2026-11-28 04:36:36 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by liuhVIP on 2026-11-28T04:36:36Z.


Updated to the latest upstream main at 63b902f.

Conflict resolution preserves the new upstream behaviour:

  • host_wide branch handling remains authoritative in control_regions;
  • lds_looped keeps its fence-only path for non-face shaders;
  • the underwater shader's emit_once retry remains intact;
  • the per-wave meet path is still limited to the 128-thread face-relocation compute.

Re-validated on the new merge commit 63429aa:

  • cargo check --workspace — passed
  • half_meet_orders_a_128_thread_lds_region — passed
  • cargo test -p victory-gpu --lib descriptor — 62 passed, 0 failed, 1 ignored
  • cargo build --release --locked -p victory — passed
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7234147451 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/378#issuecomment-7234147451). Originally posted by [liuhVIP](https://github.com/liuhVIP) on 2026-11-28T04:36:36Z. --- Updated to the latest upstream `main` at `63b902f`. Conflict resolution preserves the new upstream behaviour: - `host_wide` branch handling remains authoritative in `control_regions`; - `lds_looped` keeps its fence-only path for non-face shaders; - the underwater shader's `emit_once` retry remains intact; - the per-wave meet path is still limited to the 128-thread face-relocation compute. Re-validated on the new merge commit `63429aa`: - `cargo check --workspace` — passed - `half_meet_orders_a_128_thread_lds_region` — passed - `cargo test -p victory-gpu --lib descriptor` — 62 passed, 0 failed, 1 ignored - `cargo build --release --locked -p victory` — passed
liuhVIP commented 2026-11-28 13:22:25 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by liuhVIP on 2026-11-28T13:22:25Z.


Independent downstream validation

A separate draft experiment tested this PR's exact head 63429aa together with the one-file head blend-shape-map fix from #703:

  • https://github.com/JohnTWillemsen/VIctory-W/pull/67
  • Exact tested PR head: 66e75cada34658d0646aa083d7ecc9a9574db725
  • RTX 5090 owner report: face, head and skin rendering normal
  • 30 scene-like windows: FPS p10 14.5, p50 19.5, p90 21.7
  • CPU preparation p50 23.4 ms; no detected GPU loss

This is useful evidence that the per-wave path renders correctly, but it is not yet enough for a performance claim: the scenes and cache state were not a matched A/B, and the result is still below a stable 30 FPS target. The experiment also keeps #703 as a separate prerequisite for the head pipeline, so this PR remains focused on the Wave32 face-relocation lowering only.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7239889330 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/378#issuecomment-7239889330). Originally posted by [liuhVIP](https://github.com/liuhVIP) on 2026-11-28T13:22:25Z. --- ## Independent downstream validation A separate draft experiment tested this PR's exact head `63429aa` together with the one-file head blend-shape-map fix from #703: - https://github.com/JohnTWillemsen/VIctory-W/pull/67 - Exact tested PR head: `66e75cada34658d0646aa083d7ecc9a9574db725` - RTX 5090 owner report: face, head and skin rendering normal - 30 scene-like windows: FPS p10 14.5, p50 19.5, p90 21.7 - CPU preparation p50 23.4 ms; no detected GPU loss This is useful evidence that the per-wave path renders correctly, but it is not yet enough for a performance claim: the scenes and cache state were not a matched A/B, and the result is still below a stable 30 FPS target. The experiment also keeps #703 as a separate prerequisite for the head pipeline, so this PR remains focused on the Wave32 face-relocation lowering only.
liuhVIP commented 2026-11-28 18:09:22 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by liuhVIP on 2026-11-28T18:09:22Z.


Updated to upstream main at 9300875 (v2026.11.28.02/.03 range).

The merge is clean and preserves the new mouse/keyboard controls, F1 mouse-release menu work, MFG documentation and repository workflows. New PR head: 99ddfad.

Re-validated:

  • cargo check --workspace — passed
  • half_meet_orders_a_128_thread_lds_region — passed
  • cargo build --release --locked -p victory — passed
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7243573136 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/378#issuecomment-7243573136). Originally posted by [liuhVIP](https://github.com/liuhVIP) on 2026-11-28T18:09:22Z. --- Updated to upstream `main` at `9300875` (v2026.11.28.02/.03 range). The merge is clean and preserves the new mouse/keyboard controls, F1 mouse-release menu work, MFG documentation and repository workflows. New PR head: `99ddfad`. Re-validated: - `cargo check --workspace` — passed - `half_meet_orders_a_128_thread_lds_region` — passed - `cargo build --release --locked -p victory` — passed
YUYING234 commented 2026-11-28 20:14:49 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by YUYING234 on 2026-11-28T20:14:49Z.


Reporting this against #378 because it is the only change on this tree that touches face rendering, and it is still there after it. Measured on 923e38c (main, after #378, #243, #428 and #534 all merged), so if it is not yours to fix, feel free to point me at whoever owns it.

The symptom

Standing still in the prison dorm on an RTX 4060 Laptop 8 GB, Series S picture at 1113x626 balanced, DLSS, frame generation 2x, VICTORY_CARD_ROOM_FOR_TARGETS_MB=1280, VICTORY_AMBIENT=constant:0.1:

The face of the character in front of the camera vanishes for about one frame, once a second. What is left is a black silhouette of the head - the hair still reads, the rest of the head does not. Occasionally the same head comes back covered in a brown blotchy texture instead of black.

Captured from outside at 60 fps so the per-frame behaviour is visible (the game itself runs at 14-16 fps, so one game frame is about 70 ms). The contact sheet runs f0104 to f0112, the disappeared frames in red:

contact sheet

Normal, then the face gone, then normal again, then a wrong texture:

normal
face black
wrong texture on the face

What it measures

Face-region brightness over 560 captured frames (9.33 s), engine:

median 74.0
minimum 47.8
frames obviously darker than the median 54 / 560 = 9.6 %
separate events 9 in 9.33 s, so about once a second
duration of each 33-83 ms, i.e. one game frame; the longest was 24 captured frames, 400 ms

Only that one character is affected: the character in the foreground of the same frame, the ones on the bunks behind, and the room lighting are unchanged in the bad frames.

What is already ruled out

All of these were tried on the same save, same camera, standing still; none removes it:

  • VICTORY_AMBIENT=constant:0.1 (the estimate bypassed entirely - its log line says level=0.0 constant=0.1)
  • VICTORY_AMBIENT_ONCE=1
  • VICTORY_SOFT_VIEWS=copies
  • VICTORY_TEXTURE_NO_WAIT=1 (this one makes the neighbouring clothing flicker worse, range 21.4 against 11.1, so the default wait is doing something)
  • VICTORY_CARD_ROOM_FOR_TARGETS_MB=1280 - this is what stopped the device-removal crashes on this card (VRAM peak 7,730 -> 6,798 MB, no room 30+ -> 1, six runs without a removal), but it does not touch this.

VICTORY_PAGE_WRITES=7 has no landing point here: every counter of that path stays at zero for a whole run.

Why #378 in particular

Because the panel's TEXTURES count barely moves between a good and a bad frame (18 against 17), the texture queue is not obviously the cause, and the thing that disappears is the head, while the eyes and teeth keep drawing now and then - which reads like the face geometry or its per-wave relocation dropping out rather than a texture going missing. That is why I am asking here first.

What I can do next

  • Record with VICTORY_RECORD if a replay capture of a bad frame helps you (the replay tool would need building here).
  • Run the same scene with --dred/VICTORY_GPU_TIMING=1 to see whether the bad frame's command list differs.
  • Try an older commit to bisect where it started, if you tell me which one to start from.

Logs (stare.out), the 12-second 60 fps capture and all 560 extracted frames are here and can be uploaded.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7245144148 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/378#issuecomment-7245144148). Originally posted by [YUYING234](https://github.com/YUYING234) on 2026-11-28T20:14:49Z. --- Reporting this against #378 because it is the only change on this tree that touches face rendering, and it is still there after it. Measured on `923e38c` (main, after #378, #243, #428 and #534 all merged), so if it is not yours to fix, feel free to point me at whoever owns it. ## The symptom Standing still in the prison dorm on an RTX 4060 Laptop 8 GB, Series S picture at **1113x626 balanced**, DLSS, frame generation 2x, `VICTORY_CARD_ROOM_FOR_TARGETS_MB=1280`, `VICTORY_AMBIENT=constant:0.1`: **The face of the character in front of the camera vanishes for about one frame, once a second.** What is left is a black silhouette of the head - the hair still reads, the rest of the head does not. Occasionally the same head comes back covered in a brown blotchy texture instead of black. Captured from outside at 60 fps so the per-frame behaviour is visible (the game itself runs at 14-16 fps, so one game frame is about 70 ms). The contact sheet runs f0104 to f0112, the disappeared frames in red: ![contact sheet](https://raw.githubusercontent.com/YUYING234/VI-BR-PORT/8gb-27nov/docs/attachments/face-flicker-contact-sheet.png) Normal, then the face gone, then normal again, then a wrong texture: ![normal](https://raw.githubusercontent.com/YUYING234/VI-BR-PORT/8gb-27nov/docs/attachments/face-normal-frame.png) ![face black](https://raw.githubusercontent.com/YUYING234/VI-BR-PORT/8gb-27nov/docs/attachments/face-black-frame.png) ![wrong texture on the face](https://raw.githubusercontent.com/YUYING234/VI-BR-PORT/8gb-27nov/docs/attachments/face-wrong-texture-frame.png) ## What it measures Face-region brightness over **560 captured frames (9.33 s)**, engine: | | | |---|---| | median | 74.0 | | minimum | 47.8 | | frames obviously darker than the median | 54 / 560 = 9.6 % | | separate events | **9 in 9.33 s, so about once a second** | | duration of each | 33-83 ms, i.e. **one game frame**; the longest was 24 captured frames, 400 ms | Only that one character is affected: the character in the foreground of the same frame, the ones on the bunks behind, and the room lighting are unchanged in the bad frames. ## What is already ruled out All of these were tried on the same save, same camera, standing still; none removes it: - `VICTORY_AMBIENT=constant:0.1` (the estimate bypassed entirely - its log line says `level=0.0 constant=0.1`) - `VICTORY_AMBIENT_ONCE=1` - `VICTORY_SOFT_VIEWS=copies` - `VICTORY_TEXTURE_NO_WAIT=1` (this one makes the neighbouring clothing flicker *worse*, range 21.4 against 11.1, so the default wait is doing something) - `VICTORY_CARD_ROOM_FOR_TARGETS_MB=1280` - this is what stopped the device-removal crashes on this card (VRAM peak 7,730 -> 6,798 MB, `no room` 30+ -> 1, six runs without a removal), but it does not touch this. `VICTORY_PAGE_WRITES=7` has no landing point here: every counter of that path stays at zero for a whole run. ## Why #378 in particular Because the panel's `TEXTURES` count barely moves between a good and a bad frame (18 against 17), the texture queue is not obviously the cause, and the thing that disappears is *the head*, while the eyes and teeth keep drawing now and then - which reads like the face geometry or its per-wave relocation dropping out rather than a texture going missing. That is why I am asking here first. ## What I can do next - Record with `VICTORY_RECORD` if a replay capture of a bad frame helps you (the replay tool would need building here). - Run the same scene with `--dred`/`VICTORY_GPU_TIMING=1` to see whether the bad frame's command list differs. - Try an older commit to bisect where it started, if you tell me which one to start from. Logs (`stare.out`), the 12-second 60 fps capture and all 560 extracted frames are here and can be uploaded.
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!378
No description provided.