Fix firmware size limits and refresh CI compatibility checks
Compact the existing STM32 field arithmetic and ESP-NOW tail-frame storage without removing features or lowering memory reserves. Refresh power-saving fixtures and pin official-app tests to a published archive.
This commit is contained in:
1 parent
cf98125c65
commit
c563c40c66
15 files changed
+494
-66
No files matched your search
@@ -209,6 +209,7 @@ int main() {
|
||||
assert(h.driver.n_recv==0&&h.driver.n_sent==0&&h.driver.n_recv_errors==0);
|
||||
assert(h.driver._rx_ps_arm_failures==0);
|
||||
assert(h.driver._rx_ps_arm_retry.consecutiveFailures()==0&&h.driver._rx_ps_arm_retry.canAttempt());
|
||||
assert(h.driver._rx_ps_enabled&&h.driver._rx_ps_rx_us==123456&&h.driver._rx_ps_sleep_us==765432);
|
||||
assert(h.dispatcher.n_sent_flood==0&&h.dispatcher.n_sent_direct==0&&h.dispatcher.n_recv_flood==0&&h.dispatcher.n_recv_direct==0);
|
||||
assert(h.dispatcher._err_flags==0&&h.tables._direct_dups==0&&h.tables._flood_dups==0);
|
||||
assert(h.driver.n_wd_soft==11&&h.driver.n_wd_hard==13&&h.driver.last_rx==1234);
|
||||
|
||||
+15
-10
@@ -1,9 +1,12 @@
|
||||
Official app compatibility source witness
|
||||
|
||||
Source: https://app.meshcore.nz/main.dart.js
|
||||
Observed: 2026-10-04
|
||||
Bytes: 9494192
|
||||
SHA-256: 84bc39a950735aaffa93d912556852a4c22e235d0cc4e4d04790113207f13a68
|
||||
Source: https://files.liamcottle.net/MeshCore/v1.50.0/MeshCore-v1.50.0%2B78-b7528a7-web.zip
|
||||
Reviewed: 2026-10-23 (official v1.50.0+78, build b7528a7)
|
||||
Archive bytes: 16950142
|
||||
Archive SHA-256: c28f5549a63ce42a50a8a5bd80081c69ef85aeb1dca221c36bc692b838a92dd7
|
||||
Member: web/main.dart.js
|
||||
JavaScript bytes: 9491330
|
||||
JavaScript SHA-256: aafc714732d1e1af749104da446cd250ea72e288f7cd60ce742f9733da30f309
|
||||
|
||||
Run:
|
||||
python3 -B test/test_official_app_compatibility.py -v
|
||||
@@ -13,16 +16,18 @@ under AddressSanitizer and UndefinedBehaviorSanitizer. No PlatformIO or
|
||||
hardware is used. The complete web application is not copied into Git.
|
||||
|
||||
Default external cache:
|
||||
~/.cache/meshcore-tests/84bc39a950735aaffa93d912556852a4c22e235d0cc4e4d04790113207f13a68/main.dart.js
|
||||
~/.cache/meshcore-tests/aafc714732d1e1af749104da446cd250ea72e288f7cd60ce742f9733da30f309/main.dart.js
|
||||
|
||||
An optional MESHCORE_OFFICIAL_APP_BUNDLE path selects an existing external
|
||||
bundle. Its bytes and SHA must match. Without that variable, a cold cache
|
||||
downloads the public source and verifies its exact size and SHA before saving.
|
||||
downloads the official versioned archive and verifies both the archive and
|
||||
JavaScript's exact size and SHA before saving only the JavaScript member.
|
||||
CI should use actions/setup-node with node-version 22 and actions/cache for
|
||||
~/.cache/meshcore-tests, keyed by the full SHA above. The public URL is mutable:
|
||||
if it changes and no pinned cache exists, the test fails explicitly. Updating
|
||||
the source pin and function witnesses requires review; it never silently uses
|
||||
the new app or replaces its parsers with test implementations.
|
||||
~/.cache/meshcore-tests, keyed by the source-pin tests. The live app URL is no
|
||||
longer used, so its deployments cannot break a cold-cache run. Changed archive
|
||||
or cached bytes still fail explicitly. Updating the source pin and function
|
||||
witnesses requires review; the test never silently uses a new app or replaces
|
||||
its parsers with test implementations.
|
||||
|
||||
The JS harness extracts and evaluates unmodified compiled app function bodies:
|
||||
ACL request builder/decoder, CMD50 builder, binary frame parser, SENT/Binary
|
||||
|
||||
+16
-16
@@ -31,7 +31,7 @@ const errors = [];
|
||||
const type = {a: value => value, b: value => value instanceof Uint8Array,
|
||||
h() { return this; }};
|
||||
const t = new Proxy({}, {get: () => type});
|
||||
const $ = {cT: () => new Uint8Array(0), cqf() {}, dF() {}, ay() {}, fQ() {},
|
||||
const $ = {cT: () => new Uint8Array(0), cq9() {}, dF() {}, ay() {}, fQ() {},
|
||||
vI: () => ({Ia: () => 0x78563412})};
|
||||
const B = {
|
||||
e: {aN: (a, b) => a >> b, qP: (a, b) => Math.trunc(a / b)},
|
||||
@@ -43,13 +43,13 @@ const B = {
|
||||
const J = {
|
||||
a3: () => ({gt: a => a.length, gap: a => a.length === 0, i: (a, i) => a[i]}),
|
||||
i2: (a, b, c) => new Uint8Array(a, b, c),
|
||||
po: a => new Uint8Array(a), lx: (a, b, c) => new DataView(a, b, c),
|
||||
c6: (a, b) => a.push(b), aaW: (a, predicate) => {
|
||||
pn: a => new Uint8Array(a), lx: (a, b, c) => new DataView(a, b, c),
|
||||
c6: (a, b) => a.push(b), aaU: (a, predicate) => {
|
||||
for (let i = a.length - 1; i >= 0; --i) if (predicate.$1(a[i])) a.splice(i, 1);
|
||||
},
|
||||
bf: a => { let i = -1; return {v: () => ++i < a.length, gM: () => a[i]}; },
|
||||
cTH: a => a.a, kz: (a, b) => a.split(b), aA: a => a.length,
|
||||
a1: (a, i) => a[i], p: (a, b) => a === b, cri: (a, n) => a.toFixed(n)
|
||||
cTB: a => a.a, kz: (a, b) => a.split(b), aA: a => a.length,
|
||||
a1: (a, i) => a[i], p: (a, b) => a === b, crc: (a, n) => a.toFixed(n)
|
||||
};
|
||||
function deferred() {
|
||||
const result = {a: 0};
|
||||
@@ -79,12 +79,12 @@ const A = {
|
||||
b3: () => ({$1() {}}), b6() {},
|
||||
bF: (_, __, ___, ms) => ({a: ms * 1000}), bT: function(a) { this.a = a; },
|
||||
fh: (duration, callback) => timers.push({due: now + duration.a / 1000, callback}),
|
||||
csH: callback => queueMicrotask(() => callback.$0()),
|
||||
csB: callback => queueMicrotask(() => callback.$0()),
|
||||
wc: function() {}, an: () => radioConnection,
|
||||
kY: value => { const number = Number(value); assert(Number.isFinite(number)); return number; },
|
||||
cS: value => { const number = Number(value); assert(Number.isInteger(number)); return number; },
|
||||
c: () => ({glp: () => "invalid radio fields", glb: () => "radio error"}),
|
||||
av: (...args) => errors.push(args), L: error => error,
|
||||
c: () => ({glo: () => "invalid radio fields", gla: () => "radio error"}),
|
||||
au: (...args) => errors.push(args), av: (...args) => errors.push(args), L: error => error,
|
||||
aH: (_, error) => errors.push(error)
|
||||
};
|
||||
const context = vm.createContext({A, B, J, t, $, u: {AD: "tag mismatch", b1: "CLI mismatch"},
|
||||
@@ -93,15 +93,15 @@ function constructor(name) {
|
||||
const code = extract(`${name}:function ${name}(`).replace(`${name}:`, `A.${name}=`);
|
||||
vm.runInContext(code, context);
|
||||
}
|
||||
for (const name of ["cZ", "d3", "fo", "ab7", "U1", "aba", "PS", "acs",
|
||||
"aSq", "aSp", "aSr", "aSs", "aSf", "pK", "b0Z", "b0Y",
|
||||
"b0X", "b1_", "b0W"]) constructor(name);
|
||||
for (const name of ["cZ", "d3", "fo", "aba", "aSq", "aSp", "aSr", "aSs", "aSf",
|
||||
"b0V", "b0Z", "b0Y", "b0X", "b1_", "b0W", "wc"]) {
|
||||
for (const name of ["cZ", "d3", "fo", "ab8", "U1", "ab5", "PS", "acr",
|
||||
"aSq", "aSp", "aSr", "aSs", "aSf", "pJ", "b0S", "b0R",
|
||||
"b0Q", "b0T", "b0P"]) constructor(name);
|
||||
for (const name of ["cZ", "d3", "fo", "ab5", "aSq", "aSp", "aSr", "aSs", "aSf",
|
||||
"b0O", "b0S", "b0R", "b0Q", "b0T", "b0P", "wc"]) {
|
||||
if (!A[name]) A[name] = function() {};
|
||||
vm.runInContext(extract(`A.${name}.prototype={`), context);
|
||||
}
|
||||
Object.assign(A, vm.runInContext(`({${extract("eD(a){")},${extract("d_f(a){")},${extract("bO(a,b){")}})`, context));
|
||||
Object.assign(A, vm.runInContext(`({${extract("\neD(a){")},${extract("\nd_9(a){")},${extract("\nbO(a,b){")}})`, context));
|
||||
|
||||
function connection() {
|
||||
const connection = new A.wc();
|
||||
@@ -111,8 +111,8 @@ function connection() {
|
||||
i: (_, key) => map.get(key), Z: (_, key) => map.has(key),
|
||||
ey: (_, fn) => { for (const [key, value] of map) fn.$2(key, value); }
|
||||
};
|
||||
for (const name of ["eY", "N", "bCk", "bu", "dT", "W7"])
|
||||
connection[name] = A.b0V.prototype[name];
|
||||
for (const name of ["eY", "N", "bCk", "bu", "dT", "W6"])
|
||||
connection[name] = A.b0O.prototype[name];
|
||||
connection.writes = [];
|
||||
connection.d6 = async bytes => { connection.writes.push(Buffer.from(bytes)); };
|
||||
return connection;
|
||||
|
||||
@@ -29,15 +29,15 @@ $.lw = $.c5 = () => {};
|
||||
$.a4 = null;
|
||||
A.au = value => Promise.resolve(value);
|
||||
A.aN = bytes => Buffer.from(bytes).toString("hex");
|
||||
A.jV = (items, predicate) => items.find(item => predicate.$1(item)) || null;
|
||||
A.jU = (items, predicate) => items.find(item => predicate.$1(item)) || null;
|
||||
// SQLite's map and insert boundaries retain values produced by real app code.
|
||||
A.z = () => ({fields: {}, l(_, key, value) { this.fields[key] = value.a; }});
|
||||
context.Date = {now: () => 1900000000000};
|
||||
for (const name of ["VU", "Nu", "be", "ax", "VW", "bZ7", "aS1", "aS2", "aS3", "aS4"])
|
||||
for (const name of ["VT", "Nt", "be", "ax", "VV", "bZ1", "aS1", "aS2", "aS3", "aS4"])
|
||||
constructor(name);
|
||||
for (const name of ["VW", "bZ7", "aS1", "aS2", "aS3", "aS4"])
|
||||
for (const name of ["VV", "bZ1", "aS1", "aS2", "aS3", "aS4"])
|
||||
vm.runInContext(extract(`A.${name}.prototype={`), context);
|
||||
Object.assign(A, vm.runInContext(`({${extract("czU(a,b,c,d,e,f,g,h,i,j,k,l,m,n){")}})`, context));
|
||||
Object.assign(A, vm.runInContext(`({${extract("czO(a,b,c,d,e,f,g,h,i,j,k,l,m,n){")}})`, context));
|
||||
const methods = vm.runInContext(`({${extract("\nbA0(a,b,c){")},${extract("\nbCv(a,b,c){")}})`, context);
|
||||
|
||||
function connection() {
|
||||
@@ -47,8 +47,8 @@ function connection() {
|
||||
i: (_, key) => listeners.get(key), Z: (_, key) => listeners.has(key),
|
||||
ey: (_, fn) => { for (const [key, value] of listeners) fn.$2(key, value); }
|
||||
};
|
||||
for (const name of ["eY", "N", "bCk", "bu", "dT", "W7"])
|
||||
client[name] = A.b0V.prototype[name];
|
||||
for (const name of ["eY", "N", "bCk", "bu", "dT", "W6"])
|
||||
client[name] = A.b0O.prototype[name];
|
||||
client.writes = [];
|
||||
client.d6 = async bytes => { client.writes.push(Buffer.from(bytes)); };
|
||||
return client;
|
||||
@@ -75,7 +75,7 @@ async function persist(message) {
|
||||
abP(owner, contact, decoded) { return methods.bA0.call(this, owner, contact, decoded); },
|
||||
a33: async () => null
|
||||
};
|
||||
$.e_ = {d: ownerKey}; $.aj = database;
|
||||
$.dZ = {d: ownerKey}; $.aj = database;
|
||||
// This is the stock app's ordinary/backlog message intake, with widget
|
||||
// notifications disabled and its SQL duplicate-query boundary mocked.
|
||||
await methods.bCv.call({k2: [room]}, message, false, false);
|
||||
|
||||
Reference in new issue
Block a user