test(ci): harden scheduling and allocation gates
This commit is contained in:
parent
c4608b1127
commit
d123c4b67c
11 changed files with 101 additions and 87 deletions
|
|
@ -371,11 +371,10 @@ public sealed class DirectionalShadowPreparedDrawTests
|
|||
Assert.Equal([0, 1], product.DynamicTransformSlots.ToArray());
|
||||
|
||||
product.RefreshDynamicTransforms(changed);
|
||||
long before = GC.GetAllocatedBytesForCurrentThread();
|
||||
for (int iteration = 0; iteration < 256; iteration++)
|
||||
product.RefreshDynamicTransforms(changed);
|
||||
long allocated = GC.GetAllocatedBytesForCurrentThread() - before;
|
||||
Assert.Equal(0, allocated);
|
||||
ZeroAllocationProbe.AssertAllocatesNothing(
|
||||
"DirectionalShadowPreparedDraws.RefreshDynamicTransforms",
|
||||
() => product.RefreshDynamicTransforms(changed),
|
||||
batchSize: 256);
|
||||
|
||||
RenderProjectionRecord wrongId = current with
|
||||
{
|
||||
|
|
@ -508,16 +507,12 @@ public sealed class DirectionalShadowPreparedDrawTests
|
|||
product.Transforms[0]);
|
||||
AssertMatrixBitsEqual(movedPart * movedRoot, product.Transforms[1]);
|
||||
|
||||
long beforeDense = GC.GetAllocatedBytesForCurrentThread();
|
||||
for (int iteration = 0; iteration < 256; iteration++)
|
||||
{
|
||||
product.RefreshDynamicTransforms(
|
||||
ZeroAllocationProbe.AssertAllocatesNothing(
|
||||
"DirectionalShadowPreparedDraws.RefreshDynamicTransforms dense",
|
||||
() => product.RefreshDynamicTransforms(
|
||||
reversedDenseChanges,
|
||||
denseRefresh: true);
|
||||
}
|
||||
long denseAllocated =
|
||||
GC.GetAllocatedBytesForCurrentThread() - beforeDense;
|
||||
Assert.Equal(0, denseAllocated);
|
||||
denseRefresh: true),
|
||||
batchSize: 256);
|
||||
|
||||
Assert.True(product.TryBegin(generation, 14, estimatedInstances: 0));
|
||||
product.Complete(generation, 14, in stats);
|
||||
|
|
@ -619,9 +614,14 @@ public sealed class DirectionalShadowPreparedDrawTests
|
|||
RenderSceneGeneration generation = RenderSceneGeneration.FromRaw(9);
|
||||
|
||||
BuildVariedTopology(product, generation, buildSequence: 1, drawCount);
|
||||
long before = GC.GetAllocatedBytesForCurrentThread();
|
||||
BuildVariedTopology(product, generation, buildSequence: 2, drawCount);
|
||||
long allocated = GC.GetAllocatedBytesForCurrentThread() - before;
|
||||
ulong buildSequence = 1;
|
||||
long allocated = ZeroAllocationProbe.MeasureWarmed(
|
||||
() => BuildVariedTopology(
|
||||
product,
|
||||
generation,
|
||||
++buildSequence,
|
||||
drawCount),
|
||||
batchSize: 1);
|
||||
|
||||
Assert.Equal(drawCount, product.Stats.PreparedInstances);
|
||||
// One small constant covers the sort's comparison-delegate wrapper.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue