upload: stop named_in_upload's scan at the end of the request (≈10 fps with RT in dense areas) #117

Manually merged
github merged 1 commit from github-bot/gh-116 into main 2026-12-05 17:31:23 +00:00 AGit
Owner

@⁠vicky-revicky001 on GitHub · 2026-12-05 12:50 UTC · original
vicky-revicky001:upload-block-ends-with-request → main · +20 −3 · 1 files · 1 commits · merged 2026-12-05 17:25 UTC

upload::block(address) returns the taken blocks from address to the end of the whole run of contiguous taken blocks, not to the end of the request (allocate_upload call) that holds address. Each allocate_upload request is handed out side by side with others, so Memory::named_in_upload reads every upload that follows it, other lists' included.

Measured in a crowded city spot (RX 9070, 1080p FSR 4 Quality, RT on, VICTORY_RT_PRESET=performance): each scan read ~1.8 MB, ~90 times a frame (~5 GB/s), all under the MEMORY lock. That was ~125 µs a scan; other translating threads waited ~50 µs for the lock on every builder dispatch. Almost no scan found a new page to map.

The fix records where each request starts (Arena::starts) and stops block() at the next start, so the scan covers the request's own instance descriptions, as the doc comment of named_in_upload intends.

After the change, same spot:

  • scan ~65 KB / ~6 µs (was ~1.8 MB / ~125 µs)
  • the builder's memory_ready ~32 µs a dispatch (was ~95 µs)
  • thin-translation wait 2-3 ms a frame (was 10-12 ms)
  • ~34 → ~44 fps, no visible difference

VICTORY_UPLOAD_SCAN_ONE=0 restores the old behaviour.

🤖 Generated with Claude Code

**@⁠vicky-revicky001** on GitHub · 2026-12-05 12:50 UTC · [original](https://github.com/ReTerryDavis/ReVIctory/pull/116) `vicky-revicky001:upload-block-ends-with-request` → `main` · +20 −3 · 1 files · 1 commits · merged 2026-12-05 17:25 UTC `upload::block(address)` returns the taken blocks from `address` to the end of the whole run of contiguous taken blocks, not to the end of the request (`allocate_upload` call) that holds `address`. Each `allocate_upload` request is handed out side by side with others, so `Memory::named_in_upload` reads every upload that follows it, other lists' included. Measured in a crowded city spot (RX 9070, 1080p FSR 4 Quality, RT on, `VICTORY_RT_PRESET=performance`): each scan read ~1.8 MB, ~90 times a frame (~5 GB/s), all under the `MEMORY` lock. That was ~125 µs a scan; other translating threads waited ~50 µs for the lock on every builder dispatch. Almost no scan found a new page to map. The fix records where each request starts (`Arena::starts`) and stops `block()` at the next start, so the scan covers the request's own instance descriptions, as the doc comment of `named_in_upload` intends. After the change, same spot: - scan ~65 KB / ~6 µs (was ~1.8 MB / ~125 µs) - the builder's `memory_ready` ~32 µs a dispatch (was ~95 µs) - thin-translation wait 2-3 ms a frame (was 10-12 ms) - ~34 → ~44 fps, no visible difference `VICTORY_UPLOAD_SCAN_ONE=0` restores the old behaviour. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-05 12:57:33 +00:00
github manually merged commit 1a6089ab30 into main 2026-12-05 17:31:23 +00:00
Author
Owner

@⁠Saksukella on GitHub · 2026-12-05 18:01 UTC · original

Tested this independently on **AMD Radeon RX 9070 XT (

**@⁠Saksukella** on GitHub · 2026-12-05 18:01 UTC · [original](https://github.com/ReTerryDavis/ReVIctory/pull/116#issuecomment-7442746433) Tested this independently on **AMD Radeon RX 9070 XT (
This discussion has been locked. Commenting is limited to contributors.
No description provided.