2,694 Commits over 669 Days - 0.17cph!
Update(tests): even more edge case unit tests
- escaped double quotes
- split escaped double quotes
Tests: ran tests
Update(tests): add a couple more edge case unit tests
- torn nested string
- single quotes nested
- torn single quote nested
- Added a whitespace to first nested string in all tests to validate trimming
Tests: ran unit tests
Add(tests): add StringExtensionTests
Currently only covers SplitQuotesStrings. Baseline allocs - 33allocs, 1.8KB
Tests: ran tests
Optim: fully remove function temporary
Saves 1 alloc (63 allocs, 3.9KB)
Tests: ran tests
Update(tests): add case or command with no args
Tests: ran unit tests
Optim: don't recreate temporary klass and function substrings, fetch the full name at the end
Saves 2 allocs (64 allocs, 4.2KB)
Tests: ran tests
Optim: skip lowercasing command class and function names
We rely on case-insensitivite comparator for map lookups - saves 2 allocs (66 allocs, 4.3KB)
Tests: ran unit and perf tests
Update(tests): also validate uppercase commands are resolved properly
Tests: ran unit tests
New(tests): add basic Facepunch.Console.CommandTests tests(3 unit, 1 perf)
Need it before I start optimizing out allocs
Tests: ran tests, they pass and show allocs (68 allocs, 4.4KB total for test string)
Bugfix: ensure UseMutexPool feature switch catches all pool calls
Now pools lazy-update their internal storage when toggling the feature switch - this makes sure calls are routed to the right pools
Tests: played on craggy, slapped breakpoints into Take and made sure no calls were made to fallback/new pool when new/fallback mode was set
Clean(tests): same for UpdateNetGroup
Tests: ran unit tests
Clean(tests): same for MovePlayer
Tests: ran unit tests
Clean(tests): UpdateSubs injectLastVis default to true now
Tests: ran unit tests
Bugfix(tests): sae for TestNew_KillSleeperAndReconnect
Tests: ran all ServerOcclusionGroupTests - they pass
Bugfix(tests): same fix for TestNew_KillSleeperAndReconnect
Tests: ran TestNew_KillSleeperAndReconnect
Bugfix(tests): properly setup player's last visibility state in TestNew_Reconnect
Tests: ran unit test - it passes
Bugfix: NetworkVisibilityGrid.IsVisibleFrom no longer reports visibility between hardcoded groups
Failed unit tests by making Limbo group visible from main grid cell
Tests: ran TestNew_MoveOther, no longer fails
Bugfix(tests): fix incorrect setup of TestNew_KillSleeper
We weren't injecting lastSeen records for other subscribers, which tripped up assertions
Tests: ran unit test
▊█▋▅█▅▌▅▋▄▇▆▌ █▄▆▄ ▍▅▉▆ ▆▍▊▆█▊▄▉▄▉▇▉▄█▄▆ ▉▅██▄▊▊▊▌▌▅▉▆ ▆▇▆▍▊█▉ ▅▌ ▍█▌▉▋█▄▊▌▄ ▄▍▉▌▋▅ ▆▉▆▍█▊▉▉▇▋▆ ▄▊█ ▍▉▅▋▅▍▊▉▍▅ ▉▅▍▅█▆▋▉▉▌█ ▌▆▅▇▇ ▍▆▅▍ ▆▄ ▄▇▄▉ ▌▋▊▋█▋ ▊▄▇▇▊▇▄▅▄▊█▋▍▅▆▄▇▌ ▍▇ ▇ ▄▍ ▉▅ ▉▅▍ █▍▌ ▋▇ ▋▆▆▋▄▊▊▆▄▌ ▊▉ ▆█▍▇▋▇▌▌▅▇ ▊▄▋▅▄▅▅ ▊▄▋ ▋█▆▌▍▆ ▇▆▆▅ ▆▅▇▄▌▅
Update: pool.usemutexpool convar (default 0) to optionally revert to original pool
- ran codegen(skipping protobuf due to mac weirdness)
Tests: booted into craggy and toggled the var. Checked pool capacities via pool.print_memory
Update: add debug only sentinel writing to playerInfos and playerSegments
Tests: ran unit tests
Bugfix: fix tick being written to an index that didn't account for growth
Tests: all unit tests pass
Update(tests): add TestTickGrowth2Players that also validates tick consistency after growth
Tests: ran new test - fails as expected
Bugfix: avoid out of bounds read when growing array due to tick capacity exhaustion
Tests: ran unit tests - no more failures (but there's an extra known bug)
Bufix(tests): TestTickGrowth - ensure all ticks are interpolated by picking a better reset point
Tests: ran unit test
Update(tests): Adding TestTickGrowth - accumulates ticks past capacity
This one catches out of bounds read during growth (but not the one expected)
Tests: ran unit test
Update(tests): add TickInterpolatorCache stress unit test
Slams 10k operations on it(add/remove player, move player, reset) - doesn't catch issues
Tests: ran new test
Buildfix: missing files from previous submit
Clean: minor reaorganization + comments
Tests: unit tests
Clean: store buffer[pos] accesses in a variable
Just for easier code reading
Tests: ran unit tests
Clean(editor): get rid of Pool.UseSafetyChecks flag
- lock-free Pool can't ensure associated hashset consistency, so we can't use that anymore
- checking for null on Take call doesn't seem to make sense since awhile back
Tests: ran tests. StressTestMT doens't sporadically fail anymore
Optim: couple micro optims
- rewrite a couple branches into branchless logic
- inlined IsTurnTicketSameIgnoreProgress
- got rid of module via use of MADD
- added extra comments for explaining what's going on
AllocDeallocST: 2.82 -> 2.77ms for 10k allocs. Tiny, but every bit helps
Tests: ran unit and perf tests
Update: replace member variables with cacheline sized counterparts
Didn't see any notable change in perf tests, but wouldn't hurt
Tests: ran tests
Update(tests): add a couple tests
- Perf: AllocDeallocMPSCAtomicCounter
- Unit: TestAllocWhenEmpty, TestFreeWhenFull
Tests: ran tests
Update: resubmit original pool mutex implementation in a separate branch
Makes it easy to test across extra benchmarks
Tests: ran unit and perf tests
Bugfix: rewrite fuzzy circular buffer to prevent gradual poisoning of the pool (hurt my brain)
Lost a bunch of perf(loses a bit to CircularBuffer in some tests, wins in others), but the spills are now minimal.
AllocDeallocST - Avg: 0.79ms, Created: 0 Spilled: 0
AllocDeallocMTShortLived - Avg: 4.03ms, Created: 22(0.07%) Spilled: 25(0.08%)
AllocDeallocMTLongLived - Avg: 3.84ms, Created: 0 Spilled: 0
AllocDeallocMPSC - Avg: 3.96ms, Created: 0 Spilled: 0
Tests: ran all unit and perf tests.
Update: use volatile int instead of Volatile.Read(ref long), as the latter is an expensive CAS
Existing code was using non-volatile read of long, but I don't think it's safe
Tests: ran perf tests
Bugfix: fix extreme spillage in high-contention perf test
Turns out I needed to do an extra spin, whoops
Tests: ran unit and perf tests
Update(tests): add 4, 8, 16, 32 task scenarios (previously was just 32) for pool perf tests
Tests: ran perf tests
Update(tests): expand AllocDeallocMTShortLived to optionally simulate busywork
We're never going to be just slamming the pool(or if we do - we shouldn't as that's overhead). This makes the test closer to real world.
Tests: ran perf test
Clean(tests): consolidate pool create-spilled code into Utils.MeasureAndPrint
Tests: ran perf tests