feat(streaming): establish cost budget ledger
Add the validated frame-work profile, deterministic completion charges, and shadow admission meter before enforcing the scheduler in Slice E2. Lifecycle artifacts now expose elapsed work, would-yield limits, backlog bytes/age, and pending owner ledgers without changing accepted execution. Tests: dotnet build AcDream.slnx -c Release --no-restore; dotnet test AcDream.slnx -c Release --no-build --no-restore (8124 passed, 5 skipped)
This commit is contained in:
parent
2945896a6f
commit
ac45cb1bd7
14 changed files with 1280 additions and 71 deletions
|
|
@ -1,6 +1,7 @@
|
|||
using System.Collections.Generic;
|
||||
using AcDream.App;
|
||||
using AcDream.App.Rendering.Residency;
|
||||
using AcDream.App.Streaming;
|
||||
|
||||
namespace AcDream.App.Tests;
|
||||
|
||||
|
|
@ -20,6 +21,65 @@ public sealed class RuntimeOptionsTests
|
|||
_ => null);
|
||||
|
||||
Assert.Equal(ResidencyBudgetOptions.Default, options.ResidencyBudgets);
|
||||
Assert.Equal(
|
||||
StreamingWorkBudgetOptions.Default,
|
||||
options.StreamingWorkBudgets);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void StreamingWorkBudgetOverridesAreOneTypedProfile()
|
||||
{
|
||||
var values = new Dictionary<string, string?>
|
||||
{
|
||||
["ACDREAM_STREAM_WORK_MS"] = "1.75",
|
||||
["ACDREAM_STREAM_WORK_COMPLETIONS"] = "31",
|
||||
["ACDREAM_STREAM_WORK_CPU_MIB"] = "6",
|
||||
["ACDREAM_STREAM_WORK_ENTITY_OPS"] = "144",
|
||||
["ACDREAM_STREAM_WORK_GPU_MIB"] = "5",
|
||||
["ACDREAM_STREAM_WORK_GL_RETIRE_OPS"] = "23",
|
||||
["ACDREAM_STREAM_WORK_DEST_RESERVE_PERCENT"] = "60",
|
||||
};
|
||||
|
||||
RuntimeOptions options = RuntimeOptions.Parse(
|
||||
"D:\\dat",
|
||||
name => values.GetValueOrDefault(name));
|
||||
|
||||
Assert.Equal(1.75, options.StreamingWorkBudgets.MaxUpdateMilliseconds);
|
||||
Assert.Equal(31, options.StreamingWorkBudgets.MaxCompletionAdmissions);
|
||||
Assert.Equal(
|
||||
6 * StreamingWorkBudgetOptions.MiB,
|
||||
options.StreamingWorkBudgets.MaxAdoptedCpuBytes);
|
||||
Assert.Equal(144, options.StreamingWorkBudgets.MaxEntityOperations);
|
||||
Assert.Equal(
|
||||
5 * StreamingWorkBudgetOptions.MiB,
|
||||
options.StreamingWorkBudgets.MaxGpuUploadBytes);
|
||||
Assert.Equal(23, options.StreamingWorkBudgets.MaxGlRetireOperations);
|
||||
Assert.Equal(0.60f, options.StreamingWorkBudgets.DestinationReserveFraction);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("0")]
|
||||
[InlineData("-1")]
|
||||
[InlineData("NaN")]
|
||||
[InlineData("Infinity")]
|
||||
[InlineData("bad")]
|
||||
public void InvalidStreamingWorkValuesFallBackIndependently(string value)
|
||||
{
|
||||
RuntimeOptions options = RuntimeOptions.Parse(
|
||||
"D:\\dat",
|
||||
name => name switch
|
||||
{
|
||||
"ACDREAM_STREAM_WORK_MS" => value,
|
||||
"ACDREAM_STREAM_WORK_DEST_RESERVE_PERCENT" => value,
|
||||
_ => null,
|
||||
});
|
||||
|
||||
Assert.Equal(
|
||||
StreamingWorkBudgetOptions.Default.MaxUpdateMilliseconds,
|
||||
options.StreamingWorkBudgets.MaxUpdateMilliseconds);
|
||||
Assert.Equal(
|
||||
StreamingWorkBudgetOptions.Default.DestinationReserveFraction,
|
||||
options.StreamingWorkBudgets.DestinationReserveFraction);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue