Conversation
Server-side performance work, split out from the Linux/containerization branch to keep that PR scoped to platform support and test automation. - SimdMath (src/Perpetuum/Simd): SIMD-accelerated heightfield math - HeightfieldMetadata + CompactPassabilityMask: per-tile height and passability metadata maintained from terrain updates - LineOfSight: heightfield precheck before the tile walk - Zone: idle throttling when a zone has no active work - TerrainUpdateMonitor: dirty-chunk tracking - compose: GC adaptation env for the server container - unit tests: SimdMath, CompactPassabilityMask, HeightfieldMetadata, ZoneHeightfield, ZoneIdleThrottling
The test called Monitor.Enter and then awaited while holding the lock; continuations reschedule onto the thread pool, so Monitor.Exit could run on a different thread and throw SynchronizationLockException (observed in CI). A dedicated holder thread now owns the monitor for the observation window; the test body awaits as before.
Server-side performance work, split out from the Linux/containerization branch to keep that PR scoped to platform support and test automation. - SimdMath (src/Perpetuum/Simd): SIMD-accelerated heightfield math - HeightfieldMetadata + CompactPassabilityMask: per-tile height and passability metadata maintained from terrain updates - LineOfSight: heightfield precheck before the tile walk - Zone: idle throttling when a zone has no active work - TerrainUpdateMonitor: dirty-chunk tracking - compose: GC adaptation env for the server container - unit tests: SimdMath, CompactPassabilityMask, HeightfieldMetadata, ZoneHeightfield, ZoneIdleThrottling
clouths
force-pushed
the
perf/simd-heightfield-idle-throttling
branch
from
September 28, 2026 17:25
217b961 to
b8b8081
Compare
…enPerpetuum/PerpetuumServer2 into perf/simd-heightfield-idle-throttling
Runtime on/off switch for the zone idle throttle so its CPU savings can be measured on a live server without a restart. - ZoneIdleThrottling: volatile on/off flag (default on), read on the zone tick thread, written by the command handler - Zone.Update: idle throttling applies only while the flag is set - zoneIdleThrottleSet: GameAdmin channel command (state 1 = on, 0 = off), registered next to the other channel commands, replies with the resulting state - test: throttle off updates units every tick at full tick time, re-enabling resumes once-per-idle-second with accumulated elapsed
The vanilla client reaches admin channel commands through the chat
command router (messages starting with # in a secured channel), not as
raw request commands. Replace the zoneIdleThrottleSet request command
and handler with a [ChatCommand("IdleThrottle")] in
AdminCommandHandlers, matching how the other channel commands work.
- #idlethrottle[,true|false] in a #secure'd channel toggles
ZoneIdleThrottling on the live server; replies with the new state
- tests: command parsing/application and router gating (command does
not run in an unsecured channel); both flag-mutating test classes
moved into the serial PerpetuumStaticsCollection
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Server-side performance work split out of #5 to keep that PR scoped to Linux support and test automation. Single commit on top of
linux+containerize.Contents
SimdMath(src/Perpetuum/Simd/) — SIMD-accelerated heightfield mathHeightfieldMetadata+CompactPassabilityMask— per-chunk height bounds / passability masks maintained incrementally from terrain updatesLineOfSight— heightfield precheck before the tile walkZone— idle throttling when a zone has no active work;TerrainUpdateMonitortracks dirty chunksUnit tests:
SimdMathTests,CompactPassabilityMaskTests,HeightfieldMetadataTests,ZoneHeightfieldTests,ZoneIdleThrottlingTests(22 tests).Dynamic plant changes
Plants express height and solidity in the
Blockslayer (TerrainExtensions.PutPlant/ClearPlantBlockingsetBlockingInfo.Plant+Heighton growth/harvest), so plant state changes flow throughTerrainUpdateMonitor→Heightfield.MarkDirtyTile/MarkDirtyArealike any other terrain mutation.Using the
#idlethrottleadmin commandSwitches the throttle on a live server (no restart) via the standard admin chat command system:
Notes: the sending character must have
AccessLevel.admin(the router's existing exact-equality check, value 14); the switch is global (all zones); every#command is logged toadminCommandLog.Open review items (from #5, apply to this code)
UpdateUnits(time)for NPC-only zones — breaks NPC time accumulation (PBS energy, timers, expiry). Reviewer suggested elapsed-time accounting; not yet applied.Validation
make test-unit: 210/210 pass, 0 warningsmake test-integration: 15 pass / 2 opt-in DTC skips