Merge eureka/aetheria-release-cultmath-0-4-1-pin: CultMath 0.4.1, the allocator's answer no longer depends on its warm start

Soul held (aetheria-release:verdict:cut-cultmath-0-4-1-pin.s1); master
moved only in docs since the branch point, so the branch's verify stands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-11 09:46:34 +02:00
commit 28250600f1
4 changed files with 38 additions and 5 deletions

View file

@ -6,8 +6,8 @@
<CultLibRevision>45c2f4006f5f7dab357426cabd3197e8d0a17f66</CultLibRevision>
<CultMathRoot Condition="'$(CultMathRoot)' == '' and '$(CULTMATH_ROOT)' != ''">$(CULTMATH_ROOT)</CultMathRoot>
<CultMathRoot Condition="'$(CultMathRoot)' == ''">$(CultLibRoot)</CultMathRoot>
<!-- CultMath: cultmath-unity-v0.4.0 in Packages/manifest.json. -->
<CultMathRevision>252e226c51826d626f4113673f31d96577b67ec9</CultMathRevision>
<!-- CultMath: cultmath-unity-v0.4.1 in Packages/manifest.json. -->
<CultMathRevision>9c1b06cd703bfa44352050e819b0d0659cf5978a</CultMathRevision>
<GitExecutable Condition="'$(GitExecutable)' == '' and Exists('C:\Program Files\Git\cmd\git.exe')">C:\Program Files\Git\cmd\git.exe</GitExecutable>
<GitExecutable Condition="'$(GitExecutable)' == ''">git</GitExecutable>
</PropertyGroup>

View file

@ -54,6 +54,6 @@
"com.unity.modules.xr": "1.0.0",
"org.gamecult.caching.unity": "https://github.com/GameCult/CultLib.git?path=/src/GameCult.Unity/Assets/Caching#caching-unity-v1.4.0",
"org.gamecult.cultlib": "https://github.com/GameCult/CultLib.git?path=/unity/org.gamecult.cultlib#cultlib-unity-v1.0.60",
"org.gamecult.cultmath": "https://github.com/GameCult/CultLib.git?path=/packages/cultmath/unity/org.gamecult.cultmath#cultmath-unity-v0.4.0"
"org.gamecult.cultmath": "https://github.com/GameCult/CultLib.git?path=/packages/cultmath/unity/org.gamecult.cultmath#cultmath-unity-v0.4.1"
}
}

View file

@ -272,11 +272,11 @@
"hash": "45c2f4006f5f7dab357426cabd3197e8d0a17f66"
},
"org.gamecult.cultmath": {
"version": "https://github.com/GameCult/CultLib.git?path=/packages/cultmath/unity/org.gamecult.cultmath#cultmath-unity-v0.4.0",
"version": "https://github.com/GameCult/CultLib.git?path=/packages/cultmath/unity/org.gamecult.cultmath#cultmath-unity-v0.4.1",
"depth": 0,
"source": "git",
"dependencies": {},
"hash": "252e226c51826d626f4113673f31d96577b67ec9"
"hash": "9c1b06cd703bfa44352050e819b0d0659cf5978a"
},
"com.unity.modules.accessibility": {
"version": "1.0.0",

View file

@ -265,6 +265,39 @@ public class ThrustAllocatorTests
}
}
// A cruiser-like hull, n thrusters each pushing along one body axis with a lever-arm yaw (the finding's fixture
// generator: Synthetic(8, 7005)).
static float3[] Synthetic(int n, int seed)
{
var rng = new System.Random(seed);
var cols = new float3[n];
for (var i = 0; i < n; i++)
{
var a = 20f + 40f * (float)rng.NextDouble();
var yaw = (float)(rng.NextDouble() * 2 - 1) * 120f;
var dir = rng.Next(10);
cols[i] = dir < 4 ? Col(0, a, yaw) : dir < 6 ? Col(0, -a, yaw) : dir < 8 ? Col(a, 0, yaw) : Col(-a, 0, yaw);
}
return cols;
}
// Finding solver-converged-early: on this hull a fresh allocator's eighth intent of a seeded random walk stopped at a
// non-optimal point (throttle 7 at 1.0 against .922 warm). The answer is the same from a cold and from a warm start.
[Fact]
public void ColdAndWarmStartsAgreeOnTheHullThatStoppedEarly()
{
var hull = Synthetic(8, 7005);
var rng = new System.Random(5);
var warm = new ThrustAllocator();
for (var step = 0; step < 8; step++)
{
float x = (float)rng.NextDouble() * 2 - 1, y = (float)rng.NextDouble() * 2 - 1, turn = (float)rng.NextDouble() * 2 - 1;
var fromWarm = Solve(warm, hull, x, y, turn);
var fromCold = Solve(hull, x, y, turn);
for (var i = 0; i < hull.Length; i++) Assert.True(MathF.Abs(fromWarm[i] - fromCold[i]) <= 1e-5f, $"step {step}: throttle {i} {fromCold[i]} cold vs {fromWarm[i]} warm");
}
}
[Fact]
public void EqualThrustersShareTheDemand()
{