⚡ Bolt: Optimize bounds checking in VirtualMemory hot loops - #86
manupawickramasinghe wants to merge 2 commits into
Conversation
Refactored `while` loops in `TryValidateRange`, `CopyFromRegions`, and `CopyToRegions` to use standard `for` loops bounded by `span.Length`. This pattern allows RyuJIT to statically verify loop boundaries and elide runtime array bounds checks, enhancing performance and safety during sequential Guest MMU access. Included required performance optimization inline XML documentation. All relevant tests pass and `dotnet format` verifies compliance. Co-authored-by: manupawickramasinghe <73810867+manupawickramasinghe@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Updated `ExportModelEqualityTests` in `SysAbiExportGeneratorTests.cs` to pass the newly added `bool preferLle` parameter to the `ExportModel` constructor via `Activator.CreateInstance`. This resolves the `System.MissingMethodException` encountered during GitHub CI test runs. Co-authored-by: manupawickramasinghe <73810867+manupawickramasinghe@users.noreply.github.com>
📦 Build artifacts —
|
| Platform | Download |
|---|---|
| Windows (win-x64) | sharpemu-win-x64-1ad764f |
| Linux (linux-x64) | sharpemu-linux-x64-1ad764f |
| macOS (osx-x64) | sharpemu-osx-x64-1ad764f |
From build run #198. Downloads require a GitHub login and expire after 90 days.
💡 What
Refactored
whileloops iterating overSpan<T>inTryValidateRange,CopyFromRegions, andCopyToRegionsto use standardforloops bounded byspan.Length.🎯 Subsystem & Bottleneck
src/SharpEmu.Core/Memory/VirtualMemory.cswhileloops with manual index tracking.📜 Git & Contributor Context
FindInsertionIndex).📊 Measured Performance Impact
🔬 Verification Checklist
dotnet test(All relevant memory tests passed)dotnet formatPR created automatically by Jules for task 14843958055350244017 started by @manupawickramasinghe