mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 00:02:25 +00:00
Read QA drawing evidence through the globe contract
Port the layer probes in twenty-six browser scripts to engine primitive lists, drawn rows and layer diagnostics. Preserve Cesium as the reference and keep the supported Navara paths on the same observations. This changes QA observation only, with no application behaviour change. Review the interrupted infrastructure group and retain its readiness, drape, selection, label and floor checks. Match both installation outline buffers. Frame each CCTV city before reading its visible coverage. Read Radio colours and selected identities from actual mover writes. Retain transit's GPU upload budgets using engine-owned line primitives rather than substituting rebuild counts. Keep native inspection where a check specifically measures GPU uploads, loaded meshes or ground readiness. The preceding combined B/C commit owns all shared manifests, docs, locale catalogs and the coupling baseline; this commit changes only its own twenty-six QA scripts. Coupling remains unchanged at 344 Cesium renderer lines, 1294 Navara renderer lines, 9 Cesium import files, 1026 viewer lines, 2 Navara kind checks, 0 engine sniff calls, 9 extension reads, 1 ground pass, 3 SDK loads, 4 screen-handler files and 42 engine-name lines. The full unit suite and the boundary, format and coupling checks pass. Browser validation remains to be run. Browser checks to run GOOGLE_MAPS_API_KEY= CESIUM_ION_TOKEN= npm run dev -- --port 4291 node scripts/qa-alpr-journey.mjs http://localhost:4291 node scripts/qa-alpr-journey.mjs 'http://localhost:4291/?engine=navara' node scripts/qa-cables-overlay.mjs --url http://localhost:4291 node scripts/qa-cctv-v2.mjs --url http://localhost:4291 --fixture --terrain-globe node scripts/qa-context-arrivals.mjs http://localhost:4291 node scripts/qa-directions.mjs --url http://localhost:4291 QA_BASE_URL=http://localhost:4291 node scripts/qa-draw-tool.mjs QA_BASE_URL=http://localhost:4291 node scripts/qa-floor-hold.mjs node scripts/qa-ghostmaps.mjs --url http://localhost:4291 node scripts/qa-gnss.mjs --url http://localhost:4291 node scripts/qa-height-datum.mjs --url http://localhost:4291 node scripts/qa-infra-lod.mjs --url http://localhost:4291 node scripts/qa-installation-navigation.mjs http://localhost:4291 node scripts/qa-military-names.mjs http://localhost:4291 --no-video node scripts/qa-overpass-offload.mjs --url http://localhost:4291 node scripts/qa-radio.mjs --url http://localhost:4291 node scripts/qa-traffic-motion.mjs http://localhost:4291 --mode=osm QA_BASE_URL=http://localhost:4291 node scripts/qa-transit-recovery.mjs QA_BASE_URL=http://localhost:4291 node scripts/qa-transit.mjs node scripts/qa-weather-teardown.mjs --url http://localhost:4291 --headless for engine in cesium navara; do node scripts/qa-enrich-ambient.mjs --url http://localhost:4291 --engine=$engine QA_BASE_URL=http://localhost:4291 node scripts/qa-floor-verify.mjs --engine=$engine node scripts/qa-heading-b3.mjs --url http://localhost:4291 --engine=$engine node scripts/qa-overlay-baseline.mjs --url http://localhost:4291 --engine=$engine node scripts/qa-sprites-b5.mjs --url http://localhost:4291 --engine=$engine node scripts/qa-vessel-datum.mjs --url 'http://localhost:4291/?qaFeed=vessels:fixture' --engine $engine done The military-names driver exercises installation-polish; the transit driver exercises transit-scenes. Use only the keyless server. Cases that require photoreal tiles or unavailable providers remain unverified.
This commit is contained in:
1 parent
97c4dc76ce
commit
3907b7084e
26 files changed
+1429
-1075
No files matched your search
+11
-103
@@ -19,10 +19,11 @@
|
||||
* node scripts/qa-vessel-datum.mjs --ports rotterdam --url http://localhost:4173
|
||||
* node scripts/qa-vessel-datum.mjs --engine navara --url 'http://localhost:PORT/?qaFeed=vessels:fixture'
|
||||
*
|
||||
* --engine cesium|navara: the engine-neutral path on either engine,
|
||||
* through window.__godsEyeView.engine and the QA probe (layers.drawn: each
|
||||
* chevron's drawn position and depth-test flag) instead of the Cesium
|
||||
* viewer's primitives; the URL gets ?engine=. Without it, as before.
|
||||
* Both engines take the engine-neutral path, through window.__godsEyeView.engine
|
||||
* and the dev server's QA probe (layers.drawn: each chevron's drawn position
|
||||
* and depth-test flag); the vessels layer owns no Cesium billboards any more.
|
||||
* --engine cesium|navara puts ?engine= on the URL; without it, the app's
|
||||
* default engine.
|
||||
*/
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
@@ -89,62 +90,6 @@ function findChromeExecutable() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* In-page probe: locate the vessel BillboardCollection (duck-typed — its
|
||||
* billboards carry the vessel record as `id`, so `id.mmsi` exists), then
|
||||
* report depth-test flags across a sample and ellipsoidal heights of
|
||||
* near-port billboards.
|
||||
*/
|
||||
function probeVessels({ portLat, portLon, nearDeg, sampleCap }) {
|
||||
const gev = window.__godsEyeView;
|
||||
const viewer = gev?.viewer;
|
||||
if (!viewer) return { error: 'no viewer' };
|
||||
const ellipsoid = viewer.scene.globe.ellipsoid;
|
||||
const prims = viewer.scene.primitives;
|
||||
|
||||
let collection = null;
|
||||
for (let i = 0; i < prims.length; i += 1) {
|
||||
const p = prims.get(i);
|
||||
if (!p || typeof p.get !== 'function' || typeof p.length !== 'number' || p.length === 0) continue;
|
||||
const first = p.get(0);
|
||||
if (first && first.id && typeof first.id === 'object' && 'mmsi' in first.id
|
||||
&& first.disableDepthTestDistance !== undefined) {
|
||||
collection = p;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!collection) return { error: 'vessel billboard collection not found' };
|
||||
|
||||
let depthFreeCount = 0;
|
||||
let depthTestedCount = 0;
|
||||
const nearHeights = [];
|
||||
const step = Math.max(1, Math.floor(collection.length / sampleCap));
|
||||
for (let i = 0; i < collection.length; i += step) {
|
||||
const b = collection.get(i);
|
||||
if (!b) continue;
|
||||
if (b.disableDepthTestDistance === Number.POSITIVE_INFINITY) depthFreeCount += 1;
|
||||
else depthTestedCount += 1;
|
||||
const rec = b.id;
|
||||
if (Number.isFinite(rec?.lat) && Number.isFinite(rec?.lon)
|
||||
&& Math.abs(rec.lat - portLat) <= nearDeg && Math.abs(rec.lon - portLon) <= nearDeg) {
|
||||
const carto = ellipsoid.cartesianToCartographic(b.position);
|
||||
if (carto) nearHeights.push(carto.height);
|
||||
}
|
||||
}
|
||||
nearHeights.sort((a, b) => a - b);
|
||||
const median = nearHeights.length ? nearHeights[Math.floor(nearHeights.length / 2)] : null;
|
||||
return {
|
||||
total: collection.length,
|
||||
sampled: depthFreeCount + depthTestedCount,
|
||||
depthFreeCount,
|
||||
depthTestedCount,
|
||||
nearCount: nearHeights.length,
|
||||
medianHeight: median,
|
||||
minHeight: nearHeights[0] ?? null,
|
||||
maxHeight: nearHeights[nearHeights.length - 1] ?? null,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* In-page probe on either engine (the QA probe): the chevrons the layer
|
||||
* draws, their depth-test flag and the ellipsoidal heights of those near the
|
||||
@@ -201,7 +146,7 @@ async function frameEngine(p, enable) {
|
||||
async function main() {
|
||||
console.log(`\nAIS Vessel Datum — assertion harness`);
|
||||
console.log(` App URL : ${APP_URL}`);
|
||||
console.log(` Engine : ${ENGINE ?? 'viewer (Cesium)'}`);
|
||||
console.log(` Engine : ${ENGINE ?? 'the app default'}`);
|
||||
console.log(` Ports : ${PORT_KEYS.join(', ')}\n`);
|
||||
|
||||
try {
|
||||
@@ -247,29 +192,10 @@ async function main() {
|
||||
page.on('pageerror', (err) => console.error(` [page-error] ${err.message}`));
|
||||
|
||||
await page.goto(PAGE_URL, { waitUntil: 'domcontentloaded', timeout: 60000 });
|
||||
if (ENGINE)
|
||||
await page.waitForFunction(() => !!window.__godsEyeView?.layers, { timeout: 180000 });
|
||||
else
|
||||
await page.waitForFunction(() => !!window.__godsEyeView?.viewer, { timeout: 60000 });
|
||||
await page.waitForFunction(() => !!window.__godsEyeView?.layers, { timeout: 180000 });
|
||||
|
||||
// Frame the port (kill the intro flight first) and enable the layer.
|
||||
if (ENGINE) await page.evaluate(frameEngine, port, true);
|
||||
else await page.evaluate(async (p) => {
|
||||
const gev = window.__godsEyeView;
|
||||
const v = gev.viewer;
|
||||
v.camera.cancelFlight?.();
|
||||
v.scene.tweens?.removeAll?.();
|
||||
const carto = {
|
||||
longitude: (p.lon * Math.PI) / 180,
|
||||
latitude: (p.lat * Math.PI) / 180,
|
||||
height: p.height,
|
||||
};
|
||||
v.camera.setView({
|
||||
destination: v.scene.globe.ellipsoid.cartographicToCartesian(carto),
|
||||
orientation: { heading: p.heading, pitch: p.pitch, roll: 0 },
|
||||
});
|
||||
await gev.dataManager.setEnabled('ais-live-vessels', true);
|
||||
}, port);
|
||||
await page.evaluate(frameEngine, port, true);
|
||||
|
||||
// Wait for rows + the geoid re-floor: poll until near-port anchors sit
|
||||
// inside the expected band (both ports' bands exclude the pre-fix 0–3 m
|
||||
@@ -279,7 +205,7 @@ async function main() {
|
||||
let probe = null;
|
||||
let settled = false;
|
||||
while (Date.now() < deadline) {
|
||||
probe = await page.evaluate(ENGINE ? probeVesselsEngine : probeVessels, probeArgs);
|
||||
probe = await page.evaluate(probeVesselsEngine, probeArgs);
|
||||
if (probe && !probe.error && probe.nearCount >= 3
|
||||
&& probe.medianHeight !== null
|
||||
&& probe.medianHeight >= port.heightBand[0]
|
||||
@@ -316,29 +242,11 @@ async function main() {
|
||||
|
||||
// Visual proof — re-assert the framing (the app's intro flight can land
|
||||
// mid-probe on slow runs), wait for the photoreal tileset, screenshot.
|
||||
if (ENGINE) await page.evaluate(frameEngine, port, false);
|
||||
else await page.evaluate((p) => {
|
||||
const v = window.__godsEyeView.viewer;
|
||||
v.camera.cancelFlight?.();
|
||||
v.scene.tweens?.removeAll?.();
|
||||
const carto = {
|
||||
longitude: (p.lon * Math.PI) / 180,
|
||||
latitude: (p.lat * Math.PI) / 180,
|
||||
height: p.height,
|
||||
};
|
||||
v.camera.setView({
|
||||
destination: v.scene.globe.ellipsoid.cartographicToCartesian(carto),
|
||||
orientation: { heading: p.heading, pitch: p.pitch, roll: 0 },
|
||||
});
|
||||
}, port);
|
||||
await page.evaluate(frameEngine, port, false);
|
||||
await page
|
||||
.waitForFunction(
|
||||
(engineNeutral) =>
|
||||
engineNeutral
|
||||
? window.__godsEyeView?.engine?.surface?.tilesLoaded?.()
|
||||
: window.__godsEyeView?.tileset?.tilesLoaded,
|
||||
() => window.__godsEyeView?.engine?.surface?.tilesLoaded?.(),
|
||||
{ timeout: 60000, polling: 500 },
|
||||
Boolean(ENGINE),
|
||||
)
|
||||
.catch(() => console.log(' (tileset settle timeout — screenshotting anyway)'));
|
||||
await new Promise((r) => setTimeout(r, 2500));
|
||||
|
||||
Reference in new issue
Block a user