branchrust_reboot/main/parallel_validatemovecancel
90 Commits over 92 Days - 0.04cph!
Debug: Bring back player cache validation on release
Saw on release env today that it did trip up twice and prevented issues, so there's still value in it.
Tests: none, trivial change
Update: move some of the validate logic back to DEV_BUILD only
These routines do sanity checks, and for the last couple days of testing they haven't picked up anything.
Tests: on Craggy in editor with UsePlayerUpdateJobs 1
Clean: remove recently-added debugging logic
Tests: none, trivial change
Bugfix: safeguard against NRE induced kicked players in UsePlayerUpdateJobs
- Added a couple warning comments
If kick happens in the middle of player update loop, it would invalidate one of cached indexes and access a null.
Tests: forced a disconnect mid processing, no NRE caught
Merge: from main
Tests: none, no conflicts
Debug: add a latch to track player disconnects & removal during ServerUpdateParallel
Tests: unit tests + craggy in editor
Debug: adding progress tracking to FinalizeTickParallel to help track down origin of NRE
- also couple formatting fixes
Tests: used mode on Craggy in editor
Update: Another validity check for UsePlayerUpdateJobs
- validates player counts between PlayerCache and activePlayerList
Tests: played back server demo
Update: promote some UsePlayerUpdateJobs validation logic from DEBUG only to release
- Hidden behind EmergencyDisablePlayerJobs switch(on by default) and UsePlayerUpdateJobs(off by default)
- ValidatePlayerCache checks whole range instead of just up to player count (in case we got more than expected)
Tests: played back server demo
Update: turn server.EmergencyDisablePlayerJobs const into a servervar
Allows to run some extra validation
Tests: editor compiles
Test: test case for missing player removal from PlayerCache
Tests: ran the new unit test
Optim: reduce physics casts scheduling overhead when using batches
- Added a helper function that subdivides workloar across equal batches and potential for work stealing
On a 10player test case(40 ticks total), reduces parallel processing time from 0.2ms to 0.12ms. Still slower than serial execution 0.06ms.
Tests: unit tets
Optim: PlayerCache.ValidPlayers no longer allocates garbage
Tests: took snapshot on Craggy in editor to confirm
Merge: from main
Tests: none, no conflicts
Tests: add GamePhysics.CheckShhere, CheckCapsule and related consistency tests
Contains divergence cases that are constantly warned about - this is to document current behavior
Tests: ran unit tests
Update: Adding GamePhysics.CheckSpheres
Tests: unit tests (next submit)
Merge: from main
Tests: none, no conflicts
Update: Made GamePhysics.CheckCapsules and related consistent with CheckCapsule around sphere queries
- Added a defaulted param(true) that controls whether we should scan for sphere-like capsule queries or not
- Added a couple comments to clarify things
This adds ~1ms on 10k player perf test scenario, but should silence Unity's warnings
Tests: unit tests + staging demo playback
Update: GamePhysics.OverlapCapsules and OverlapSpheres now check for invalid commands and report errros
Tests: unit tests
Clean: added a comment expanding the reason for previous test
Tests: none, trivial change
Bugfix: ServerDemoPlayer - skip trying to spawn invalid prefabs from the server demo stream
Tests: played back server demo
Update: make ServerDemoPlayer complient with recent Protobuf changes
Tests: played back a staging server demo
Merge: from main
Tests: none, no conflicts
Clean: remove minor TODOs
- append Job to the last burst job without it
- Replace .Add with AddNoResize
Tests: uni tests
Merge: from main
Tests: none, no conflicts
Clean: fixing various whitespace issues and unused "using" statements
Tests: compiles in editor
Merge: from main
Tests: ran unit tests
Update: add profiling scopes to search-component parts of GamePhysics.CheckSphere<T> and CheckCapsule<T>
This is a slow path if there are many terrain/water volumes being hit
Tests: none
Tests: GamePhysics tests now contain cases with both water and terrain ignore volumes
This is kind of a bug fix, since it wasn't testing both paths, but ah well
Tests: ran unit tests
Clean: remove unused NativeList
Tests: none, trivial change
Clean: removing dead code
Tests: compiles
Update: add GamePhysics.TraceSphere and TraceSphereUnordered
- added GamePhysics.Sort(NativeArray...)
- replaced some inline code with TraceSphere call
Works the same as Trace(>0 radius) and TraceUnordered(>0 radius)
Tests: unit tests + staging demo playback
Update: add GamePhysics.TraceRays and TraceRaysUnordered
- works the same as Trace(0 radius) and TraceUnordered(0 radius)
- Replaced some inlined code with a call to TraceRays
Tests: ran unit tests
Optim: use Burst to generate commands in GamePhysics.OverlapSpheres
- It used to be there, but lost it during refactor
Tests: unit tests
Clean: minor changes to GamePhysics
- Renamed batch methods to be plural
- Split GamePhysics.CheckSphere<T> to separate OverlapSpheres
- added profiling scopes
Tests: unit tests
Update: move RemoveTerrainMask to GamePhysics
Tests: unit tests
Update: move GenerateCheckCapsuleQueries to GamePhyics and utilize
Tests: ran unit tests
Update: split GamePhysics.CheckCapsule<T>
- forbid CheckCapsule(batch) from returning ColliderHits - this is to better represent relationship to non-batched CheckCapsule
Tests: unit tests
Update: adding GamePhysics.CheckCapsule(batch)
Last factored out func - should be able to complete refactor shortly
Tests: none, will integrate to tests next
Bugfix: fixing native allocation leaks in tests
Tests: ran the tests with leak detections enabled
Update: GamePhysics.CheckCapsule<T>(batch) internalized layermask handling
There's room for optims, but not going to pursue them for now - will test later how the perf deteriorates with the new APIs.
Tests: ran relevant unit tests
Update: GamePhysics.CheckSphere(batch) now able to handle mask validation internally
- Renamed GamePhysics.IgnoreCollision to MasksToValidate (prev name could be misleading and confusing)
- undid sphere command building as that wasn't meshing well with MasksToValidate flow
- Added UtrilityJobs.GatherJob<T> (will need to go through other code and clean up similar/same jobs)
I still need to update GamePhysics.CheckCapsule, and replace inlined code with new versions
Tests: all relevant unit tests
Clean: simplify NativeList.CopyFrom<T>(ReadOnly)
Tests: none, trivial change
Update: Rewrite GamePhysics.HandleIgnoreCollision(batch) to allow for explicit control of what exclusion volumes to check
Tests: ran updated test
Update: adding GamePhysics.HandleIgnoreWater
- comes with it's own consistency test
Going to use those to try to refactor some of the existing code and hopefully shrink it
Tests: ran new test
Tests: adding tests that generate various "HandleIgnoreCollision" scenarios
- added TestHandleIgnoreTerrainConsistency
Covers both TerrainCollisionTrigger and WaterVisibilityTrigger.
Tests: ran the new unit test, checked that all paths all covered.