feat(A.5 T4): StreamingRegion ComputeFirstTickDiff
Adds the first-tick bootstrap diff: ToLoadNear for the (2*near+1)^2 inner window, ToLoadFar for the outer annulus up to FarRadius. Uses Chebyshev distance, matching existing Recenter convention. Also renames the single-tier RecenterTo → RecenterToSingleTier to free the canonical name for the upcoming two-tier overload (T5). Updates StreamingRegionTests and StreamingController to call the renamed method. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
378f32ac7a
commit
7bcababf82
4 changed files with 54 additions and 6 deletions
|
|
@ -20,4 +20,18 @@ public class StreamingRegionTwoTierTests
|
|||
// becomes (NearRadius+2) for the far-tier unload, which is wrong.
|
||||
Assert.Equal(region.FarRadius, region.Radius);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RecenterTo_FirstTick_SplitsLoadIntoNearAndFar()
|
||||
{
|
||||
// near=1, far=3 → near window is 3×3=9, far window is 7×7-3×3=40 LBs.
|
||||
var region = new StreamingRegion(centerX: 100, centerY: 100, nearRadius: 1, farRadius: 3);
|
||||
var diff = region.ComputeFirstTickDiff();
|
||||
|
||||
Assert.Equal(9, diff.ToLoadNear.Count);
|
||||
Assert.Equal(40, diff.ToLoadFar.Count);
|
||||
Assert.Empty(diff.ToPromote);
|
||||
Assert.Empty(diff.ToDemote);
|
||||
Assert.Empty(diff.ToUnload);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue