perf(gpu): coalesce card-step staging reads behind an opt-in #1137

Merged
Tigranchick merged 1 commit from upstream-pr/1137 into main 2026-11-29 08:16:57 +00:00
Tigranchick commented 2026-11-28 13:54:01 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Tigranchick on 2026-11-28T13:54:01Z.


Summary

Port the staging-read coalescing from Foxhound v0.2.0-pre.5. It combines adjacent reads within the same shadow buffer and dependency level, preserves 256-byte CBV alignment and records the number of staging reads per frame. The layout test packs 40 nearby reads into one copy. Original change by readmet3xt-lab

Coalescing is disabled by default. To try it, append --set VICTORY_CARD_STEPS_JOIN=4096 to victory play. Use 0 to compare with individual reads.

Validation

  • Release build and git diff --check passed. cargo xtask policy passed on 294 files.
  • The host::card_steps::tests suite passed 15 tests. The separate D3D12 ordering test passed with the gap set to 0 and 4096. In each run, 48 of 48 logical copies went through the GPU path.
  • Series S A/B on 63b902f with Windows 11, RTX 4070, i7-12700KF and 32 GB RAM. Both runs used copies of the same save and prewarmed cache, with DLSS and frame generation off. Both exited at the Player screen after about 17–18 seconds with 0x80000003 at title offset +0x4dcbc9d. Gameplay frame time and rendering artifacts are unmeasured.

Could someone with a working Series S run compare both settings in the same warmed scene and report staging copy counts, median and p95 frame times, and any visual differences?

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5540825211 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1137). Originally posted by [Tigranchick](https://github.com/Tigranchick) on 2026-11-28T13:54:01Z. --- ## Summary Port the staging-read coalescing from Foxhound `v0.2.0-pre.5`. It combines adjacent reads within the same shadow buffer and dependency level, preserves 256-byte CBV alignment and records the number of staging reads per frame. The layout test packs 40 nearby reads into one copy. [Original change by readmet3xt-lab](https://github.com/readmet3xt-lab/foxhound/commit/7c535276b136b3bf4542cebdf208c78747732fee) Coalescing is disabled by default. To try it, append `--set VICTORY_CARD_STEPS_JOIN=4096` to `victory play`. Use `0` to compare with individual reads. ## Validation - Release build and `git diff --check` passed. `cargo xtask policy` passed on 294 files. - The `host::card_steps::tests` suite passed 15 tests. The separate D3D12 ordering test passed with the gap set to `0` and `4096`. In each run, 48 of 48 logical copies went through the GPU path. - Series S A/B on `63b902f` with Windows 11, RTX 4070, i7-12700KF and 32 GB RAM. Both runs used copies of the same save and prewarmed cache, with DLSS and frame generation off. Both exited at the Player screen after about 17–18 seconds with `0x80000003` at title offset `+0x4dcbc9d`. Gameplay frame time and rendering artifacts are unmeasured. Could someone with a working Series S run compare both settings in the same warmed scene and report staging copy counts, median and p95 frame times, and any visual differences?
cxy0072019-sketch commented 2026-11-28 14:44:39 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by cxy0072019-sketch on 2026-11-28T14:44:39Z.


I ran the requested in-game A/B on an i5-14600KF and RTX 5070 Ti 16 GB with driver 621.24. This is b5ea86d on a local #1069-based compatibility branch, Series S with 1080p output, DLSS and frame generation off, VICTORY_CARD_STEPS=2, VICTORY_RELAY=2, and relay copy on.

I added a local diagnostics-only switch to alternate the gap within one process every 12 s. At the same camera on the daytime porch, I retained nine adjacent pairs with zero pending pipelines and matched draw counts within 6%. I excluded phases affected by D-pad input used to dismiss the idle camera.

Gap Frames Mean frame time Rendered FPS Median staging copies/frame Median P95 across 1 s windows
0 1,840 53.87 ms 18.56 1,796 56.6 ms
4096 1,858 53.35 ms 18.74 1,763 56.1 ms

The median staging copies per 1,000 fills were 306.9 and 307.4. Removing the single largest frame-time difference gives 53.31 ms at gap 0 and 53.36 ms at gap 4096. The captures show the same scene contents. This single scene gives no convincing performance signal.

I also ran a_copy_behind_a_flight_reads_what_the_flight_wrote in a clean process for each gap. Both passed with 48/48 copies on the card and zero submissions waiting.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7240897903 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1137#issuecomment-7240897903). Originally posted by [cxy0072019-sketch](https://github.com/cxy0072019-sketch) on 2026-11-28T14:44:39Z. --- I ran the requested in-game A/B on an i5-14600KF and RTX 5070 Ti 16 GB with driver 621.24. This is `b5ea86d` on a local #1069-based compatibility branch, Series S with 1080p output, DLSS and frame generation off, `VICTORY_CARD_STEPS=2`, `VICTORY_RELAY=2`, and relay copy on. I added a local diagnostics-only switch to alternate the gap within one process every 12 s. At the same camera on the daytime porch, I retained nine adjacent pairs with zero pending pipelines and matched draw counts within 6%. I excluded phases affected by D-pad input used to dismiss the idle camera. | Gap | Frames | Mean frame time | Rendered FPS | Median staging copies/frame | Median P95 across 1 s windows | | --- | ---: | ---: | ---: | ---: | ---: | | 0 | 1,840 | 53.87 ms | 18.56 | 1,796 | 56.6 ms | | 4096 | 1,858 | 53.35 ms | 18.74 | 1,763 | 56.1 ms | The median staging copies per 1,000 fills were 306.9 and 307.4. Removing the single largest frame-time difference gives 53.31 ms at gap 0 and 53.36 ms at gap 4096. The captures show the same scene contents. This single scene gives no convincing performance signal. I also ran `a_copy_behind_a_flight_reads_what_the_flight_wrote` in a clean process for each gap. Both passed with 48/48 copies on the card and zero submissions waiting.
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!1137
No description provided.