Skip to content

Commit de2d8be

Browse files
committed
fix(site): subset-ness is relative to the base, and each scoped run is screened on its own flags
1. isStrictSubset compared against `widest` rather than the run being layered ONTO. Subset-ness only means anything relative to the base: a scoped re-run is a subset of the GRID, not necessarily of some historical snapshot. Add a 7th dialect, re-run OTB_DIALECTS=openai,vertex, and its 4 cells contain vertex|openai - a coord the old 36-cell run never had. Not a subset of widest, so it landed in `fulls`, became the base by recency, and 33 measured cells vanished. That is the exact failure this module exists to prevent, arriving through the door next to the one it was watching. 2. The degraded-mode refusal read snap.matrix, which by then is the LAYERED result carrying the BASE run's mode flags - layerScopedMatrix copies cells and nothing else. Every scoped snapshot that layered in was exempt, so a verify-local smoke run with cell_perf_sweep: false could replace the headline cell of a clean field run while the guard read the base's `true` and threw nothing. Screened per run now, which is the only place the scoped run's own flags still exist. The 3 red site tests are C8 only - the board mixes two engines while the field run is mid-flight. They clear when it completes.
1 parent 9187d1a commit de2d8be

1 file changed

Lines changed: 26 additions & 2 deletions

File tree

‎site/gen-data.mjs‎

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,12 +230,36 @@ function resolvedSnapshot(key) {
230230
// The base is the newest run that is NOT a strict subset of the widest - i.e. a full run.
231231
const fulls = snaps.filter((s) => !isStrictSubset(s.__coords, widest.__coords));
232232
const base = fulls[fulls.length - 1];
233-
const scopedNewer = snaps.filter((s) => isStrictSubset(s.__coords, widest.__coords) && s.__ms >= base.__ms);
233+
/* SUBSET OF THE BASE, NOT OF THE WIDEST. Subset-ness only means anything relative to the run being
234+
layered ONTO: a scoped re-run is a subset of the GRID, not necessarily of some historical
235+
snapshot. Testing against `widest` misclassified any re-run that touched a coordinate the widest
236+
run lacked - add a 7th dialect, re-run `OTB_DIALECTS=openai,vertex`, and its 4 cells contain
237+
`vertex|openai`, which the old 36-cell run never had. Not a subset of `widest`, so it landed in
238+
`fulls`, became the base by recency, and 33 measured cells vanished from the board. That is the
239+
exact failure this module was written to prevent, arriving through the door next to the one it
240+
was watching. */
241+
const scopedNewer = snaps.filter((s) => isStrictSubset(s.__coords, base.__coords) && s.__ms >= base.__ms);
234242
if (!scopedNewer.length) return base;
235243
const out = structuredClone(base);
236244
out.__file = base.__file;
237245
let m = base.matrix;
238-
for (const sc of scopedNewer) m = layerScopedMatrix(m, sc.matrix, sc);
246+
for (const sc of scopedNewer) {
247+
/* AND EACH SCOPED RUN IS SCREENED ON ITS OWN FLAGS. The degraded-mode refusal below reads
248+
`snap.matrix`, which by then is the LAYERED result carrying the BASE run's mode flags -
249+
`layerScopedMatrix` copies cells and nothing else. So every scoped snapshot that layered in was
250+
exempt from the guard, and a `verify-local` smoke run with `cell_perf_sweep: false` could
251+
replace the headline cell of a clean field run while the guard read the base's `true` and threw
252+
nothing. Screening here, per run, is the only place the scoped run's own flags still exist. */
253+
const degraded = snapshotDegradedMode(sc.matrix);
254+
if (degraded) {
255+
throw new Error(
256+
`gen-data: REFUSING to layer a DEGRADED-MODE re-run into ${key}. ${sc.__file} ` +
257+
`(measured_at ${sc.measured_at}) ran with ${degraded} - those phases were switched OFF, so it ` +
258+
`is a local smoke run, not a measurement, and its cells would replace measured ones.\n` +
259+
` Fix: delete or move that snapshot out of results/snapshots/.`);
260+
}
261+
m = layerScopedMatrix(m, sc.matrix, sc);
262+
}
239263
out.matrix = m;
240264
out.__layered_from = scopedNewer.map((s) => s.__file);
241265
return out;

0 commit comments

Comments
 (0)