From 697dc91e813dbe13e9d4c6770c306c266aea820d Mon Sep 17 00:00:00 2001 From: German Khokhlov Date: Tue, 10 Nov 2026 23:39:36 +0400 Subject: [PATCH] Check a released tileset by height, not by the source label Cesium labels every scene hit, the globe included, as tiles, so asking that no answer is labelled tiles after leaving photoreal failed on the reference engine. The check now asks that no tile geometry answers above the terrain: a tile-labelled height must match the terrain height. --- src/globe/testing/contractSuite/maps.mjs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/globe/testing/contractSuite/maps.mjs b/src/globe/testing/contractSuite/maps.mjs index e02b1c288..402daedc6 100644 --- a/src/globe/testing/contractSuite/maps.mjs +++ b/src/globe/testing/contractSuite/maps.mjs @@ -23,11 +23,18 @@ export function photorealChecks(engine, { settle }) { ].filter(Boolean); await engine.maps.setPhotorealTiles(null); await settle(); - for (const place of places) + // Cesium labels every scene hit, the globe included, as tiles; what + // matters is that no tile geometry answers above the terrain. + for (const place of places) { + const sampled = engine.surface.sampleHeightDetailed(place); + const terrain = engine.surface.terrainHeight(place); ensure( - engine.surface.sampleHeightDetailed(place)?.source !== 'tiles', + sampled?.source !== 'tiles' || + (Number.isFinite(terrain) && + Math.abs(sampled.height - terrain) <= 1), 'released photoreal tiles still answer surface queries', ); + } }, ], ];