perf: give back a list's descriptor slots and kept views in one batch #608
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/608"
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 LooperSalty/AnyXboxX. Originally posted by AlphaVIE on 2026-12-01T18:12:04Z.
Change
When a submission's lists had run, the relay released each dynamic descriptor table on its own (
HostHeap::releaseunder the allocator lock) and retired every kept view with its ownretire_resourcecall, each taking aRETIREDshard lock that the recording threads take as well. In the world that is about 70,000 retirements per frame. On a Ryzen 7 5700X (Series S profile) the relay spent 120-360 ms per frame there, while the submitting thread waited for it and the card stood idle.descriptor:release_dynamic_many()/HostHeap::release_many()give a list's slots back under one hold of the allocator lock per heap.host:retire_resources()retires many resources with one stamp, one lock and one ordered merge (merge_retired_batch). They wait for the same stamp as before, so nothing is dropped earlier.draw:State::tables_done()andDropuse the batched release.Measured on my copy (Xbox Series build 1.0.2.1,
anyxboxx run --console series-swith the tuned settings, world, release build). Method: VIctory's own log lines, plus a local split of the landing's "read-backs and lists" step that is not part of this PR.Machine: Ryzen 7 5700X (8 cores, 16 threads), 32 GB RAM, RTX 5060 Ti 16 GB (PCIe 4.0 x8), Windows 11.
Linked issue: Fixes #607
Verification
GPU: RTX 5060 Ti (not WARP).
One unrelated flaky test:
watch::tests::a_raw_copy_in_watched_memory_keeps_the_other_asked_rangesfailed in 1 of 6 runs on this branch and in 4 of 10 runs on unchangedmain(66b92fb), same machine. This PR does not touch the write watch.Oracle and test data
descriptor::hostrelease_many_gives_back_every_run_and_its_kept_resources_at_onceandhostretire_resources_queues_all_under_one_stampdo not build without this change (the functions are new). They check that every run is given back to the heap with the matching identity only, that kept resources are cleared, and that every retired resource waits under one stamp, none older than the stamp at the call.Checklist
E_NOTIMPL), never a fake success. (Not applicable: no emulated function.)This change was made with AI assistance (Claude Code); I ran and measured it on my own machine.
Imported from LooperSalty/AnyXboxX. Originally posted by AlphaVIE on 2026-12-01T18:12:17Z.
@LooperSalty this is ready for review. All checks listed in the description pass locally (pytest 1983 passed, ruff clean, cargo xtask policy ok). If it looks good to you, could you merge it? Happy to adjust anything you'd like changed.
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.