mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-17 00:32:21 +00:00
Takes main's per-point mesh floor readings (#1642) onto the seam's port-based sampler: a spot refused only while the cell's DEM prior was cold is probed again, each spot is recorded once, a cell keeps at most sixteen readings, and grounded flights read the floor at the contact held inside its sticky cell.
29 lines
1.4 KiB
JavaScript
29 lines
1.4 KiB
JavaScript
import { test } from 'node:test';
|
|
import assert from 'node:assert/strict';
|
|
import { spawnSync } from 'node:child_process';
|
|
import { isCalibratedAllocationRuntime } from '../../scripts/run-unit-tests.mjs';
|
|
|
|
/**
|
|
* Allocation budgets cover two intentionally different call shapes:
|
|
* - Prebuilt-option pure paths: <=16 B/call for each treatment helper.
|
|
* - Production sprite tick: <=212 B/tick when its caller builds both fresh
|
|
* options literals. The latter preserves roughly 25% headroom over the
|
|
* locally measured steady-state median instead of pretending those caller
|
|
* allocations belong to the pure helper bound.
|
|
*/
|
|
test('converged focus treatment stays within the GC-bracketed allocation budget', (t) => {
|
|
if (!isCalibratedAllocationRuntime()) {
|
|
return t.skip(`allocation budgets are calibrated for Node 24 or 26; running ${process.versions.node}`);
|
|
}
|
|
const result = spawnSync(
|
|
process.execPath,
|
|
['--expose-gc', 'scripts/focus-allocation-check.mjs'],
|
|
{ cwd: process.cwd(), encoding: 'utf8' },
|
|
);
|
|
assert.equal(result.status, 0, result.stderr || result.stdout);
|
|
const report = JSON.parse(result.stdout.trim());
|
|
assert.ok(report.advanceSpriteFocus.roundedMedian <= 16, result.stdout);
|
|
assert.ok(report.aircraftTreatmentAlpha.roundedMedian <= 16, result.stdout);
|
|
assert.ok(report.productionSpriteTick.roundedMedian <= 212, result.stdout);
|
|
});
|