feat(streaming): enforce typed completion queues
Replace the flat deferred list, priority scan, unload bypass, and count-only execution cap with exact destination/control/unload/Near/Far FIFOs behind one typed frame meter. Price worker results before adoption, retain exact retry identity, reject stale generations without payload retention, and publish queue pressure through lifecycle diagnostics. Tests: dotnet build AcDream.slnx -c Release --no-restore; dotnet test AcDream.slnx -c Release --no-restore (8138 passed, 5 skipped)
This commit is contained in:
parent
ac45cb1bd7
commit
b8f6317fe1
15 changed files with 1261 additions and 336 deletions
|
|
@ -263,6 +263,34 @@ public class LandblockStreamerTests
|
|||
Assert.Equal(43ul, unloaded.Generation);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task CompletionSourcePeekPreservesExactResultAndBacklog()
|
||||
{
|
||||
using var streamer = new LandblockStreamer(loadLandblock: _ => null);
|
||||
streamer.Start();
|
||||
streamer.EnqueueUnload(0xABCE0000u, generation: 44);
|
||||
|
||||
for (int i = 0;
|
||||
i < SpinMaxIterations && streamer.BacklogCount == 0;
|
||||
i++)
|
||||
{
|
||||
await Task.Delay(SpinStepMs);
|
||||
}
|
||||
|
||||
Assert.Equal(1, streamer.BacklogCount);
|
||||
Assert.True(streamer.TryPeek(out LandblockStreamResult? firstPeek));
|
||||
Assert.NotNull(firstPeek);
|
||||
Assert.Equal(1, streamer.BacklogCount);
|
||||
Assert.True(streamer.TryPeek(out LandblockStreamResult? secondPeek));
|
||||
Assert.Same(firstPeek, secondPeek);
|
||||
Assert.Equal(1, streamer.BacklogCount);
|
||||
|
||||
Assert.True(streamer.TryRead(out LandblockStreamResult? consumed));
|
||||
Assert.Same(firstPeek, consumed);
|
||||
Assert.Equal(0, streamer.BacklogCount);
|
||||
Assert.False(streamer.TryRead(out _));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Load_ExecutesLoaderOnWorkerThread()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue