From ca2c02e67fc32939d8794d0f42f0298cf72daddd Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Thu, 19 Nov 2026 21:12:14 +0100 Subject: [PATCH] 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 --- tests/Lodur.Tests/ConnectedPainBoxTests.cs | 20 ++++++++++++++++++++ tests/Lodur.Tests/NativeWorld.cs | 3 +++ 2 files changed, 23 insertions(+) diff --git a/tests/Lodur.Tests/ConnectedPainBoxTests.cs b/tests/Lodur.Tests/ConnectedPainBoxTests.cs index 47ef546..6a3002b 100644 --- a/tests/Lodur.Tests/ConnectedPainBoxTests.cs +++ b/tests/Lodur.Tests/ConnectedPainBoxTests.cs @@ -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() { diff --git a/tests/Lodur.Tests/NativeWorld.cs b/tests/Lodur.Tests/NativeWorld.cs index d601f44..5a22cbc 100644 --- a/tests/Lodur.Tests/NativeWorld.cs +++ b/tests/Lodur.Tests/NativeWorld.cs @@ -3,6 +3,9 @@ namespace Lodur.Tests; /// /// 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. /// [CollectionDefinition(Name)] public sealed class NativeWorld