Complete phase 3 W1 acceptance and close T16 findings

Fix Navara model display tint, overlay ordering, follow gestures and resource cleanup.
Reduce repeated aircraft work and correct fixture enrichment responses.
Strengthen dev/preview QA, preserve failure history and document verified W1 results.

Validation: 7171 ordinary tests pass, one Windows-only skip; 15 allocation probes;
37 W1 acceptance steps; contracts, shell, four performance gates; 18 identical
Cesium baseline PNGs. Known pre-existing CCTV and live-source limits are recorded.
This commit is contained in:
German Khokhlov committed 2026-10-26 23:23:25 +04:00
1 parent 766c786093
commit 0600964249
59 files changed
+2334 -701

No files matched your search

+13
View File
@@ -22,6 +22,7 @@ import {
} from './card.js';
import { createLocalAdsbEnrichment, localAdsbClass } from './enrichment.js';
import { createLocalAdsbModels } from './models.js';
import { localAdsbQaDrawn } from './qaDrawn.js';
import { LocalAdsbMotion } from './motion.js';
import {
ENTITY_PREFIX,
@@ -714,6 +715,18 @@ export function createLocalAdsbLayer({
void receiver.destroy?.();
},
...(import.meta.env?.DEV
? {
qaDrawn() {
return localAdsbQaDrawn(markers, models?.qaModels?.(), {
enabled,
cameraPosition: renderer?.view.camera?.positionWC,
isVisible: markerVisible,
});
},
}
: {}),
getStats() {
const current = receiver.getState();
const at = now();
+1
View File
@@ -178,6 +178,7 @@ export function createLocalAdsbModels({
}
return {
...(import.meta.env?.DEV ? { qaModels: () => models } : {}),
/** Ids whose model admission is current; the layer enriches these. */
get eligible() {
return eligible;
+49
View File
@@ -0,0 +1,49 @@
// On-demand QA snapshots of the cached local renderer state. Never read
// an entity CallbackProperty: that would evaluate rendering during a probe.
export function localAdsbQaDrawn(
markers,
models,
{ enabled, cameraPosition, isVisible },
) {
const rows = [];
for (const marker of markers.values()) {
const position = marker.position;
const distance =
position && cameraPosition
? Math.hypot(
position.x - cameraPosition.x,
position.y - cameraPosition.y,
position.z - cameraPosition.z,
)
: Infinity;
const show = Boolean(
enabled &&
!marker.modelOwnsVisual &&
isVisible(marker) &&
distance <= 2_000_000,
);
const model = models?.get(marker.id);
const matrix = model?.modelMatrix;
rows.push({
id: marker.record.icao,
show,
rotation: marker.lastRotation,
alpha: show ? 1 : 0,
position: position
? { x: position.x, y: position.y, z: position.z }
: null,
model: model
? {
show: model.show,
ready: model.ready,
computedScale: model.computedScale,
position: matrix
? { x: matrix[12], y: matrix[13], z: matrix[14] }
: null,
matrix: matrix ? Array.from(matrix) : null,
}
: null,
});
}
return rows;
}
+72
View File
@@ -0,0 +1,72 @@
import assert from 'node:assert/strict';
import test from 'node:test';
import { localAdsbQaDrawn } from './qaDrawn.js';
function setup() {
const marker = {
id: 'local-adsb:abc123',
record: { icao: 'abc123' },
position: { x: 6378137, y: 2, z: 3 },
lastRotation: 0.7,
modelOwnsVisual: false,
};
Object.defineProperty(marker, 'entity', {
get() {
throw new Error('A snapshot must not evaluate native callbacks');
},
});
const matrix = new Float64Array(16);
matrix[12] = 6378138;
matrix[13] = 4;
matrix[14] = 5;
const model = {
ready: true,
show: true,
computedScale: 12,
modelMatrix: matrix,
};
const markers = new Map([[marker.id, marker]]),
models = new Map([[marker.id, model]]);
const options = {
enabled: true,
cameraPosition: { x: 6379137, y: 2, z: 3 },
isVisible: () => true,
};
return { marker, matrix, markers, models, options };
}
test('local QA copies the drawn model and reads cached glyph rotation without callbacks', () => {
const f = setup();
const [row] = localAdsbQaDrawn(f.markers, f.models, f.options);
assert.equal(row.id, 'abc123');
assert.equal(row.rotation, 0.7);
assert.equal(row.alpha, 1);
assert.equal(row.model.computedScale, 12);
assert.equal(row.model.ready, true);
row.position.x = 0;
row.model.matrix[12] = 0;
row.model.position.x = 0;
assert.equal(f.marker.position.x, 6378137);
assert.equal(f.matrix[12], 6378138);
});
test('local QA respects disabled, horizon, model handoff and the two-million-metre glyph limit', () => {
for (const change of [
(f) => {
f.options.enabled = false;
},
(f) => {
f.options.isVisible = () => false;
},
(f) => {
f.marker.modelOwnsVisual = true;
},
(f) => {
f.options.cameraPosition.x += 2_000_000;
},
]) {
const f = setup();
change(f);
const [row] = localAdsbQaDrawn(f.markers, f.models, f.options);
assert.equal(row.show, false);
assert.equal(row.alpha, 0);
assert.equal(row.model.ready, true);
}
});