test(streaming): enforce slice E physical evidence
Record route-lifetime streaming overruns and maximum operation costs, require canonical reveal/resource convergence at every connected checkpoint, and keep recenter semantics independent of the production wall-clock budget. Co-authored-by: Erik Nilsson <erikn@users.noreply.github.com>
This commit is contained in:
parent
2ff8f844b0
commit
621f70eab6
6 changed files with 215 additions and 4 deletions
|
|
@ -69,6 +69,12 @@ public sealed class StreamingController
|
|||
private long _nextCompletionSequence;
|
||||
private int _legacyCompletionProfile = 4;
|
||||
private DestinationReservation? _destinationReservation;
|
||||
private long _lifetimeWorkOverruns;
|
||||
private long _lifetimeOversizedProgress;
|
||||
private double _maximumWorkFrameMilliseconds;
|
||||
private string? _maximumWorkFrameStage;
|
||||
private double _maximumWorkOperationMilliseconds;
|
||||
private string? _maximumWorkOperationStage;
|
||||
|
||||
private readonly GpuWorldState _state;
|
||||
private StreamingRegion? _region;
|
||||
|
|
@ -190,6 +196,12 @@ public sealed class StreamingController
|
|||
_completionQueue.CaptureSnapshot();
|
||||
return new StreamingWorkDiagnostics(
|
||||
_lastWorkMeter,
|
||||
_lifetimeWorkOverruns,
|
||||
_lifetimeOversizedProgress,
|
||||
_maximumWorkFrameMilliseconds,
|
||||
_maximumWorkFrameStage,
|
||||
_maximumWorkOperationMilliseconds,
|
||||
_maximumWorkOperationStage,
|
||||
queued.Count,
|
||||
queued.RetainedCpuBytes,
|
||||
queued.OldestAgeMilliseconds,
|
||||
|
|
@ -690,11 +702,42 @@ public sealed class StreamingController
|
|||
finally
|
||||
{
|
||||
meter.FinishFrame();
|
||||
_lastWorkMeter = meter.Snapshot;
|
||||
StreamingWorkMeterSnapshot snapshot = meter.Snapshot;
|
||||
ObserveWorkLifetime(snapshot);
|
||||
_lastWorkMeter = snapshot;
|
||||
_activeWorkMeter = null;
|
||||
}
|
||||
}
|
||||
|
||||
private void ObserveWorkLifetime(StreamingWorkMeterSnapshot snapshot)
|
||||
{
|
||||
_lifetimeWorkOverruns = SaturatingAdd(
|
||||
_lifetimeWorkOverruns,
|
||||
snapshot.OverrunCount);
|
||||
_lifetimeOversizedProgress = SaturatingAdd(
|
||||
_lifetimeOversizedProgress,
|
||||
snapshot.OversizedProgressCount);
|
||||
|
||||
if (_maximumWorkFrameStage is null
|
||||
|| snapshot.ElapsedMilliseconds > _maximumWorkFrameMilliseconds)
|
||||
{
|
||||
_maximumWorkFrameMilliseconds = snapshot.ElapsedMilliseconds;
|
||||
_maximumWorkFrameStage = snapshot.LastStage;
|
||||
}
|
||||
|
||||
if (_maximumWorkOperationStage is null
|
||||
|| snapshot.MaximumOperationMilliseconds
|
||||
> _maximumWorkOperationMilliseconds)
|
||||
{
|
||||
_maximumWorkOperationMilliseconds =
|
||||
snapshot.MaximumOperationMilliseconds;
|
||||
_maximumWorkOperationStage = snapshot.MaximumOperationStage;
|
||||
}
|
||||
}
|
||||
|
||||
private static long SaturatingAdd(long left, int right) =>
|
||||
left > long.MaxValue - right ? long.MaxValue : left + right;
|
||||
|
||||
private void AdvanceRadiiReconfiguration()
|
||||
{
|
||||
if (_advancingRadiiReconfiguration)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue