Skip to content

Gym.NET 1.0.1+rc1 - the first 1.0 on nuget.org: JAX environments, Make's wrappers, and the fixes the issues found - #27

Merged
Nucs merged 22 commits into
masterfrom
release/1.0.1
Dec 1, 2026
Merged

Nucs merged 22 commits into
masterfrom
release/1.0.1

Conversation

@Nucs

@Nucs Nucs commented Dec 1, 2026 •

Copy link
Copy Markdown
Member

Gym.NET 1.0.1+rc1 is the first 1.0 on nuget.org. It is 1.0.0+rc1, which shipped on GitHub only, plus Gymnasium's five JAX environments, a wrappers list on Gymnasium.Make, steps that allocate up to 406 times less, a page for each environment the showreel plays, and the fixes that checking every open GitHub issue against 1.0.0 turned up.
For the same seed and actions, every environment still returns Gymnasium v1.4.0's observations, rewards, flags and infos bit for bit, checked by a parity suite that runs Gymnasium inside the test process.
Coming from 0.2.0, read the 1.0.0 release notes and the migration guide first: 1.0 replaced 0.2's API, which followed gym before 0.26, with Gymnasium's.

🧭 Overview

  • 44 environment ids - the 39 of 1.0.0+rc1 and Gymnasium's five JAX environments, tabular (2) and phys2d (3), bit for bit with Gymnasium's jitted programs on JAX 0.12.1; Gym.NET now registers every id Gymnasium v1.4.0 registers with an environment class, and Gymnasium's 19 refusing ids raise its ImportError as Gymnasium's do.
  • 267 of Gymnasium v1.4.0's 301 public names - up from 237, the JAX functional environments' among them; the other 34: 24 Python-only (the JAX/PyTorch conversions' 21, the process workers' 2, pickling's 1), 9 provided another way by design, and AtariPreprocessing, out of scope.
  • Gymnasium.Make(id, wrappers: [...]) and env.Wrap(...) - any wrapper around an env of any type, closed over the env's own types as make closes its own layers.
  • Leaner steps - bytes a step: CarRacing 3,631,032 to 8,931, BipedalWalker 35,071 to 2,651, Pendulum 11,088 to 1,249, LunarLander 8,993 to 4,886, every result unchanged; re-measured, Gym.NET steps x1.9 (CarRacing) to x48.3 (Pendulum) as fast as Gymnasium.
  • Frames - InvertedPendulum's and InvertedDoublePendulum's MuJoCo frames now equal Gymnasium's byte for byte, and the Avalonia and WinForms windows show one screen pixel per frame pixel at any display scaling.
  • 2 fixes from the GitHub issues - #14: a .NET Framework or .NET 6 project gets NuGet's NU1202 at install again, not a build error; #22: closing a human-mode window with its X no longer throws from the next step or ends the app.
  • Documentation - 23 environment pages, every C# sample beside its Gymnasium twin, 25 example projects, and 12 published expert agents.
  • Release candidate 1, 1.0.1+rc1 - labelled as 1.0.0+rc1 was: NuGet ignores the +rc1 build metadata, so to every NuGet client these are the stable 1.0.1 packages.
  • 4,484 unit tests pass on net8.0, net10.0 and net11.0, in Debug and Release.
  • Published through trusted publishing - no API key stored anywhere, and no README embedded, so each version's README tab on nuget.org carries its release notes.
  • 1 new package on nuget.org - Gym.NET.Rendering.
  • 1 breaking change - a binary one: code compiled against 1.0.0+rc1 is rebuilt against 1.0.1+rc1.

📦 New NuGet Packages

  • Gym.NET.Rendering - pygame's drawing in managed C#, which Gym.NET.Environments depends on; on nuget.org for the first time.

Detailed Breakdown

Show All

📦 New NuGet Packages

  • Gym.NET.Rendering - the rasterizer behind the rgb_array frames, equal to pygame-ce's pixels, and Gymnasium's play; it shipped with 1.0.0+rc1 on GitHub and reaches nuget.org with 1.0.1+rc1, a dependency of Gym.NET.Environments.
  • Versions - the five packages share 1.0.1+rc1, which NuGet reads as 1.0.1. 1.0.0+rc1, which NuGet reads as 1.0.0, stays on its GitHub release only, so nuget.org goes from 0.2.0 to 1.0.1+rc1.

📊 Dashboards & Docs

  • Environment pages - 23 of them, for the environments the showreel plays and MountainCarContinuous (FrozenLake8x8 and BipedalWalkerHardcore are sections of their siblings' pages), in Gymnasium's order and more: an infobox playing the env's own seeded episode, a quick start, the episode's anatomy, how it works with a labelled frame, the spaces, rewards, start and end, every argument with its Python name, the info keys, rendering, code, agents, variants, parity and performance.
  • The site's Environments section - the gallery beside a sidebar of the pages; the sidebar remembers the sections a reader opens, and a click locks a cartridge so the pointer can cross to NOW PLAYING.
  • Samples in Gymnasium's shape - every reset deconstructs into (observation, info), every declaration names its type, and every C# sample with a Gymnasium counterpart has its Python twin beside it (the guides, the env pages, the landing page) or below it (the README), each run against Gymnasium when written.
  • Examples - 25 projects, one per environment the showreel plays plus MountainCarContinuous; each records its env page's media with --record, plays from the keyboard where a few keys allow, and twelve play published expert agents.
  • Expert agents - Farama's SAC, TQC and PPO experts for the eleven MuJoCo v5 environments and RL Zoo's TQC for BipedalWalkerHardcore, served from the tests as gym.net-agent/1 JSON, each playing an expert episode on Gym.NET's own engines in the unit tests.
  • README - a front page in NumSharp's shape: what Gym.NET is, the features, a still of each environment, a typed example beside its Gymnasium twin, the performance table, the packages.

✨ New APIs & Modules

  • Gymnasium.Make(..., wrappers: [...]) - every Make overload's last parameter: a list of wrappers outside every layer make adds, the first innermost, each closed over the types of the env beneath it; the typed Make<TObs, TAct> returns the outermost wrapper's types.
  • env.Wrap(options) - wraps any IEnv, however it was built, as Python's env = Wrapper(env, **kwargs); a failed wrap leaves the env as it was.
  • EnvOptions and WrapperOptions - every generated options record's base; a wrapper's record names its class, and WrapperOptions.Of(typeof(X<,>), kwargs) names any other, your own included.
  • Jax.Jit and Jax.Vmap - FuncEnv.Transform's JAX transforms for the four functional environments: a batched function maps state records and arrays over their leading axis, with params applied to every row.
  • Functional environments - CliffWalkingFunctional, BlackjackFunctional, CartPoleFunctional and PendulumFunctional on FuncEnv, with their params records (BlackJackParams, CartPoleParams, PendulumParams) and state records.

🧩 Environments

  • tabular/CliffWalking-v0, tabular/Blackjack-v0 - Gymnasium's JAX tabular environments: JAX 0.12.1's threefry2x32 keys, splits and draws, jit's x32 conversions and weak-type promotion written in C#, without JAX.
  • phys2d/CartPole-v0, phys2d/CartPole-v1, phys2d/Pendulum-v0 - Gymnasium's JAX classic control: XLA's compiled float32 programs in C#, fused multiply-adds exactly where XLA fuses, its folded constants, its sin and cos; each with its vector environment, a key per env and Gymnasium's next-step autoreset. XLA compiles for the host CPU, so Gymnasium's last bits match where it compiles as on the reference CPU: with FMA, and for the vector environments AVX2 without AVX-512.
  • Complex actions - phys2d CartPole computes a complex action in complex64, as Gymnasium's jit does, without its ComplexWarning.
  • The 19 refusing ids - the MuJoCo v2 and v3 ids and GymV21Environment-v0/GymV26Environment-v0 are registered as Gymnasium registers them: make warns that a MuJoCo id is out of date where Gymnasium does, then raises Gymnasium's ImportError; Gymnasium.Envs has no constants for them.

⚡ Performance

Ratios are Gymnasium ÷ Gym.NET time per step - higher is better (x2 = twice Gymnasium's speed); xLOW->xHIGH spans the slowest->fastest env of a family. Measured 2026-11-25 on a quiet Linux machine (an Intel Xeon E5-2690 v2, without AVX2 or FMA), each process pinned to two cores: net10.0 Release builds on .NET 10.0.15 against Gymnasium v1.4.0 on CPython 3.12.16 (NumPy 2.4.2, pygame-ce 2.5.8, Box2D 2.3.10), five rounds of Gym.NET and four of Gymnasium, interleaved, medians of benchmark_step after a 2-second warm-up. 1.0.0+rc1's ratios were measured on another machine, so the two releases' ratios do not compare.

  • x6.4->x48.3 - classic_control: Pendulum x48.3, Acrobot x17.9, MountainCar x9.3, CartPole x6.4.
  • x5.7->x6.4 - toy_text: FrozenLake x6.4, Taxi x5.7.
  • x1.9->x3.8 - box2d, on Gym.NET's managed Box2D: BipedalWalker x3.8, LunarLander x3.1, CarRacing x1.9.
  • Bytes a step, the managed allocations of the same loop over 2,000 steps - CarRacing 3,631,032 to 8,931, BipedalWalker 35,071 to 2,651, Pendulum 11,088 to 1,249, LunarLander 8,993 to 4,886: Box.Sample draws without NumSharp's temporaries, Box2D's scratch lives on the stack and in the world, and CarRacing writes its frame in place; every observation, reward and frame is unchanged.

🎯 Parity & Fixes

  • #14, .NET Framework - Gym.NET.Environments 1.0.0 packed its registration targets as a framework-neutral asset, so a net472 or net6.0 project installed it without NU1202, got no library and failed to build (CS0234, CS0400); 1.0.1+rc1 packs them for net8.0 and later, and NuGet refuses older frameworks at install with NU1202, naming the supported ones. .NET Framework stays unsupported.
  • #22, the WinForms window - 0.2.0's freeze (a blank window and a hung app when the env ran on a WinForms UI thread) is gone since 1.0.0; 1.0.1+rc1 fixes the rest: the user's X closes the window, the env keeps stepping, its later frames are dropped without an error, and disposing the env no longer ends the app's own message loop. The Avalonia window drops frames after the X the same way.
  • Deliberate difference - Gymnasium's pygame window ignores its X while an env renders; Gym.NET's windows close on it.
  • MuJoCo frames - the rasterizer's facing test is exact (a float32 area turned slivers of a few thousandths of a pixel around), so InvertedPendulum's and InvertedDoublePendulum's frames, v4 and v5, equal Gymnasium's byte for byte; the other families' frames stay within their measured baseline.
  • Windows at any scaling - the WinForms window is per-monitor DPI aware and the Avalonia window sizes itself in the monitor's scale, so the screen holds the frame's own bytes at 100%, 125%, 150% and 175%.

🧰 Testing & Tooling

  • Trusted publishing - a workflow run by hand for a release's tag builds the five packages as a release is built, checks each version against the tag, attaches them and their SHA-256 files to the GitHub release, and pushes them with a one-hour key from nuget.org's trusted publishing; no key is stored.
  • Package guards - GYMNET0012 fails the pack of a project that embeds a README (each version's README tab stays editable on nuget.org), and GYMNET0013 one that packs a build asset outside a framework folder.
  • The unit suite - 4,484 of 4,509 pass on each framework, in Debug and Release, on CI; the other 25 skip: 24 data rows where Gymnasium's own tests call pytest.skip, and the MP4 writer's test, on a machine without ffmpeg.
  • Window tests - a WinForms and an Avalonia cell click a window's X as a user does and check the app's own message loop survives; on a clean Windows 11 desktop every window test passes (WinForms 45 of 45, Avalonia 45 of 45).

💥 Breaking Changes

  • Recompile against 1.0.1+rc1 - every Gymnasium.Make overload gained a last optional parameter, wrappers: source code compiles unchanged, but a binary built against 1.0.0+rc1 that calls Make stops with MissingMethodException until it is rebuilt.
  • From 0.2.0 - 1.0's breaking changes are in the 1.0.0 release notes: move every Gym.NET package to 1.0.1+rc1 at once, replace NumSharp.Lite with NumSharp 0.81.0, and target .NET 8 or later.

Install via NuGet

dotnet add package Gym.NET --version 1.0.1
dotnet add package Gym.NET.Environments --version 1.0.1
dotnet add package Gym.NET.Rendering --version 1.0.1
dotnet add package Gym.NET.Rendering.Avalonia --version 1.0.1
dotnet add package Gym.NET.Rendering.WinForm --version 1.0.1

Packages

Package NuGet
Gym.NET NuGet
Gym.NET.Environments NuGet
Gym.NET.Rendering NuGet
Gym.NET.Rendering.Avalonia NuGet
Gym.NET.Rendering.WinForm NuGet

Nucs and others added 21 commits November 23, 2026 09:59
…akes wrappers, env.Wrap(...), options records with a common base (round 36, DR-117...DR-120)

The maintainer asked: "I want Gymnasium.Make that returns IEnv and correctly wraps".

What was measured first (a scratch probe against the tree):
- Gymnasium.Make already returned IEnv, and the stack make builds was typed correctly inside
  (TimeLimit<NDArray, NDArray> for CartPole, OrderEnforcing<object?[], NDArray> for Blackjack).
- Make(env.Spec) already closed recorded wrappers over the env's real types.
- What was missing: a way to wrap an IEnv the caller holds. The typed path needs the env's types:
  new RecordEpisodeStatistics<NDArray, NDArray>((Env<NDArray, NDArray>)env) works for CartPole. For Blackjack the same
  line compiles and throws InvalidCastException ('OrderEnforcing`2[Object[],NDArray]' is not 'Env`2[NDArray,NDArray]').
- make's own helper, EnvRegistry.Wrap, closes a wrapper class over the env's types through PyKwargs, but it was private.

Design review round 36 (docs/plans/DESIGN_REVIEW.md), asked in three calls of HTML option pages with before/after diffs.
The maintainer asked why IEnv and Env both exist and whether the old way stays. Answer: IEnv is Env<TObs, TAct>'s
stateless untyped view, implemented explicitly so the typed and untyped members never show side by side, and the only
type every env shares, since C# has no Env<?, ?>. The typed way stays.
- DR-117 "A. Options records", with the comment "All options shall have a common base (maybe EnvOptions or something)
  so we can use that in like IEnumerable<EnvOptions> instead of IEnumerable":
  - Every generated <Class>Options record derives from the new abstract record Gym.Envs.EnvOptions (ToKwargs(), still an
    IGymOptions).
  - A wrapper's record (the class implements IWrapper and its constructor takes env) derives from
    Gym.Envs.WrapperOptions : EnvOptions.
  - WrapperOptions.WrapperType is the class's unbound definition (typeof(RecordEpisodeStatistics<,>)), closed per env.
  - WrapperOptions.Of(typeof(X<,>), kwargs) covers any other class (Autoreset, a class of the caller's own). Its
    arguments are passed by Python name and compared by Python's equality. It refuses a non-env class, an abstract class
    and an env keyword where the list is written.
  - Read as (to confirm): the list's element type is WrapperOptions, the wrappers' subset of the common base, so an
    env's record cannot go in the list by mistake.
- DR-118 "Both":
  - Make(..., wrappers: [...]) for the common case.
  - env.Wrap(options) on any IEnv (Gym.Envs.EnvExtensions, Python's env = Wrapper(env, **kwargs)).
  - Both go through EnvRegistry.Wrap (now internal), so a wrapper is closed exactly as make closes TimeLimit.
  - A failed Wrap leaves the env the caller's, undisposed.
  - Make disposes what it built when a wrapper refuses the env, the wrappers already applied included.
  - A null element is an ArgumentException before anything is built.
  - MakeVec keeps Gymnasium's functions, which can call Wrap without a cast.
- DR-119 "Extend every Make":
  - All twelve Gymnasium.Make overloads (untyped and typed, id and spec, with and without a render mode) gain
    IEnumerable<WrapperOptions>? wrappers = null as their last parameter.
  - Every existing call compiles unchanged; binaries built against 1.0.0+rc1 must be rebuilt.
  - The list goes outside every layer make adds (HumanRendering and RenderCollection included), the first innermost, as
    wrapping after gym.make does and as make_vec applies its wrappers.
  - The typed form's TObs/TAct are the outermost wrapper's, checked once the stack is built.
  - EnvRegistry.Make keeps Gymnasium's registration.make signature.
- DR-120 "IEnv, as built": DR-07, DR-10 and DR-83 stand. A non-generic Env class and an Env<object?, object?> view
  were shown and not taken.

Code:
- src/Gym/Envs/EnvOptions.cs: EnvOptions, WrapperOptions (WrapperType, Of, PrintMembers leaving WrapperType out of a
  record's text), and Of's private record.
- src/Gym/Envs/EnvExtensions.cs: IEnv.Wrap(WrapperOptions).
- src/Gym/Envs/Registration/EnvRegistry.cs:
  - MakeCore applies the list after RenderCollection and before the typed check.
  - The early typed check is skipped when a list is given.
  - MakeWithViewer takes the list and checks it first (CheckWrappers).
  - Wrap is internal.
- src/Gym/Gymnasium.cs: the twelve overloads, now all routed through EnvRegistry.MakeWithViewer, with their docs and the
  crefs that name them.
- src/Gym.SourceGenerators/GymRecordsGenerator.cs:
  - The record's base is EnvOptions or WrapperOptions, and ToKwargs is an override.
  - A wrapper's record overrides WrapperType with typeof(global::Ns.Class<,>), each containing type keeping its arity
    (UnboundTypeName).
  - The record's summary says how it wraps.

Tests:
- tests/Gym.Tests/Envs/Registration/MakeWrappersTests.cs (17):
  - order and types; Blackjack's object?[]; the typed form and its TypeError; spec replay; the list outside
    RenderCollection; all twelve overloads.
  - disposal on a refusing wrapper and of the whole stack; Wrap chaining and failure.
  - Of's forms, equality and refusals; a generic record (TransformObservationOptions<,>) and its refusal of other types.
  - every generated record's base (32 wrappers, 34 env classes).
  - a user's own [GymOptions] wrapper replayed from its spec; MakeVec's functions calling Wrap.
- tests/Gym.Tests.Parity/Tests/Wrappers/MakeWrappersLiveParityTests.cs: the list against Gymnasium's hand-wrapped make,
  str() and lockstep steps:
  - TimeAwareObservation(NormalizeObservation(make("CartPole-v1")), flatten=False)
  - FrameStackObservation(DelayObservation(make("Blackjack-v1"), 1), 2), closed over object?[].

Docs:
- getting_started.md: "Wrapping an env of any type", its samples compiled warning-free and run.
- architecture.md: IEnv as an interface, Make's list, the records' bases.
- creating_custom_environments.md: a custom env and a custom wrapper in Make's list.
- README's wrappers row.
- CLAUDE.md: tree, bullets, DR-01...DR-120.
- DESIGN_REVIEW.md: round 36 and the coverage row.

Verified:
- Unit gate (headless, OpenBugs excluded), net10.0: 4,187 passed, 0 failed, 24 skipped. It was built before the last
  test (the user-written wrapper) was added; that test and its neighbours were rerun after the rebuild.
- MakeWrappersTests with GymRecordsTests, MakeRenderModeTests and ScopeSafetyTests: 171/171 on net10.0. MakeWrappersTests
  with GymRecordsTests and MakeRenderModeTests: 30/30 on net8.0.
- tests/Gym.Tests/Docs (master's env-page facts test and compiled samples) with MakeWrappersTests and GymRecordsTests,
  on this commit's base: 28/28 on net10.0.
- Live parity on the pinned stack (a fresh tools/parity/.venv: NumPy 2.4.2, pygame-ce 2.5.8, Box2D 2.3.10, MuJoCo
  4.0.0):
  - MakeWrappersLiveParityTests: 2/2 on net8.0 and net10.0.
  - Every class that drives Gymnasium.Make (Registration, Core, Wrappers, Bridge, EnvCoverageLiveParityTests): 571/571
    on net10.0.
- The guide's new samples: compiled with warnings as errors (only the expected ImageSharp advisories muted) and run;
  their printed output is the one in the guide.

Branch: journey1 was fast-forwarded to the local master (ed065ab, the other session's env-docs work, not pushed) before
this commit, so round 36 follows round 35 with no gap in the DR ids, and master can fast-forward to this commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… tabular/Blackjack-v0, their JAX parts in C# (round 37, DR-121...DR-123)

The maintainer asked, of the two easiest real envs left in Gymnasium's registry: "Lets implement these. Learn and
understand them and then prepare to implement them and inlining any core code they needed".

What was measured first (a scratch venv with Gymnasium 1.4.0 and JAX 0.12.1, jaxlib 0.12.1, flax 0.12.12):
- Both are FuncEnvs, jitted and driven by FunctionalJaxEnv:
  - __init__ makes a key from an entropy-drawn uint32;
  - a seeded reset makes one with PRNGKey(seed);
  - the key is split before every reset and step.
- CliffWalking is deterministic. Blackjack draws each card with split(key)[0], then choice(key, deck, (1,)), whose
  randint splits once more and reduces two 32-bit draws modulo 13.
- JAX 0.12.1 runs with jax_threefry_partitionable on (its default since 0.5), which decides both the splits and the
  draws. A pure-Python reading of threefry2x32, PRNGKey, split, randint and choice equalled JAX for 10 seeds (up to
  2^63 - 1), 50 splits and 200 draws.
- Neither env checks its action:
  - Blackjack's 2 hits and pays -2.0 on a bust, np.uint8(1) pays 255.0, NaN pays nan and never ends.
  - CliffWalking needs a (1,) array (action[0]): [1.5] does not move, and [[1]] moves before float(reward) fails.
- JAX turns bool x into a select (a NaN hit that does not bust leaves done at 0.0), eagerly as under jit; int x
  stays a multiply (that hit's reward is NaN).
- jnp.sum over a hand adds left to right (3,000 of 3,000 random hands). Writes past the hand's end are dropped, while
  negative indices wrap once. float32 to int32 saturates, NaN giving 0.
- Only options reaches the functional env (natural=True raises TypeError), and the env's reward always follows Sutton
  and Barto's rules.

Design review round 37 (docs/plans/DESIGN_REVIEW.md), one call of three questions with HTML option pages; all three
recommendations taken:
- DR-121 "Env classes, core inlined":
  - CliffWalkingFunctional and BlackjackFunctional (Gymnasium's names, namespace Gym.Environments.Envs.Tabular) derive
    from Gym.NET's FuncEnv (DR-43) and hold each env's functions with JAX's semantics written out in C#.
  - The registered CliffWalkingJaxEnv and BlackJackJaxEnv (Gymnasium's spelling) derive from Env<NDArray, NDArray> and
    inline FunctionalJaxEnv's lines: func_env, rng (JAX's legacy key, a uint32 (2,) array), state, render_state; the
    key at construction and at a seeded reset; a split before every reset and step; float(reward), bool(terminal) and
    render_image.
  - JAX's random functions as 0.12.1 computes them are one internal helper (JaxRandom).
  - BlackJackParams, the two EnvStates (CliffWalkingState, BlackjackState, [PyName("EnvState")]), CliffWalking's
    RenderStateType and the modules' functions (statics) are public.
  - FunctionalJaxEnv and FunctionalJaxVectorEnv stay out: the first is inlined, the second is phys2d's.
- DR-122 "Pin JAX and Flax": jax 0.12.1, jaxlib 0.12.1 and flax 0.12.12 join tools/parity/requirements.txt and the
  manifest (jax.version, flax.version), checked at start like mujoco.version. The venv grows by about 520 MB and 55
  packages. A JAX re-pin that changes the PRNG fails the cells, as a NumPy re-pin changing PCG64 would.
- DR-123 "All of it, errors included": jit's x32 conversion of the arguments (int64 to int32 and uint64 to uint32
  wrapping, float64 to float32, complex128 to complex64; a .NET integer is a Python int, so beyond int32 it raises jit's
  OverflowError), JAX's weak-type promotion for every NumSharp dtype, XLA's select for bool x, and the same errors.
  Only Python lists and tuples, strings, char and decimal differ.
- Consequences recorded under "Consequences found while implementing":
  - Gymnasium's jitted reward refuses explicit params (TracerBoolConversionError); Gym.NET applies them as the
    un-jitted BlackjackFunctional().reward does.
  - The module functions have one implementation; Gymnasium's eager and jitted calls agree (measured).
  - A keyword other than options: make's wrapped TypeError names CliffWalkingJaxEnv.__init__() where Gymnasium's names
    FuncEnv.__init__() (pinned).
  - A .NET array is NumPy's array of it, never a pytree; strings, char and decimal raise jit's TypeError with "a jitted
    function" for the function's repr; a complex action's last_action stays complex128 (NumSharp has no complex64).
  - Spaces and metadata are per instance (DR-40). Two hazards stay as Gymnasium has them: the dealer's endless loop on
    an injected hand whose cards fall past slot 20, and -1 hitting for +1.0 without ending the game.

Code (src/Gym.Environments/Envs/Tabular, new):
- JaxRandom.cs (internal): Threefry2x32 (20 rounds), PrngKey (BigInteger and uint; int64 wrap to int32, OverflowError
  "int too big to convert" past int64), Split, RandomBits32, RandInt (JAX's two-word modulo with its multiplier), Choice,
  KeyData (JAX's key checks in its order, with its texts), Format.
- JaxArray.cs (internal): a JAX value as jit sees it (JaxDType: bool, int8/16/32, uint8/16/32, float16/32, complex64):
  FromNDArray (x32 conversion; jit's TypeError for other dtypes), FromPythonScalar (weak int32/float32; jit's
  OverflowError), FromPythonAction (the untyped step's values, errors deferred to the jitted call), PythonFloat,
  PythonBool, SaturatingInt32, JAX's dtype names and shapes.
- JaxJit.cs (internal): the identity IFunctionTransform the envs pass to FuncEnv.Transform, Gymnasium's jax.jit.
- CliffWalkingFunctional.cs: CliffWalkingState, CliffWalkingRenderState, the functional env (initial, transition per
  element with the reshape's TypeError, observation, reward, terminal, render_init with its keyword check,
  render_image, render_close; fell_off).
- CliffWalkingJaxEnv.cs: the registered env ([GymOptions]; RenderMode twin constructor).
- BlackjackFunctional.cs: BlackjackState, BlackJackParams, the functional env (lax.cond's predicate checks, take,
  notake, the dealer's loop, done in the action's dtype, the reward in JAX's arithmetic, natural and Sutton and Barto
  rules through selects, render_init's NumPy-seeded face-up card, render_image over BlackjackEnv.DrawTable) and the
  module's functions as statics (cmp, random_card, draw_hand, draw_card, usable_ace, take, dealer_stop,
  draw_card_wrapper, notake, sum_hand, is_bust, score, is_natural).
- BlackJackJaxEnv.cs: the registered env ([GymOptions]; RenderMode twin constructor).
- Scope safety (DR-96): states, keys and render states are detached where the envs keep them; step results release the
  observation when a later function throws.
- Ownership: every reset and step replaces the key, and the env releases the key it replaced (found in review: it was
  left to the finalizer, one array per call); nothing else holds it, since Rng hands out copies and copies what it is
  given. Replaced states stay with the finalizer, as documented: the functions options may supply have no ownership
  contract (DR-43), so a new state may share arrays with the old one, and a caller may still hold one read through
  State, as Python's references stay valid.

Registration and API:
- src/Gym.Environments/GymEnvironments.cs: tabular/Blackjack-v0 and tabular/CliffWalking-v0, after Taxi-v4 as
  Gymnasium registers them, with disable_env_checker=True and no step limit (41 ids).
- src/Gym/Gymnasium.Envs.cs: TabularBlackjackV0, TabularCliffWalkingV0 (DR-88's naming, the namespace capitalised).

Tests:
- tests/Gym.Tests/Envs/Tabular/TabularJaxEnvTests.cs (9): Random123's threefry2x32 known answers; PRNGKey, split and
  randint against values JAX 0.12.1 printed; CliffWalking's resets and steps; Blackjack's deals and odd actions; the
  untyped step's Python scalars; rgb_array-only rendering; registration; idempotent disposal; replaced keys released
  while the caller's copies stay.
- tests/Gym.Tests/Gymnasium/Functional/TestJaxBlackjack.cs, TestJaxCliffwalking.cs: Gymnasium's
  tests/functional/test_jax_blackjack.py and test_jax_cliffwalking.py mirrored (normal and jit; vmap n/a).
- tests/Gym.Tests.Parity/Tests/Envs/TabularCliffWalkingLiveParityTests.cs (13 cells) and
  TabularBlackjackLiveParityTests.cs (16 cells): live against Gymnasium on JAX 0.12.1, key and state after every call
  (sampled episodes and games, a strategy, a scripted walk, every action form jit takes or refuses, Python scalars,
  reward rules on injected hands, hands past their slots, the module functions called eagerly with JAX arrays, the
  jitted functional envs, seeds, frames, render errors, options, spaces, metadata, make's stacks).
- EnvCoverageLiveParityTests: both ids join the sync/async vector, human (the viewer through Make's factory, DR-89) and
  rgb_array_list cells. RegistrationLiveParityTests: str(make(id)) and both printed specs for both ids.
- Golden cases tabular/CliffWalking-v0.sampled.seed0 and tabular/Blackjack-v0.sampled.seed5 (tests/Golden/tabular,
  recorded alone so no other golden's header changed), replayed without Python on the Linux job.
- Harness: ValueFacts describes a jax.Array through np.asarray; GymPythonSession reads jax/flax versions; Pythonic.cs
  gains the jax, flax and gymnasium.envs.tabular rows.
- Inventory: 22 tabular names ported; FunctionalJaxEnv "by design: inlined (DR-121)"; FunctionalJaxVectorEnv n/a.
- EnvIdsTests (41 ids, the namespaced naming rule), MakeWrappersTests (36 env classes with options records),
  ScopeSafetyTests (both ids in rgb_array).

Docs and packaging:
- CLAUDE.md (tree, DR range, stack); README (41 ids, the tabular family); docs/architecture.md (package row, namespace
  map); docs/environments/index.md (41 ids in five families); getting_started.md's env table;
  development_and_testing.md's parity stack; the Gym.NET.Environments package description.
- THIRD-PARTY-NOTICES.md: a JAX 0.12.1 (Apache-2.0) entry with JAX's notice, as OpenCV's and MuJoCo's have, since
  Envs/Tabular computes what JAX's random functions and jit compute; GYMNASIUM_PORT_PLAN.md §4.3 lists it.
- tests/Gym.Tests.Parity/CLAUDE.md (stack, coverage rows, the per-id table, five pitfalls: JAX arrays through
  np.asarray, eager module calls need JAX arrays, JAX's bool x select, the jitted reward's refusal of params, the
  viewer factory through Make); GYM_PARITY_INTEROP_TESTING.md's stack table; DESIGN_REVIEW.md (round 37 and its
  consequences).
- docs/plans/COMPLETION_PLAN.md is unchanged: it orders the work to 1.0, and the rounds after the release are not
  recorded there.

Results:
- Unit gate (headless, TestCategory!=OpenBugs): 4,221 passed, 0 failed, 24 skipped on each of net8.0, net10.0 and
  net11.0. The run before the count updates had found the three tests the new ids change (EnvIdsTests' two,
  MakeWrappersTests' options-record count).
- Parity gate (TestCategory!=OpenBugs) on net10.0: 2,973 of 2,973, MuJoCo frame cells on the reference GPU included.
- After the key fix (made after both gates): the 180 tests of the tabular, scope-safety and registration classes on
  net8.0, net10.0 and net11.0, and the 49 tabular parity cells (own suites, coverage and registration rows, goldens
  live and replayed) on all three.
- Builds: 0 errors; no warnings from the new files (Gym.Environments and Gym.Tests recompiled whole). The doc checker
  (~/.claude/scripts/check-docs.py) passes every new file.
…egisters them, and design round 38 recorded (DR-124...DR-127)

After round 37 the maintainer said "Continue": the rest of the ids Gymnasium registers and Gym.NET did not. Those are the
19 ids that only raise ImportError, and the three JAX phys2d envs. This commit records the round and lands the first
part, the refusing ids (DR-124). The phys2d envs (DR-125...DR-127) follow in their own commit.

Measured first (Gymnasium 1.4.0):
- Gymnasium registers 63 ids. 19 have function entry points that only raise:
  - _raise_mujoco_py_error for the 17 MuJoCo v2 and v3 ids (Reacher-v2 ... HumanoidStandup-v2, "moved to the
    gymnasium-robotics project");
  - _raise_shimmy_error for GymV21Environment-v0 and GymV26Environment-v0 ("run `pip install "shimmy[gym-v21]"`...").
- make("Ant-v3") warns "The environment Ant-v3 is out of date. You should consider upgrading to version `v5`." (a
  DeprecationWarning), then raises ImportError.
- Gym.NET answered DeprecatedEnv for the MuJoCo ids and NameNotFound for the shimmy ids.

Design review round 38 (docs/plans/DESIGN_REVIEW.md): one call of four questions with HTML option pages.
- DR-124 "All 19, no constants" (the maintainer's pick over the recommended "with constants"):
  - Registered in Gymnasium's order: each v2/v3 id before its family's v4, the shimmy ids last.
  - Each entry point is an EnvCreator named as Gymnasium's function, so a spec prints
    <function _raise_mujoco_py_error at 0x...>.
  - One delegate is shared by the 17 MuJoCo ids and one by the 2 shimmy ids, as Python's ids share one function object.
  - make warns as Gymnasium's does and raises its ImportError (kwargs ignored, as *args/**kwargs are); to_json refuses
    them with Gymnasium's text; pprint_registry lists them under None, as Gymnasium's does.
  - Gymnasium.Envs gets no constants for them. DR-88 now reads "one constant per id registered with an env class", so
    Pusher-v4, a class that refuses, keeps its constant.
- DR-125 "DR-121's shape, vector too", DR-126 "XLA's program, bit for bit" and DR-127 "Reproduce the measured rule":
  recorded here with the measurements behind them, implemented in the next commit.

Code:
- src/Gym.Environments/GymEnvironments.cs:
  - the 19 registrations;
  - _raise_mujoco_py_error and _raise_shimmy_error, private EnvCreator methods throwing NumSharp's ImportError with
    Gymnasium's texts (IDE1006 suppressed: Python's names);
  - MujocoPyError and ShimmyError, the shared delegates;
  - the class remarks.
- src/Gym/Gymnasium.Envs.cs: the remarks state the amended rule.

Tests:
- tests/Gym.Tests/Envs/Registration/RefusingIdsTests.cs (4): registration with the shared functions and Gymnasium's
  order; make's warning and ImportError for the 17 (kwargs too); the shimmy ids' ImportError without a warning; spec's
  defaults and printed function.
- EnvIdsTests.TheRefusingIds_HaveNoConstants; the class pins DR-88 as DR-124 reads it.
- RegistrationLiveParityTests.Make_RefusingIds_MatchGymnasium (19 cells), each against Gymnasium:
  - make's recorded warnings and its ImportError;
  - spec.pprint(print_all=True) with the entry point;
  - to_json's ValueError, the function's address masked on both sides.

Docs: CLAUDE.md (GymEnvironments' line, DR-01...DR-127), README (the 19 beside the env list), getting_started.md
(the registry also holds them), tests/Gym.Tests.Parity/CLAUDE.md (the registry row).

Results:
- Unit gate (headless, net10.0): 4,227 passed, 0 failed, 24 skipped.
- RegistrationLiveParityTests on net10.0: 66 of 66, the 19 new cells included.
…hys2d/Pendulum-v0 with their vector envs, XLA's float32 programs in C# (round 38, DR-125...DR-127)

The last three env ids Gymnasium 1.4.0 registers with an env class, after round 37's two tabular envs and round 38's 19
refusing ids (3024093): Gymnasium's JAX classic control. Each is a FuncEnv jitted and driven by FunctionalJaxEnv, and
each registers a vector entry point, FunctionalJaxVectorEnv vmapping the jitted functions. Gym.NET registers 44 ids now,
every id Gymnasium registers with an env class.

What the maintainer approved (docs/plans/DESIGN_REVIEW.md, round 38):
- DR-125 "DR-121's shape, vector too": CartPoleFunctional and PendulumFunctional on FuncEnv with the public records
  CartPoleParams and PendulumParams (Gymnasium's fields and defaults, polemass_length = masspole + length = 0.6
  included); CartPoleJaxEnv and PendulumJaxEnv inline FunctionalJaxEnv's lines as DR-121's envs do;
  CartPoleJaxVectorEnv and PendulumJaxVectorEnv (VectorEnv<NDArray, NDArray>) inline FunctionalJaxVectorEnv's: a key
  split per env, NEXT_STEP autoreset through prev_done, the time limit (200 by default, the spec's through make_vec),
  Gymnasium's quirks kept. Namespace Gym.Environments.Envs.Phys2d; JaxRandom gains uniform's bits.
- DR-126 "XLA's program, bit for bit": XLA's SinCosF32 translated to C# (Apache-2.0, notice in the file and in
  THIRD-PARTY-NOTICES), MathF.FusedMultiplyAdd exactly where XLA's compiled program fuses, XLA's folded constants,
  flush-to-zero and denormals-are-zero after every operation. Gym.NET's numbers do not depend on the machine;
  Gymnasium's equal them on x86-64 CPUs with FMA.
- DR-127 "Reproduce the measured rule": the vector CartPole computes env n-1's theta_dot with the scalar remainder's
  fusion, except for batches of 9 to 15 (all vector) and of 1 (the single env's program).

The code (src/Gym.Environments/Envs/Phys2d):
- XlaMath (internal): F (flush), Add/Sub/Mul/Div, Fma (MathF.FusedMultiplyAdd then flush), Sign, Max/Min (NaN first,
  IEEE 754-2019 zeros), Rem, Sin/Cos (SinCosF32: double arithmetic, Cody-Waite with two parts of pi/2 below 2^12 and
  three below 2^28, Payne-Hanek above with XLA's 2/pi table, the two polynomials, ApplyQuadrant, one rounding).
- CartPoleFunctional: initial (jax.random.uniform's bits, max(minval, fma(u, span, minval))), transition (the
  default program with 0.909090877 = f32(1/f32(1.1)) folded, and the traced-params program with true divisions),
  observation, terminal, reward (1.0, or Sutton and Barto's), render_init/render_image/render_close (pygame's
  drawing through Gym.Rendering; render_image is not jitted in Gymnasium, so a float32 state draws in float32 and a
  float64 state assigned by the user in float64, as Python does).
- PendulumFunctional: the same five functions with JAX's broadcasting (Phys2dShapes: an action of more dimensions grows
  the state an axis, as in Gymnasium), float16 torques kept in float16 by the weak constants, the reward's floor modulo
  with JAX's fix-up, max_torque as an attribute; render_image's 500x500 drawing blitted on the 600x400 screen (the
  torque's arrow never drawn, as last_u is never set).
- CartPoleJaxEnv, PendulumJaxEnv ([GymOptions]): the key from an entropy-drawn uint32, PRNGKey(seed) at a seeded reset,
  a split before every reset and step even when the step fails, float(reward) and bool(terminal) after the state moved,
  rgb_array only; Gymnasium's metadata (CartPole's without autoreset_mode, Pendulum's with it).
- CartPoleJaxVectorEnv, PendulumJaxVectorEnv ([GymOptions]): (numEnvs, renderMode, maxEpisodeSteps = 200, options) and
  a RenderMode twin; steps += 1 first, the per-env keys, the vmapped transition (CartPole's measured remainder rule),
  truncation at time_limit, the NEXT_STEP reset step that rebuilds the next state from the state before the step
  (self.state.at[to_reset].set: the other envs keep their old states), a reset that keeps prev_done, the observation
  key split checked and dropped; the render's TypeError (Gymnasium's render_image is not vmapped); metadata as
  Gymnasium's (the Pendulum vector env's lacks autoreset_mode, so MakeVec warns as make_vec does).
- GymEnvironments registers the three ids after Classic, as Gymnasium does: disable_env_checker=True, 200/195 and
  500/475 for CartPole, 200 for Pendulum, the JAX vector envs as vector entry points. Gymnasium.Envs gains
  Phys2dCartPoleV0, Phys2dCartPoleV1, Phys2dPendulumV0.

Where the code had to choose (DESIGN_REVIEW, "Consequences found while implementing"): the vector envs' FuncEnv is the
jitted functional env, not vmapped (its functions take one env's state); CartPole refuses a complex action with
Gym.NET's own TypeError where Gymnasium computes it in complex64 (pinned); states are float32 or float64 of Gymnasium's
shapes, other dtypes refused; the vector envs take CartPole's (num_envs,) and Pendulum's (num_envs, k) actions, another
batch raising ValueError with Gym.NET's text.

Verified:
- Gates: the unit gate (headless, OpenBugs excluded) 4,277 passed, 24 skipped, 0 failed on each of net8.0, net10.0
  and net11.0 (Debug); the full parity gate (TestCategory!=OpenBugs) 3,072 passed, 0 skipped, 0 failed (Release,
  net10.0, 18 min 29 s); the solution builds with 0 errors and no new warning in any touched file.
- Live parity against Gymnasium on JAX 0.12.1, every cell passing on the reference i9 (AVX2 and FMA, no AVX-512):
  Phys2dCartPoleLiveParityTests (31 cells) and Phys2dPendulumLiveParityTests (22): sampled, balanced and wound-up
  episodes with the key and the float32 state after every call; 29 CartPole action forms and 28 Pendulum torque forms
  (float16 included); Python scalars; seeds; frames at the env's states and at injected float32 and float64 ones;
  render errors; the jitted functional envs with the defaults and with traced params (11 params sets, angles to 1e30
  through every range reduction); options; spaces; metadata; make's stacks; the vector envs at 12 CartPole batch sizes
  (1, 2, 3, 5, 8, 9, 12, 15, 16, 17, 32, 65) and 6 Pendulum ones, truncations and autoresets, odd batches, the render's
  errors and make_vec's warning. EnvCoverageLiveParityTests over the three ids (sync and async vector envs, human
  frames, rgb_array_list: 18 cells), RegistrationLiveParityTests (the stacks and printed specs), two goldens recorded
  alone (tests/Golden/phys2d, no older golden rewritten) and replayed without Python. The single-env cells need FMA,
  the vector cells a CPU like the reference (ParityTestBase.SkipOffXlaFmaCpu, SkipOffXlaVectorReferenceCpu); elsewhere
  Inconclusive.
- Unit tests: Phys2dJaxEnvTests (XLA's sin/cos at ten arguments across the reductions, the four envs' resets and steps
  bit for bit as Gymnasium printed them, the autoreset quirk, odd actions, rendering, params, registration, key
  release); Gymnasium's own test files mirrored (TestJax for tests/envs/functional/test_jax.py, TestFuncJaxEnv for
  tests/functional/test_func_jax_env.py, whose test_equal_episode_length runs in all three vectorization modes; the
  vmap tests have no counterpart, as with the tabular envs); EnvIdsTests (44 ids), ScopeSafetyTests (the three ids,
  their render modes and both vector entry points), MakeWrappersTests (40 env classes with options records),
  InventoryTests (the eight phys2d names present; FunctionalJaxVectorEnv "by design: inlined").

Docs: README (44 ids, the phys2d family), architecture.md, getting_started.md, environments/index.md,
development_and_testing.md (the phys2d cells' CPU), the parity guide (coverage rows and three pitfalls: XLA's float32 and fusion, the vector
remainder, render_image unjitted), CLAUDE.md (Envs/Phys2d), the port plan (scope and licensing), THIRD-PARTY-NOTICES
(XLA's notice), the package description.
…127 to DR-126...DR-129 (master's round 38 took DR-124 and DR-125 first)

master's round 38 (1f613ed, 2026-11-23 14:43: examples/MountainCarContinuous for its env page, and toy text's "How it
works" figure as the env's frame labelled) took DR-124 and DR-125. journey1's round 38, recorded half an hour later in
3024093 (15:13) and implemented in 6d13b66, took DR-124...DR-127 without checking master's highest id, against the rule
that every round takes ids above the highest on either branch. journey1 is not pushed, so its ids move; master's stay.

The mapping, the same everywhere:
- DR-124 (the 19 refusing ids, "All 19, no constants") is now DR-126.
- DR-125 (the phys2d envs' shape, "DR-121's shape, vector too") is now DR-127.
- DR-126 (float math, "XLA's program, bit for bit") is now DR-128.
- DR-127 (the vector CartPole's last value, "Reproduce the measured rule") is now DR-129.
- journey1's "Round 38" heading and every "round 38" in the docs and code comments are now round 39.

The commit messages of 3024093 and 6d13b66 keep the old numbers (commits are never amended); the round's record in
docs/plans/DESIGN_REVIEW.md now opens with a note naming both commits and the old ids, so a reader of those messages can
map them. CLAUDE.md's range reads DR-01...DR-129 and says DR-124 and DR-125 are master's round 38 until the branches
meet; when journey1 merges into master, master's round 38 and journey1's round 39 sit in number order.

Changed: the ids in the XML docs and inline comments of the phys2d envs, GymEnvironments, Gymnasium.Envs, JaxRandom,
the unit and parity tests and the parity harness (comments only); the design record (the round's heading, its four rows,
DR-88's amendment, the implementation consequences); the port plan, architecture.md, THIRD-PARTY-NOTICES, the parity
guide and CLAUDE.md; the inventory's expected-missing reasons. No behavior changes.

Verified: the solution builds (0 errors); InventoryTests, EnvDocPagesTests, EnvIdsTests, RefusingIdsTests, the phys2d
unit tests and Gymnasium's mirrored phys2d tests pass (51 of 51, net10.0); `git grep -E "DR-12[45]"` finds no id of
this branch's round left under its old number.
…24...DR-127 to DR-126...DR-129": the maintainer's DR-129 (master's round 39) renumbers journey1's ids at the merge

This reverts commit 716324a.

716324a (17:03) moved journey1's round 38 to round 39, DR-126...DR-129, to clear master's round 38 (1f613ed, 14:43,
DR-124 and DR-125). Two minutes later master's session recorded the maintainer's own answer to the same collision, in
master's round 39 (9d84fb4, 17:05):

- DR-129 "The round-38 ids both branches use": "Renumber journey1's at the merge". master's DR-124 and DR-125 stay. When
  journey1 merges, its DR-124...DR-127 (3024093) and every reference to them in its code, tests and docs move above
  master's highest id. Not taken: renumbering master's two now.

The same round took DR-128...DR-131 on master, so 716324a's DR-128 and DR-129 now meant other decisions there, and its
"Round 39" collided with master's round 39 too. Reverting restores what DR-129 expects to find at the merge: journey1's
round 38 with DR-124...DR-127, recorded in 3024093 and implemented in 6d13b66, in every file that cites them.

Added beside the revert:
- docs/plans/DESIGN_REVIEW.md: journey1's round 38 now opens with a note on the collision, master's DR-129 decision, and
  this revert, so a reader of either branch can follow the ids.
- CLAUDE.md: the design gate's range reads DR-01...DR-127 here, says master holds its own DR-124...DR-131, and that
  journey1's DR-124...DR-127 move above master's highest id at the merge (master's DR-129).

Nothing else changes: the revert touches comments, docs and the inventory's reasons only, as 716324a did.
…Gymnasium's jit does, without its ComplexWarning (round 40, DR-132, DR-133)

Round 38's consequences recorded a reading: CartPole refused a complex action with Gym.NET's own TypeError, where
Gymnasium computes one. The maintainer, of that reading: "just use complex128 as we have no choice. Lets tackle this".

What was measured first (JAX 0.12.1 on the reference i9: AVX2 and FMA, no AVX-512), against Gymnasium's jitted
transition (the defaults compiled in, and traced params) and its vmapped vector step:
- jit converts a complex128 action to complex64 (DR-123), so sign(action - 0.5) and the force are complex64. x and theta
  do not depend on the action, and the float32 array Gymnasium stacks the state into keeps the real parts of x_dot and
  theta_dot. Each equals the real program's result with the complex64 sign's real part in place of the sign; a NaN
  imaginary part does not reach it.
- XLA's complex64 magnitude is |z| = max(|re|, |im|) * sqrt(1 + (min / max)^2), the square and the 1 fused into one
  rounding in the compiled program, a NaN result replaced by min (|0| = 0, |inf + inf i| = inf). The sign is the value
  itself when both parts are zero, else z / |z|. Source: XLA 97b8433b maps a complex sign to MLIR's complex.sign
  (xla/mlir_hlo/mhlo/transforms/map_mhlo_to_scalar_op.h), which MLIR's ComplexToStandard lowers, at the LLVM commit XLA
  pins (c03c4571), through computeAbs.
- Written in float32 with flush-to-zero, that gave Gymnasium's bits for:
  - 1,600 of 1,600 finite results over 64 states x 30 edge actions (zero, subnormal, infinite and NaN parts, 0.5 + 1j,
    a magnitude beyond float32's range); the other 320 results are NaN on both sides, their sign bits no contract;
  - 20,000 of 20,000 random actions with parts from 1e-6 to 1e6;
  - 3,000 of 3,000 traced-params steps.
  Rounding the square before adding the 1 missed 111 of those 23,000 (about one in 200). Gymnasium's chain kept in
  complex128, the real parts rounded to float32 at the end (the maintainer's first answer), gave the same bits for 1,236
  of the 1,920 edge steps; Re(sign) alone in float64, rounded once, for 1,425 of the 1,600 finite ones.
- A complex64 magnitude overflows where a complex128 one does not: 3e38 + 3e38j pushes with no force, as does
  1 + inf j. 0.5 + 1j pushes with no force, 1 + 1j with 4.47 N.
- NumPy's ComplexWarning ("Casting complex values to real discards the imaginary part", raised in
  jax/_src/numpy/array_constructors.py) comes twice at the first complex step of each env instance and input kind (a
  NumPy array or a Python complex scalar), while jit traces the program; later steps run the cached program.

Design round 40, on journey1 (one AskUserHtmlQuestion call, two questions, each option an HTML page):
- DR-132 "complex64 in float32 (exact)" (the recommendation once the measurements showed there was a choice; not taken:
  "complex128 (as answered)", parity by tolerance).
- DR-133 "No warning": a recorded deviation, no public API change (not taken: the recommendation, "Warn as Gymnasium
  (adds category)", a new Gym.Utils.WarningCategory.ComplexWarning).
- Round 40 is above both branches' rounds (master's go to 39), and DR-132/DR-133 above master's highest id (DR-131),
  re-checked when written. DR-129's renumbering at the merge leaves them as they are; the four ids it moves (round 38's
  DR-124...DR-127) must then go above DR-133 too, so that no id is used twice (written into round 40 and CLAUDE.md).

Code (src/Gym.Environments/Envs/Phys2d):
- XlaMath.ComplexSignReal (internal): the real part of XLA's complex64 sign in float32, the fused magnitude, the NaN
  select, flush-to-zero; documented with the measurements, the NaN sign-bit footgun and pinned XLA/MLIR permalinks.
- CartPoleFunctional.ActionSign: a complex64 action now goes through the new internal ComplexActionSign (the subtraction
  in complex64, then the sign's real part), feeding StepConstants and StepWithParams as a real action's sign does; the
  complex TypeError is gone. Class remarks, the transition's and ActionSign's docs updated (no warning, DR-133).
- CartPoleJaxVectorEnv.ActionSigns: each cart's complex sign the same way; the complex TypeError is gone. The class
  footgun remark lists the complex remainder residual (below).
- CartPoleJaxEnv.Step: docs.

Tests:
- Parity (Phys2dCartPoleLiveParityTests):
  - GymNet_ActionForms_MatchGymnasium: 29 -> 40 forms, ten complex scalars (a fractional force, no force for 0.5 + 1j,
    for an infinite imaginary part and where complex64's magnitude overflows, subnormal parts, 1e10 + 1j) and a complex
    (2,) array, which raises JAX's Cannot concatenate error as a real one does.
  - GymNet_ComplexAction_IsRefusedWhereGymnasiumComputes replaced by GymNet_ComplexActions_MatchGymnasium_WithoutTheWarning:
    three complex steps compared whole with the key and state after each; Gymnasium's two ComplexWarnings at the first
    complex step and none after, Gym.NET's none (DR-133, pinned); then inf + 0j, nan + 0j and 1 + nan j, whose speeds
    come out NaN: NaN on both sides, x, theta and the key exact.
  - GymNet_PythonScalars_MatchGymnasium: complex Python scalars 1+1j and 0.5-2j (no force) through the untyped step.
  - GymNet_FunctionalEnv_MatchesGymnasium: a complex action per state from its own generator (so the real cases keep
    their states): 600 complex steps through both programs and the five param sets, force_mag=5.0 included.
  - GymNet_VectorComplexActions_MatchGymnasium (new): 60 seeded complex steps at 12 batch sizes (1, 2, 3, 5, 9, 12, 15,
    17, 22, 33, 57, 100), the sizes where XLA's complex program places its remainder as the real one does, every result
    whole and the state, key, counters and pending autoresets after every call.
- Parity interop: PyConvert maps System.Numerics.Complex to a Python complex (Python.builtins.complex, a new row of the
  facade in Pythonic.cs).
- Unit (Phys2dJaxEnvTests.ComplexActions_ComputeAsComplex64): Gymnasium's bits for 1+1j, the untyped Python scalar
  1+1j, 0.2-3j and a batch of three, recorded from JAX; no warning recorded.

Consequence recorded for the maintainer's reading (DESIGN_REVIEW.md, "Consequences found while implementing"): XLA
compiles the vmapped loop otherwise for a complex batch, so the scalar remainder DR-127 measured for real batches falls
elsewhere at some sizes. On the reference CPU, over batch sizes 1 to 140 and 29 larger ones up to 1,025: as the real
program's for 1 to 5 and 9 to 15, and from 17 on when the size modulo 8 is 1 to 5 (also 22, 23, 30, 31, 38 and 39);
elsewhere the last cart's theta_dot takes the vector body's fusion, at 8 every cart's takes the remainder's, and at 511
and 513 many values match neither program (not at 512, 1,000 or 1,023 to 1,025); 46 and 47 stayed undetermined. The
vector env applies DR-127's rule to every batch, so at the other sizes a complex batch's theta_dot can differ from
Gymnasium's in the last bit (16 carts: 6 of 448 cart-steps in a 28-step probe). Reproducing the complex placement would
take a second, partly unexplained rule.

Docs: DESIGN_REVIEW.md (round 40 with DR-132 and DR-133, the consequence above, round 38's refusal bullet amended);
tests/Gym.Tests.Parity/CLAUDE.md (the phys2d row's coverage, a pitfall on complex actions); CLAUDE.md (the design gate's
ids, XlaMath's complex64 sign).

Verified:
- phys2d parity 68 of 68 (43 CartPole cells, 22 Pendulum, 3 registration; Debug, net10.0), before and after the last
  test edit (the second run compiled the tree as it stood, which by then also held another session's uncommitted JAX
  edits, not part of this commit);
- unit gate 4,278 passed / 24 skipped / 0 failed on each of net8.0, net10.0 and net11.0 (one new test);
- Release build of the parity project and its libraries: no warning in the files this commit touches;
- the numbers above re-measured against the shipped XlaMath.ComplexSignReal (a scratch harness compiling the product
  file), and the documented vector residual re-derived from the two probes' data.

Not pushed (journey1).
…ax.vmap does, and the phys2d vector envs step through their vmapped FuncEnv (round 41, DR-134...DR-137)

Round 38's consequences recorded that the phys2d vector envs' FuncEnv takes one env's state, not a batch, because it is
not vmapped as Gymnasium's is. The maintainer, of that reading: "Lets tackle this, using questions html". Design round 41
(docs/plans/DESIGN_REVIEW.md) put four questions as HTML option pages, after measuring on JAX 0.12.1 on the reference i9
(AVX2 and FMA, no AVX-512):

- DR-134 "Public, five JAX envs": Jax.Vmap beside Jax.Jit, public in Gym.Environments.Envs (static class Jax,
  IFunctionTransforms for FuncEnv.Transform), for the four functional envs behind the five JAX ids (CartPole, Pendulum,
  CliffWalking, Blackjack). The vector envs apply Jax.Jit then Jax.Vmap, as Gymnasium's do, and call FuncEnv line for
  line. Another FuncEnv's function, one assigned over a JAX env's, or a subclass's override raises TypeError. Gymnasium's
  four test_vmap tests get their mirrors.
- DR-135 "Same params for all" (against the recommendation "Refuse params, as JAX does"): params given to a batched
  function apply to every row, a Gym.NET extension; the numbers equal Gymnasium's per-env params of equal values.
- DR-136 "Gym.NET's own texts" (against the recommendation "JAX's own texts"): Gymnasium's exception types at the same
  call, Gym.NET's messages; the parity cells compare the types.
- DR-137 "Twice where exact": a second vmap maps two leading axes where row by row is Gymnasium's, and refuses with
  NotImplementedError where XLA's two-level program places its values otherwise.
- Workflow: "Same tree, now" (the peer session's round 40 was in the same tree; it was committed as 8cb68bc before
  this commit, so every hunk here is this session's).

Measured before the questions (scratchpad probes, JAX 0.12.1):
- vmap(jit(f)) equals jit(vmap(f)) (0 of 300 CartPole batches differ).
- Row by row is XLA's vmapped program for every function but CartPole's transition: Pendulum's four float functions
  (0 of 200 batches at 6 sizes), CartPole's initial/observation/reward/terminal (2, 9, 17), CliffWalking and Blackjack
  (0 of 300 rows). CartPole's vmapped transition differs from the single program in every row from 2 carts on: DR-127's
  vector program; the vector env's step equals func_env.transition on 901 plain steps. XLA's sin/cos: no lane effect
  (0 of 60,000).
- A params instance under vmap raises ValueError (its 0-d fields cannot be mapped); per-env params (arrays) are mapped.
- CartPole's vmapped transition with per-env params of equal values (C# reading of the fused program, 144 readings per
  element): the vector body fuses thetaacc's numerator as fma(-cos, temp, gravity * sin) (the single traced program:
  fma(gravity, sin, -(cos * temp))); the scalar remainder takes the last cart's theta_dot, except 1 (the single program),
  8 (every cart's theta_dot, x_dot keeping the vector numerator), 9 to 16 and multiples of 8 (none).
- Twice vmapped: CartPole's transition differs from one vmap over the flattened batch in 11 to 63 of 80 batches at 10 of
  12 shapes; Pendulum's transition equals it.

Measured while implementing (the new parity cells found what the probes had missed):
- CartPole's vmapped initial with params rounds u * span on its own (max(minval, u * span + minval)) for the first
  4 * (n / 4) carts at 4 carts and at 20 to 23, 28 to 31, 36 to 39 and 44 to 47; every other size of 1 to 140 and 14
  larger ones up to 1,025 is the single fused program, as are all sizes with the defaults compiled in and all of
  Pendulum's (scratchpad/vmap/probe_initial_sweep.py, 12 batches per size, two params sets, the unfused reading
  explaining every differing element).
- Twice vmapped over 92 shapes (scratchpad/vmap/probe_nested_sweep.py): Pendulum's reward differs from row by row at
  (4, 2) to (4, 8), with and without params; CartPole's initial with params at every (n, 4) and at (4, 1), all values
  unfused; every other function of both envs equals row by row. The round's question page had listed all of Pendulum's
  functions as working twice, from a probe of the transition alone; DR-137's rule now refuses both.

What changed:
- src/Gym.Environments/Envs/Jax.cs (new, public): Jax.Jit (JaxJit, the identity) and Jax.Vmap, with the footguns.
- src/Gym.Environments/Envs/JaxVmap.cs (new, internal): JaxVmap (the transform: finds the env by the delegate's target,
  refuses foreign functions and subclass overrides), IJaxVmappable/IJaxVmappedFunction, JaxRowFunctions (the single-row
  functions, TransitionKernel and InitialKernel for one vmap, RefusesTwice), JaxVmapping.Vmap (depth 1 for the env's own
  ...Core methods, depth + 1 for its batched ones), JaxVmapped (the batched functions; NotImplementedError where an env
  refuses a second vmap, naming the function and params), JaxBatch (LeadingShape's ValueErrors, MapRows: each argument
  flattened, row copies, the single function, results stacked as arrays, records or infos; an empty batch runs the
  function on zero-filled rows for its errors and shapes; AtSet = state.at[rows].set(values)).
- CartPoleFunctional: IJaxVmappable; VmappedTransition (DR-127's rule with the defaults, RemainderThetaDot with params;
  one cart or none runs the single program; each cart read by ReadState and ActionSign, so its errors are the single
  transition's, complex actions included, DR-132); VmappedInitial with UnfusedInitialRows; StepWithParams gains
  vectorBody/tailThetaDot (the vector numerator), InitialState gains fused; RefusesTwice: the transition, initial with
  params.
- PendulumFunctional, CliffWalkingFunctional, BlackjackFunctional: IJaxVmappable, row by row; Pendulum refuses its reward
  twice vmapped.
- CartPoleJaxVectorEnv, PendulumJaxVectorEnv: rewritten onto the vmapped FuncEnv: Reset (initial of split keys,
  observation, state_info), Step (counters, split, transition, reward, terminal, truncations, the unvmapped
  transition_info, the NEXT_STEP reset step through JaxBatch.AtSet from the state before the step, prev_done, the
  observation's split keys), the state an NDArray kept detached and released on Dispose; State keeps an assigned array as
  given (copied), so a malformed state fails at the next step as Gymnasium's does; the old ActionSigns/Torques/ToArray
  helpers removed. Every result stays Gymnasium's (the 99 phys2d and tabular parity cells pass unchanged); a (n, 1)
  CartPole batch now raises JAX's concatenate TypeError per cart, as Gymnasium's does, where it raised Gym.NET's
  ValueError.
- JaxRandom: ToArray of a key batch, a uint32 (n, 2) array; the ambiguous cref fixed; its note now names Jax.

Tests:
- tests/Gym.Tests/Envs/JaxVmapTests.cs (new, 14 methods): CartPole's batched transition against bits JAX printed (3
  carts with the defaults, 8 with params; the single program per cart differs), the batched initial with params at 4
  carts and UnfusedInitialRows' table, RemainderThetaDot's rules, Pendulum's functions equal to the rows with and without
  params, jit and vmap in either order, two axes (Pendulum, CliffWalking's record), the three refusals twice vmapped,
  empty batches, ValueErrors, TypeError for foreign functions (another FuncEnv, an assigned lambda, an overriding
  subclass; a plain subclass batches), step_info batched and transition_info single, the vector envs' FuncEnv on their
  own batches and a replaced reward paying the steps.
- Gymnasium's test_vmap mirrored: TestJax.TestVmap and TestFuncJaxEnv.TestVmap (Phys2dFunctionalChecks.TenBatchedSteps),
  TestJaxBlackjack.TestVmapBlackJack, TestJaxCliffwalking.TestVmapCliffWalking (Gymnasium names it test_vmap_BlackJack
  too); the mirrors' jit tests use Jax.Jit; their test permalinks now cite the def lines (several cited blank lines).
- tests/Gym.Tests.Parity/Tests/Envs/JaxVmapLiveParityTests.cs (new, 35 cells): CartPole at 18 sizes and Pendulum at 6,
  each with the defaults and 4 params sets crossed as per-env params (initial, transition, observation, reward,
  terminal, state_info, step_info); every size of 1 to 140 and 14 larger ones (GymNet_VmappedSizes_MatchGymnasium,
  listing every differing batch before failing); CliffWalking and Blackjack through 30 batched steps at 1, 4, 10; two
  vmaps over 5 shapes with the three refusals pinned; errors (vmap's by type, the rows' whole); a params instance
  refused by Gymnasium and applied by Gym.NET (pinned); Blackjack's reward with params (Gymnasium's
  TracerBoolConversionError pinned, Gym.NET's equal to the un-jitted function row by row); the vector envs' func_env
  and a zero reward assigned over it on both sides. Facade rows: jax.jit, jax.vmap, FuncEnv.transform (tabular and
  phys2d), state_info, step_info, FunctionalJaxVectorEnv.func_env.

Gates: unit 4,298 passed (24 skipped) on net8.0, net10.0 and net11.0; parity gate (Release, net10.0) 3,119 of 3,119;
the vmap cells 35 of 35 (Debug).

Docs: DESIGN_REVIEW round 41 (DR-134...DR-137), its consequences, notes on round 38's; CLAUDE.md (the tree, the design
gate's DR range); docs/architecture.md (jax.jit/jax.vmap row, the phys2d row); tests/Gym.Tests.Parity/CLAUDE.md (the
cells' row, two pitfalls: shape-dependent vmapped programs, vmap mapping keyword arguments).
…649 and 1,249 bytes a step instead of 3,591,125, 35,415 and 11,202; every result unchanged (round 44, DR-144...DR-147)

The maintainer, of the README's Performance table: "Fix top 3 allocates per step". The three were CarRacing (3,631,032
bytes a step in the table), BipedalWalker (35,071) and Pendulum (11,088). Design round 44 (docs/plans/DESIGN_REVIEW.md)
records the measurements, the choices and four questions put as HTML option pages.

Measured first, on the table's own loop (Gymnasium.Make, a sampled action and the observation released each step, a
reset at each episode's end; GC.GetAllocatedBytesForCurrentThread, net10.0, Release), each step split into the sampler,
the wrappers and the env's own step, and attributed to call stacks with dotnet-trace's allocation ticks
(Microsoft-Windows-DotNETRuntime:0x1:5) read through TraceEvent:
- Box.Sample allocated 10,336 bytes a call (bounds and masks copied out, four index lists, a NumSharp draw per category
  even when empty, NumSharp's array-bounds uniform, a cast through three arrays): 92% of Pendulum's step, 30% of
  BipedalWalker's. make's wrappers allocate nothing a step.
- BipedalWalker's own step: 23,520 bytes, Box2D scratch that C++ keeps on the stack or in its stack allocator: ten lidar
  ray casts with a 1 KB node stack each, each step's island arrays (bodies, velocities, positions, sized to ~200 bodies),
  the island search's stack, the TOI island, the contact solvers' constraints.
- CarRacing's own step: 3.55 MB: the flipped 1000x800 frame (3.2 MB, large object heap), the 96x96 smoothscale result,
  the observation's managed byte array, ~170 KB of road drawing, the score re-rendered every frame, Box2D's scratch.

Done without a question, every result unchanged:
- Box2D (src/Gym.Environments/Box2D): b2GrowableStack is a ref struct over the caller's stackalloc int[256] (C++'s
  m_array), growing to the heap as before; the world keeps its discrete and TOI islands and the island search's stack
  between steps (b2Island.Reset sets the capacities exactly as a new island's, so every assertion and the TOI search's
  limits are unchanged; ReleaseReferences drops the step's bodies, contacts and joints afterwards); each island keeps its
  b2ContactSolver (Initialize grows the constraint arrays by doubling and clears the ones a solve uses, as a fresh array
  was zeroed); the TOI search's {bA, bB} array and the broad phase's per-sort Comparison delegate are gone (same sort).
- Gym.Rendering: gfxdraw's polygon coordinates (a ref struct, PolygonCoordinates, renting past 64 vertices), SDL_gfx's
  row crossings and draw.polygon's vertices and crossings live on the stack; SDL_gfx's polygon functions take spans;
  surfarray's ToRgbArray writes the frame straight into the array's NumSharp memory (no managed byte array per frame,
  empty surfaces as before).
- Pendulum and BipedalWalker write their observations straight into the new array (one static Shape, NumSharp's shapes
  being immutable and shared by design) and keep their step's scratch (Pendulum's two-value state in place,
  BipedalWalker's 24 values).
- CarRacing builds the playfield and the 400 grass polygons once (static, Gymnasium's expressions), draws each polygon
  through one reused list (its indicators and its car's too; fixture lists and vertices read in place, the same order),
  drops the per-tile LINQ colour copy (the (int) cast truncates as Python's int() for every colour a tile holds), and
  re-renders the score only when its text changes. Car.Gas loses its Skip/Take iterators.

The four questions (one call):
- DR-144 "Internal + InternalsVisibleTo": Gym.Rendering grants InternalsVisibleTo("Gym.Environments") (and, for their
  tests, "Gym.Tests") and keeps Transform.FlipInPlace (Flip's pixels in the surface itself; rows swapped through stack
  scratch, renting past 2,048 columns) and Transform.SmoothscaleInto (Smoothscale's pixels over a kept surface, as
  pygame's dest_surface; the shrink shared through Transform.Shrink). CarRacing draws, flips and shrinks into its kept
  canvas, 96x96 observation surface and 600x400 rgb_array surface. No public API change.
- DR-145 "The live canvas" (against the recommendation "Copy on first read"), with the maintainer's "which clears on
  dispose": CarRacingEnv.Surf is the env's kept 1000x800 surface itself, null before the first render and after Dispose,
  which drops the canvas, the shrink targets and the score's cached text. A recorded deviation from Gymnasium (whose
  env.surf is a new surface per render), amending DR-50; in GYMNASIUM_PARITY_AUDIT.md section 7.2, pinned by the unit
  test CarRacingTests.Surf_IsTheLiveCanvas_AndClearsOnDispose.
- DR-146 "Gym.NET fast path (done)": Box.Sample reads its bounds and masks in place, keeps its float64 scratch on the
  stack (up to 32 entries) or rented, skips a category with no entries (NumPy's empty draw consumes nothing; NpRandom is
  still read once per category, as Gymnasium reads self.np_random, so an unseeded empty box still creates its
  generator), draws the uniform category as low + (high - low) * next_double() from the bit generator under its lock,
  and writes float32/float64 samples straight into the new array (the box's own Shape, shared). A range uniform refuses
  (infinite, NaN or sign bit set, only after writing into Low or High) still runs NumSharp's uniform, which raises its
  own OverflowError or ValueError. 10,336 -> 528 bytes a call.
- DR-147 "Re-measure the table": the code review's protocol over all nine envs, README and code review section 4 updated.
  This PC was busy with another project's benchmark (TraderLab-options' sampler_bench, ~19 of 32 threads), so the
  maintainer said "commit now measure on worker machine": this commit carries the bytes (section 4's new table; R3 and
  R4 annotated), and the steps/s table follows in its own commit from the worker.

Numbering: the questions went out as round 42 (DR-138...DR-141). While the gates ran, master's session committed its own
round 42 (DR-138...DR-141) and round 43 (DR-142, DR-143, pushed as 5e2b739), so this round was renumbered before the
commit to 44, DR-144...DR-147, above both branches' highest (journey1's DR-137, master's DR-143).

Verified:
- Box.Sample against the previous build: 24 kinds of box (every interval category; float32, float64, float16, uint8,
  int32, int64, bool; 0-d, empty, 100 and 40 entries; huge, subnormal, zero-width and signed-zero ranges; bounds
  mutated to -inf, NaN and above high), 300 samples each: identical sample bytes, next generator word, first sample and
  error message (OverflowError "Range exceeds valid bounds", ValueError "high - low < 0").
- Live parity, targeted first (Box2D engine, BipedalWalker, CarRacing, LunarLander, Pendulum, Box, gfxdraw, pygame draw,
  space details and specs): 1,055/1,055. Full parity gate (Release, net10.0): 3,119 passed / 0 failed / 0 skipped.
- Unit gate (Release, headless, TestCategory!=OpenBugs): 4,298 passed / 24 skipped / 0 failed on net10.0, net8.0 and
  net11.0 (built before the new tests; the new and extended classes after: 39/39 on each framework, and in Debug).
- New tests: StepAllocationTests (budgets: Box.Sample <= 2,048 bytes a call, Pendulum <= 2,048, BipedalWalker <= 8,192,
  CarRacing <= 65,536 bytes a step), RasterizerTests (FlipInPlace and SmoothscaleInto against Flip and Smoothscale,
  pixel for pixel, every flag, odd/even/empty/wide/alpha surfaces, a noisy destination, the refusals), BoxTest (the fast
  path draws NumSharp's uniform bit for bit in float64 and float32 over 200 samples; the refused ranges raise uniform's
  errors), CarRacingTests (DR-145's pin).
- Bytes a step after (2,000 steps of the table's loop): Acrobot 4,060, Pendulum 1,249, MountainCar 3,199, CartPole
  3,265, Taxi 4,690, FrozenLake 4,292, BipedalWalker 2,649, CarRacing 10,956, LunarLander 4,907 (9,040 before: Box2D's
  islands are shared).
…: Gym.NET steps 1.9x (CarRacing) to 48.3x (Pendulum) Gymnasium's speed, 1,249-8,931 bytes a step (round 44, DR-147)

DR-147 ("Re-measure the table") for round 44's allocation work (cb8f29f). The reference PC was busy with another
project's benchmark (TraderLab-options' sampler_bench, ~19 of its 32 threads), so the maintainer said "commit now
measure on worker machine": the code went in as cb8f29f and the table follows here.

Where and how (the code review's protocol, the worker's benchmarking conventions):
- The worker machine (Proxmox host `worker`): Intel Xeon E5-2690 v2 (Ivy Bridge, 10 cores / 20 threads, no AVX2 or
  FMA), Linux 7.0.14-pve, idle: an idle gate before every process (three 1-s windows under 5 % busy, the guests under
  half a CPU) passed 16 times, never waiting more than 3 s; over the run (05:51:55-06:08:44) the guests stayed under
  4.0 % of one CPU and no CPU besides the monitor's and the benchmark's two passed 12 %.
- Gym.NET: 6b7defe (before round 44) and cb8f29f (after), each published framework-dependent for linux-x64 from a
  git archive (every library hashed against its snapshot's bin/Release), on .NET 10.0.15. Gymnasium v1.4.0 on CPython
  3.12.16 with NumPy 2.4.2, pygame-ce 2.5.8 and Box2D 2.3.10 (cp312 manylinux wheels downloaded on the workstation).
- Everything in one disposable folder on drive 2, /mnt/drive2/data/gymnet-bench (runtime and CPython copied from
  OptunaSharp's folder on the same disk, a venv from the copied-in wheels; nothing installed on the system); the stage
  copied in at 6.25 MB/s (scp -l 50000, the worker's rule 22).
- Each process pinned to CPUs 2,3 (siblings 12,13 idle); five rounds of each Gym.NET build and four of Gymnasium,
  interleaved with the order rotating each round; benchmark_step for 5 s after a 2-s warm-up in the same env; medians.
  Single runs stayed within 7.3 % of their median (Gymnasium's within 3.0 %). Bytes: the table's loop over 2,000
  steps, GC.GetAllocatedBytesForCurrentThread.

Results (Gym.NET after | Gymnasium | ratio | Gym.NET before | after/before | bytes a step after):
- Pendulum 396,405 | 8,202 | x48.3 | 42,465 | 9.33x | 1,249
- Acrobot 167,022 | 9,337 | x17.9 | 159,499 | 1.05x | 4,060
- MountainCar 235,340 | 25,335 | x9.3 | 224,392 | 1.05x | 3,199
- CartPole 233,393 | 36,519 | x6.4 | 222,572 | 1.05x | 3,262
- FrozenLake 199,458 | 31,299 | x6.4 | 193,181 | 1.03x | 4,284
- Taxi 146,906 | 25,615 | x5.7 | 143,439 | 1.02x | 4,690
- BipedalWalker 9,878 | 2,609 | x3.8 | 7,679 | 1.29x | 2,651
- LunarLander 37,290 | 12,085 | x3.1 | 37,210 | 1.00x | 4,886
- CarRacing 222 | 115 | x1.9 | 197 | 1.13x | 8,931
Pendulum's sampler was most of its time as well as its bytes; the rows whose code did not change move 1.00-1.05x,
inside the runs' spread.

What changed:
- README.md: the Performance table (sorted by ratio within each family, as before), its caption (machine, versions,
  protocol, spread) and the "Faster than Gymnasium" bullet (x1.9 to x48.3).
- docs/plans/CSHARP_CODE_REVIEW.md: section 4's round-44 steps/s table with both builds and the setup; the verdict's
  performance item notes the round. The 2026-11-11 measurement on the i9 stays in section 4.
The worker's raw results, gate and load logs: /mnt/drive2/data/gymnet-bench/results/table-20261125. master's env pages
quote the old rows and take these at the merge (DR-147).
…-127 become DR-149...DR-152, as DR-129 decided for the merge

DR-129 (master's round 39, the maintainer's "Renumber journey1's at the merge"): master's DR-124 and DR-125 keep their
numbers, and journey1's four, with every reference to them in journey1's code, tests and docs, move above master's
highest id when journey1 merges. This commit, on release/1.0.1 (cut from journey1 at 7ee81c8), runs that renumbering
right before master merges in for 1.0.1. master's highest id is DR-148 (round 45, 7562baf), journey1's DR-147
(round 44), so:

- DR-124 -> DR-149 (Gymnasium's 19 refusing ids), DR-125 -> DR-150, DR-126 -> DR-151, DR-127 -> DR-152 (the JAX phys2d
  envs), everywhere in the tree but refs/: 93 references in 34 files (the Phys2d sources, GymEnvironments.cs,
  Gymnasium.Envs.cs, JaxVmap.cs, JaxRandom.cs, the unit and parity tests, the inventory's expected-missing list,
  THIRD-PARTY-NOTICES.md, docs/architecture.md, GYMNASIUM_PORT_PLAN.md, both CLAUDE.md files, DESIGN_REVIEW.md).
  journey1's tree holds no reference to master's DR-124/DR-125 except where its design review tells the story of the
  collision, so the rename was scripted (word-bounded, line endings kept) with those lines left out and edited by hand.
- "Round 38" -> "Round 46" where journey1 means its own round (DESIGN_REVIEW.md, GYMNASIUM_PORT_PLAN.md). The round's
  heading keeps its date and says it was written as journey1's round 38; its opening paragraph now tells the collision
  and the renumbering as done (master's highest DR-148 at the merge). Rounds 40 and 41, which planned for the
  renumbering, now say where the four went.

Left for the merge commit: the root CLAUDE.md's design-gate line (both branches rewrote it, so it conflicts anyway) and
the round's place in DESIGN_REVIEW.md (after round 45 once master's rounds are in).

Checked: a Unicode-aware scan of every tracked file outside refs/ finds DR-124...DR-127 only on the three lines that
name master's ids or the reverted renumbering (DESIGN_REVIEW.md's collision paragraph, CLAUDE.md's design-gate line).
…s env docs, README and rounds 38-45 for 1.0.1

release/1.0.1 is journey1 (7ee81c8) plus DR-129's renumbering (281eff9); this merges master (57a5ba6, pushed) so the
branch holds everything since 1.0.0+rc1 and the 1.0.1 work goes on top of it.

From journey1: Make's wrappers list and IEnv.Wrap (round 36, DR-117...DR-120), the JAX tabular envs (round 37,
DR-121...DR-123), Gymnasium's 19 refusing ids and the JAX phys2d envs (round 46, DR-149...DR-152, written as round 38),
complex64 CartPole actions (round 40, DR-132, DR-133), Jax.Vmap (round 41, DR-134...DR-137) and the per-step allocations
(round 44, DR-144...DR-147), with the README's re-measured Performance table. From master: the 23 env pages and their
examples' --record (E1-E9), the site's sidebar and gallery lock (rounds 42-43), samples in Gymnasium's shape with Python
twins (DR-139...DR-141), the README's typed example (DR-148) and its gallery's names below the stills.

Conflicts, each resolved by keeping both sides:
- CLAUDE.md, the design-gate line: the merged ranges, DR-01...DR-125 and DR-128...DR-152, DR-126 and DR-127 unused.
- docs/environments/index.md: journey1's 44 ids in six families with master's newer gallery sentence (the manual
  panel and READ THE MANUAL); journey1's "and the call that makes it" dropped, since master's screen no longer shows it.
- docs/guides/getting_started.md: master's Python tab for the registry sample, then journey1's paragraph on the 19
  refusing ids after the tab group.
- docs/plans/DESIGN_REVIEW.md: the rounds each branch added after round 35, interleaved by number (36, 37, 38, 39, 40,
  41, 42, 43, 44, 45, 46), and the consequences each appended, by date (E4, E5, then journey1's four of 2026-11-23,
  then E6, E7); a scripted splice, each section byte for byte. ids 01...152, none twice, DR-126/DR-127 the only gap.

Beyond the conflicts:
- DESIGN_REVIEW.md's status line (master's) now names journey1's rounds 40, 41 and 44 and the merge itself.
- The nine env pages with a Performance table (CartPole, MountainCar, Pendulum, Acrobot, FrozenLake, Taxi,
  BipedalWalker, LunarLander, CarRacing) quoted the 2026-11-11 measurement; they take DR-147's (2026-11-25, the worker's
  Xeon E5-2690 v2), the numbers of the README's table: rows, ratio and date only, paragraphs rewrapped at 120.
- Getting Started's "Wrapping an env of any type" (journey1's, written before DR-141) gets its two Python twins in tab
  groups, run against Gymnasium 1.4.0 (8ba8c3a6): the same stacks as the C# comments, and "return -1.0, length 1"
  where C# prints "return -1, length 1".

Checked: Gym.NET.sln builds in Debug with no error.
…nd publishing 1.0.1 (DR-153...DR-155)

The maintainer asked to check every open GitHub issue against 1.0.0 and draft replies, then: "What do we have for
merging? Also create a PR. Also Bump the version to 1.0.1 and prepare to release and then release nugets". The checks
ran on the GitHub release's 1.0.0 nupkgs (checksums verified) in an isolated NuGet cache, and on a disposable Windows
desktop for the windows; they found two 1.0.0 defects. One HTML call of three questions decided them:

- DR-153, issue #14's packaging, "Fix in 1.0.1": Gym.NET.Environments packed its registration targets at the root of
  buildTransitive/, a framework-neutral asset, so NuGet let a net472 or net6.0 project install the package with no
  lib, and its build then failed on the injected file (CS0234 on ModuleInitializer, CS0400 on Gym) where 0.2.0 had
  failed at install with NU1202. The fix packs them under buildTransitive/net8.0/, guarded by a pack-time GYMNET0013.
- DR-154, the human window's X (issue #22's second half), "Close, drop frames": 1.0.0 no longer freezes as 0.2.0 did
  (reproduced on the desktop: 0.2's async factory blocked with GetAwaiter().GetResult() on the WinForms UI thread),
  but the user's X mid-run made the next step throw InvalidAsynchronousStateException, and the env's disposal ran the
  viewer's Application.ExitThread on the app's own UI thread, which an instrumented run showed as ThreadExit on the
  viewer thread, then on the main one. Not taken: the X doing nothing while an env renders, as Gymnasium's pygame
  window does.
- DR-155, publishing, "I run the push" with the maintainer's "Set up trusted publisher for gym.net": a hand-run
  workflow, nuget.yml, pushes with a one-hour key from nuget.org's trusted publishing (GitHub's OIDC token), no key
  stored; nuget.org's policy is the maintainer's to create.

The round is 47 and its ids DR-153...DR-155, the first above every branch's highest (DR-152 after the merge's
renumbering). The status line names it; CLAUDE.md's design-gate range now ends at DR-155.
…dTransitive/net8.0/, so an older framework gets NU1202 at install again, and GYMNET0013 keeps it so (round 47, DR-153)

Issue #14 (.NET Framework 4.7.2) on 1.0.0: NuGet counts a file at the root of a package's buildTransitive/ folder as
fitting every framework, so the package fitted net472 and net6.0 too. Such a project restored it without NU1202, got
no lib (project.assets.json: compile []), and its build failed on the file the targets inject:
GymNetEnvironmentsRegistration.cs(12,50): error CS0234 (ModuleInitializer) on net472, error CS0400 (Gym) on net6.0.
0.2.0, which shipped no build assets, failed at install with NU1202, naming its frameworks.

- src/Gym.Environments/Gym.Environments.csproj: the targets and the .cs pack to buildTransitive\net8.0\ instead of
  buildTransitive\. NuGet reads that folder for net8.0 and every later framework (net10.0, net11.0, the -windows ones),
  the frameworks the libs target, and refuses the rest. The source folder is unchanged: the examples and tests import
  the targets by path.
- Directory.Build.targets: GYMNET0013, before GenerateNuspec as GYMNET0012 is, fails the pack of any project that packs
  a None or Content item into the root of build/ or buildTransitive/, with the files named, the reason and the fix in
  its text, so the mistake cannot reach nuget.org, where a published package is immutable.

Checked, packing Gym.NET, Gym.NET.Rendering and Gym.NET.Environments as 1.0.1-dr153.1 (Release,
ContinuousIntegrationBuild) into a test feed and restoring from it in an isolated cache:
- the nupkg holds buildTransitive/net8.0/Gym.NET.Environments.targets and .../GymNetEnvironmentsRegistration.cs only;
- net472 and net6.0: error NU1202 at restore, listing net8.0, net10.0 and net11.0;
- net8.0 and net10.0: build, and Gymnasium.Make<NDArray, NDArray>("CartPole-v1") by id works (the injected module
  initializer registered the ids), printing CartPole's seed-42 reset, [ 0.0273956 -0.00611216 0.03585979 0.0197368 ];
- negative control: with the two PackagePaths put back at buildTransitive\, the pack fails with GYMNET0013 naming both
  files and writes no nupkg; the csproj was restored byte for byte after.
…re dropped and Close does nothing, never on the caller's thread (round 47, DR-154)

Issue #22's second half on 1.0.0, reproduced on a Windows desktop with the migration guide's loop on a WinForms app's UI
thread: closing the env's window with its X mid-run made the next Step throw InvalidAsynchronousStateException
("The destination thread no longer exists", Control.Invoke from CartPoleEnv.Render), and disposing the env then ended
the app: the viewer's close found InvokeRequired false (it is, on every thread, once the window is destroyed) and ran
CloseOnOwnThread, Application.ExitThread included, on the app's own UI thread (an instrumented run logged ThreadExit
on the viewer's thread, then on the main one, and Application.Run returned).

Gym.Rendering.WinForm, WinFormEnvViewer:
- _closed, set in a new OnFormClosed override however the form closed (with input on the X never gets there: DR-70's
  OnFormClosing cancels and reports it). Render and RenderAsync validate the frame, then drop it once closed; a frame
  already on its way when the window closes is dropped too (InvalidAsynchronousStateException and
  InvalidOperationException caught only when closed), and the form's thread checks again before showing a queued frame.
- IEnvViewer.Close and CloseAsync do nothing once closed. Which thread is the form's comes from _ownThreadId, recorded
  in the constructor (the thread that creates a form runs its loop), never from InvokeRequired, so
  Application.ExitThread runs on the form's thread or not at all.
- Start creates the window's handle before the factory returns the viewer, so a frame or close from another thread can
  always be marshalled (before, a call made before the handle existed ran on the caller's thread).
- An async render or close still waiting when the form closes completes then (_closedSignal), instead of waiting on a
  thread that is gone.

Gym.Rendering.Avalonia, AvaloniaEnvViewer: its shared UI thread outlives the window and its close only hides it, so it
never hit the thread bug; for the same behaviour it gains _closed (a new OnClosed override): frames dropped, the hide
skipped once the user has closed the window, and a frame queued before the X dropped on the UI thread.

Both classes' remarks say what the X does now; Gymnasium's pygame window ignores its X, a recorded difference (DR-154).

tests/Gym.Tests/Rendering/ViewerUserCloseTests.cs (window cells, names ending WinFormEnv/AvaloniaEnv, so the headless
gate leaves them out), the X clicked as a user clicks it, WM_CLOSE posted to the window:
- WinFormViewer_UserClose_DropsFramesAndKeepsTheAppsLoop_WinFormEnv: on an STA thread running its own WinForms loop,
  Render, RenderAsync (complete at once), Close and CloseAsync after the X, then a callback queued to the app's form
  must still run: the loop survived.
- HumanCartPole_UserClosesTheWindow_KeepsSteppingAndDisposes_WinFormEnv: issue #22 itself, CartPole-v1 in human mode
  stepped on that loop, 20 steps after the X, then disposed.
- AvaloniaViewer_UserClose_DropsFrames_AvaloniaEnv.
On a clean Windows 11 desktop (the release branch's Debug build, net10.0-windows, VSTest): 3 passed.
…ishing, a workflow run by hand for a release's tag (round 47, DR-155)

The maintainer: "I run the push", and "Set up trusted publisher for gym.net". .github/workflows/nuget.yml, on
workflow_dispatch with the tag (v1.0.1), on windows-latest with the .NET 8, 10 and 11 SDKs:

- checks out the tag and builds the five packaged projects in Release with ContinuousIntegrationBuild=true, so
  GYMNET0011 stops an SDK without .NET 11 and GYMNET0012/GYMNET0013 guard the package layout; build, not pack
  (NU5026 on a fresh checkout);
- checks that exactly the five ids were packed, each at the tag's version (a stale csproj stops the push), and writes
  each nupkg's SHA-256 as the 1.0.0+rc1 release's .sha256 files are written;
- uploads them as an artifact and to the tag's GitHub release (--clobber, so a re-run replaces them);
- right before the push, NuGet/login@v1 exchanges GitHub's OIDC token (id-token: write) for a one-hour nuget.org API
  key, then dotnet nuget push --skip-duplicate, so a re-run skips what nuget.org has. No key is stored anywhere.

nuget.org's side is the maintainer's: a trusted publishing policy (Repository Owner SciSharp, Repository Gym.NET,
Workflow File nuget.yml) owned by the account the repository secret NUGET_USER names; the policy covers what its owner
owns (and new ids when its scope allows), so that account must own or co-own all five ids. Checked: the file parses as
YAML with the manual trigger only, contents: write and id-token: write, and eight steps.
The maintainer: "Bump the version to 1.0.1 and prepare to release and then release nugets". Decision D25 named it: NuGet
reads 1.0.0+rc1 as the stable 1.0.0 (build metadata is ignored when versions match), and nuget.org cannot hold a second
1.0.0, so whatever followed, a fix or the final, ships as 1.0.1.

- src/Gym, src/Gym.Rendering, src/Gym.Environments, src/Gym.Rendering.Avalonia, src/Gym.Rendering.WinForm: <Version>
  1.0.1, and the comment above it says why and that the five move together (nuget.yml checks each against the tag).
- CLAUDE.md, the package build's comment: version 1.0.1, GYMNET0013 beside GYMNET0012, and nuget.org's packages come
  from nuget.yml (DR-155).
… the app's loop survived, and CartPole's X lands while frames flow (round 47, DR-154)

A negative control (the same tests built against the merge commit's viewers, 7c9270d, run on a Windows desktop) showed
the end-to-end test passing on 1.0.0's code. Two reasons, both in the test:

- The loop check queued a callback after the scenario. Application.ExitThread asks a loop to quit, but Windows hands the
  quit over only after the messages already posted, so the callback still ran on a loop that was ending. The check is
  now a WinForms timer started after the scenario: a timer's tick comes after the quit, so a loop that ExitThread ended
  never sees it, and the runner fails with "the app's message loop ended".
- CartPole's X was clicked and the close awaited before stepping, so no frame was on its way when the window went. The
  X now lands while 60 steps run, as the report's user clicked it, and the close is checked after them.

Result on the desktop (net10.0-windows, VSTest): the release branch 3 of 3 passed; 1.0.0's viewers fail both WinForms
cells (ObjectDisposedException from the closed form; "the app's message loop ended: a close ran Application.ExitThread on
the app's own thread"), and the Avalonia cell passes there too, as that viewer never had the thread bug. The release
branch's whole window suite passed on the same desktop: WinFormEnv 45 of 45, AvaloniaEnv 45 of 45.
….org

docs/releases/RELEASE_1.0.1.md, in the maintainer's house style (as RELEASE_1.0.0.md): an owner-voice intro that sends
0.2.0 users to the 1.0.0 notes and the migration guide first (nuget.org goes from 0.2.0 to 1.0.1, since 1.0.0+rc1 stayed
on its GitHub release), the Overview, the new package, the Detailed Breakdown in one <details> block (packages, docs,
APIs, environments, performance with its xLOW->xHIGH explainer, parity and fixes, tooling, breaking changes last), then
the install lines and the badge table at 1.0.1. One bullet per line, ASCII hyphens, no commit hashes.

Where the numbers come from:
- 44 ids, the five JAX ones, the 19 refusing ids: the registry (GymEnvironments.cs) and the round 37/46 commits.
- 267 of 301 public names: tools/parity/gymnasium_inventory.json (301 entries, unchanged since 1.0.0+rc1) less the 34
  lines of tests/Gym.Tests/Gymnasium/inventory.expected-missing.txt (64 at 1.0.0+rc1, hence 237 then), grouped by their
  reasons: 21 JAX/PyTorch, 2 process workers, 1 pickling, 9 by design, 1 Atari.
- Bytes a step and the ratios: the README's two Performance tables, 1.0.0+rc1's (2026-11-11) and DR-147's (2026-11-25,
  the worker's Xeon), each with its conditions; 3,631,032 / 8,931 = 406.6, hence "up to 406 times less". The notes say
  the two releases' ratios do not compare, the machines differing.
- Frames: round 30's commits (InvertedPendulum and InvertedDoublePendulum, v4 and v5, 0 differing pixels at both states;
  the screen tests at 100%, 125%, 150% and 175%).
- #14 and #22: round 47's checks; the window tests' 45 and 45: the desktop run of this branch.
- 23 pages, 25 examples, 12 agents: docs/environments, examples/, tests/Gym.Tests/Agents.

docs/README.md lists the new notes above 1.0.0's; CLAUDE.md's user-docs line names both.
… environment its trusted publishing policy names (round 47, DR-155)

The maintainer, of nuget.org's side of trusted publishing: "You do it with browser". Done in the maintainer's own Chrome
(signed in as elibelash through the existing Microsoft account session, no password typed):

- Gym.NET.Environments' Manage page answered "You do not have permission to manage the owners of this package":
  elibelash is a member of the SciSharp organization, not its admin, so the plan of one owner for all five ids was not
  possible. A policy covers one owner's packages, and the ids have two: elibelash (Gym.NET, Gym.NET.Rendering.WinForm,
  and Gym.NET.Rendering from its first push) and SciSharp (Gym.NET.Environments, Gym.NET.Rendering.Avalonia).
- Two policies created on nuget.org > Trusted Publishing, both Active, both for Repository Owner SciSharp (#44989469),
  Repository Gym.NET (#194005104), Workflow File nuget.yml, "Push new packages and package versions":
  "Gym.NET", owner elibelash, environment nuget, packages Gym.NET, Gym.NET.Rendering, Gym.NET.Rendering.WinForm;
  "Gym.NET (SciSharp)", owner SciSharp, environment nuget-scisharp, packages Gym.NET.Environments,
  Gym.NET.Rendering.Avalonia. The maintainer's existing policies (NumSharp, OptunaSharp, KvNode, KvAsm, AsmSdk) use the
  environment nuget the same way.
- GitHub: the environments nuget and nuget-scisharp created on SciSharp/Gym.NET; the repository secret NUGET_USER
  (elibelash, the account both policies were created by) was set before.

.github/workflows/nuget.yml: the build job (checkout of the tag, the five packages built as a release, the versions
checked against the tag, the SHA-256 files, the artifact, the release upload) is unchanged; the push moves into two
jobs on ubuntu-latest that download the artifact, log in with NuGet/login (one OIDC token, one key, each), and push
their owner's ids, each matched as "<id>." followed by a digit so Gym.NET does not take Gym.NET.Environments:
push-elibelash in environment nuget, then push-scisharp in environment nuget-scisharp, second because
Gym.NET.Environments depends on the other three. DR-155's row records the two policies and why.

Checked: the YAML parses, with build, push-elibelash (needs build, environment nuget) and push-scisharp (needs both,
environment nuget-scisharp); the per-id pattern picks exactly one of the five 1.0.1 nupkgs for each id and no .sha256.
… was (decision D26); the notes gain CI's unit counts

The maintainer, of the release after 1.0.0+rc1: "Wait so we are rc1 in v1.0.0, we must also be v1.0.1+rc1 in the new
release". Recorded as D26 in docs/plans/COMPLETION_PLAN.md, beside D25 (1.0.0+rc1).

- The five csprojs: <Version>1.0.1+rc1</Version>, the comment above it naming D26 and why NuGet reads it as the stable
  1.0.1. Checked: a Release build of src/Gym packs Gym.NET.1.0.1.nupkg (NuGet names the file by the version without its
  build metadata, as 1.0.0+rc1's release assets are named Gym.NET.1.0.0.nupkg), whose nuspec reads 1.0.1+rc1.
- .github/workflows/nuget.yml: the examples name the tag v1.0.1+rc1; the check's comment says why the tag's metadata goes
  before the file names are compared (the code already dropped it: -replace '\+.*$').
- docs/releases/RELEASE_1.0.1.md: titled Gym.NET 1.0.1+rc1, the version named 1.0.1+rc1 wherever it is the packages'
  version, and a "Release candidate 1" bullet as 1.0.0's notes have one; the install lines and the badges keep 1.0.1,
  nuget.org's normalized version, as 1.0.0's keep 1.0.0. The Overview gains "4,484 unit tests pass on net8.0, net10.0
  and net11.0, in Debug and Release", and Testing & Tooling the unit suite's line: 4,484 of 4,509, and the 25 skips:
  24 data rows where Gymnasium's own tests call pytest.skip (Pusher-v4 on mujoco >= 3, the envs without an
  observation_structure, the dynamic-shape spaces with shared memory) and TestFfmpegWriterWritesMp4Files, Inconclusive
  on DependencyNotInstalled where the machine has no ffmpeg.
  Source: CI run 46712151704 on 938dc87, cancelled at the maintainer's word during its parity gate, after both unit
  gates had passed (4,484 passed, 25 skipped, 0 failed, on each framework, Debug and Release). The commits since then
  change no test of the headless gate (bb13029 touches window tests only, which the gate excludes), so the counts hold
  for this tree. No parity count: the run stopped before the parity suite's summaries.
- docs/README.md: the notes' row reads "1.0.1+rc1, release candidate 1", as 1.0.0's does; CLAUDE.md: decisions D2-D26,
  v1.0.1+rc1, the packages' version line.

The cancelled run had no error: both builds 0 errors (849 warnings against master's last green run's 837; the 12 more
are NDW012 at four sites of tests/Gym.Tests/Envs/Registration/MakeWrappersTests.cs, journey1's round 36 tests, on three
frameworks each), the unit gates 0 failed, Ubuntu's golden replay 67 passed per framework, and the parity gate no failure
before the cancel. The Docs run's 20 DocFX warnings are master's 20.
@Nucs Nucs changed the title Gym.NET 1.0.1 - the first 1.0 on nuget.org: JAX environments, Make's wrappers, and the fixes the issues found Gym.NET 1.0.1+rc1 - the first 1.0 on nuget.org: JAX environments, Make's wrappers, and the fixes the issues found Dec 1, 2026
…s DOTNET_EnableAVX512F=0 no longer runs them on an AVX-512 runner under net8.0 (DR-152)

CI run 46728375198 on 0c0afc7 (the release head) failed its parity gate on net8.0 only: 11 cells,
GymNet_VmappedCartPole_MatchesGymnasium at 8, 16, 17, 20, 24, 31, 32, 33, 64 and 65 carts and
GymNet_VmappedSizes_MatchGymnasium (790 batches), each the vmapped CartPole's initial states 1 to 51 ulp from
Gymnasium's (net8.0: 3,042 passed, 11 failed, 66 skipped of 3,119). net10.0 and net11.0 passed (2,989 passed, 130
skipped): the same cells were Inconclusive there. The unit gates passed (4,484 of 4,509 on each framework, Debug and
Release), as did Ubuntu's golden replay.

Cause: SkipOffXlaVectorReferenceCpu, the guard DR-152 puts on the phys2d vector cells (they run only on a CPU like the
reference one, FMA and AVX2 without AVX-512, since XLA vectorizes the batch for the host's vector width; elsewhere they
are Inconclusive), asked .NET's JIT about AVX-512 (Avx512F.IsSupported). CI sets DOTNET_EnableAVX512F=0, which acted on
net8.0 and not on net10.0 or net11.0: on the runner, an AVX-512 host (the run's own "Runner CPU" step: host AVX512F
True), net8.0 saw no AVX-512 and ran the cells, while XLA, in the same process, compiled for the AVX-512 the CPU has.
The counts agree: net8.0 ran 64 cells the other two skipped (53 passed, 11 failed).

tests/Gym.Tests.Parity/Session/ParityTestBase.cs: CpuHasAvx512F reads CPUID leaf 7 (EBX bit 16), which no .NET setting
can hide. FMA and AVX2 stay with the JIT, whose view a setting can only shrink (a skip, never a wrong run) and which
includes the OS's support; a CPU whose OS leaves its AVX-512 state off reads as having AVX-512, and its cells skip, the
safe direction. No new design: this is DR-152's "elsewhere they are Inconclusive", now held on .NET 8 under CI's
settings.

.github/workflows/ci.yml: the comment on DOTNET_EnableAVX512F says it acts on net8.0 only (observed in 46728375198) and
that nothing may ask .NET's JIT what XLA compiles for. The setting itself stays.

docs/releases/RELEASE_1.0.1.md: the phys2d line says where Gymnasium's last bits match: XLA compiles for the host CPU,
so where it compiles as on the reference CPU, with FMA (DR-151), and for the vector environments AVX2 without AVX-512
(DR-152).

Checked on this PC (Intel i9: AVX2 and FMA, no AVX-512):
- A net8.0 probe printing the JIT's and CPUID's views: plain, both say AVX2 true and AVX512F false; under
  DOTNET_EnableAVX2=0 the JIT's AVX2 turns false while CPUID's stays true, the masking CI's setting did to AVX-512;
  under DOTNET_EnableAVX512F=0 nothing changes here (no AVX-512 to hide).
- JaxVmapLiveParityTests on net8.0, Release, under CI's environment (DOTNET_EnableAVX512F=0, OPENBLAS_CORETYPE=Haswell,
  NPY_ENABLE_CPU_FEATURES=X86_V3, GYMNET_PYTHONNET_REQUIRE_ENGINE=1) against the parity venv (JAX 0.12.1, NumPy 2.4.2,
  MuJoCo 4.0.0): 35 of 35 passed, none skipped, so the reference CPU still runs every cell and matches.
@Nucs
Nucs merged commit d1d75f9 into master Dec 1, 2026
4 checks passed
@Nucs
Nucs deployed to nuget-scisharp December 2, 2026 03:14 — with GitHub Actions Active

This branch was successfully deployed

3 active deployments
nuget-scisharp — d1d75f91 Deployed Dec 2, 2026 by Nucs via push Gym.NET.Environments, Gym.NET.Rendering.Avalonia #1
github-pages — d1d75f91 Deployed Dec 1, 2026 by Nucs via deploy to GitHub Pages #25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant