test(teleport): tp-probe AIM/ENQ/BUILD/APPLY/PLACED instrumentation (REMOVABLE)
Acceptance apparatus for the teleport-residency fix. ACDREAM_PROBE_TELEPORT=1 gates 5 log points with cross-thread TickCount64 timestamps + the _datLock waited/held measurement. Stripped (or promoted) at verification (plan T6). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
02f4be72c0
commit
9ac719424c
3 changed files with 52 additions and 0 deletions
|
|
@ -5472,6 +5472,9 @@ public sealed class GameWindow : IDisposable
|
|||
EnsureTeleportArrivalController();
|
||||
_pendingTeleportRot = rot;
|
||||
_teleportArrival!.BeginArrival(newWorldPos, p.LandblockId);
|
||||
AcDream.Core.Physics.PhysicsDiagnostics.LogTeleport(
|
||||
"AIM", p.LandblockId,
|
||||
$"lb={lbX},{lbY} indoor={((p.LandblockId & 0xFFFFu) >= 0x0100u)} diffLb={differentLandblock}");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -5561,6 +5564,8 @@ public sealed class GameWindow : IDisposable
|
|||
dt: 1f / 60f);
|
||||
|
||||
_playerController.State = AcDream.App.Input.PlayerState.InWorld;
|
||||
AcDream.Core.Physics.PhysicsDiagnostics.LogTeleport(
|
||||
"PLACED", resolved.CellId, $"forced={forced}");
|
||||
Console.WriteLine($"live: teleport complete — snapped to {snappedPos} cell=0x{resolved.CellId:X8}");
|
||||
|
||||
// Tell the server the client finished loading the new landblock (holtburger
|
||||
|
|
@ -5813,6 +5818,25 @@ public sealed class GameWindow : IDisposable
|
|||
// case), which blocks the render thread for at most that duration.
|
||||
// This is the minimum correct behavior; a future pass can reduce
|
||||
// contention by pre-building render-thread work on the worker.
|
||||
// tp-probe (2026-06-22, REMOVABLE): measure lock-WAIT (the _datLock
|
||||
// contention signal — large only when the render thread is hammering the
|
||||
// lock during a CreateObject flood) AND lock-HOLD (the intrinsic build
|
||||
// cost). Identical work in both branches; the probe branch only adds the
|
||||
// stopwatch + log. No behavior change when ProbeTeleportEnabled is false.
|
||||
if (AcDream.Core.Physics.PhysicsDiagnostics.ProbeTeleportEnabled)
|
||||
{
|
||||
var sw = System.Diagnostics.Stopwatch.StartNew();
|
||||
lock (_datLock)
|
||||
{
|
||||
long waitedMs = sw.ElapsedMilliseconds;
|
||||
sw.Restart();
|
||||
var built = BuildLandblockForStreamingLocked(landblockId, kind);
|
||||
AcDream.Core.Physics.PhysicsDiagnostics.LogTeleport(
|
||||
"BUILD", landblockId,
|
||||
$"waited={waitedMs}ms held={sw.ElapsedMilliseconds}ms kind={kind}");
|
||||
return built;
|
||||
}
|
||||
}
|
||||
lock (_datLock)
|
||||
{
|
||||
return BuildLandblockForStreamingLocked(landblockId, kind);
|
||||
|
|
@ -6414,6 +6438,7 @@ public sealed class GameWindow : IDisposable
|
|||
AcDream.Core.Terrain.LandblockMeshData meshData)
|
||||
{
|
||||
if (_terrain is null || _dats is null) return;
|
||||
AcDream.Core.Physics.PhysicsDiagnostics.LogTeleport("APPLY", lb.LandblockId);
|
||||
|
||||
// Phase A.1 hotfix: render-thread path also takes the dat lock so it
|
||||
// doesn't race with BuildLandblockForStreaming on the worker thread.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue