CS2 Input Lag Explained - The Monolithic 64 Hz Client Simulation Tick Stalls the Render Thread

Everything about latency. This section is mainly user/consumer discussion. (Peer-reviewed scientific discussion should go in Laboratory section). Tips, mouse lag, display lag, game engine lag, network lag, whole input lag chain, VSYNC OFF vs VSYNC ON, and more! Input Lag Articles on Blur Busters.
User avatar
unconnected
Posts: 68
Joined: 08 Oct 2023, 19:52

Re: CS2 Input Lag Explained - The Monolithic 64 Hz Client Simulation Tick Stalls the Render Thread

Post by unconnected » Today, 17:13

Ok, I finally had time to analyze CS2 thread calls with Superluminal.

Image

The core issue is a synchronous Fork-Join barrier inside the engine: the Main Thread splits jobs across worker threads and has to wait for all of them to finish before proceeding with the render pipeline. While it waits, the GPU simply runs out of commands to draw.

Look at the Blocking stack in the bottom left:
  • engine2.dll: Source 2’s core loop coordinating the current frame
  • scenesystem.dll: The scene renderer trying to process visibility, objects, and draw lists
  • tier0.dll!0xA4CF5: (The bottleneck) Valve’s low-level threading library. This function is an explicit job barrier that forces the thread to stop and wait for worker tasks to complete
  • KernelBase.dll & ntdll.dll (ZwWaitForMultipleObjects): CS2 explicitly asks the Windows kernel to put the thread to sleep until all handles are signaled
  • ntoskrnl.exe: Windows suspends the thread into the Synchronization state.
The scene thread sits frozen for up to 1.9ms (on my rig) on each barrier. It only wakes up when the slowest worker in the pool finishes its job.
Because this happens synchronously inside scenesystem.dll, render submission completely stops. The GPU finishes rasterizing in ~1.2ms, runs out of draw calls, and goes into starvation (MsGPUWait).

This confirms it’s an internal synchronous design flaw inside Source 2, not driver overhead or system latency.
Archaic engine design from a multi-billion dollar company... insane.

Any ideas on how to push this publicly to force Valve to decouple the render queue from the main thread?

cuaderno
Posts: 28
Joined: 02 Feb 2025, 20:26

Re: CS2 Input Lag Explained - The Monolithic 64 Hz Client Simulation Tick Stalls the Render Thread

Post by cuaderno » Today, 18:47

Thanks for doing the research.

Best way to get publicity is on r/cs2 or r/globaloffensive, but be ready to deal with all sorts of insane posters. If you just want to bring attention of this to Valve, the e-mail should be sufficient. Decoupling doesn't seem easy to implement.

User avatar
kyube
Posts: 1027
Joined: 29 Jan 2018, 12:03

Re: CS2 Input Lag Explained - The Monolithic 64 Hz Client Simulation Tick Stalls the Render Thread

Post by kyube » Today, 19:12

unconnected wrote: ↑
Today, 17:13
This confirms it’s an internal synchronous design flaw inside Source 2, not driver overhead or system latency.
Archaic engine design from a multi-billion dollar company... insane.
It's too soon to call it a flaw of the entire engine.
Have you tried profiling Deadlock, Dota2 & CSGO?
In CSGO, you have more choices in terms of tick rate, assuming that game follows the same pattern CS2 has.
More data using different system configurations would also be satisfactory.
Ideally .etl-based data.

Post Reply