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
|
|
@ -191,6 +191,46 @@ public sealed class ConnectedR6SoakContractTests
|
|||
foreach (string field in zeroFields)
|
||||
Assert.Contains($"'{field}'", source, StringComparison.Ordinal);
|
||||
|
||||
string[] revealFields =
|
||||
[
|
||||
"materialized",
|
||||
"completed",
|
||||
"worldViewportObserved",
|
||||
"cancelled",
|
||||
"invariantFailureCount",
|
||||
"isReady",
|
||||
];
|
||||
foreach (string field in revealFields)
|
||||
Assert.Contains($"'{field}'", source, StringComparison.Ordinal);
|
||||
|
||||
string[] streamingZeroFields =
|
||||
[
|
||||
"deferredCompletions",
|
||||
"deferredAdoptedCpuBytes",
|
||||
"pendingPublications",
|
||||
"pendingRetirements",
|
||||
"workerCompletionBacklog",
|
||||
"destinationBacklog",
|
||||
"controlBacklog",
|
||||
"unloadBacklog",
|
||||
"nearBacklog",
|
||||
"farBacklog",
|
||||
];
|
||||
foreach (string field in streamingZeroFields)
|
||||
Assert.Contains($"'{field}'", source, StringComparison.Ordinal);
|
||||
|
||||
string[] streamingEvidenceFields =
|
||||
[
|
||||
"lifetimeFrameOverrunCount",
|
||||
"lifetimeOversizedProgressCount",
|
||||
"maximumFrameMilliseconds",
|
||||
"maximumFrameStage",
|
||||
"maximumOperationMilliseconds",
|
||||
"maximumOperationStage",
|
||||
];
|
||||
foreach (string field in streamingEvidenceFields)
|
||||
Assert.Contains($"'{field}'", source, StringComparison.Ordinal);
|
||||
|
||||
Assert.Equal(1, CountOccurrences(
|
||||
source,
|
||||
"$privateLimit = [Math]::Max(192.0, $pair.First.PrivateMiB * 0.20)"));
|
||||
|
|
|
|||
|
|
@ -633,7 +633,15 @@ public sealed class LandblockPresentationPipelineTests
|
|||
applyTerrain: (_, _) => publications++,
|
||||
state,
|
||||
nearRadius: 2,
|
||||
farRadius: 4);
|
||||
farRadius: 4,
|
||||
workBudgetOptions: new StreamingWorkBudgetOptions(
|
||||
MaxUpdateMilliseconds: 100,
|
||||
MaxCompletionAdmissions: 64,
|
||||
MaxAdoptedCpuBytes: 1_000_000,
|
||||
MaxEntityOperations: 1_000,
|
||||
MaxGpuUploadBytes: 1_000_000,
|
||||
MaxGlRetireOperations: 1_000,
|
||||
DestinationReserveFraction: 0.75f));
|
||||
var recenter = new StreamingOriginRecenterCoordinator(controller, origin);
|
||||
|
||||
Assert.False(recenter.Begin(0x30, 0x30, isSealedDungeon: true));
|
||||
|
|
|
|||
|
|
@ -241,6 +241,9 @@ public sealed class StreamingWorkBudgetTests
|
|||
Assert.Equal(1, snapshot.OverrunCount);
|
||||
Assert.Equal(1, snapshot.FailureCount);
|
||||
Assert.Equal(0, snapshot.CompletedOperations);
|
||||
Assert.Equal(3, snapshot.MaximumOperationMilliseconds);
|
||||
Assert.Equal("slow", snapshot.MaximumOperationStage);
|
||||
Assert.Equal("slow", snapshot.LastStage);
|
||||
Assert.Equal(StreamingWorkLimit.Time, snapshot.LastLimit);
|
||||
}
|
||||
|
||||
|
|
@ -465,6 +468,29 @@ public sealed class StreamingWorkBudgetTests
|
|||
Assert.Equal(4, second.LastFrame.CompletedOperations);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ControllerPublishesLifetimeOversizeAndMaximumOperationEvidence()
|
||||
{
|
||||
uint center = StreamingRegion.EncodeLandblockIdForTest(32, 32);
|
||||
var source = new QueueCompletionSource(Loaded(center));
|
||||
StreamingController controller = Controller(
|
||||
source,
|
||||
static () => { },
|
||||
WorkOptions(
|
||||
admissions: 4,
|
||||
cpuBytes: 1_000,
|
||||
gpuBytes: 1));
|
||||
|
||||
controller.Tick(32, 32);
|
||||
|
||||
StreamingWorkDiagnostics diagnostics = controller.WorkDiagnostics;
|
||||
Assert.True(diagnostics.LifetimeOversizedProgressCount >= 1);
|
||||
Assert.True(diagnostics.MaximumOperationMilliseconds >= 0);
|
||||
Assert.NotNull(diagnostics.MaximumOperationStage);
|
||||
Assert.True(diagnostics.MaximumFrameMilliseconds >=
|
||||
diagnostics.MaximumOperationMilliseconds);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ControllerBoundsProductionAdmissionByCountBeforeAdoption()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue