Repository navigation
Log crashes to the diagnostics file; decode each MXP picture once - #68
Merged
Merged
Conversation
The window has no console, so an exception that ended the client loop, or escaped every thread, left no trace in client-diagnostics-*.log. The framework's log (where it reports what its loop and queued UI actions threw) is now forwarded from Warning up, and unhandled and unobserved exceptions are recorded for the life of RunLive, in both hosts. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_011SqUn5K4cB6cU9zp3HmVmF
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_011SqUn5K4cB6cU9zp3HmVmF
The row cache was keyed by pane width, so a picture re-sent on every look was fetched and decoded again after any resize, split or sidebar change, and looks landing before the first fetch returned each started their own. Decoded pictures are now kept per URL (64 MB, least recently used first) and a fetch under way is shared. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_011SqUn5K4cB6cU9zp3HmVmF
HarryCordewener
marked this pull request as ready for review
October 26, 2026 19:47
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.
Requested by Grave · project thread
Two changes from the same investigation.
Crashes reach
client-diagnostics-*.logA crash in the window left nothing in
client-diagnostics-*.log. The only record was in Windows Event Viewer and%LOCALAPPDATA%\CrashDumps. Three gaps are closed, inRunLive(shared by both hosts) and inSharpMUTermApp:ClientDiagnostics.Forward). The framework catches whatever its main loop and queued UI actions (EnqueueOnUIThread, behind ourOnUiThread) throw, then logs it to aLogServicethat writes nowhere unlessSHARPCONSOLEUI_DEBUG_LOGis set. When the loop dies it returns 1 and prints the stack to a console, which the window doesn't have.RunLiveruns (ClientDiagnostics.RecordUnhandled). This coversAppDomain.UnhandledException, which also catches an exception escaping Avalonia's UI thread, andTaskScheduler.UnobservedTaskException. Neither is marked handled. The file sink is unbuffered, so the line is on disk before the process ends.Runis logged before it reachesMainWindow's catch, which only writes toConsole.Error. A non-zero exit code is logged too.The crashes that prompted this were native faults on one machine and would not have reached any of these hooks. The same WebP decodes identically 680 times on Linux x64 with the same ImageSharp and runtime, and other programs on that machine crash with the same codes.
Each MXP picture is fetched and decoded once per session
InlineImageHost's cache held finished rows, keyed by presentation, pane width, box and URL. A room picture re-sent on everylookwas therefore fetched and decoded again after any resize, split or sidebar change. Looks that arrived before the first fetch returned each started their own fetch. Decoding is the expensive half: a desktop-sized WebP costs tens of milliseconds of SIMD work.Tests
CrashLoggingTests(Tui): framework errors are forwarded with their exception, framework debug/info output is not, nothing is forwarded after disposal, and a live app forwards its framework's log.InlineImageCacheTests(Tui): a second width doesn't refetch, three looks during one fetch share it, a failure is retried, and the budget keeps or drops a picture correctly.🤖 Generated with Claude Code
https://claude.ai/code/session_011SqUn5K4cB6cU9zp3HmVmF