macOS: run on MoltenVK, and build pipelines ahead #1469
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!1469
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1469/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@mohamed-rekiba on GitHub · 2026-10-13 00:07 UTC · original
mohamed-rekiba:feat/moltenvk-host-and-prebuilt-pipelines→main· +36489 −3890 · 293 files · 10 commits · closed without mergingSummary
KytyPS5 runs on macOS through MoltenVK. Pipelines are built ahead, so a draw does not wait for one.
0x0fbfe00000). Without this, every game stops atagc.cppEXIT_IF(address != DriverDmemBase).--video-out-resolutionoption,--perf-counters,--bench-script(key presses replayed for measured runs), a log line naming each gamepad's vendor, product, path and driver, and SO_BROADCAST and ADCX on Rosetta 2. The GPU tests run on MoltenVK, and CI runs every unit test from one list.Performance
Crash Bandicoot 4 on an Apple M4 Max, x86_64 under Rosetta 2, MoltenVK 1.4.2:
What each part is worth, measured without and with it in the same scene:
--video-out-resolution FullHdThe scenes, routes and render sizes differ between parts, so the rows do not add up. In one nine-minute run of the recorded route with every part, the level held 27–34 fps: the cache buffers levelled off at 654 and device memory at 4.4 GB, and a guest fault cost 40–60 µs on average (fault_us / guest_faults) throughout.
Where the work of a frame runs
Work that would hold a draw runs ahead of it, on other threads, or once for many draws. Details:
docs/performance.Commits
Each commit builds on its own.
Game and build
Test result
Result details: Both games reach controllable gameplay with correct rendering. All 84 unit tests pass on MoltenVK, the GPU tests included. Two players with two gamepads were checked in Contra: Operation Galuga.
Host system
Evidence
Log file: I can send it on request.
Screenshots:
@coderabbitai[bot] on GitHub · 2026-10-13 00:22 UTC · original · edited 2026-11-08 09:36 UTC
No actionable comments were generated in the recent review.
Walkthrough
The PR expands graphics and shader execution with host-capability checks, asynchronous pipeline building, mesh emulation, shader-based depth bounds, and updated GPU memory synchronization. It adds performance counters, cache handling, and configuration for reported video resolution and pipeline-cache location. Controller input state moves into
PadInput; socket broadcast handling and x64 instruction emulation are updated. CMake and CI gain additional unit-test targets and shared test-list validation.Merge Risk:
Moderate · previous review
2316bDraws within the same render pass may read data before an earlier write is made visible, causing incorrect rendering. Resolve or explicitly accept that risk before merging.
Pre-merge checks:
4 ·
1
Full details: Docstring Coverage
Explanation
Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 395 functions across 60 files. (1 skipped: 1 unsupported.)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Share
ℹ️ Recent review info
⚙️ Run configuration
74616419-71aa-4138-83fe-b77169446ca2📥 Commits
Reviewing files that changed from the base of the PR and between 1ee6777dffe89833bd307b945719fe0c5a806c4c and 2316b7a339d313970eb929920e9e0e58d03f486f.
⛔ Files ignored due to path filters (5)
docs/performance/draw-cpu-path.svgis excluded by!**/*.svgdocs/performance/performance-overview.svgis excluded by!**/*.svgdocs/performance/pipeline-timeline.svgis excluded by!**/*.svgdocs/screenshots/ps5-07.jpgis excluded by!**/*.jpgdocs/screenshots/ps5-08.jpgis excluded by!**/*.jpg📒 Files selected for processing (1)
docs/performance/README.md🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
@coderabbitai[bot] on GitHub · 2026-10-13 00:22 UTC · original · edited 2026-10-13 01:17 UTC
On
src/graphics/guest_gpu/graphicsRun.cppline 1285 (outdated):🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 9939
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 42682
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 183
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 947
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 13217
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 13060
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 12732
🐛 Suggested fix
@coderabbitai[bot] on GitHub · 2026-10-13 00:22 UTC · original · edited 2026-10-13 00:34 UTC
On
src/graphics/host_gpu/renderer/cache/textureCache.cppline 435 (outdated):🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 9271
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 42870
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 4793
Remove the setting check from
ProcessDownloadImages.TrackImageDownload()adds eligible tiny images tom_download_imageseven whenm_readback_linear_imagesisfalse.ProcessDownloadImages()then returns before processing that set. With the default configuration, tiny GPU-written images are not copied back to guest memory.🐛 Suggested fix
✅ Addressed in commit afae11b
@coderabbitai[bot] on GitHub · 2026-10-13 00:22 UTC · original · edited 2026-10-13 00:48 UTC
On
src/graphics/host_gpu/renderer/pipeline/pipelineCache.cppline 1849 (outdated):🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Stop the pipeline builders before
Save()destroysm_driver_cache.Each builder thread copies
m_driver_cacheinto the localdriver_cachewhen it starts.WindowRuncallsPipelineCache::Save()after the window loop ends. The builder threads still run at that point, because only~PipelineCachestops them.Save()then callsdestroyPipelineCache(m_driver_cache)and sets the member to null. A builder that still has a queued or in-progress job then callscreateGraphicsPipelines/createComputePipelineswith the destroyed handle.This is a use-after-destroy. It also violates the Vulkan rule that
vkDestroyPipelineCachemust not run while the cache is in use (external synchronization). The trigger is a release build, on a host where the cache is kept on disk (not MoltenVK), with writable lists, and with listed pipelines still building at exit. The result can be a crash or driver corruption at shutdown.Before the cache is destroyed, stop and join the builders in
Save(). Another option is to not destroy the cache inSave()and let the destructor do it afterm_builders.clear().Proposed fix
✅ Confirmed as addressed by @mohamed-rekiba
@coderabbitai[bot] on GitHub · 2026-10-13 00:22 UTC · original · edited 2026-10-13 00:48 UTC
On
src/graphics/host_gpu/renderer/pipeline/shaders.cppline 518 (outdated):🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Use one push-constant range per graphics layout, and push with exactly its stage flags. The graphics layout defines ranges whose stage flags differ from the
stageFlagsthat the draw path passes topushConstants. VUID-vkCmdPushConstants-offset-01796 requires each push to include every stage of every range that overlaps the pushed bytes. The emulated-mesheVertexpush and the shader-side depth-boundseFragmentpush break this rule. With--vulkan-validation, the debug callback exits on the first such draw. Without validation, the behavior depends on the driver.src/graphics/host_gpu/renderer/pipeline/shaders.cpp#L506-L518: create one range{stages, 0, NativePushConstantSize}, wherestagesiseVertex | eFragmentfor emulated mesh andgraphics_stagesotherwise. Storestagesin a newPipelineCache::Pipeline::push_constant_stagesfield.src/graphics/host_gpu/renderer/renderDraw.cpp#L1163-L1169: push the depth-bounds parameters withpipeline.push_constant_stagesinstead ofeFragment. To do this, pass thePipelinetoApplyDepthBoundsByShaderin place of the layout. Pushmesh_draw_dataat Line 1465 with the same flags.📍 Affects 2 files
src/graphics/host_gpu/renderer/pipeline/shaders.cpp#L506-L518(this comment)src/graphics/host_gpu/renderer/renderDraw.cpp#L1163-L1169✅ Confirmed as addressed by @mohamed-rekiba
@ -1570,1 +1756,4 @@});if (state.single_lane) {return atomic;}@coderabbitai[bot] on GitHub · 2026-10-13 00:22 UTC · original · edited 2026-10-13 00:48 UTC
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 10370
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 24832
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 9829
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 3441
Use a count of one for active single-lane invocations.
EmitAppendConsumecounts bits from the ballot even whenstate.single_laneis true.ValueEmitContext::Ballotreplicates the predicate into all four 32-bit words in single-lane mode. The current code counts two words, so an active invocation producescount == 64instead of1. The atomic counter therefore advances by 64 and returns incorrect append/consume slots.Suggested fix
✅ Confirmed as addressed by @mohamed-rekiba
@coderabbitai[bot] on GitHub · 2026-10-13 00:22 UTC · original · edited 2026-10-13 00:48 UTC
On
src/graphics/shader/recompiler/ir/passes/ReadLaneElimination.cppline 261 (outdated):🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Wrap the
V_WRITELANEselector into the wave size.The
laneargument is already reduced with% program.wave_size. The immediate branch comparesselector.U32() == lanewithout that reduction. A selector such as 35 in wave32, or 67 in wave64, then misses its lane. The read returns the value from below the write. The final lowering pass at Line 385 does apply% program.wave_size, so the two paths disagree.selector.U32()also exits if the immediate is notU32.SearchChainchecks the type first; this code does not.The dynamic branch also compares the selector without masking it to the wave size.
Proposed fix
Apply the same masking to the dynamic selector at Lines 388-389.
📝 Committable suggestion
✅ Confirmed as addressed by @mohamed-rekiba
@coderabbitai[bot] on GitHub · 2026-10-13 00:22 UTC · original · reviewed
Actionable comments posted: 6
🧹 Nitpick comments (1)
ℹ️ Review info
⚙️ Run configuration
e40dc2fd-3195-4993-b97b-2373fe190f6c📥 Commits
Reviewing files that changed from the base of the PR and between
df5b9b92beand d2627578db2cffc47e199cb75212eab6bdcf7732.⛔ Files ignored due to path filters (2)
docs/screenshots/ps5-07.jpgis excluded by!**/*.jpgdocs/screenshots/ps5-08.jpgis excluded by!**/*.jpg📒 Files selected for processing (172)
.github/scripts/unit-tests.sh.github/workflows/build.yml.gitignoreCMakeLists.txtREADME.mdsrc/common/cacheFolder.hsrc/common/emulatorConfig.cppsrc/common/emulatorConfig.hsrc/common/fileLock.cppsrc/common/fileLock.hsrc/common/hash.hsrc/common/perfCounters.cppsrc/common/perfCounters.hsrc/common/profiler.hsrc/graphics/guest_gpu/command_processor/commandProcessor.hsrc/graphics/guest_gpu/command_processor/constRam.hsrc/graphics/guest_gpu/command_processor/pm4Handlers.cppsrc/graphics/guest_gpu/graphicsRun.cppsrc/graphics/guest_gpu/graphicsRun.hsrc/graphics/guest_gpu/tile.cppsrc/graphics/host_gpu/bufferChunk.hsrc/graphics/host_gpu/cacheCollection.hsrc/graphics/host_gpu/copyWorkers.hsrc/graphics/host_gpu/depthSnapshotPlan.hsrc/graphics/host_gpu/graphicContext.hsrc/graphics/host_gpu/guestWriteLog.hsrc/graphics/host_gpu/hostCapabilities.hsrc/graphics/host_gpu/hostLowering.hsrc/graphics/host_gpu/imageReadback.hsrc/graphics/host_gpu/pageManager.cppsrc/graphics/host_gpu/pipelineUse.hsrc/graphics/host_gpu/queueCommits.hsrc/graphics/host_gpu/rangeSet.hsrc/graphics/host_gpu/readbackPlan.hsrc/graphics/host_gpu/regionDefinitions.hsrc/graphics/host_gpu/regionManager.hsrc/graphics/host_gpu/renderer/cache/bufferCache.cppsrc/graphics/host_gpu/renderer/cache/bufferCache.hsrc/graphics/host_gpu/renderer/cache/samplerCache.cppsrc/graphics/host_gpu/renderer/cache/samplerCache.hsrc/graphics/host_gpu/renderer/cache/streamBuffer.cppsrc/graphics/host_gpu/renderer/cache/streamBuffer.hsrc/graphics/host_gpu/renderer/cache/textureCache.cppsrc/graphics/host_gpu/renderer/cache/textureCache.hsrc/graphics/host_gpu/renderer/commandScheduler.cppsrc/graphics/host_gpu/renderer/commandScheduler.hsrc/graphics/host_gpu/renderer/context.cppsrc/graphics/host_gpu/renderer/depthRenderTarget.cppsrc/graphics/host_gpu/renderer/dynamicState.cppsrc/graphics/host_gpu/renderer/fenceRetirement.hsrc/graphics/host_gpu/renderer/image/colorMetadataFill.hsrc/graphics/host_gpu/renderer/image/image.cppsrc/graphics/host_gpu/renderer/image/image.hsrc/graphics/host_gpu/renderer/image/imageView.cppsrc/graphics/host_gpu/renderer/masterSemaphore.cppsrc/graphics/host_gpu/renderer/masterSemaphore.hsrc/graphics/host_gpu/renderer/pipeline/descriptors.cppsrc/graphics/host_gpu/renderer/pipeline/descriptors.hsrc/graphics/host_gpu/renderer/pipeline/pipelineCache.cppsrc/graphics/host_gpu/renderer/pipeline/pipelineCache.hsrc/graphics/host_gpu/renderer/pipeline/programList.hsrc/graphics/host_gpu/renderer/pipeline/shaderResourceBarrier.cppsrc/graphics/host_gpu/renderer/pipeline/shaderResourceBarrier.hsrc/graphics/host_gpu/renderer/pipeline/shaders.cppsrc/graphics/host_gpu/renderer/render.hsrc/graphics/host_gpu/renderer/renderCompute.cppsrc/graphics/host_gpu/renderer/renderContext.cppsrc/graphics/host_gpu/renderer/renderContext.hsrc/graphics/host_gpu/renderer/renderDraw.cppsrc/graphics/host_gpu/renderer/sync.cppsrc/graphics/host_gpu/submitPlan.hsrc/graphics/host_gpu/vertexSubgroupProbe.cppsrc/graphics/host_gpu/vertexSubgroupProbe.hsrc/graphics/host_gpu/vulkanCommon.hsrc/graphics/host_gpu/writeHeat.hsrc/graphics/host_gpu/writeWatchSet.hsrc/graphics/presentation/overlayQueue.hsrc/graphics/presentation/systemOverlay.cppsrc/graphics/presentation/videoOut.cppsrc/graphics/presentation/videoOutResolution.hsrc/graphics/presentation/window/deviceSuitability.cppsrc/graphics/presentation/window/deviceSuitability.hsrc/graphics/presentation/window/swapchain.cppsrc/graphics/presentation/window/vulkanWindow.cppsrc/graphics/presentation/window/window.cppsrc/graphics/presentation/window/windowInternal.hsrc/graphics/shader/capturedVertexLayout.hsrc/graphics/shader/recompiler/ShaderRecompiler.cppsrc/graphics/shader/recompiler/ShaderRecompiler.hsrc/graphics/shader/recompiler/backend/spirv/SpirvEmitter.cppsrc/graphics/shader/recompiler/backend/spirv/SpirvEmitter.hsrc/graphics/shader/recompiler/backend/spirv/softFloat64.hsrc/graphics/shader/recompiler/backend/spirv/spirvEmitterAlu.cppsrc/graphics/shader/recompiler/backend/spirv/spirvEmitterAluHelpers.cppsrc/graphics/shader/recompiler/backend/spirv/spirvEmitterAnalysis.cppsrc/graphics/shader/recompiler/backend/spirv/spirvEmitterCapturedReplay.cppsrc/graphics/shader/recompiler/backend/spirv/spirvEmitterFloat64.cppsrc/graphics/shader/recompiler/backend/spirv/spirvEmitterFlow.cppsrc/graphics/shader/recompiler/backend/spirv/spirvEmitterHelpers.cppsrc/graphics/shader/recompiler/backend/spirv/spirvEmitterImage.cppsrc/graphics/shader/recompiler/backend/spirv/spirvEmitterInstructions.hsrc/graphics/shader/recompiler/backend/spirv/spirvEmitterInternal.hsrc/graphics/shader/recompiler/backend/spirv/spirvEmitterMemory.cppsrc/graphics/shader/recompiler/backend/spirv/spirvEmitterMesh.cppsrc/graphics/shader/recompiler/backend/spirv/spirvEmitterModule.cppsrc/graphics/shader/recompiler/backend/spirv/spirvEmitterProgram.cppsrc/graphics/shader/recompiler/frontend/translate/Memory.cppsrc/graphics/shader/recompiler/ir/Program.cppsrc/graphics/shader/recompiler/ir/ShaderIR.hsrc/graphics/shader/recompiler/ir/Value.cppsrc/graphics/shader/recompiler/ir/Value.hsrc/graphics/shader/recompiler/ir/passes/ReadLaneElimination.cppsrc/graphics/shader/recompiler/ir/passes/ReadLaneElimination.hsrc/graphics/shader/recompiler/ir/passes/ResourceMaterialization.cppsrc/graphics/shader/recompiler/ir/passes/ResourceMaterialization.hsrc/graphics/shader/recompiler/ir/passes/ShaderInfoCollection.cppsrc/graphics/shader/recompiler/ir/passes/SrtWalker.cppsrc/graphics/shader/recompiler/ir/passes/SrtWalker.hsrc/graphics/shader/rectListShader.cppsrc/graphics/shader/shader.cppsrc/graphics/shader/shader.hsrc/graphics/shader/shaderCompiler.hsrc/graphics/shader/shaderPixelParameter.cppsrc/graphics/shader/triangleVertexValueShader.cppsrc/graphics/shader/triangleVertexValueShader.hsrc/kernel/pthread.cppsrc/launcher/forms/configuration_edit_dialog.uisrc/launcher/include/configuration.hsrc/launcher/src/configuration.cppsrc/launcher/src/configurationEditDialog.cppsrc/launcher/src/mainDialog.cppsrc/libs/agc.cppsrc/libs/agc.hsrc/libs/controller.cppsrc/libs/network.cppsrc/libs/padInput.cppsrc/libs/padInput.hsrc/loader/runtimeLinker.cppsrc/loader/x64InstructionEmulator.cppsrc/loader/x64InstructionEmulator.hsrc/main.cpptests/BufferChunkTests.cpptests/CacheCollectionTests.cpptests/CacheFolderTests.cpptests/ConstRamTests.cpptests/ControllerSettingsTests.cpptests/CopyWorkersTests.cpptests/DepthSnapshotPlanTests.cpptests/DeviceSuitabilityTests.cpptests/FenceRetirementTests.cpptests/FileLockTests.cpptests/GuestWriteLogTests.cpptests/HostLoweringTests.cpptests/ImageReadbackTests.cpptests/KernelFileSystemTests.cpptests/MemoryTrackerTests.cpptests/MetadataFillTests.cpptests/OverlayQueueTests.cpptests/PadInputTests.cpptests/PerfCountersTests.cpptests/PipelineUseTests.cpptests/ProgramListTests.cpptests/QueueCommitsTests.cpptests/ReadbackPlanTests.cpptests/ResourceMaterializationTests.cpptests/ShaderRecompilerComputeTests.cpptests/SoftFloat64Tests.cpptests/SubmitPlanTests.cpptests/VideoOutResolutionTests.cpptests/WriteHeatTests.cpptests/macosSse4aTests.cpptests/shaderCfgTests.cpp💤 Files with no reviewable changes (2)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
@mohamed-rekiba on GitHub · 2026-10-13 00:46 UTC · original
On
src/graphics/guest_gpu/graphicsRun.cppline 1285 (outdated):Kept as is. The draw path's barrier is for buffers only and is unchanged from
main. Storage image writes are ordered by each image's own access tracking:Image::GetBarriersemits a barrier for a repeated write or a write followed by a read of the same image, soHasShaderMemoryWriteshere would add a second, global barrier for images.@mohamed-rekiba on GitHub · 2026-10-13 00:46 UTC · original
On
src/graphics/host_gpu/renderer/pipeline/pipelineCache.cppline 1849 (outdated):Fixed in 4f614606.
Save()now writes the driver cache once and keeps it alive (m_driver_cache_saved). The destructor stops and joins the builders, then destroys the cache. Stopping the builders inSave()was not used: draws can still run after the window loop ends, and a draw that waits for its pipeline would never return.@mohamed-rekiba on GitHub · 2026-10-13 00:46 UTC · original
On
src/graphics/host_gpu/renderer/pipeline/shaders.cppline 518 (outdated):Fixed in 4f614606. A graphics layout has one range over every stage it serves (vertex + fragment for an emulated mesh draw), kept as
Pipeline::push_constant_stages. The descriptor push data, the mesh draw records and the depth-bounds push all use exactly those stages.@ -1570,1 +1756,4 @@});if (state.single_lane) {return atomic;}@mohamed-rekiba on GitHub · 2026-10-13 00:46 UTC · original
Fixed in 4f614606: in a one-lane stage the count is 1, and the atomic runs only for an active invocation. New test: a one-lane GDS append has no
OpBitCount(shaderCfgTests).@mohamed-rekiba on GitHub · 2026-10-13 00:46 UTC · original
On
src/graphics/shader/recompiler/ir/passes/ReadLaneElimination.cppline 261 (outdated):Fixed in 4f614606. Both paths of the one-lane lowering wrap the selector into the wave: an immediate with
% wave_size, a dynamic one with& (wave_size - 1), and an immediate that is not U32 takes the dynamic path. New test: a selector of 67 writes lane 3. The nitpick is in too: the missing-parameter test checks that neither shader hasOpUndef.@coderabbitai[bot] on GitHub · 2026-10-13 00:48 UTC · original
On
src/graphics/host_gpu/renderer/pipeline/shaders.cppline 518 (outdated):@mohamed-rekibaThanks for the fix in4f614606. One graphics push-constant range and matchingPipeline::push_constant_stagesat each push address the stage-flag mismatch.If you found this review helpful, would you consider giving us a shout-out on X?
Thank you for using CodeRabbit!
✅ Review thread resolved.
You are interacting with an AI system.
@ -1570,1 +1756,4 @@});if (state.single_lane) {return atomic;}@coderabbitai[bot] on GitHub · 2026-10-13 00:48 UTC · original
@mohamed-rekibaThanks for the fix. The supplied code usescount == 1in single-lane mode and gates the atomic withexec. This addresses the incorrect counter increment. The reportedshaderCfgTestsregression test covers the unwantedOpBitCountemission.If you found this review helpful, would you consider giving us a shout-out on X?
Thank you for using CodeRabbit!
✅ Review thread resolved.
You are interacting with an AI system.
@coderabbitai[bot] on GitHub · 2026-10-13 00:48 UTC · original
On
src/graphics/shader/recompiler/ir/passes/ReadLaneElimination.cppline 261 (outdated):@mohamed-rekibaThanks for the fix. The supplied code confirms that both lowering paths wrap the selector and checkType::U32before callingU32(). The selector-67 regression test covers the reported mismatch.If you found this review helpful, would you consider giving us a shout-out on X?
Thank you for using CodeRabbit!
✅ Review thread resolved.
You are interacting with an AI system.
@coderabbitai[bot] on GitHub · 2026-10-13 00:48 UTC · original
On
src/graphics/host_gpu/renderer/pipeline/pipelineCache.cppline 1849 (outdated):@mohamed-rekibaThanks for the clarification. The supplied code confirms thatSave()keepsm_driver_cachealive and usesm_driver_cache_savedto prevent repeated saves. The destructor stops and joins the builders before it destroys the cache. This addresses the use-after-destroy finding.Keeping the builders active after
Save()also avoids blocking later draws that wait for pipeline completion.✏️ Learnings added
If you found this review helpful, would you consider giving us a shout-out on X?
Thank you for using CodeRabbit!
✅ Review thread resolved.
You are interacting with an AI system.
@ -0,0 +29,4 @@A pipeline that is not in the list is built on a worker, and the list keeps it for the next run.A draw whose pipeline is still building:@coderabbitai[bot] on GitHub · 2026-10-13 01:10 UTC · original
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Clarify pipeline-miss outcomes.
A picture-only draw receives a grace wait and can appear if its pipeline becomes ready during that wait. A reset-target draw can also be left out after its frame-budget wait expires because control falls through to the same grace-wait path. The current wording can therefore mislead readers about when these draws appear.
Suggested fix
@coderabbitai[bot] on GitHub · 2026-10-13 01:10 UTC · original
On
docs/performance/README.mdline 39 (outdated):📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Correct the cache-memory description.
BUFFER_CHUNK_SIZEdescribes allocation coverage, not eviction. Collection uses candidate-count limits and device-memory-budget thresholds, not 2 MiB eviction chunks or a 2 MiB memory limit. Idle texture collection keeps GPU-written images, but memory-pressure collection can free them.Suggested fix
📝 Committable suggestion
@coderabbitai[bot] on GitHub · 2026-10-13 01:10 UTC · original · reviewed
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
5aaf2904-594f-46b7-aa09-e8c397164725📥 Commits
Reviewing files that changed from the base of the PR and between 4f614606ca7ea3323753f0700b3db50affdd0635 and 278f574c89f64cd18c591f30016ec23e48238040.
⛔ Files ignored due to path filters (3)
docs/performance/draw-cpu-path.svgis excluded by!**/*.svgdocs/performance/performance-overview.svgis excluded by!**/*.svgdocs/performance/pipeline-timeline.svgis excluded by!**/*.svg📒 Files selected for processing (1)
docs/performance/README.mdIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 5 remain after this review.
@coderabbitai[bot] on GitHub · 2026-10-13 01:17 UTC · original
On
src/graphics/guest_gpu/graphicsRun.cppline 1285 (outdated):@mohamed-rekibaThanks for clarifying. The draw-path barrier covers buffer writes.Image::GetBarriersseparately orders repeated storage image writes and subsequent reads of the same image. My suggestion would add a redundant global barrier for those image accesses. I withdraw the finding.✏️ Learnings added
✅ Review thread resolved.
You are interacting with an AI system.
@maok625 on GitHub · 2026-10-13 17:53 UTC · original · edited 2026-10-13 18:41 UTC
Is there a build to test your PR ? I would like to test it on my Apple M4. I wanted to also ask if building the artifacts went successful for you, as I encountered some fails when building a merged version of your commits on my fork. Here are the logs :
Test project /Users/runner/work/KytyPS5-PullsTry/KytyPS5-PullsTry/_Build/macos
Start 1: emulator_user_name_cli
1/63 Test #1: emulator_user_name_cli .................. Passed 3.80 sec
Start 2: emulator_user_name_too_long
2/63 Test #2: emulator_user_name_too_long ............. Passed 0.12 sec
Start 3: emulator_present_mode_cli
3/63 Test #3: emulator_present_mode_cli ............... Passed 0.12 sec
Start 4: emulator_present_mode_invalid
4/63 Test #4: emulator_present_mode_invalid ........... Passed 0.10 sec
Start 5: emulator_video_out_resolution_cli
5/63 Test #5: emulator_video_out_resolution_cli ....... Passed 0.11 sec
Start 6: emulator_video_out_resolution_invalid
6/63 Test #6: emulator_video_out_resolution_invalid ... Passed 0.11 sec
Start 7: ime_dialog
7/63 Test #7: ime_dialog .............................. Passed 0.31 sec
Start 8: shader_cfg
8/63 Test #8: shader_cfg .............................. Passed 3.73 sec
Start 9: scalar_provenance
9/63 Test #9: scalar_provenance ....................... Passed 1.15 sec
Start 10: device_suitability
10/63 Test #10: device_suitability ...................... Passed 0.31 sec
Start 11: host_lowering
11/63 Test #11: host_lowering ........................... Passed 0.34 sec
Start 12: write_heat
12/63 Test #12: write_heat .............................. Passed 0.38 sec
Start 13: perf_counters
13/63 Test #13: perf_counters ........................... Passed 0.38 sec
Start 14: guest_write_log
14/63 Test #14: guest_write_log ......................... Passed 0.30 sec
Start 15: copy_workers
15/63 Test #15: copy_workers ............................ Passed 1.11 sec
Start 16: readback_plan
16/63 Test #16: readback_plan ........................... Passed 0.29 sec
Start 17: pipeline_use
17/63 Test #17: pipeline_use ............................ Passed 0.30 sec
Start 18: submit_plan
18/63 Test #18: submit_plan ............................. Passed 0.25 sec
Start 19: cache_collection
19/63 Test #19: cache_collection ........................ Passed 0.30 sec
Start 20: buffer_chunk
20/63 Test #20: buffer_chunk ............................ Passed 0.29 sec
Start 21: depth_snapshot_plan
21/63 Test #21: depth_snapshot_plan ..................... Passed 0.25 sec
Start 22: video_out_resolution
22/63 Test #22: video_out_resolution .................... Passed 0.30 sec
Start 23: queue_commits
23/63 Test #23: queue_commits ........................... Passed 0.27 sec
Start 24: bench_script
24/63 Test #24: bench_script ............................ Passed 0.27 sec
Start 25: cache_folder
25/63 Test #25: cache_folder ............................ Passed 0.25 sec
Start 26: file_lock
26/63 Test #26: file_lock ............................... Passed 1.25 sec
Start 27: image_page_table
27/63 Test #27: image_page_table ........................ Passed 0.30 sec
Start 28: metadata_fill
28/63 Test #28: metadata_fill ........................... Passed 0.28 sec
Start 29: fence_retirement
29/63 Test #29: fence_retirement ........................ Passed 0.32 sec
Start 30: memory_tracker
30/63 Test #30: memory_tracker .......................... Passed 1.52 sec
Start 31: page_manager
31/63 Test #31: page_manager ............................ Passed 19.68 sec
Start 32: archive_file
32/63 Test #32: archive_file ............................ Passed 0.45 sec
Start 33: trophy_system
33/63 Test #33: trophy_system ........................... Passed 0.34 sec
Start 34: avplayer_file
34/63 Test #34: avplayer_file ........................... Passed 1.93 sec
Start 35: bit_array
35/63 Test #35: bit_array ............................... Passed 0.26 sec
Start 36: lru_cache
36/63 Test #36: lru_cache ............................... Passed 0.22 sec
Start 37: program_list
37/63 Test #37: program_list ............................ Passed 0.24 sec
Start 38: soft_float64
38/63 Test #38: soft_float64 ............................ Passed 1.44 sec
Start 39: shader_vertex_metadata
39/63 Test #39: shader_vertex_metadata .................. Passed 0.30 sec
Start 40: resource_materialization
40/63 Test #40: resource_materialization ................ Passed 0.36 sec
Start 41: resource_tracking
41/63 Test #41: resource_tracking ....................... Passed 0.55 sec
Start 42: event_queue_lifetime
42/63 Test #42: event_queue_lifetime .................... Passed 0.43 sec
Start 43: kernel_file_system
43/63 Test #43: kernel_file_system ......................Subprocess aborted***Exception: 4.90 sec
KernelFileSystemTests: failed: create hidden Vulkan test window
Start 44: sync_on_address
44/63 Test #44: sync_on_address ......................... Passed 1.40 sec
Start 45: audio_out2_port
45/63 Test #45: audio_out2_port ......................... Passed 0.38 sec
Start 46: audio_out_timing
46/63 Test #46: audio_out_timing ........................ Passed 1.54 sec
Start 47: ngs2_sampler
47/63 Test #47: ngs2_sampler ............................ Passed 0.33 sec
Start 48: pad_haptics
48/63 Test #48: pad_haptics ............................. Passed 1.52 sec
Start 49: controller_settings
49/63 Test #49: controller_settings ..................... Passed 0.35 sec
Start 50: pad_input
50/63 Test #50: pad_input ............................... Passed 0.27 sec
Start 51: player_seats
51/63 Test #51: player_seats ............................ Passed 0.25 sec
Start 52: gamepad_quit
52/63 Test #52: gamepad_quit ............................ Passed 0.24 sec
Start 53: image_readback
53/63 Test #53: image_readback .......................... Passed 0.28 sec
Start 54: overlay_queue
54/63 Test #54: overlay_queue ........................... Passed 0.25 sec
Start 55: const_ram
55/63 Test #55: const_ram ............................... Passed 0.25 sec
Start 56: save_data_memory
56/63 Test #56: save_data_memory ........................ Passed 0.43 sec
Start 57: png_enc
57/63 Test #57: png_enc ................................. Passed 0.28 sec
Start 58: ces
58/63 Test #58: ces .....................................***Failed 1.29 sec
CesTests:108: CesMbcsStrToUtf8Str(context, test.source.data(), test.limit, &consumed, output.data(), output.size(), &produced) == test.error
CesTests:109: consumed == 1 && produced == 1
CesTests:112: CesMbcsStrGetUtf8Len(context, test.source.data(), test.limit, &consumed, &produced) == test.error
CesTests:113: consumed == 1 && produced == 1
Start 59: save_data_dialog
59/63 Test #59: save_data_dialog ........................ Passed 0.29 sec
Start 60: http_uri_parse
60/63 Test #60: http_uri_parse .......................... Passed 0.80 sec
Start 65: virtual_memory_allocation
61/63 Test #65: virtual_memory_allocation ............... Passed 1.57 sec
Start 66: guest_red_zone_patcher
62/63 Test #66: guest_red_zone_patcher .................. Passed 0.15 sec
Start 84: macos_sse4a
63/63 Test #84: macos_sse4a ............................. Passed 0.34 sec
Errors while running CTest
97% tests passed, 2 tests failed out of 63
Total Test time (real) = 62.15 sec
The following tests FAILED:
43 - kernel_file_system (Subprocess aborted)
58 - ces (Failed)
Error: Process completed with exit code 8.
@mohamed-rekiba on GitHub · 2026-10-13 19:57 UTC · original · edited 2026-10-13 20:01 UTC
@maok625 I have fix the tests issues and you can download the build releases from here
KytyPS5-2026-10-13-c9013e6
@maok625 on GitHub · 2026-10-13 22:34 UTC · original
Good news, it starts up games on my M4, thanks !
@mohamed-rekiba on GitHub · 2026-10-14 12:36 UTC · original
Hey @Nmzik,
Please let me know if you have any comments
@jamesst20 on GitHub · 2026-10-14 17:34 UTC · original
Vice City - Apple M4 Pro 48GB - MoltenVK version 1.4.2
@Nmzik on GitHub · 2026-10-15 21:13 UTC · original · edited 2026-10-15 21:20 UTC
@mohamed-rekiba Thanks for detailed info (before/after). I will definitely take a look. Some changes can easily benefit non macOS platforms
Pull request closed