fix(rendering): isolate world selection transactions

Keep shared private entity viewports outside the normal-world picking product and make the injected spatial-pin retry test independent of the production frame clock.

Co-Authored-By: OpenAI Codex <codex@openai.com>
This commit is contained in:
Erik 2026-07-24 22:31:15 +02:00
parent 0eb6648589
commit 056bbd4efd
3 changed files with 54 additions and 1 deletions

View file

@ -94,6 +94,32 @@ public sealed class RetailSelectionSceneTests
Assert.Empty(oracle.SelectionParts);
}
[Fact]
public void PrivateViewportPartsOutsideWorldFrame_DoNotEnterPickingOrReferee()
{
var oracle = new CurrentRenderSceneOracle();
var scene = CreateScene();
scene.SetCurrentRenderSceneObserver(oracle);
var world = Entity(localId: 49u, serverGuid: 0x5000_0049u);
var privateViewport =
Entity(localId: 50u, serverGuid: 0x5000_0050u);
Publish(scene, world);
scene.AddVisiblePart(
privateViewport,
partIndex: 0,
gfxObjId: 0x0100_0001u,
Matrix4x4.CreateTranslation(0f, 0f, -5f));
RetailSelectionHit? hit = PickCenter(scene);
Assert.NotNull(hit);
Assert.Equal(world.Id, hit.Value.LocalEntityId);
CurrentRenderSelectionFingerprint fingerprint =
Assert.Single(oracle.SelectionParts);
Assert.Equal(world.Id, fingerprint.LocalEntityId);
Assert.Equal(1, oracle.Snapshot.SelectionPartCount);
}
private static RetailSelectionScene CreateScene(
RetailSelectionLightingPulse? pulse = null)
{

View file

@ -900,7 +900,8 @@ public sealed class LandblockPresentationPipelineTests
nearRadius: 0,
farRadius: 0,
onLandblockLoaded: _ => liveRecoveryCalls++,
ensureEnvCellMeshes: _ => replayCalls++);
ensureEnvCellMeshes: _ => replayCalls++,
workBudgetOptions: GenerousWorkBudget());
Assert.Throws<InvalidOperationException>(() => controller.Tick(0x60, 0x60));
Assert.True(state.IsNearTier(landblockId));