Repository navigation
Conversation
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
AMD / Windows run of this PR at 5b3c1ea: Radeon 780M (RDNA 3, 0x15bf), AMD driver 25.10.20.01 (32.0.21020.1007), Windows 11 Home 10.0.26100, WinLibs GCC 15.2.0 r7, Release. Every ctest entry built from the test targets this PR changes passes (14):
AI-assisted: yes (runs made on the device above). |
adriadam10
left a comment
There was a problem hiding this comment.
Thanks, the HashSlotMap itself reads correctly (growth, backward-shift erase including the wrapped run, key 0, and the test pins them). It now conflicts with main, and not mechanically:
ResourceCacheonmainhas adaptive capacity (capacity,fixedCapacity,baseEntries, shrink window) and new helpersnoteEvicted(key),noteReturn(key),noteUse(key),dropReleasedTextures(evicted).Find,InsertandTouchcall them, andInsertno longer uses the staticcapacitylambda your diff edits (ShaderResources.cpparound theInserthunk).noteEvicted/noteUsestill take aKeyand useKeyHash{}(key)for their own tables, soKeyHashcannot simply be removed. Decide whether they take the newhashKeyvalue (thenevictedKeys/usedKeysare keyed by it) or keep the old hash.ResourceCachehas other places that readentriesas pairs (->first/->second) onmain; they need theEntrystruct too.
Please rebase on current main and re-measure: noteUse adds work per Find/Touch, so the ~1.5% of the worker's frame may differ. Keep the trace-vs-sampler caveat in the body.
5b3c1ea to
ae33fb5
Compare
|
This pull request is labeled |
|
Closing this: on current main it shows no gain.
That isn't worth a new map in the cache. Thanks @adriadam10 for the review and @keravyn-ops for the AMD run. |
What
ResourceCacheholds the shader resource objects of draws and dispatches. Its keys are about a hundred words: the device, the stages and their bindings' guest descriptors. Every draw and every dispatch looks one up (Find, orTouchon a recipe hit). The cache indexes its LRU list with anstd::unordered_map<Key, iterator, KeyHash>:KeyHashis FNV-1a over every word: one multiply per word, each waiting on the one before.KeyHashisnoexcept, so libstdc++ keeps no hash code in the nodes. A lookup's bucket walk hashes the key of every node it passes again, to find where its bucket ends.The index is now a
HashSlotMap(Execution/include/HashSlotMap.hpp) keyed by the key's hash:RemoveImage.hashSlotMapTests(graphics tests) covers:On the S2 page of Sonic Origins Plus's main menu, the queue worker spent, per frame (APS5 sampler, 15 s):
ResourceCache::Find: 0.52 to 0.27. In a profile of an earlier build, 45 of its 70 samples were its own code, mostly the inlined FNV over the key, and 23 the bucket walk.std::_Hashtable::_M_find_before_node, the bucket walk: 0.26 to 0.06. What remains belongs to other hash tables.That is about 1.5% of the worker's frame (31 samples).
#6492 adds another walk over the cache's entries that reads
it->firstandit->second. Whichever of the two lands second changes them toit->hashandit->resources.Tested
Windows 11 (10.0.26300), WinLibs GCC 15.2.0 (UCRT), Release, NVIDIA GeForce RTX 2080 Ti, driver 617.14.
agc_driver_gpu_indirect_arguments_misaligned_writer_aheadis not run: main itself does not compile it with MinGW (alignas(65536)).select_testsfails in its setup on Windows without the symlink privilege (WinError 1314fromsymlink_to), as on main.agc_driver_multisample_fill_host_onlyfailed once ("the sentinel fill did not land"). That is main's own race, agc_driver_multisample_fill_host_only fails intermittently: the sentinel fill after an absorbed multisampled clear does not land #6512, which fix(agc): record a multisampled target's commands on its own device #6522 fixes. With fix(agc): record a multisampled target's commands on its own device #6522's line added it failed 0 of 200 runs (8 at a time).guest_positioned_close(libkernel and libc only) ended with 0xc0000409 once in the parallel run. Alone it passes 5 of 5.APS5_TRACE_SECONDS=200:15on the same machine in one session, caches warm. Traces attached.This pair overstates the change: its target is about 1.5% of the worker's frame, and windows of this page vary by a few percent at the median. The title FPS during the two captures was 10.82 and 11.12. The sampled pair, 10.56 to 10.84 FPS, is the better estimate.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Traces and summary lines (baseline 245e355, whose summary says b1909f4; this change 557d4da, whose summary says 245e355):
keyhash-traces.zip