mirror of
https://github.com/MacosPorters/betterxen.git
synced 2026-11-26 22:10:44 +00:00
Each frame-loop session opened its own Metal command queue. The GPU driver allocates a per-queue working set on the first command buffer (about 45 MiB on an Apple M5 with validation) and frees it asynchronously 10-50 ms after the queue is released, so the footprint read right after a session ended swung by about 50 MiB and the repeated-sessions footprint test failed intermittently (5 of 30 runs). There was no leak. Sessions now share one process-wide NativeCompute, which is Send + Sync, so the working set is allocated once and kept. Remove the settled_footprint wait added in #292: the original test measures the immediate footprint again. Add a 50-session regression test (completion, pause and resume, destroy while running) and a concurrent two-session test for shared-queue correctness and session isolation. Signed-off-by: Swastick Chowdhury <28708247+Swastickc@users.noreply.github.com>