Lodur.Tests: pin the strain shake on the body; name the Ymir defect on the native-world collection

At the shipped StrainShake 0.03 the hand's height moves over 3 cm peak to peak per second
in seconds 8-13; at StrainShake 0 it moves under 1.5 cm. NativeWorld.cs now names
lodur:finding:cut-nervous-layers.s1.ymir-concurrent-world-create and says to remove it
once Ymir's lock lands.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-11-19 21:12:14 +01:00
commit ca2c02e67f
2 changed files with 23 additions and 0 deletions

View file

@ -164,6 +164,26 @@ public sealed class ConnectedPainBoxTests
Assert.True(Dist(full.Hand[last].Hand, plain.Hand[last].Hand) > 0.023f);
}
private static float VerticalPeakToPeak(Timeline t, int fromSecond)
{
var seg = t.Hand.Skip(fromSecond * Hz).Take(Hz).Select(h => h.Hand.Y).ToList();
return seg.Max() - seg.Min();
}
[Fact]
public void Strain_shows_as_a_visible_shake_of_the_hand_which_the_shipped_amplitude_makes_and_zero_does_not()
{
// Seconds 8 to 13 of seed 1: strain is about 3, the will has not broken (it breaks at 14.75 s). Measured at the
// shipped StrainShake 0.03 / ShakeHz 3.5: 3.9-4.7 cm peak to peak in hand height per second; at 0, 0.3-0.7 cm.
var shaking = Run(seed: 1, new HoldParameters(), maxSeconds: 16.0);
var still = Run(seed: 1, new HoldParameters { StrainShake = 0.0 }, maxSeconds: 16.0);
for (var s = 8; s <= 13; s++)
{
Assert.True(VerticalPeakToPeak(shaking, s) > 0.03f, $"shipped shake only {VerticalPeakToPeak(shaking, s)} m peak to peak in second {s}");
Assert.True(VerticalPeakToPeak(still, s) < 0.015f, $"no shake still moved {VerticalPeakToPeak(still, s)} m in second {s}");
}
}
[Fact]
public void The_same_seed_twice_gives_the_same_events_and_the_same_world_state_hash()
{

View file

@ -3,6 +3,9 @@ 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