feat(wb): extend NULL_RESULT probe with reader-divergence diagnostic

Phase 2 Task 1's continuation logged [indoor-upload] NULL_RESULT
when WB's PrepareMeshDataAsync returned null. Extend the line to
include two cross-checks:

  ourCellDb.TryGet=<bool>    — acdream's DatCollection.Cell.TryGet<EnvCell>
  wbResolveId.Count=<int>    — WB's DefaultDatReaderWriter.ResolveId().Count

This narrows the cause among WB's null-return paths (ResolveId empty
vs TryGet<EnvCell> failure vs wrong type). Best-effort: both calls
wrapped in try/catch so diagnostic failures don't propagate.

Capture: 55 NULL_RESULTs across multiple landblocks ALL show
ourCellDb.TryGet=True + wbResolveId.Count=1. Both readers find the
cells in their indices, but WB's downstream PrepareMeshData logic
still returns null. Divergence is downstream of ResolveId.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Erik 2026-05-19 12:36:37 +02:00
parent 011a5e43f4
commit 914638819d

View file

@ -175,7 +175,30 @@ public sealed class WbMeshAdapter : IDisposable, IWbMeshAdapter
}
else if (t.IsCompletedSuccessfully && t.Result is null)
{
Console.WriteLine($"[indoor-upload] NULL_RESULT cellId=0x{cellId:X8}");
// Phase 2 cause-narrowing: WB's PrepareMeshData can return
// null for several reasons (ResolveId empty / TryGet<EnvCell>
// failed / type Unknown). Cross-check against acdream's own
// DatCollection — if WE find the cell but WB doesn't, the
// divergence is between dat readers, not a missing record.
bool ourCellFound = false;
try
{
ourCellFound = _dats?.Cell.TryGet<DatReaderWriter.DBObjs.EnvCell>(
(uint)cellId, out _) ?? false;
}
catch { /* swallow — this is best-effort diagnostic */ }
int wbResolveCount = -1;
try
{
wbResolveCount = _wbDats?.ResolveId((uint)cellId).Count() ?? -1;
}
catch { /* swallow — best-effort */ }
Console.WriteLine(
$"[indoor-upload] NULL_RESULT cellId=0x{cellId:X8} " +
$"ourCellDb.TryGet={ourCellFound} " +
$"wbResolveId.Count={wbResolveCount}");
}
}, TaskScheduler.Default);
}