Repository navigation
perf: optimize IPC socket buffers, enable async compile & desc batch in perf mode, inline wire decoders, add Mali-Gxxx presets - #39
Open
wwmaxik wants to merge 3 commits into
Conversation
added 3 commits
October 28, 2026 15:06
…in perf mode, inline wire decoders, add Mali-Gxxx presets
…d dead-process cleanup - server_errata_flip: unconditionally retain and refcount linked GPL pipeline libraries so underlying driver objects remain valid on Mesa and Mali until the executable linked pipeline is destroyed. - server_pcache: hold save_lock throughout device destroy and pc_lock during saver iteration, eliminating a race condition and use-after-free when devices are destroyed while the saver thread is active. - server_conn: call vkb_vidyn_device_destroy during dead-process device cleanup in vkb_proc_cleanup to unlink from global list, preventing SIGSEGV. - host/mode_test.sh: update step 6 assertions for descriptor batching enabled in performance mode.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This pull request brings several targeted performance, stability, and latency optimizations to MaliBridge, particularly beneficial for Valhall and 5th Gen ARM Mali GPUs (e.g. Mali-G610, G710, G720, G925) when running games under Proton / DXVK / vkd3d:
1. IPC Socket Buffer Tuning (
SO_SNDBUF/SO_RCVBUF)SO_SNDBUF&SO_RCVBUF) to 2 MB on both the client (client/conn.c) and server (server/server_conn.c).2. Enable Descriptor Batching by Default in Performance Mode
desc_batch()inclient/conn.cso thatVKB_CLIENT_MODE_PERFORMANCEenables descriptor batching (by_mode[VKB_CLIENT_MODE_PERFORMANCE] = 1).3. Default Asynchronous Pipeline Compilation in Performance Mode
server/server_async.c, automatically enables asynchronous graphics pipeline compilation (on = 1) whenvkb_mode() == VKB_MODE_PERFORMANCE, unless explicitly overridden byVKBRIDGE_ASYNC_COMPILE.VK_EXT_graphics_pipeline_library.4. Fast-path Inlined Wire Scalar Decoders & Alignment
vkb_dec_u8,vkb_dec_u32, andvkb_dec_u64incommon/vkb_wire.hwith direct bounds check and unaligned word loading.client/cmdbuf.c.5. Built-in Tested Mali Valhall / 5th Gen Presets
server/presets_builtin.incto match Mali GPUs (Mali-G610,Mali-G710,Mali-G720,Mali-G925) with ASTC 6x6 texture compression block size and fast BC transcoding (VKBRIDGE_BC_ASTC_BLOCK=6x6 VKBRIDGE_BC_TRANSCODE_QUALITY=fast).6. Linked GPL Pipeline Library Retention (
server/server_errata_flip.c)links->pLibrariesinr->libsviaobj_ref_lockedon executable pipelines linked from pipeline libraries (VK_EXT_graphics_pipeline_library).7. Thread-Safety & UAF Fix in Pipeline Cache Saver (
server/server_pcache.c)save_lockthroughout device destruction invkb_pcache_device_destroy, and holdpc_lockwhile stepping the list in thesaverthread.8. Vertex Input Dynamic State Device Cleanup on Process Exit (
server/server_conn.c)vkb_vidyn_device_destroy(t)call invkb_proc_cleanupwhen a process exits abruptly without callingvkDestroyDevice.alllist and fixes SIGSEGV during survivor cleanup.Testing
make -C host && out/hotpath_bench).viewport_test.sh,mode_test.sh,flicker_check,desc_traffic_check,exitclean_check).