Commit Graph

5 Commits

Author SHA1 Message Date
702fbaa969 test: keep geometry_views_test's GeometryViews off the stack
Since #2098 every TitleBufferWindows carries a 128 KiB published_ array, so the
eight GeometryViews this test puts on the stack pass the 1 MiB Windows default
and the test died at startup with a stack overflow. They are heap-allocated now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 21:31:45 -05:00
6fd430ebc7 d3d12: deliver a released title range to every device's geometry views
leonida::geometry_writes previously kept one process-wide release queue, so when two devices held GeometryViews over the same title range, the first device to call drain_released() emptied the queue and the second kept its view and charged bytes forever.

Give each GeometryViews its own ReleaseQueue subscribed to leonida::geometry_writes on construction and unsubscribed on destruction. note_released() delivers each released range to every subscriber's queue under subscribers_mutex -> queue.mutex (keeping the 65536-entry collapse per queue), and take_released() drains only the caller's queue under queue.mutex.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 23:24:42 +02:00
c09ee75c0e d3d12: geometry views drain on the submit thread, bound the release queue, keep one empty block
- Drain released geometry ranges only in the submit-thread before_execute callback, removing recording-thread drain calls and GeometryViews::should_reclaim().
- Filter geometry_writes::note_released() against monotonic watched_lo/watched_hi bounds and collapse the queue on 65536-entry overflow instead of dropping ranges.
- Bound GeometryViews::retire_range() walks using max_view_bytes_ and an ordered refused_ map with max_refused_bytes_.
- Keep one empty 4 MiB spare block in TitleBufferWindows (dropping it when needed under a cap), remove failed_ reset in free(), and cover all four points in geometry_views_test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 20:54:56 +02:00
e54c69175a d3d12: evict geometry views on range release and retry refused ranges
RT-GEOMETRY-VIEW-EVICTION: free GeometryViews entries when their backing
title range is released or unmapped, deferring Vulkan storage reclamation
until in-flight GPU work completes, and retry cap-refused ranges once
budget is freed.

- Queue released title ranges from xmem (XMemFree/Default, VirtualFree
  MEM_RELEASE/MEM_DECOMMIT, XMemMapPhysicalPages unmap, CopyPageMappingsBatchX
  unmap range) via leonida::geometry_writes::note_released.
- Add coalesced sub-range freeing and empty-block Vulkan destruction to
  TitleBufferWindows.
- Retire overlapping views immediately from lookup/find/refresh/watch and
  title_va_aliases, and reap their backing storage once
  completed_retire_ticket() reaches the view's retire ticket.
- Track free_generation_ per refused key so resolve() short-circuits while
  nothing changed and retries once budget is reclaimed.
- Extend geometry_views_test.cpp with small-cap eviction, deferred GPU
  retirement, retry, and full block reclamation checks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 20:46:30 +02:00
ba626820ec Integrate post-story-load memory, queue and Vulkan runtime changes
Preserve physical window aliases across remaps, order console list values,
and replay bounded indirect graphics with captured draw state. Coordinate
pipeline lifetime, texture refresh and queue teardown. Add synthetic CPU
and GPU coverage for the integrated paths.

Co-authored-by: Plaaasma <47513553+Plaaasma@users.noreply.github.com>
Co-authored-by: ivanepsilondelta <264061546+ivanepsilondelta@users.noreply.github.com>
2026-11-25 03:44:43 -06:00