Skip to content

Commit bd5a08f

Browse files
committed
test(vnext): make worker evidence hermetic
1 parent fd6bc39 commit bd5a08f

5 files changed

Lines changed: 87 additions & 64 deletions

File tree

docs/adr/0004-isolated-parser-execution.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -234,11 +234,11 @@ that entry does not exist. The protocol PR must move the worker implementation
234234
behind the packed package boundary and remove the fixture's direct parser
235235
dependency before making a public packaging claim.
236236

237-
The latest local Node 24 / Chromium 149 / arm64 macOS sample recorded:
237+
A representative local Node 24 / Chromium 149 / arm64 macOS sample recorded:
238238

239239
| Output | Raw | gzip |
240240
| --- | ---: | ---: |
241-
| Core-only fixture | 24,680 B | 7,572 B |
241+
| Core-only fixture | 24,056 B | 7,497 B |
242242
| PostgreSQL transitive worker graph | 321,156 B | 67,396 B |
243243
| BigQuery transitive worker graph | 225,309 B | 50,389 B |
244244
| Complete worker fixture | 549,885 B | 118,160 B |
@@ -254,10 +254,10 @@ One sequential cold/warm run on the shared worker measured:
254254

255255
| Dialect | Grammar load and initialization | First parse | First round trip | Warm parse | Warm round trip |
256256
| --- | ---: | ---: | ---: | ---: | ---: |
257-
| PostgreSQL | 8.2 ms | 2.3 ms | 10.7 ms | 0.2 ms | 0.2 ms |
258-
| BigQuery | 4.3 ms | 2.2 ms | 6.7 ms | 0.3 ms | 0.3 ms |
257+
| PostgreSQL | 8.0 ms | 2.4 ms | 10.6 ms | 0.1 ms | 0.3 ms |
258+
| BigQuery | 4.2 ms | 2.5 ms | 6.7 ms | 0.2 ms | 0.4 ms |
259259

260-
The worker ready handshake took 7.4 ms in that run.
260+
The worker ready handshake took 10.3 ms in that run.
261261

262262
These numbers establish packaging feasibility and initial size guards. They
263263
are not percentile claims. Stable latency decisions require repeated,

test/worker-placement/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ exact tarball created by `pnpm pack`. It is intentionally not a workspace
55
package. Its direct `node-sql-parser` dependency is intentional: the frozen
66
fixture dependencies are installed before the exact tarball is extracted, and
77
the harness verifies that its exact `5.4.0` version matches the packed
8-
package's dependency.
8+
package's dependency. The fixture workspace pins Vite's floating transitive
9+
versions to the exact versions in the root lock, so the nested frozen install
10+
can run offline after a clean root CI install.
911

1012
The minified Vite 8 single-worker baseline is 67,396 gzip bytes for the
1113
PostgreSQL transitive graph, 50,389 gzip bytes for the BigQuery transitive

test/worker-placement/pnpm-lock.yaml

Lines changed: 62 additions & 57 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
packages:
2+
- .
3+
4+
overrides:
5+
lightningcss: 1.32.0
6+
nanoid: 3.3.15
7+
postcss: 8.5.16

test/worker-placement/vite.core.config.mjs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
import { resolve } from "node:path";
22
import { defineConfig } from "vite";
33

4+
const fixtureRoot = `${import.meta.dirname.replaceAll("\\", "/")}/`;
5+
6+
function normalizeModuleId(moduleId) {
7+
const normalized = moduleId.replaceAll("\\", "/");
8+
return normalized.startsWith(fixtureRoot)
9+
? normalized.slice(fixtureRoot.length)
10+
: normalized;
11+
}
12+
413
function moduleTrace() {
514
return {
615
name: "worker-placement-core-module-trace",
@@ -13,7 +22,7 @@ function moduleTrace() {
1322
imports: [...chunk.imports].sort(),
1423
isEntry: chunk.isEntry,
1524
moduleIds: Object.keys(chunk.modules)
16-
.map((moduleId) => moduleId.replaceAll("\\", "/"))
25+
.map(normalizeModuleId)
1726
.sort(),
1827
}))
1928
.sort((left, right) =>

0 commit comments

Comments
 (0)