Lodur.Body.Ymir: HumanoidRagdoll, Muscle and Limb public; friend grant and native-world collection gone

Ymir 0b0321a makes the SoA world public and locks world create/destroy. The ragdoll's
Build takes the caller's Box3DSoaWorld and Lodur still never creates one. Deleted
AssemblyInfo.cs (InternalsVisibleTo), NativeWorld.cs and the collection attributes; first-slice.md
now records that no DLL rename is needed under MinGW.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-11-19 21:51:28 +01:00
commit 05b74e864e
6 changed files with 5 additions and 23 deletions

View file

@ -33,7 +33,7 @@ Ymir's structure-of-arrays world. Nothing above layer 5 exists yet.
## Not measured, or limits found
- Cross-platform bit-identity: unclaimed. Windows (2026-11-19, no MSVC): builds and passes with MinGW gcc, `CMAKE_GENERATOR="Ninja Multi-Config" CC=gcc`; MinGW names the DLL `libymir_box3d.dll` where `Ymir.Box3D.csproj` expects `ymir_box3d.dll`, so copy it to the unprefixed name in `artifacts/box3d-native/production/Debug/bin/Debug` until Ymir emits that name. Test classes that build worlds must not run in parallel there (two live worlds crashed the host). Unity consumption: unrun. One machine, Debug
- Cross-platform bit-identity: unclaimed. Windows (2026-11-19, no MSVC): builds and passes with MinGW gcc, `CMAKE_GENERATOR="Ninja Multi-Config" CC=gcc`; Ymir 0b0321a emits `ymir_box3d.dll` under MinGW, so no rename is needed, and its world create/destroy lock makes test classes safe to run in parallel (before it, two live worlds crashed the host). Unity consumption: unrun. One machine, Debug
native build only; no Release run, no run in a second process.
- Explicit PD through torque lanes limits stiffness and damping: damping times the step must stay under the
inertia it acts on. Hips and spine went unstable at damping 15 and 20 and are set to 3 and 4; the gains

View file

@ -1 +0,0 @@
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Lodur.Tests")]

View file

@ -4,7 +4,7 @@ using Ymir.Box3D;
namespace Lodur.Body.Ymir
{
/// <summary>The ragdoll's joints, in strength-array and target-array order.</summary>
internal enum Muscle
public enum Muscle
{
Spine, Neck, ShoulderL, ShoulderR, ElbowL, ElbowR, HipL, HipR, KneeL, KneeR, AnkleL, AnkleR
}
@ -16,7 +16,7 @@ namespace Lodur.Body.Ymir
}
/// <summary>The ragdoll's bodies, also the limb label written into the world's limb lane.</summary>
internal enum Limb
public enum Limb
{
Pelvis, Torso, Head, UpperArmL, UpperArmR, LowerArmL, LowerArmR, ThighL, ThighR, ShinL, ShinR, FootL, FootR
}
@ -25,10 +25,10 @@ namespace Lodur.Body.Ymir
/// A 13-body humanoid built in a caller-owned Ymir SoA world (invariant one-physics-world): capsule limbs,
/// box pelvis, torso and feet, a sphere head, spherical joints at spine, neck, shoulders and hips, hinges at
/// elbows, knees and ankles. Facing +z, left is +x, standing on y = 0 at the creation pose, which is also
/// every joint's zero. <see cref="Drive"/> is the muscle layer: it turns caller-owned strengths and target
/// every joint's zero. The game owns the physics world: Build adds bodies to the caller's world and Lodur never creates or steps one. <see cref="Drive"/> is the muscle layer: it turns caller-owned strengths and target
/// rotations into torques on the world's torque lanes and does nothing else to the physics.
/// </summary>
internal sealed class HumanoidRagdoll
public sealed class HumanoidRagdoll
{
public const int MuscleCount = 12;
public const int LimbCount = 13;

View file

@ -73,7 +73,6 @@ internal sealed class ConnectedPainBox : IDisposable
public void Dispose() => World.Dispose();
}
[Collection(NativeWorld.Name)]
public sealed class ConnectedPainBoxTests
{
private static float Dist((float X, float Y, float Z) a, (float X, float Y, float Z) b) =>

View file

@ -1,14 +0,0 @@
namespace Lodur.Tests;
/// <summary>
/// Test classes that build Ymir worlds share this collection so xunit runs them one at a time: two native
/// Box3D worlds alive on different threads crashed the test host (0xC000001D) on Windows/MinGW, 2026-11-19.
/// This works around a Ymir defect (lodur:finding:cut-nervous-layers.s1.ymir-concurrent-world-create: world create and
/// destroy are not thread-safe). Remove this collection, and the attributes naming it, in the body commit after Ymir
/// merges its lock around world create/destroy.
/// </summary>
[CollectionDefinition(Name)]
public sealed class NativeWorld
{
public const string Name = "native Ymir world";
}

View file

@ -4,8 +4,6 @@ using Ymir.Box3D;
namespace Lodur.Tests;
/// Native Ymir worlds are not created concurrently (see NativeWorld.cs).
[Collection(NativeWorld.Name)]
public sealed class RagdollTests
{
private const float StandingHead = 1.74f;