Performance chasing
All checks were successful
CI / React UI Build (push) Successful in 10s
CI / Native Windows Build And Tests (push) Successful in 2m51s
CI / Windows Release Package (push) Successful in 2m55s

This commit is contained in:
Aiden
2026-05-11 23:10:45 +10:00
parent c5cead6003
commit a434a88108
18 changed files with 1115 additions and 82 deletions

View File

@@ -95,6 +95,9 @@ void TestBackendPlayoutHealth()
8.5,
7.25,
12.0,
1.0,
6.5,
0.5,
8,
11,
3,
@@ -121,6 +124,9 @@ void TestBackendPlayoutHealth()
Expect(playout.outputRenderMilliseconds == 8.5, "backend playout health stores output render duration");
Expect(playout.smoothedOutputRenderMilliseconds == 7.25, "backend playout health stores smoothed output render duration");
Expect(playout.maxOutputRenderMilliseconds == 12.0, "backend playout health stores max output render duration");
Expect(playout.outputFrameAcquireMilliseconds == 1.0, "backend playout health stores output frame acquire duration");
Expect(playout.outputFrameRenderRequestMilliseconds == 6.5, "backend playout health stores output render request duration");
Expect(playout.outputFrameEndAccessMilliseconds == 0.5, "backend playout health stores output frame end access duration");
Expect(playout.completedFrameIndex == 8, "backend playout health stores completed index");
Expect(playout.scheduledFrameIndex == 11, "backend playout health stores scheduled index");
Expect(playout.measuredLagFrames == 2, "backend playout health stores measured lag");
@@ -148,6 +154,9 @@ void TestBackendPlayoutHealth()
-5.0,
-4.0,
-3.0,
-2.0,
-1.0,
-0.5,
9,
12,
3,
@@ -165,6 +174,32 @@ void TestBackendPlayoutHealth()
Expect(snapshot.backendPlayout.lifecycleState == "Running", "full health snapshot includes backend playout state");
Expect(!snapshot.backendPlayout.degraded, "full health snapshot includes backend degraded state");
}
void TestOutputRenderPipelineTiming()
{
HealthTelemetry telemetry;
telemetry.RecordOutputRenderQueueWait(2.5);
telemetry.RecordOutputRenderPipelineTiming(1.0, 0.5, 0.25, 0.75, 0.125, 0.375, 0.1, 0.2, 0.3, 0.4, 3.5, true, true, false);
Expect(telemetry.TryRecordOutputRenderPipelineTiming(-1.0, -2.0, -3.0, -4.0, -5.0, -6.0, -7.0, -8.0, -9.0, -10.0, -11.0, false, false, true),
"try output render timing succeeds when uncontended");
const HealthTelemetry::BackendPlayoutSnapshot playout = telemetry.GetBackendPlayoutSnapshot();
Expect(playout.outputRenderQueueWaitMilliseconds == 2.5, "output render timing stores queue wait");
Expect(playout.outputRenderDrawMilliseconds == 0.0, "output render timing clamps draw duration");
Expect(playout.outputReadbackFenceWaitMilliseconds == 0.0, "output render timing clamps fence wait duration");
Expect(playout.outputReadbackMapMilliseconds == 0.0, "output render timing clamps map duration");
Expect(playout.outputReadbackCopyMilliseconds == 0.0, "output render timing clamps readback copy duration");
Expect(playout.outputCachedCopyMilliseconds == 0.0, "output render timing clamps cached copy duration");
Expect(playout.outputAsyncQueueMilliseconds == 0.0, "output render timing clamps async queue duration");
Expect(playout.outputAsyncQueueBufferMilliseconds == 0.0, "output render timing clamps async queue buffer duration");
Expect(playout.outputAsyncQueueSetupMilliseconds == 0.0, "output render timing clamps async queue setup duration");
Expect(playout.outputAsyncQueueReadPixelsMilliseconds == 0.0, "output render timing clamps async queue read pixels duration");
Expect(playout.outputAsyncQueueFenceMilliseconds == 0.0, "output render timing clamps async queue fence duration");
Expect(playout.outputSyncReadMilliseconds == 0.0, "output render timing clamps sync read duration");
Expect(playout.outputAsyncReadbackMissCount == 1, "output render timing counts async readback misses");
Expect(playout.outputCachedFallbackCount == 1, "output render timing counts cached fallbacks");
Expect(playout.outputSyncFallbackCount == 1, "output render timing counts sync fallbacks");
}
}
int main()
@@ -174,6 +209,7 @@ int main()
TestRuntimeEventTryRecord();
TestPersistenceWriteHealth();
TestBackendPlayoutHealth();
TestOutputRenderPipelineTiming();
if (gFailures != 0)
{

View File

@@ -93,9 +93,10 @@ void TestPolicyNormalization()
policy.maxReadyFrames = 2;
VideoPlayoutPolicy normalized = NormalizeVideoPlayoutPolicy(policy);
Expect(normalized.outputFramePoolSize == 1, "policy normalization keeps at least one output frame");
Expect(normalized.targetPrerollFrames == 1, "policy normalization keeps at least one preroll frame");
Expect(normalized.maxReadyFrames == normalized.targetReadyFrames, "policy normalization keeps max ready frames above target");
Expect(normalized.outputFramePoolSize >= normalized.targetPrerollFrames + normalized.maxReadyFrames + normalized.minimumSpareDeviceFrames,
"policy normalization keeps enough output frames for preroll and ready queue ownership");
}
void TestFrameBudgets()