d3d12: skip texture gather exclusivity when a batch copies nothing #668
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/668"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from brcly/TuxBox. Originally posted by s3rius on 2026-12-03T02:46:12Z.
Summary
The queued-texture-copy gate held every batch's native images exclusively — a per-batch busy-wait over ~2,000 shared images — even when the batch copies nothing (all reads fresh, no writes, no label waits). That serialized every queue against every other and made the story intro collapse to ~0.2 fps. This change skips only the exclusivity step for such batches: the record, the copies and the fence dance are unchanged, so the images still stay alive through the fence and the copy lifetimes are identical. Batches with real copies (fresh or not) still hold exclusively, and regathers after a label wait still hold. Not yet verified in a game — the gate is only one of the causes of the stall (see below).
Tested
Run the checks relevant to this change.
GPU, driver and backend:
The
Evidence:linetuxbox.py checkprints last, one per card (it names the commit it tested; run it on this pull request's head):Commands run and their results:
Checks
CI runs the code checks: the Python and Rust unit tests, the translator tests through DXC, a Windows typecheck, clippy, formatting, rustdoc, and Miri on the providers. It has no GPU.
If this pull request changes evidence JSON, regenerate the results table and the progress map and include both files:
Imported from brcly/TuxBox. Originally posted by JeffreyBytes on 2026-12-03T03:32:47Z.
Testing this now on RX 6700 XT. What GPU did you run on @s3rius ?
Imported from brcly/TuxBox. Originally posted by s3rius on 2026-12-03T03:44:44Z.
I ran it on RTX5090. Thanks, @JeffreyBytes .
Imported from brcly/TuxBox. Originally posted by JeffreyBytes on 2026-12-03T04:27:11Z.
Checks all pass and the changes seem to be okay, but I'm getting some mixed results with testing. Doing a few more runs to get a better average. Results soon. Please hold this PR for now.
Imported from brcly/TuxBox. Originally posted by JeffreyBytes on 2026-12-03T05:21:17Z.
Results from more runs. RX 6700 XT 12 GB, Mesa 26.3.1 RADV, GE-Proton11-15.
The full check on the head passed:
In game I did 10 runs of ProjectScarlett's intro, 5 on #667 alone and 5 on #667 with this merged on top. The last 5 alternated between the two builds. Setup:
section-import=substituted, private views on,TUXBOX_STALL_DUMP=1,TUXBOX_FRAME_LOG=1. "Placement/min" is the placement time from all slow frames in the run, in seconds per minute of game time, since runs end at different times.So it looks like it helps, but not every time. The median placement/min goes from 10.4 s to 3.5 s, and long placement frames showed up in 2 of 5 runs with it vs 4 of 5 without. One run with it (11.5 s/min, a 29 s placement frame) looks just like #667 alone, though. With 5 runs each, the difference isn't significant (Mann-Whitney, one-sided p ≈ 0.11). The waits held past 5 s weren't fewer with it either.
Every run on both builds that didn't fault ended in exit 5 (the title's watchdog), at about the same time. In the runs I looked at closely, the last stall had the GPU mostly idle and the queues waiting on the texture publication fence, so I think that's the other cause you mentioned.
The two GPU faults were gfx-ring TCP permission faults, and the ring reset worked both times. One happened on #667 alone, so I don't think it's from this PR.
I don't see any reason to hold it back from what I measured. It just isn't the whole fix for the stall.
Imported from brcly/TuxBox. Originally posted by s3rius on 2026-12-03T15:26:32Z.
@JeffreyBytes, thanks for such a deep analysis. Yes, it's not the whole fix. I'm still investigating what could be the reason for this whole fencing thing.
Probably will publish some more other small updates today. As of right now everything points at CPU. Since my GPU is loaded by 20% at its peak load during the launch. Could be something there.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.