Skip to content

fix missing chunks at high render distance - #853

Merged
Purdze merged 19 commits into
masterfrom
rd-chunk-garbage
Nov 4, 2026
Merged

Purdze merged 19 commits into
masterfrom
rd-chunk-garbage

Conversation

@Purdze

@Purdze Purdze commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

chunk meshes go in budgeted arenas now, far chunks get evicted when vram runs out instead of leaving holes

  • arenas are budgeted from VK_EXT_memory_budget (a quarter of their heaps without it); an arena the driver can't allocate holds off adding more for a while, longer each time, instead of crashing
  • eviction goes farthest first behind a frontier that resets once nothing waits; a column handed back to evict for holds the room until it uploads, so free space split into small gaps can't bounce two columns back and forth
  • empty arenas compact and free once nothing waits for room; when a waiting column has room in total but no gap for it, the emptiest arena drains into the others' gaps for it
  • pomme-gpu-allocator keeps one spare empty block per memory type instead of freeing it, for every allocation, not just arenas

windowed chunk bench, 2 runs each, 1 warmup + 3 measured per run:

  • rd 32: all 3725 chunks in 1.62 s (11 arenas, 1936 MB); master gets ~2877 in 7.3-8.0 s and skips the rest (vertex pool full)
  • rd 64: all 13881 chunks in 5.4 s (31 arenas, 5456 MB); master gets ~2900 in 13-14 s
  • worst frame the same as master (17 vs 17-18 ms at rd 32, 25 vs 25-26 ms at rd 64)

tests: unit tests for the allocator, eviction, retry and frontier, plus a randomized streaming test against a model of the store; ingame scripts chunk_arenas, chunk_arenas_teleport, render_distance

This was referenced Nov 3, 2026
@Purdze
Purdze added this pull request to stack #874 November 3, 2026 20:07
Purdze added 13 commits November 3, 2026 21:33
…ew findings

- a column handed back to evict for holds the room until its mesh uploads,
  so free room split into small gaps can't bounce two columns forever
- allocation takes the draining arena's room before evicting
- the eviction frontier resets once nothing waits
- empty arenas aren't freed while columns wait for room
- a failed arena allocation caps the arena count instead of panicking
- arena order cached per frame, compaction walks only the draining arena's
  columns, retry walks the loaded columns only when it would evict
…fragmented room for waiting columns and retry when an arena goes
…le the failed-add backoff, and settle only once nothing could still come back
…t only with two arenas, and check eviction under a cap
…ly where it can help, and test streaming against a model of the store
…e the frontier and retry code with the model
@Purdze
Purdze merged commit e6e7f7c into master Nov 4, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant