Skip to content

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

Draft
Tigranchick wants to merge 1 commit into
trustno1-coder:mainfrom
Tigranchick:port-foxhound-card-step-copies
Draft

Tigranchick wants to merge 1 commit into
trustno1-coder:mainfrom
Tigranchick:port-foxhound-card-step-copies

Conversation

@Tigranchick

Copy link
Copy Markdown

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?

Group adjacent staging reads within one shadow and dependency level. Keep coalescing disabled by default.

Ported-from: readmet3xt-lab/foxhound@7c53527
@cxy0072019-sketch

Copy link
Copy Markdown

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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants