test(ci): harden scheduling and allocation gates
All checks were successful
CI / linux-portable (push) Successful in 3m30s
CI / windows-gate (push) Successful in 6m15s
CI / release (push) Successful in 2m11s

This commit is contained in:
Erik 2026-08-27 19:28:10 +02:00
parent c4608b1127
commit d123c4b67c
11 changed files with 101 additions and 87 deletions

View file

@ -138,20 +138,12 @@ public sealed class DirectionalShadowCascadeFitterTests
DirectionalShadowCascadeFitInput input = CameraInput(
Vector3.Zero,
DirectionalShadowQuality.For(DirectionalShadowPreset.High));
Span<DirectionalShadowCascade> cascades =
stackalloc DirectionalShadowCascade[4];
var cascades = new DirectionalShadowCascade[4];
// Cross the tiered-JIT promotion threshold before taking the thread's
// allocation counter; measuring immediately after one call makes the
// runtime's compilation bookkeeping look like renderer allocation.
for (int i = 0; i < 128; i++)
DirectionalShadowCascadeFitter.Fit(in input, cascades);
long before = GC.GetAllocatedBytesForCurrentThread();
for (int i = 0; i < 100; i++)
DirectionalShadowCascadeFitter.Fit(in input, cascades);
long after = GC.GetAllocatedBytesForCurrentThread();
Assert.Equal(0, after - before);
ZeroAllocationProbe.AssertAllocatesNothing(
"DirectionalShadowCascadeFitter.Fit",
() => DirectionalShadowCascadeFitter.Fit(in input, cascades),
batchSize: 100);
}
[Fact]