Repository navigation
Translate once, cache, use every core: a plan to boot like a PC game and reach 30 FPS on UE5 titles (Sword of the Sea numbers) #5436
Replies: 14 comments 28 replies
|
+1 |
|
A non-UE data point for the table: Astro's Playroom (PPSA01325) in its first level,
So here part 2 is the whole story: one thread at about 190 ms per frame with draw keys that almost never repeat, while the GPU is under 20% busy and pipeline creation plays no role. Dispatch keys mostly repeat, unlike your title. I have no trace digest for this run; it ended before the trace window. |
|
An overlap map for the draw-thread work, from Astro's Playroom in its first level (Linux, RTX 5080). I ported 8 of our older CPU cuts onto
Two of these are being built twice. If the authors of #494 / #5656 and #1202 / #1896 settle on one each, I'll measure that one rebased on current |
|
A third engine for part 2: DAVE THE DIVER (PPSA19115, Unity 6 IL2CPP) in game, underwater, on Windows 11, RTX 5060, Ryzen 7 5800X. It answers "which component of the draw key changes" for this title: the user-data words. Build: Who limits. Draw key churn. I added a local counter (not proposed) to
The cache cannot keep up with that. With the default 4096 entries it is full after 30 s and has evicted 67,833 entries by the end. With Worker profile ( Next, I'll measure #494 + #5656 and the #4943 / #5906 / #5609 stack on the same scene and post the numbers in those PRs. AI-assisted: yes |
|
@AlxcBTW a third shape for part 2: Stray (PPSA02100, Unreal Engine 4), with numbers from the queue-0 draw path. My setup is Linux (CachyOS, kernel 7.2.10, scx_lavd), Ryzen 9 9950X, RTX 3090 (NVIDIA 615.78.08), 3840x2160 and stock settings, standing still at the start of Dead City. The build is
What this means for 2.2, as far as I can tell:
A possible order, each step a PR that stays off by default until it is measured:
Is anyone already on 2.2's recording side? If not, I'd prototype a and b behind a switch, on top of #6946 rather than beside it, measured on Stray and one more title. The draw-key misses above are the part-2.1 question; I haven't split them by component yet. AI-assisted: yes (analysis and text with Claude Code; the runs are from my machine). |
|
NHL 26 (PPSA26785) β a second reference title, Frostbite engine, Windows Numbers from the same shape of problem on a non-UE5 title. I have been profiling this title for two days with APS5_PROFILE_DRAW=1, APS5_PROFILE_BUILD_AVG=1, APS5_PROFILE_COMMIT_DRAW=1, AP5_PIPELINED_DRAWS=4, APS5_RESOURCE_CACHE_ENTRIES=32768, APS5_DRAW_CACHE_ENTRIES=65536. Machine Windows 11, RTX 5080 (16 GB, NVIDIA 617.x), Ryzen 5 7500F (6C/12T), 32 GB DDR5, SATA SSD for the shader cache. Build: main-derived fork plus the EOP latch fix (#241429c45), PHI image tables (#d971ed011), the 16-slot sampledCache, update-after-bind descriptors (#6647), and a local guest-memory upload cache. Where the time goes Posting raw phase logs is fine; say the word and I attach the [draw] / [build-avg] / [lock] lines. |
|
Another UE5 data point for the plan: RoboCop: Rogue City - Unfinished Business (PPSA28329, bring-up #7578), in game after loading a save, standing in the first mission. Windows 11 26200, RTX 5070 Ti (NVIDIA 617.42), Ryzen 9 7900X3D, WinLibs GCC 15.2.0 r7, Release. Each section names the commit it was measured on; where a result comes from one run only, it says so. Where a frame goes (25ab351, Queue worker 0, sampled with
Per frame from the trace: GPU (6030b31 with the join change described at the end,
Single changes measured in game:
Two stability notes from the same runs: with a cold shader cache, the title often stops on Unreal's 120 s render-thread timeout before it reaches the menu; and one run ended with Unreal reporting an allocation of 40,142,176,256 bytes (38 GiB), so a size it computed was wrong. One CPU copy pattern worth knowing for part 4: on 6030b31 the title alternated between about 2.1 and 4.6 FPS from run to run. In the slow runs a writable buffer of about 5 MB was copied on the CPU about 1,000 times per second, because its allocation happened to cross an 8 MiB import window edge and What this suggests to me for the plan: on this title the CPU side (per-draw specialization and the drains between worker and committer) and the GPU side (module size and register pressure, then atomics and writes into host imports) have to move together; neither alone changes the frame time. I can run the same captures for any PR that targets these. Edited: the drain and AI-assisted |
NHL 26 (PPSA26785) β a second reference title, Frostbite engine, WindowsNumbers from the same shape of problem on a non-UE5 title (EA Sports Frostbite). I have been profiling this title with MachineWindows 11 Pro, RTX 5080 (16 GB, NVIDIA 617.x), Ryzen 5 7500F (6C/12T), 32 GB DDR5, NVMe SSD for shader cache. Build: Performance Progression (From 2.7 FPS to 12.7 FPS on the road to 30 FPS)
Where the remaining wall is (12.7 FPS -> 30 FPS)
Posting raw phase logs and trace dumps if needed. |
|
A Unity data point for part 2: Subnautica: Below Zero (PPSA02457), underwater at the lifepod, about 12 FPS. It has the same draw-key churn @Gashrod1 found on DAVE THE DIVER, and I split it one level further: why the stages of a data-only hit are prepared again. Setup: CachyOS, kernel 7.2.2, Ryzen 9 5950X, RX 6650 XT, RADV Mesa 26.2.4, Release. Build: Draw cache (
Why a data-only stage finds no variant (a local counter in the data-only branch of
#5609 on this scene: no FPS change (underwater 110-145 presents per 10 s, vs 120-125 without it), and the prepared-stage count stays about the same. Its patching covers buffer bases in descriptor tables in memory, while here the bases sit in the user words themselves. What I tried locally (not proposed): let a data-only candidate through when the differing used words are only the base words of an inline V# or T#. The stage's own value comes from its forwarded shader-data slot, and the other descriptor words must be equal. Then the
So on this Unity title the inline-base case is real but small. Most of the per-draw stage preparation comes from pointers the capture reads through, so relocating those with a content check (#4943 / #5609) looks like the part that pays here. I can rerun this scene with any branch that targets it. AI-assisted: yes (Claude Code) |
|
Hi @cookie42073-cmd, Thank you for the detailed feedback and for looking into the Frostbite / NHL 26 results! Here are the requested environment details, exact patch list, logs, and answers regarding #7048 and #7604: 1. Environment & Hardware Specifications
2. Fork Commit & Local Patch List (Branch
|
|
A small, non-engine data point for part 2, in a different shape from the titles above: SuperTuxKart (PPSA69421 00.001.000), a homebrew port that draws through ps5-opengl (Mesa) on top of AGC. Windows 11 26300, Ryzen AI 7 350 / Radeon 860M (driver 32.0.13058.8001), WinLibs GCC 15.2.0, Release, 1920x1080. It runs at 2β8 FPS depending on the build, against the 60 FPS it targets. Draws are cheap here, about 60β90 per frame. The draw cost the other titles hit is not what limits this one: the frame is a chain of CPU β GPU round trips. Who is busy. Tutorial race on
Per thread: committer 46.6, GPU 20.2, worker 13.1. Per frame there are 32 What the title thread does in that time. In the menu,
What doesn't help. Each of these stayed within noise:
Three alternating rounds in the menu: base 4.2β5.0 FPS, the label variants 4.7β5.3. So the 1 ms deadline before a pending label batch is submitted does not bound the wait. The title waits on the whole path from packet decode to label, not on when the store is submitted. #6658 (merged) ends the short sleeps when the GPU completes, about +5 % in the race and more in the menu. What this adds to the plan. The shapes above are draw-key churn on thousands of draws. This one is a title thread that hands work to the emulator and waits for its label tens of times per frame, with almost no overlap between the title, the worker, the committer and the GPU. Parallel translation (2.2) will not shorten that chain, because each segment ends at one of these waits. Making each round trip shorter would: decode β record β submit β GPU β label visible to the CPU. A wait census like the one 2.3 asks for would cover the CPU-side waits too. I can run an instrumented build on this title if anyone has a branch. Traces are available on request. AI-assisted: yes (Claude Code) |
|
Hi @cookie42073-cmd, Thank you for the detailed feedback and for pointing out the exact references for #7604! Apologies for the previous link issue β it got wrapped inside a preformatted code block, which broke the download. Here is the new archive reattached cleanly outside of any code blocks: What is included in this archive:
Next Steps on #7604:We noted the clarification regarding Please let us know if the download works properly now! |
|
A data point from GTA V (PPSA04264, RAGE), Windows 11, RTX 4090, i9-13900K, mostly on parts 1 and 3. Queue 0 in the open world (Los Santos, Cold boot (part 1). With an empty shader cache, about 85 % of the blocking compile time is Vulkan pipeline creation in the NVIDIA driver, and about 15 % is our translation. Two findings on the warm side:
SPIR-V size (part 3). Our modules are 100 to 400 times the ISA size. On one compute shader, compile time grows about linearly with instruction count. The shader is an FSR1 RCAS variant: 648 ISA words, about 118k SPIR-V words.
So the size work in part 3 also pays on cold boot, not only on GPU time. Ideas from other projects that I found nowhere in the repo:
AI-assisted: yes (Claude Code). The runs are from my machine. |
|
Coordination note before a PR: stage instances on current I'm going to port stage instances (serving a repeated draw stage shape from a patched result, on the queue worker) from Why this one: on our stack, switching it off costs about 9 % in Stray's Dead City scene (2 rounds, 20.5 β 18.7/18.5 fps, stock ini). It is the biggest single item left that Shape of the PR:
Overlap I know of:
If anyone is changing the same paths right now, or would rather it took a different shape, please say so here. I'll wait a day before opening it. Written with AI assistance (Claude Code); numbers measured on my machine. |
Uh oh!
There was an error while loading. Please reload this page.
Builds on #2242 (shader code compiled at registration, now going through
VK_EXT_graphics_pipeline_library) and #1612 (resolving T#/V#/S# on the GPU). It replaces neither. It puts them into one plan with a second reference title, and adds three pieces I haven't seen proposed yet:The idea
Proton/DXVK, Yuzu/Ryujinx and RPCS3 all got fast the same way. Translate once, cache what was translated, spread the remaining per-frame work over every core, and keep the per-frame path thin. AnyPS5 still does most of its work per frame:
A PS5 title hands us raw PM4, a level below Vulkan and D3D12, so the target API isn't the lever. What matters is how often we translate and on how many threads.
Where the time goes on Sword of the Sea (PPSA25344, UE5)
Windows 11, RTX 5070 Laptop (8 GB, NVIDIA 616.92), Ryzen AI 9 365, on AC. The build is
mainplus #5315 and the #290 / #4515 / #4517 import fixes, withAPS5_PROFILE_DRAW=1.VkPipelineCacheloaded (696 MiB)main(parl0v, RTX 3060; 4.9 earlier the same day); gameplay 6.6β6.8 FPSBoth walls, CPU at 130 ms and GPU at 90 ms, need roughly a 4Γ cut for 30 FPS. No single change gets there, which is why this is a plan rather than one PR.
Proposal: four parts
1. Boot like a PC game (pipelines)
#2242 covers graphics: libraries built at registration (phase B). On this title, compute dominates the load, so:
VK_KHR_pipeline_binarynext to the existingVkPipelineCache, if warm creation still costs about 1 s per pipeline after 1 and 2. The NVIDIA driver above advertises it. Binaries die with driver updates, so the manifest stays the source of truth.Target: warm boot, New Game β gameplay under 30 s, then under 10 s.
2. Translate once, on all cores (queue CPU time)
Target: queue 0 under 33 ms per frame, then under 16 ms.
3. GPU time close to a native build (shaders)
The PS5's GPU runs these shaders at the title's own frame rate, so most of the 90 ms is in what we emit.
Target: GPU frame under 33 ms (30 FPS), then under 16 ms.
4. Memory shaped for a PC
A discrete GPU can't be zero-copy with a unified-memory console, so the aim is to copy once and keep it resident:
Target: under 16 GB private for this title, no paging on 32 GB machines, VRAM within budget.
Order and how it's measured
Every step is a normal default-on PR against
main, measured with the Performance report form on the same machine and scene before and after. Milestones, in order:A non-UE5 title joins as the second reference once milestone 2 holds, so nothing gets tuned to one engine.
Risks
Asks
All reactions