Engine robustness: fewer crashes and hangs around deaths, portals and out-of-memory, plus better crash evidence #8
Loading…
Reference in a new issue
No description provided.
Delete branch "AwfulWaffle/RynthCore:engine-robustness"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closed by the author: this change is already in main (checked against
418d80b). Thanks for taking it in.What players and bot users saw
What changes
World transitions (deaths, portals, teleports, non-adjacent landblock jumps)
AcMainThreadQueue.MustQueue). Render-thread actions (ImGui panels, EndScene plugin calls) used to slip around the queue and run into a world AC was tearing down. They now queue or wait like everything else.Frozen main thread
GetEngineStatusJson(mainThreadFrozen,mainThreadStallMs,pluginTicksPausedMs) and on the heartbeat line.Crash and out-of-memory evidence
<install>\Dumpsbefore the box shows, and the newest 3 are kept. The dump writes start and end markers in the log, and the launcher holds its wedge-kill while a dump is in progress, up to 15 min per client.RynthCore.SehTrampoline.dll(native\SehTrampoline\Build-SehTrampoline.ps1) deployed with the engine. With an older DLL the engine logsRC_FlushCrashLog not exportedand skips the flush.ExitProcess(-1)is no longer treated as a crash.Logs\dumps\clr_*.dmp) as crashes, alongsidecrash_*.dmp.Appraisals
Diagnostics
valargest=) and the transition refusals (qrej=). Free and largest address space are also logged around each plugin load and unload.Notes for review
Loader.c(ConfigureCrashDumps,Logs\dumps\clr_*.dmp) and keepscreatedump.exeand the DAC inPublish-EngineCoreClr.ps1. This PR adds no second setup and leavesClr.cand the publish script exactly as they are on main.CastSlot. Main's per-cast_castStopWaitNotedbecomesCastSlot.StopWaitNoted, and it is reset before theVolatile.Writethat publishesPending. The queue time is also written withVolatile.Write, because a plain 64-bit store can tear on x86 and the drain reads it without the lock.ActionRing<T>, soStopQueuedAtOrBeforewalks it through a new consumer-onlyActionRing.TryPeekAt. An entry's time is taken before the ring's lock, so two producers can land slightly out of time order. The walk therefore checks every queued entry (at most 256) instead of stopping at the first newer one. The check is a pure helper,CastStopRules.AnyStopAtOrBefore, compiled intotools\EngineRobustnessTests; its out-of-order test fails when the walk is changed to stop at the first newer entry.tools\check_offthread_mutators.pynow accepts the gate's own shape, anif (that opens withAcMainThreadQueue.MustQueue((optionally after oneflag ||), sinceMustQueuecallsMainThreadGuard.IsOnMainThread()itself. The search skips//comments, so a commented-out gate does not count; the check is still textual, so a string literal that spells the shape would. The checker reports the same 2 findings as on main (DecalBridgeHost.PostNotice,LargeAddressAlignmentPatch.TryWriteHighByte), both already present there.PluginContractVersionstays at 80.Testing
Built and run at this branch's head, with main (
b0f9d74) as the baseline. Every commit on the branch builds and passes EngineRobustnessTests on its own.dotnet build RynthCore.sln -c Releasetools\EngineRobustnessTests(new)native\SehTrampoline\tests\Run-CrashLogFilterTests.ps1(new)native\SehTrampoline\Build-SehTrampoline.ps1 -NoDeploytools\EngineSettingsTeststools\FlightRecorderTeststools\PanelTextScaleTeststools\LoaderReloadCapTeststools\LoaderStagingTeststools\UsageStatsTeststools\check_offthread_mutators.pyOn main, UsageStatsTests failed 2 checks ("a second check the same day sends nothing", "next day: one more") when run after 23:00 UTC: the test's "same day" is
DateTime.UtcNow.AddHours(1), which is the next UTC day at that hour. After 00:00 UTC this branch passes 39/39, the newclr_*.dmpcheck included.Not tested here: a live client. Nothing in this PR has been run in game from this branch.
🤖 Generated with Claude Code
Pull request closed