chore(deps): upgrade target frameworks to .NET 8/10 and update dependencies - #24
chore(deps): upgrade target frameworks to .NET 8/10 and update dependencies#24samuelcaldas wants to merge 4 commits into
Conversation
Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
…packages - Update TargetFrameworks across projects to net8.0 and net10.0 - Upgrade SixLabors.ImageSharp to 2.1.13, ImageSharp.Drawing to 1.0.0, and Fonts to 1.0.1 - Upgrade Avalonia and Avalonia.Desktop to 0.10.22 - Upgrade MSTest.TestAdapter and MSTest.TestFramework to 3.8.2, Test.Sdk to 17.14.1 - Fix SixLabors.ImageSharp.Drawing DrawLine API usage in LunarLanderEnv - Fix 0D scalar shape bounds and sampling logic in Box space - Fix Avalonia application lifetime multi-instance reuse in StaticAvaloniaApp - Guard WinFormEnvViewer against headless/non-interactive modal dialog crashes Co-Authored-By: Claude Code <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
The PR introduces at least one likely compile-breaking API call in ImageSharp.Drawing usage and a potential deadlock path in Avalonia initialization that should be fixed before merging.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR upgrades the Gym.NET solution to modern .NET target frameworks and refreshes key NuGet dependencies (notably ImageSharp/Avalonia/test tooling), while adding compatibility fixes to keep environments/rendering and tests working under the newer stack.
Changes:
- Retargeted projects and test runners to
net8.0/net10.0(and*-windowswhere applicable) and updated major dependencies (ImageSharp, Avalonia, MSTest, coverlet, etc.). - Updated environment/rendering code for compatibility (Box scalar sampling, Avalonia multi-instance lifetime reuse, WinForms headless fallback, ImageSharp drawing call).
- Added documentation and repository metadata for the Gymnasium “source of truth” submodule (
refs/Gymnasium).
File summaries
| File | Description |
|---|---|
| tests/Gym.Tests/Gym.Tests.csproj | Updates test target frameworks and MSTest/coverlet package versions. |
| tests/Gym.Tests/Envs/Aether/LunarLanderEnvironment.cs | Updates deterministic baseline expectations for LunarLander tests under new runtimes. |
| src/Gym/Spaces/Box.cs | Fixes scalar Box sampling and avoids empty-mask sampling/indexing failures. |
| src/Gym/Gym.csproj | Retargets core library to net8/net10 and updates key package references. |
| src/Gym.Rendering.WinForm/Rendering/WinFormEnvViewer.cs | Adjusts WinForms viewer run-loop for headless/non-interactive environments. |
| src/Gym.Rendering.WinForm/Gym.Rendering.WinForm.csproj | Retargets WinForms rendering project to newer Windows TFMs. |
| src/Gym.Rendering.Avalonia/StaticAvaloniaApp.cs | Reworks Avalonia app lifetime/threading to support reuse across concurrent test instances. |
| src/Gym.Rendering.Avalonia/Gym.Rendering.Avalonia.csproj | Retargets Avalonia rendering project and updates Avalonia/ImageSharp package versions. |
| src/Gym.Environments/Gym.Environments.csproj | Retargets environments project and updates ImageSharp/ImageSharp.Drawing/Fonts/Annotations dependencies. |
| src/Gym.Environments/Envs/Aether/LunarLanderEnv.cs | Updates ImageSharp drawing call for helipad pole rendering. |
| docs/sot/gymnasium_sot_reference.md | Adds documentation describing Gymnasium as the canonical SOT and submodule placement. |
| CLAUDE.md | Adds repository guidance/documentation for contributor tooling and architecture. |
| .gitmodules | Adds refs/Gymnasium submodule definition pointing to Farama-Foundation/Gymnasium. |
Review details
- Files reviewed: 16/16 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| PointF flag2 = new PointF(x1, flag_y2); | ||
| // Pole | ||
| img.Mutate(i => i.DrawLines(new Rgba32(255, 255, 255), 1, new PointF[] { flag1, flag2 })); | ||
| img.Mutate(i => i.DrawLine(new Rgba32(255, 255, 255), 1f, new PointF[] { flag1, flag2 })); |
| var app = BuildAvaloniaApp(); | ||
| var appStartedEvent = new ManualResetEventSlim(false); | ||
| _thread = new Thread(() => { | ||
| _lifetime = new ClassicDesktopStyleApplicationLifetime() | ||
| { | ||
| Args = Array.Empty<string>(), | ||
| ShutdownMode = ShutdownMode.OnExplicitShutdown | ||
| }; | ||
|
|
||
| app.SetupWithLifetime(_lifetime); | ||
| _app = app.Instance; | ||
| _initialized = true; | ||
| appStartedEvent.Set(); | ||
| _lifetime.Start(Array.Empty<string>()); | ||
| }); | ||
| _thread.IsBackground = true; | ||
| _thread.Name = $"{nameof(AvaloniaEnvViewer)} {(string.IsNullOrEmpty(title) ? "" : $"-{title}")}"; | ||
| _thread.Start(); | ||
|
|
||
| appStartedEvent.Wait(); | ||
| } |
…ology - Add PRD.md and ROADMAP.md defining Gymnasium migration requirements and milestones - Add docs/README.md central documentation hub and developer index - Add architectural specifications for Core Lifecycle, Spaces, Wrappers, Vector Envs, and Rendering - Add docs/architecture/ontology.json machine-readable ontology graph for guide agents - Add Farama Gymnasium SOT mapping matrix and golden trajectory baseline specs - Add developer guides for testing, build automation, and custom environment authoring Co-Authored-By: Claude Code <noreply@anthropic.com>
|
@samuelcaldas This looks great and I would happily like to merge your work. To stay up to the standard:
Let me know if you would like to challenge my requirements or separate into more PRs. |
…ndate - Establish Farama Gymnasium (refs/Gymnasium) as mandatory SOT across Gym.NET - Enforce byte-perfect state transitions and pixel-perfect visual rendering - Add NumSharp >= 0.60.0 and 0.70.0 modernization policy per SciSharp maintainer feedback - Add Milestone 5 (PR SciSharp#24 review polish & NumSharp 0.60.0 upgrade) - Add Milestone 6 (Community PR SciSharp#13 CarRacing-v2 modernization backlog) - Add Milestone 7 (NumSharp 0.70.0 & Box2D robotics suite backlog) - Update SOT references, PRD specifications, and live docs hub Co-Authored-By: Claude Code <noreply@anthropic.com>
…rp 0.60.0 upgrade - Upgrade NumSharp across Gym, Gym.Environments, and examples from NumSharp.Lite 0.1.12 / 0.20.4 to NumSharp 0.60.0 - Adapt Spaces (Box, Discrete, MultiDiscrete, MultiBinary, GraphSpace, OneOfSpace, TextSpace) and Vector environments to NumSharp 0.60.0 indexing and API conventions - Harden Avalonia application lifetime in StaticAvaloniaApp with timeout and exception propagation - Fix ImageSharp Drawing API in LunarLanderEnv with safe line rendering and degenerate clipping guards - Modernize ReinforcementLearning examples and Parameter Runner to .NET 8 / .NET 10 - Re-verify 100% passing automated test suite (79/79) on both .NET 8.0 and .NET 10.0 - Update ROADMAP.md marking Milestone 5 as completed Co-Authored-By: Claude Code <noreply@anthropic.com>
|
@samuelcaldas |
Description
This PR modernizes the target frameworks and dependencies across the Gym.NET solution, upgrading from deprecated/out-of-support .NET Core 3.1 / .NET 6.0 to .NET 8.0 and .NET 10.0, while resolving security advisories in NuGet packages and fixing compatibility edge cases.
Key Changes
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>(andnet8.0-windows;net10.0-windowsfor WinForms / Test runners).SixLabors.ImageSharp: Upgraded to2.1.13(addresses GHSA-2cmq-823j-5qj8, GHSA-63p8-c4ww-9cg7, GHSA-65x7-c272-7g7r, etc.)SixLabors.ImageSharp.Drawing: Upgraded to1.0.0SixLabors.Fonts: Upgraded to1.0.1JetBrains.Annotations: Upgraded to2024.3.0Avalonia&Avalonia.Desktop: Upgraded to0.10.22Microsoft.NET.Test.Sdk: Upgraded to17.14.1MSTest.TestAdapter/MSTest.TestFramework: Upgraded to3.8.2coverlet.collector: Upgraded to6.0.4LunarLanderEnv: FixedDrawLinesignature in SixLabors.ImageSharp.Drawing.Box: Fixed 0-D scalar bounds checking and sampling empty slice exceptions.StaticAvaloniaApp: Fixed application lifetime reuse across concurrent multi-instance test runs.WinFormEnvViewer: Added headless/non-interactive fallback preventingShowDialogmodal exceptions on CI / Server environments.Farama-Foundation/Gymnasiumsubmodule reference underrefs/Gymnasium.Verification
Releaseconfiguration.MSTest).🤖 Generated with Claude Code