From eb30cac65b9d80c145d1a86014eb51df597b723a Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Thu, 19 Nov 2026 20:43:55 +0100 Subject: [PATCH] Box3D SoA world is public; drop Lodur friend grants; MinGW emits ymir_box3d.dll Co-Authored-By: Claude Sonnet 5.5 --- docs/soa-world.md | 4 ++-- native/Ymir.Box3D/CMakeLists.txt | 3 ++- src/Ymir.Box3D/Box3DSoaWorld.cs | 8 ++++---- src/Ymir.Box3D/Properties/AssemblyInfo.cs | 2 -- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/docs/soa-world.md b/docs/soa-world.md index f62d76e..e063bf9 100644 --- a/docs/soa-world.md +++ b/docs/soa-world.md @@ -30,7 +30,7 @@ separate native object (`ymir_box3d_soa.c`, ABI 1) so the Aetheria session's con w >= 0) and `joint_angular_velocity` (B minus A, in frame A). A consumer can compute a joint torque from these and write it as equal and opposite torques on the two body lanes. - State lanes change only inside `step`. Between steps a caller may read any state lane in place. -- Managed (`src/Ymir.Box3D/Box3DSoaWorld.cs`, internal): `Box3DSoaView` exposes each lane as a span over +- Managed (`src/Ymir.Box3D/Box3DSoaWorld.cs`, public: `Box3DSoaWorld`, `Box3DSoaView`, `Box3DSoaKind`, `Box3DSoaJointKind`; the native structs and the view constructor stay internal): `Box3DSoaView` exposes each lane as a span over native memory (`ReadOnlySpan` for state, `Span` for write lanes). Spans are invalid after `Dispose`. `Count` and `JointCount` are as of when the view was taken, so take it after the last add. - Determinism: one Box3D worker, bodies stepped in insertion order, same inputs give identical lane @@ -52,5 +52,5 @@ a torque-driven jointed body. Contact facts for the SoA world (Begin/Hit/End), body removal with a stable ordering rule, compound bodies and per-shape material, joint motors and springs (Lodur drives joints from torque lanes instead), and a -public typed surface in `Ymir.Core` (the wrapper is internal, visible to the test assembly). Windows build +a typed surface in `Ymir.Core` (the SoA world is public in `Ymir.Box3D`). Windows build and Unity consumption are unrun; cross-platform bit-identity is unclaimed. diff --git a/native/Ymir.Box3D/CMakeLists.txt b/native/Ymir.Box3D/CMakeLists.txt index eabb2b5..a35d8a9 100644 --- a/native/Ymir.Box3D/CMakeLists.txt +++ b/native/Ymir.Box3D/CMakeLists.txt @@ -23,4 +23,5 @@ set_target_properties(ymir_box3d PROPERTIES C_VISIBILITY_PRESET hidden RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" - ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib") + ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" + PREFIX "") diff --git a/src/Ymir.Box3D/Box3DSoaWorld.cs b/src/Ymir.Box3D/Box3DSoaWorld.cs index c6eee77..2d1759a 100644 --- a/src/Ymir.Box3D/Box3DSoaWorld.cs +++ b/src/Ymir.Box3D/Box3DSoaWorld.cs @@ -2,7 +2,7 @@ using System.Runtime.InteropServices; namespace Ymir.Box3D; -internal enum Box3DSoaKind : uint +public enum Box3DSoaKind : uint { Sphere = 0, StaticBox = 1, @@ -10,7 +10,7 @@ internal enum Box3DSoaKind : uint Box = 3 } -internal enum Box3DSoaJointKind : uint +public enum Box3DSoaJointKind : uint { Revolute = 0, Spherical = 1, @@ -148,7 +148,7 @@ internal static unsafe partial class Box3DSoaNative /// world's life, the contents change only inside , and every span is /// invalid once the world is disposed. /// -internal readonly unsafe struct Box3DSoaView +public readonly unsafe struct Box3DSoaView { private readonly Box3DSoaViewNative _v; @@ -220,7 +220,7 @@ internal readonly unsafe struct Box3DSoaView /// A headless 3D Box3D world: N bodies stepped deterministically (one worker, fixed order) with a /// structure-of-arrays state view read in place. Ymir writes no solver; Box3D decides everything. /// -internal sealed class Box3DSoaWorld : IDisposable +public sealed class Box3DSoaWorld : IDisposable { private const uint ExpectedAbi = 2; private nint _handle; diff --git a/src/Ymir.Box3D/Properties/AssemblyInfo.cs b/src/Ymir.Box3D/Properties/AssemblyInfo.cs index 263a317..93c6e82 100644 --- a/src/Ymir.Box3D/Properties/AssemblyInfo.cs +++ b/src/Ymir.Box3D/Properties/AssemblyInfo.cs @@ -2,5 +2,3 @@ using System.Runtime.CompilerServices; [assembly: InternalsVisibleTo("Ymir.Core")] [assembly: InternalsVisibleTo("Ymir.Box3D.Soa.Tests")] -[assembly: InternalsVisibleTo("Lodur.Body.Ymir")] -[assembly: InternalsVisibleTo("Lodur.Tests")]