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

+8
View File
@@ -26,6 +26,12 @@ export function aircraftQaDrawn(state) {
width: sprite.width,
show: sprite.show,
rotation: sprite.rotation,
trackedRotation:
id === state._trackedIcao
? (state._trackedEntity?.rotation ??
state._lastTrackedRotation ??
null)
: null,
alpha: sprite.color?.alpha ?? null,
position: sprite.position
? {
@@ -43,6 +49,7 @@ export function aircraftQaDrawn(state) {
ready: model.ready,
// Where it is drawn: its transform's translation.
position: translationOf(model.modelMatrix),
matrix: model.modelMatrix ? Array.from(model.modelMatrix) : null,
}
: null,
});
@@ -56,6 +63,7 @@ export function aircraftQaDrawn(state) {
scale: tracked.scale,
show: tracked.show,
ready: tracked.ready,
matrix: tracked.modelMatrix ? Array.from(tracked.modelMatrix) : null,
},
});
return out;
+43
View File
@@ -0,0 +1,43 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import { aircraftQaDrawn } from './qaDrawn.js';
for (const native of [false, true]) {
test(`heading probe copies model transforms and reads tracked glyph (${native ? 'native' : 'engine'})`, () => {
const matrix = Float64Array.from({ length: 16 }, (_, i) => i);
const sprite = {
position: { x: 1, y: 2, z: 3 },
rotation: 0.4,
show: false,
};
const model = { modelMatrix: matrix, show: true, ready: true };
const state = {
_billboards: new Map([['a', sprite]]),
_models: new Map([['a', model]]),
_trackedIcao: 'a',
_lastTrackedRotation: 0.7,
_trackedModel: model,
_trackedEntity: native
? {
billboard: {
rotation: {
getValue: () => {
throw new Error(
'Probe must not evaluate a reactive property',
);
},
},
},
}
: { rotation: 0.7 },
};
const [fleet, tracked] = aircraftQaDrawn(state);
assert.equal(fleet.trackedRotation, 0.7);
assert.equal(fleet.rotation, 0.4);
assert.equal(tracked.model.matrix[12], 12);
fleet.model.matrix[12] = -1;
tracked.model.matrix[12] = -2;
assert.equal(matrix[12], 12);
assert.equal(aircraftQaDrawn(state)[1].model.matrix[12], 12);
});
}
+33 -7
View File
@@ -57,6 +57,13 @@ const fieldsNoPick = {
show: undefined,
};
const scratchColor = new Float64Array(4);
// Sprite setters write synchronously into the mover store; reuse their
// field records rather than allocating one per contact and assignment.
const spritePositionField = { position: null };
const spriteShowField = { show: true };
const spriteRotationField = { rotation: 0 };
const spriteScaleField = { scale: 1 };
const spriteColorField = { color: scratchColor };
function writeFields(set, index, fields) {
const scratch = fieldsNoPick;
for (const key in fields) scratch[key] = fields[key];
@@ -371,7 +378,8 @@ export function createAircraftNavaraRenderer({
set position(value) {
geo.cartesian3.clone(value, this._position);
this.write({ position: this._position });
spritePositionField.position = this._position;
this.write(spritePositionField);
}
get show() {
@@ -379,8 +387,11 @@ export function createAircraftNavaraRenderer({
}
set show(value) {
this._show = value !== false;
this.write({ show: this._show });
const next = value !== false;
if (next === this._show) return;
this._show = next;
spriteShowField.show = next;
this.write(spriteShowField);
}
get rotation() {
@@ -388,8 +399,10 @@ export function createAircraftNavaraRenderer({
}
set rotation(value) {
if (value === this._rotation) return;
this._rotation = value;
this.write({ rotation: value });
spriteRotationField.rotation = value;
this.write(spriteRotationField);
}
get scale() {
@@ -397,8 +410,10 @@ export function createAircraftNavaraRenderer({
}
set scale(value) {
if (value === this._scale) return;
this._scale = value;
this.write({ scale: this.drawnScale() });
spriteScaleField.scale = this.drawnScale();
this.write(spriteScaleField);
}
get width() {
@@ -406,8 +421,10 @@ export function createAircraftNavaraRenderer({
}
set width(value) {
if (value === this._width) return;
this._width = value;
this.write({ scale: this.drawnScale() });
spriteScaleField.scale = this.drawnScale();
this.write(spriteScaleField);
}
get height() {
@@ -423,8 +440,17 @@ export function createAircraftNavaraRenderer({
}
set color(value) {
if (
value !== this._color &&
(value?.red ?? 1) === this._color.red &&
(value?.green ?? 1) === this._color.green &&
(value?.blue ?? 1) === this._color.blue &&
(value?.alpha ?? 1) === this._color.alpha
)
return;
this._color = new StoredColor(value);
this.write({ color: rgbaOf(this._color) });
rgbaOf(this._color);
this.write(spriteColorField);
}
get image() {
@@ -293,3 +293,59 @@ test('trails are engine lines in the trail pick namespace; the head follows each
renderer.destroy();
engine.destroy();
});
test('unchanged sprite style does not upload or request another frame', async () => {
const { engine, renderer } = await setup();
const sprite = renderer.fleet.add({
id: 'same',
position: geo.cartesian3.fromDegrees(0, 0, 1000),
image: aircraftIcon('light'),
});
await Promise.resolve();
const [listed] = setsOf(engine, 'flights-sprites');
const part = engine.fake.moverSet(listed.id);
const before = part.commits;
const color = sprite.color;
for (let n = 0; n < 1000; n++) {
sprite.show = true;
sprite.rotation = 0;
sprite.scale = 1;
sprite.width = 20;
sprite.color = WHITE;
}
await Promise.resolve();
assert.equal(part.commits, before);
assert.equal(sprite.color, color);
renderer.destroy();
engine.destroy();
});
test('reused sprite field records are copied, including a mutated color getter', async () => {
const { engine, renderer } = await setup();
const a = renderer.fleet.add({
id: 'a',
position: geo.cartesian3.fromDegrees(0, 0, 1000),
image: aircraftIcon('light'),
});
const b = renderer.fleet.add({
id: 'b',
position: a.position,
image: aircraftIcon('light'),
});
await Promise.resolve();
const [listed] = setsOf(engine, 'flights-sprites');
const { store } = engine.fake.moverSet(listed.id);
const position = geo.cartesian3.create(7, 8, 9);
a.position = position;
position.x = 20;
b.position = position;
a.color.alpha = 0.25;
a.color = a.color;
b.color = WHITE.withAlpha(0.75);
await Promise.resolve();
assert.deepEqual([...store.positions.subarray(0, 6)], [7, 8, 9, 20, 8, 9]);
assert.equal(store.colors[3], 0.25);
assert.equal(store.colors[7], 0.75);
renderer.destroy();
engine.destroy();
});