Refactor Vulkan frame preparation and parallel command recording
Implement the discussed production renderer refactor: explicit frame preparation and stable draw inputs, bounded persistent recording workers with frame-slot-owned command pools, deterministic GPU pass/copy/upload ordering, central submission/completion, and safe reload/resize/shutdown. Reuse existing draw order, culling, resource upload and retirement infrastructure; keep Vulkan-specific work out of shared OpenGL frontend. Start from updated develop baseline on feature/vulkan-multithreaded-rendering. No commits/pushes requested. Acceptance: real parallel recording integrated into main Vulkan renderer without mutable resource work on workers; transparent/world/body/effect order preserved; dynamic updates/uploads/copies/readbacks retain dependencies and ownership; failures and lifecycle joined safely; focused regressions shown failing before fix, relevant builds/tests and headless native Vulkan validation pass. Performance claims require matched controls; no desktop windows. Implementation baseline fast-forwarded to origin/develop d95d7f74c; no local changes lost, commits or pushes. Main Vulkan graphics passes now prepare frozen raw-handle draw packets (including descriptor compatibility, push constants, geometry and draw arguments), then execute through persistent workers with worker-by-slot pools and deterministic ordered secondary ranges. Explicit frozen frame operation sequence retains light/AO/ripple compute, probe transitions, scene/depth/sky copies, GUI transfers/layers, composite and readbacks on coordinator. Existing separate shadow submission and final native GUI/composite remain coordinator-owned; background resource-upload publication/retirement infrastructure reused, not replaced with async transfer queues. Workers do no resource lookup/allocation/retirement or shader rebuild. Exceptions join all workers before propagation; teardown stops workers and waits GPU idle before releasing pools. Added inline/1โ8 worker configuration and separate preparation/actual recording metrics; worker elapsed spans explicitly not process CPU time. Verified milestone: warning-as-error Debug client build passes; renderer unit suite 746 passed/1 existing install-data skip. New real-headless regression compares byte-identical inline/one/four-worker output across 3 frame slots, AO, 128 overlapping transparent layers, skinned transparency, billboard/quad/display-light effects, rewritable vertices and shader reload. It failed with secondary execution removed and with chunk order reversed (4-worker image mismatch), passes restored including sync/shader-access/thread-safety validation. Final complete native Vulkan suite:54 passed/1 existing opt-in benchmark skip/0failures, executed under the private compositor with synchronization, shader-access and thread-safety settings. New regression images are byte-identical for inline/one/four-worker execution; disabling execute or reversing secondary order independently fails it. Plain Xvfb has no supported Vulkan presentation surface on this machine; retained failed evidence /tmp/prk-recording-window.log. Correct private Cage/wlroots headless compositor smoke confirmed HEADLESS-1 and isolated runtime/display; all18 actual window/resize/UI/lifetime tests pass under private compositor with validation. No desktop display connections or game launch. Logs /tmp/prk-recording-{build,client-build,unit,red,green,order-control,sync,private-window}.log. Reviewer tool aborted and user explicitly requested not using it again; it was not retried. Targeted self-review verified worker input immutability, descriptor/push compatibility, packet and command-pool reuse after fences, primary pass/copy order and lifecycle failure paths. Failure aggregation joins all workers and preserves primary/worker failures, including terminal cleanup; worker OOM/device-loss fault injection was not performed. Final validation on retained content:production Release client build0warnings/errors;graphics746passed/1existing install-data skip;client4660passed/216existing environment skips;allocator74passed/no skips;native Vulkan54passed/1existing benchmark skip. Logs /tmp/prk-recording-final-{release,unit,client,allocator,build,vulkan}.log. Whitespace check passes. README documents ownership, serial boundaries, worker configuration and profiling semantics. Automatic worker count is up to4 (inline on single-core); PRK_VULKAN_RECORDING_WORKERS accepts0โ8, with0 executing the identical prepared draws inline. No commits/pushes, desktop windows or game launch. Native AOT, non-Linux hardware/platforms and live gameplay remain unverified. No controlled throughput/latency or speedup claim made; old-serial versus new-preparation performance controls were not run. Implementation and relevant acceptance validation complete. User subsequently authorized branch preparation, commit, push and a WIP PR for main-GPU testing. Committed exactly the34 intended implementation/regression/documentation paths as b4128ed18 (refactor: Separate Vulkan preparation and parallel recording); no private performance harness, snapshots, game assets or results included. Existing dedicated feature/vulkan-multithreaded-rendering branch contains one session commit against freshly fetched origin/develop d95d7f74c, with no inherited unrelated changes. Pushed normally with its own upstream; working tree clean. All34 files match the previously validated snapshot, so no tests rerun solely for committing/pushing. Draft PR #3037: https://git.project-rk.com/prk/engines/pulls/3037 โ WIP: Parallel Vulkan command recording; head feature/vulkan-multithreaded-rendering at b4128ed181052a3b31e10f452ef100b127c22131, base develop, repository prk/engines. No speedup or mergeability approval claimed; main-PC/dedicated-GPU performance investigation remains the user's next step. Private benchmark data remain under .dev-data/recording-perf. Reviewer tool was not retried.
Checklist
3 of 3 complete- Separate scene draw preparation from Vulkan recording, including transparency/body/effect order and dynamic resource bindings.
- Verify rendering equivalence, picking, updates, lifetime/reload/resize/shutdown and worker failure with focused regressions and headless Vulkan validation.
- Integrate frozen frame passes with persistent frame-slot-owned recording workers and central copies/uploads/submission.
- Area
- Project Rubi-Ka
- Project
- engines
- Kind
- Feature
- Task ID
tsk_wrz5yzswfg- Updated