[b]???? Multithreading Setup Guide[/b]
[p align="justify"]In this update, we have completely rebuilt the multithreading system and provided multiple options for players to customize their threading strategy. These options can be adjusted through the \[Deep Profiler] (accessible from Performance Test (CPU), click the \[Deep Profile] button), or in the Advanced Multithreading Settings under the \[Settings]-\[Gameplay].[/p][p align="justify"] [/p][p align="justify"]During the testing phase, many players felt uncertain about how to configure the multithreading system. Below, we'll [b]share some commonly used setup plans[/b].[/p][p align="justify"] [/p][p align="justify"]For players who don't want to tweak too much, the default settings are usually fine. However, if the default setup causes some stuttering, you can try the following configuration instead:[/p][p align="justify"]● [b]Main Thread Binding Strategy:[/b] System Automatic Allocation[/p][p align="justify"]● [b]Worker Thread Binding Strategy: [/b]Can Use Any Available Core[/p][p align="justify"]● [b]Thread Frame Waiting Strategy:[/b] Mixed Waiting[/p][p align="justify"]● [b]Thread Phase Waiting Strategy:[/b] Mixed Waiting[/p][p align="center"][img src="https://clan.akamai.steamstatic.com/images/38718364/f8dd665081d4a3a1c6edb71f0edc0256453d88ef.png"][/img][/p][p align="justify"]This setup is highly versatile and works well for most situations.[/p][p align="justify"] [/p][p align="justify"]Now let's look at some more advanced setup plans:[/p][p align="justify"] [/p][b]???? Standard Architecture: [/b]Refers to CPUs without a distinction between performance and efficiency cores.
[p align="justify"] [/p][p align="justify"]If you are aiming for [b]better game performance[/b], you can try:[/p][p align="justify"]● [b]Main Thread Binding Strategy:[/b] Binds First Physical Core (Shares)[/p][p align="justify"]● [b]Worker Thread Binding Strategy: [/b]Each Thread Binds Each Logical Processor in Turn[/p][p align="justify"]● [b]Thread Frame Waiting Strategy:[/b] Mixed Waiting[/p][p align="justify"]● [b]Thread Phase Waiting Strategy:[/b] Mixed Waiting[/p][p align="justify"][img src="https://clan.akamai.steamstatic.com/images/38718364/8664d1f548eb85c918ab78309ee834b6cbf86ac3.png"][/img][/p][p align="center"] [/p][p align="justify"]If you often run [b]multiple applications at the same time[/b] and need to reserve performance for them, you can try:[/p][p align="justify"]● [b]Main Thread Binding Strategy:[/b] Binds First Physical Core (Shares)[/p][p align="justify"]● [b]Worker Thread Binding Strategy: [/b]Each Thread Binds Each Core except the last[/p][p align="justify"]● [b]Thread Frame Waiting Strategy:[/b] Mixed Waiting[/p][p align="justify"]● [b]Thread Phase Waiting Strategy:[/b] Mixed Waiting[/p][p align="justify"][img src="https://clan.akamai.steamstatic.com/images/38718364/5ffcaf8e51b54fece3df9369ddb12e65f2ea7f4e.png"][/img][/p][p align="justify"] [/p][b]???? Hybrid Architecture: [/b]Refers to CPUs that distinguish between performance cores and efficiency cores.
[p align="justify"] [/p][p align="justify"]If you are aiming for [b]better game performance[/b], you can try:[/p][p align="justify"]● [b]Main Thread Binding Strategy:[/b] Binds First P-Core (Shares)[/p][p align="justify"]● [b]Worker Thread Binding Strategy: [/b]Each Thread Binds Each P-core or Two E-cores in turn.[/p][p align="justify"]● [b]Thread Frame Waiting Strategy:[/b] Mixed Waiting[/p][p align="justify"]● [b]Thread Phase Waiting Strategy:[/b] Mixed Waiting[/p][p align="justify"][img src="https://clan.akamai.steamstatic.com/images/38718364/3a41c493ddbd937263b4bd6275dd847b342ce29a.png"][/img][/p][p align="justify"] [/p][p align="justify"]If you often run [b]multiple applications at the same time[/b] and need to reserve performance for them, you can try:[/p][p align="justify"]● [b]Main Thread Binding Strategy:[/b] Binds First P-Core (Shares)[/p][p align="justify"]● [b]Worker Thread Binding Strategy: [/b]Each Thread Binds Each Core Except the last[/p][p align="justify"]● [b]Thread Frame Waiting Strategy:[/b] Mixed Waiting[/p][p align="justify"]● [b]Thread Phase Waiting Strategy:[/b] Mixed Waiting[/p][p align="justify"][img src="https://clan.akamai.steamstatic.com/images/38718364/e7115640739fd59c00eb250830f6852674a7e358.png"][/img][/p][p align="justify"] [/p][p align="justify"]Above are general-purpose setups, but depending on your hardware, actual performance may vary — they are not guaranteed to be optimal.[/p][p align="justify"]Of course, for hardcore players who want to fine-tune and find the strategy that works best for them, we've also developed the [b]Custom Core binding Feature[/b]. This allows players to configure CPU core binding strategies for each individual thread.[/p][p align="justify"]You can find this feature in the Advanced Multithreading Settings. By setting the Thread Binding Strategy to [b]Custom Core Binding[/b], you will be able to modify the binding for each thread.[/p][p align="justify"][img src="https://clan.akamai.steamstatic.com/images/38718364/68d4dba23158f1c098f4c7913ce2dd44e2406a1c.png"][/img][/p][p align="justify"] [/p][p align="justify"][b]For example:[/b][/p][p align="justify"]Worker Thread Mask 00 means you are editing the settings for [b]Worker Thread 00[/b]. \[0] 11000000 0000 is the mask. \[0] is the thread group(this is usually set to 0, unless the thread count exceeds 64).[/p][p align="justify"]The binary mask after that indicates [b]the logical processors for this thread[/b]: 1 means it can run on that processor, 0 means it cannot.[/p][p align="justify"][b]In this example, Worker Thread 00 is allowed to run on the first and second logical processors(CPU0 & CPU1), but not on the others.[/b][/p][p align="justify"]This configuration can also be accessed through the [b]\[Deep Profiler][/b], by clicking into each thread for settings.[/p][p align="justify"][img src="https://clan.akamai.steamstatic.com/images/38718364/11e54b12add47e6e5096a8696d9d75486c243247.png"][/img][/p][p align="justify"]For players who want to further understand each option, we've also included [b]detailed explanations for every setting inside the Advanced Multithreading Settings[/b]. Players can reference these notes while experimenting with their configurations.[/p][p align="justify"] [/p][b]???? Technical Overview[/b]
[p align="justify"]During previous development and maintenance, we felt that the program's performance had reached its limits. If we implement the Vehicle System in the future, [b]the game may need to simulate thousands of additional components[/b], far beyond the capacity of the old multithreading system.[/p][p align="justify"]The old multithreading system had some major flaws by design: it supported very few task types, had high synchronization overhead at each stage, and splitting logic into forced multithreading often brought little performance gain while adding high maintenance costs. Hastily converting logic to multithreading could result in minimal performance improvement, while dramatically increasing code complexity.[/p][p align="justify"]That's why we've recently carried out a complete overhaul of Dyson Sphere Program's multithreading system, paving the way for the upcoming Vehicle System. Here's a closer look at the key features of this brand-new system.[/p][p align="center"] [/p][p align="justify"][b]1.Customizable Core Binding:[/b] In the old system, threads were automatically assigned by the operating system, a "black box" mechanism that often led to inefficient CPU utilization. Now, players can manually assign threads to cores, eliminating performance waste caused by system scheduling.[/p][p align="justify"][img src="https://clan.akamai.steamstatic.com/images/38718364/225dd403a9b97505aa780b67f3f1b4aa3948c05c.jpg"][/img][/p][p align="center"](Multithreading Strategy Customization Panel)[/p][p align="justify"] [/p][p align="justify"][b]2.Dynamic Task Distribution: [/b]Tasks are now evenly distributed across threads, and once a thread finishes its share, it can assist with tasks from other threads until the workload is balanced.[/p][p align="justify"][img src="https://clan.akamai.steamstatic.com/images/38718364/3a5e98f450a961b8b192aa4c1524ad63bbd5e5da.png"][/img][/p][p align="center"](Even if one thread starts slower, nearly all threads now finish at the same time)[/p][p align="justify"] [/p][p align="justify"][b]3.More Flexible Framework Design: [/b]We are no longer limited to "one task type per multithreading stage." Instead, logic can be broken into multiple tasks and flexibly combined, enabling "multi-task per stage." This flexible framework allows running multiple tasks in parallel; offloading logic that was previously locked to the main thread into other facilities' logic; pairing non-distributable tasks with distributable ones, making better use of idle CPU cycles.[/p][p align="justify"][img src="https://clan.akamai.steamstatic.com/images/38718364/ee699159d6e0fdbbbaabaae0606b56694aea6aa4.png"][/img][/p][p align="center"](Flow Monitors, Sprayers, and Logistics Station belt outputs running in parallel now take less than 0.1ms in total)[/p][p align="center"] [/p][p align="justify"][b]4.Multithreading Communication & Waiting Mechanism:[/b] The new system uses much faster spinlocks (~10ns) to link tasks, combined with a hybrid spin–blocking model: Spinlocks for very short execution times; and blocking locks for longer CPU-intensive tasks. This minimizes the response delay between one task ending and the next starting.[/p][p align="justify"][img src="https://clan.akamai.steamstatic.com/images/38718364/0139864062ebb0cf1f62d9bf78790594cce64367.png"][/img][/p][p align="center"](New multithreading wait times[dynamiclink href="https://store.steampowered.com/news/app/1366540/view/543361383085900510?l=english"][/dynamiclink] [img src="https://clan.akamai.steamstatic.com/images/38718364/7f209bbdb496cbb58446cf80a0d43fa68019e20f.png"][/img]
[p align="justify"]In the gaming community, you never know what surprises players will bring. During the public test, one player shocked us by running the multithreaded version of DSP on a Threadripper CPU![/p][p align="justify"] [/p][p align="justify"]Not only was it jaw-dropping, but it also brought us valuable feedback: our game didn't seem to support more than 64 threads. We quickly located and fixed this "happy problem."[/p][p align="justify"] [/p][p align="justify"]But the story doesn't end there! Facing such high-end hardware, we ran into another problem—our team didn't have such a "god-tier" equipment to test on. So, we made a bold decision: shamelessly asking the player if we could "borrow" his CPU power for a round of benchmarking.[/p][p align="justify"][img src="https://clan.akamai.steamstatic.com/images/38718364/f78fabe973a88ccfc68560df53a0a4707d9d6e72.png"][/img] (Performance on a 680W Universe Matrix Save)[/p][p align="justify"] [/p][p align="justify"]From the screenshot, the game didn't show much difference compared to consumer-grade CPUs. After some probing, we found the reason: the player's memory was DDR4-2666. The bottleneck was most likely the memory![/p][p align="justify"]So the big question is: how do we optimize further? And what platform should we use to validate those optimizations?[/p][p align="justify"] [/p][p align="justify"]Just as we were at a loss, we reached out to AMD. To our delight, they generously offered us a beast of a machine: a Threadripper PRO 9985WX system![/p][p align="justify"] [/p][p align="justify"]The specs alone are thrilling: 64 cores, 128 threads; Base clock 3.2 GHz, boost up to 5.4 GHz; Support for up to 8 memory channels. This is the ultimate testing platform tailor-made for us![/p][p align="justify"]???? Unfortunately, due to typhoon delays, this monster is still on its way to us. Please join us in waiting patiently for the unboxing moment![/p][p align="justify"][img src="https://clan.akamai.steamstatic.com/images/38718364/e62f191500c2ce10602a464245261ef84356c5e2.png"][/img][/p][p align="justify"]Once the "beast" arrives, we'll immediately begin in-depth optimization and testing on this extreme hardware. And if you're a Threadripper owner yourself, stay tuned—the optimizations we're preparing for you are coming soon! (Of course, consumer-grade CPUs will also see performance improvements.)[/p][p align="justify"] [/p][p align="justify"] [/p]