d3d12: publish a batch's textures on several threads #574
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/574"
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 NathansDomainSolutions on 2026-11-30T06:24:47Z.
Part of #472. With the digest cost gone (private views, or #573), publication is what's left: @NickStallman's RTX 5090 numbers show 903 ms of publication per 6 s window with private views, and 2291 ms with section backing (store 440, retile 374). All of that ran in order on the queue's one publication thread, although the textures in a batch are independent.
Change
publishnow hands each texture topublish_texture(the old loop body, unchanged apart from taking its scratch buffers from aScratch).Tally::merge_parallel, as the check pool does. The first error stops the other threads and is returned.TUXBOX_PARALLEL_PUBLICATION=0turns it off.Checks
cargo clippy -D warningsandfmt --checkare clean.TUXBOX_SUBMIT_PROFILE=1; compare thepublish-retileandpublish-storesteps againstTUXBOX_PARALLEL_PUBLICATION=0).This contribution was written by an AI agent (Claude Opus 5.5) operating under my supervision. I am accountable for it and will respond to review.
🤖 Generated with Claude Code
Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-30T07:05:52Z.
@NathansDomainSolutions thanks; we'll run it tonight on an RTX 5090 (warm cache, world runs) as three 20-minute runs: default with
TUXBOX_PARALLEL_PUBLICATION=0, #573's watch on with it off, and watch on with it on, and post thepublish-*steps.One thing from reading, not tested: the overlap check compares title virtual addresses. Two textures at different addresses over the same section pages (aliases, which is the case #464 and #573 are about) wouldn't be seen as overlapping, so their order wouldn't be kept. If wrong bytes appear with it on and not off, that's where I'd look. If you think the pages can't alias inside one batch, I'd be glad to be wrong.
Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-30T11:46:30Z.
The Miri failure is in the new test
parallel_publication_stops_at_an_error_and_returns_it(tests/device/placement_writeback.rs:278). ConvertingE_INVALIDARGinto awindows::core::ErrorcallsGetErrorInfo, which Miri can't emulate. Mark it the way main marks the others:(Or build the error without that conversion, if you'd rather keep it running under Miri.) Separately, I'll review the PR once @NickStallman's three runs are posted.
Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-30T18:28:06Z.
@NathansDomainSolutions @brcly the runs on the RTX 5090 (
10de:2b85, 620.70.10, GE-Proton11-14, main8ece312fplus this PR and other open ones, no section watch, warm caches, 20-minute cap). One run each, so read it with that in mind.TUXBOX_PARALLEL_PUBLICATION=0)TUXBOX_CAPTURE_RASTER_ROOTS), and 95a started with a warmer vkd3d cache, so the frame difference isn't a clean comparison.PresentX failedwith #574 on alone, and no device loss in either (which is about the length of the runs only).Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-30T19:12:19Z.
Thanks @NickStallman, that's the number we needed: about 40% less publication time per MiB is worth having. Publication is the largest placement cost in our own world runs as well.
@NathansDomainSolutions three things before it can go in:
main. Please rebase.parallel_publication_stops_at_an_error_and_returns_itfrom my earlier comment is still needed.backing::guest_runsgives them), or show that two textures in one batch can't share a page, with a test that would fail if they did.Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-30T19:41:46Z.
A correction to my numbers above, which I should have checked first. Both runs (90a and 95a) used a diagnostic build of vkd3d-proton: the same commit GE-Proton11-14 ships (cae8353e), built by us with
enable_trace=trueand a GPU timestamp patch. The trace build makes COMQueryInterfaceand interface comparisons about ten times slower, so any CPU time that includes them is inflated, in both runs alike.