Retry texture detiling after an incomplete conversion #419
No reviewers
Labels
No labels
accessibility
already-solved
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
merged
needs-decision
needs-game-run
needs-rebase
not-merged
nvidia
obsolete
question
security
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/avatarmanz--VIctory-7900XTX!419
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-419"
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?
@feanorsun on GitHub · 2026-11-27 01:47 UTC · original
feanorsun:fix/retry-failed-texture-detile→main· +492 −153 · 3 files · 2 commits · openRefs #358 (section 1, item 5).
Staging recorded the source digest before detiling the first mip. If a later mip failed, the next refresh could accept the same input as a cache hit. The write-watch path could also advance its watermark, and a caller reading the whole texture could still pass it to the texture store.
Commit the digest after the last subresource succeeds. A failed attempt clears the digest and write-watch watermark and leaves the upload pending. Check every footprint against the same bounds used by
Layout::detilebefore writing or zeroing any mip. An earlier copy command can still reference the staging allocation, so preserving its bytes on failure matters even when the current prelude skips the upload. This requires no second texture-sized buffer.The prelude and the optional ahead queue both skip a failed conversion. Other ready jobs in the ahead batch can proceed. Whole-texture persistence and the dirty flag are updated on success. Partly mapped, all-zero input is still ignored, and the 30-frame polling interval is unchanged. A retry uses the next eligible refresh under the existing scheduling rules.
UwUCammie found that a fully reserved source with no committed pages could skip detiling altogether and still complete an ahead job. This update adapts that finding to the upstream ahead queue and list prelude. Both require a previously completed staging conversion. The worker releases unready jobs, wakes list waiters, and copies the ready members of the batch. Only a successful copy releases success callbacks. An abandoned job stays silent when the normal list later stages the texture. UwUCammie’s report · AMD port and follow-up commit
Windows CPU verification
For the baseline run, I kept the upstream digest comparison and early assignment in
Last::convertand ran the two new cache regressions against that version of the crate. The same-input case failed on its second request even after the destination grew from five to six bytes. The partial-replacement case failed at the assertion that the conversion was marked incomplete. Both assertions pass with this change.The same-input case now makes two conversion attempts across three requests. A short destination fails, the full destination receives all six bytes, then the identical input is skipped. A separate two-mip case exercises the staging preflight and checks that a short second mip leaves all six previous bytes intact, including when the first mip would otherwise have been zeroed.
Listed the tests first, then ran each selected full name separately with
--exact --test-threads=1. 12 passed, 0 failed (8 invictory-gpu, 4 invictory-formats). The inputs and destinations were small CPU buffers. The upload paths were traced in source. No GPU, game, or visual performance tests were run.With the original
!incompletecheck from3699879, the CPU batch test sent the never-converted job to the copy, and the prelude test claimed a first upload for the same state. Both now pass. The callback test injects skipped, failed, and successful copy outcomes into the worker’s batch logic and checks notifications registered before, during, and after completion.AMD device results reported by UwUCammie
UwUCammie’s Wine/RADV run passed six Windows MSVC texture tests. Their Radeon fixture reserved the source with no committed pages, observed no completion callback, then committed the pages and staged the same texture through the regular path. AMD PR #48 and test notes
The 300-second cold-story run at 720p on an RX 7900 XT recorded 1,711 presents (5.70 FPS) with the AMD port. Two stock runs with matching flags and driver recorded 8.63 and 8.84 FPS. This comparison showed no speedup. The cause of the frame-rate difference remains undetermined. UwUCammie’s cold-run comparison
Targeted commands and selected tests
@UwUCammie on GitHub · 2026-11-27 02:03 UTC · original
I adapted this to the direct upload lists and heap worker on
linux-amd-bestin jtrudeau1530/VIctory-7900XTX#48. The 19 format texture tests pass on Linux and six focused Windows MSVC tests pass under Wine. That includes reprocessing the same digest after a failure and preserving the old staging bytes when a later mip is short. I still need a matched in-game comparison for the visual effect.@UwUCammie on GitHub · 2026-11-27 02:50 UTC · original
I tested one more ahead-queue case from the AMD port. A fully reserved source with no committed pages can skip conversion entirely, so the ahead queue now waits for a successful staging conversion. The Radeon fixture kept the completion callback silent while the pages were absent, then staged the same texture after commit. That adjacent case is in the updated AMD PR, with six focused Windows MSVC tests passing on RADV under Wine. Patch and test notes
@UwUCammie on GitHub · 2026-11-27 04:37 UTC · original
I finished a 300 s cold-story run of the AMD adapter on RX 7900 XT at 720p. It accepted 1,711 presents (5.70 FPS), below both stock launches with matching flags and driver (8.63 and 8.84 FPS). The focused tests still cover the original retry bug. The cold run gives no reason to promote this as a speedup. Run and branch details
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.