branchrust_reboot/main/baseplayer_serverupdateparallelcancel

146 Commits over 123 Days - 0.05cph!

3 Months Ago
Clean: fix formatting in BasePlayerr-Server.cs after merges Tests: none, trivial change
3 Months Ago
Merge: from main
3 Months Ago
Optim: skip running server occlusion between a pair of same players Saves us a bunch of extra dictionary entries, running extra occlusion jobs Tests: 2p sessions with UsePlayerUpdateJobs 0/1/2 on Craggy (with reconnects, kills, occlusion culling)
3 Months Ago
Bugfix: UsePlayerUpdateJobs 2 - skip trying to run occlusion checks between 2 same players A little slapdash, but it fixes editor-only CLIENT+SERVER bug of sometimes failing to notify player that they're awake. I'll exclude it from all modes next CL. Tests: loaded into 2k procgen world with UsePlayerUpdateJobs 2 set from the start 3 tmes - all times no weird zombie state
3 Months Ago
Optim: UsePlayerUpdateJobs 2 - reduce GC allocations around creating tasks Surprisingly, this was a struggle to test. Suspicious about a potential bug in unrelated part of UsePlayerUpdateJobs 1/2. Tests: 2p on Craggy and 2k Procgen map with UsePlayerUpdateJobs 2
3 Months Ago
Update: Unit tests that experiment with reducing allocation overhead of tasks Got the following reductions in the unit test: Garbage size: 1.1KB -> 0.3KB Alloc Calls: 11 -> 5 The remaining ones seem impossible to remove while still using System.Threading.Task. Tests: ran the new unit tests
4 Months Ago
Merge: from main
4 Months Ago
Bugfix: UsePlayerUpdateJobs 1/2 - extend the previous bugfix to the after-validate-recache logic - Also fixed resetting a bunch of per-player state during the recache step Tests: loaded map, hover-swim doesn't reproduce anymore (this time no exceptions)
4 Months Ago
Merge: from main
4 Months Ago
Clean: Replace persistent native WaterFactorCache with transient native allocs This is slower, but it's not the hot path and it simplifies code and avoids polluting intellisense. Tests: ran unit tests
4 Months Ago
Bugfix: UsePlayerUpdateJobs 1/2 - use world pos/rots when running water queries Previously it used local pos/transf, which was incorrect when parenting happened (excavator as example). Tests: jumped on excavator, validated that the water queries are running in the right location with UsePlayerUpdateJobs 2
4 Months Ago
Update: UsePlayerUpdateJobs 1/2 - for blocking-water parented players, store empty WaterInfo instead of garbage - Expanded TestWaterFactorsConsistency unit test to detect this case Not marking as bugfix as I couldn't cause any bugs by hacking code. Makes BasePlayer.GetWaterFactors consistent with BasePlayer.WaterFactor Tests: ran unit tests
4 Months Ago
Merge: from main Tests: compiles in editor, player cache unit tests
4 Months Ago
Bugfix: UsePlayerUpdateJobs 1/2 - use correct indices when filtering out disconnected players - Added a unit test to validate BasePlayer.FilterInvalidPlayers works correctly Tests: ran new unit test
4 Months Ago
Bugfix: avoid potential NRE after player kick for terrain violations - Rewrote logic to avoid extra IsRealNull checks - we now filter indices instead Tests: clipped in geometry with noclip
4 Months Ago
Bugfix: player-like entities that don't support occlusion replicate correctly with UsePlayerUpdateJobs 2 Old way of filtering them allowed them to use cache, which never contained them, so they were culled. Tests: 2p session on Craggy with UsePlayerrUpdateJobs 2 - spawned NPC and a bot, it didn't despawn
4 Months Ago
Merge: from main
4 Months Ago
Merge: from main Tests: none
4 Months Ago
Bugfix: IndexOutOfRange exception when updating player state cache Affected both UsePlayerUpdateJobs 1 and 2 Tests: none, simple change
4 Months Ago
Buildfix: unused variable warning-as-error Weird it didn't get detected outisde of my branch, but ah well Tests: built all modes in editor
4 Months Ago
Bugfix: reset OcclusionCanUseFrameCache on emergency disable of UsePlayerUpdateJobs Tests: none, trivial change
4 Months Ago
Clean: extract WaitForTasks Tests: editor compiles
4 Months Ago
Update: review fixes #1 - fix formatting in BasePlayer-Mission - Apply same mission fix from vanilla server flow - Comments around EventRecord.New and AzureAnalytics.OnPlayerTick warning to avoid scripting API to keep it thread save Got 2 more changes to make, then think it's ready Tests: compiles in editor
4 Months Ago
Update: make batching constants servervars - New vars are Server.SnapshotTaskBatchCount and Server.DestroyTaskBatchCount - factored out SendEntityDestroyMessages Tests: none, trivial changes
4 Months Ago
Bugfix: recycle filter buffers when there's no results UsePlayerUpdateJobs 2 only issue Tests: none, trivial change
4 Months Ago
Update: ran Generate Code Tests: none, trivial change
4 Months Ago
Update: Network++ UsePlayerUpdateJobs 2 can send packets out of order, which needs client-side change (see CL 128169) Tests: none, trivial change
4 Months Ago
Update: amending a comment for SendDemoTransientEntity Finished investigating, server-demos shouldn't be a problem for multithreaded networking Tests: none, trivial change
4 Months Ago
Merge: from main
4 Months Ago
Bugfix: players go back to sleep on disconnect on a server with UsePlayerUpdateJobs 2 This looked scarrier than it ended up being. One concern left to investigate - looks like I'llbe able to merge it in tomorrow Tests: 2p session on craggy with UsePlayerUpdateJobs 2
4 Months Ago
Optim: NetworkPositionTick - skip transform access Tests: none, trivial change
4 Months Ago
Optim: inline virtual calls in SendNetworkPositions and skip transform access Tests: 2p seesion on Craggy with UsePlayerUpdateJobs 2
4 Months Ago
Update: simplify SendNetworkPositions Decided against parallelizing with tasks as it looks to be taking only ~0.3ms on a 350pop server Tests: 2p session on Craggy with UsePlayerUpdateJobs 2
4 Months Ago
Clean: fix formatting Tests: none, trivial change
4 Months Ago
Bugfix: fix failing WaterLevel tests My ReadOnlySpan caused it, as we had hardcoded access to the global PlayerCache (which we don't use in tests). Tests: unit tests pass
4 Months Ago
Update: rename BasePlayer.playerCache member var -> BasePlayer.PlayerCache It was hiding the source of a bug, as func params have lower case name Tests: compiles in editor
4 Months Ago
Clean: prefer ReadOnlySpan<BasePlayer> instead of playerCache where possible Makes it easier to guess things at a glance. Tests: ran all relevant unit tests(discovered WaterLevelTests are failing, will investigate next) + 2p session on craggy with UsePlayerUpdateJobs 2
4 Months Ago
Update: demote PlayersToFinalize, PlayersToValidate, PlayersToRecache from being global caches Tests: 2p session on Craggy with UsePlayerUpdateJobs 2
4 Months Ago
Update: demote PositionChanges from being a global cache Tests: 2p session on Craggy with UsePlayerUpdateJobs 2
4 Months Ago
Merge: from occlusion_rework - Fix for occlusion queries not being commutative - Reenable occlusion frame cache and expand it's use to full frame - Server occlusion deduplicates queries - minor API restructure (might affect mods)
4 Months Ago
Update: disable bidirectional occlusion caching for now - Left a couple optim/safety todos This fixes the batch vs serial baseplayer occlusion consistency test, but one CantSee fails as expected. Going to fix it in a child branch, as that currently blocks more optims. Tests: ran relevant unit tests
4 Months Ago
Tests: TestLineOfSight - properly enforce non-job mode in relevant cases Tests: ran test sets
4 Months Ago
Tests: TestLineOfSight - validate reverse paths Looks like some occlusion checks might fail reverse paths. That's an uh-oh. Tests: ran above set, got a failure
4 Months Ago
Tests: ServerOcclusionTests - generated data set now contains similar pairs Interestingly, this trips up consistency test - will investigate Tests: ran TestOcclusionLineOfSight_Consistency
4 Months Ago
Tests: PerfOcclusionLineOfSight - reset internal recent visibility cache between runs Tests: ran the set
4 Months Ago
Tests: ServerOcclusionTests - standardize test naming Tests: ran test set
4 Months Ago
Tests: ServerOcclusionTests.GeneratePairs - generate correct number of pairs This further shrinks runtimes, as previously we generated waaaay too many Tests: ran ServerOcclusionTests set
4 Months Ago
Tests: optim TestOcclusionLineOfSight_PerfSerial/-Parallel By properly constructing and caching base players - tests now take less than a second. Tests: ran test set
4 Months Ago
Tests: add TestOcclusionLineOfSight_PerfSerial/-Parallel Both run for too long - likely due to how I create players for the tests. Will fix next Tests: ran the new set
4 Months Ago
Tests: TestOcclusionLineOfSight_Consistency - rset occlusion cache between serial and parallel runs Tests: ran the test set