Skip to content

impl(027): increment 7, headless Chromium - #141

Merged
bartekus merged 1 commit into
mainfrom
impl/027-inc7-chromium
Oct 21, 2026
Merged

bartekus merged 1 commit into
mainfrom
impl/027-inc7-chromium

Conversation

@bartekus

@bartekus bartekus commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Spec 027 increment 7, second change: the WebAssembly package in headless Chromium (3.10.5, 3.11.3, 3.13.3).

  • tools/rustev-conformance/js/package.json: playwright-core exact-pinned at 1.63.0 (no dependencies; npm audit signatures covers it), which fixes the Chromium build; make bindings installs that version's headless shell.
  • tools/rustev-conformance/js/chromium.mjs time <pkg> <out>: cold instantiation as 3.10.5 defines it (module bytes in memory to the first successful version()), 3 discarded warm-up runs then 21 measured, each in a fresh browser process, the page served from a loopback server holding only the package directory (paths outside it refused). Writes browser version, samples, median and p95; prints the median.
  • wasm-check.mjs: --chromium-record <file> records those in the measurement document (chromium, chromium_instantiation_ms with samples and p95); its median must equal the gated --chromium-ms.
  • run.mjs: the WebAssembly adapter now turns each case into one plain call (wasmCall, bytes as base64) run by one self-contained executor (executeWasm), so identical code runs in Node and in a Chromium page. run.mjs chromium <pkg> runs every WebAssembly case in Chromium. A replay's synchronous resolver answers from the case's store items, exactly as before.
  • Makefile (bindings): installs the headless shell, measures Chromium, passes the median and record to wasm-check.mjs, and runs the conformance cases in Chromium after Node.
  • Spec 027: implementation record.

#140 has merged; this PR is rebased onto main.

Local verification (macOS arm64): make bindings passes end to end: WebAssembly conformance 23/23 in Node and 23/23 in Chromium 153.0.8010.12 (headless shell), Chromium instantiation median 3.1 ms and p95 3.3 ms (budget 100 ms), Node median 3.7 ms, sizes raw 2,216,152 / gzip 763,059 / Brotli 543,437, 27 native tests, native conformance 34/34 on the local build and on the fresh install. That run preceded the rebase onto #140's review fixes, which touch only platform-packages.mjs and were verified there. make gate; bash scripts/check-authored-content.sh.

Review round 1 (3 findings, fixed):

  1. An absent optional argument crossed into the page as undefined (which a page receives as null) and stayed undefined in Node. Both cases already read as None (wasm-bindgen's isLikeNone tests both), which is why all 23 cases passed in Chromium, but wasmCall now writes null itself for --execution and --host-cap-ms, so Node and the page receive the same value, with a comment saying why.
  2. A request whose URL does not parse or whose path does not decode threw out of the server's handler; it is now answered 400 (checked locally with a raw request for /%E0%A4%A).
  3. The timing run launched a 25th browser only to read its version; each sample now returns its browser's version, and the record takes the first measured one.

Rebased onto #140's review rounds 2 and 3. After the fixes: run.mjs wasm 23/23 and run.mjs chromium 23/23, chromium.mjs time median 3 ms with version 153.0.8010.12 recorded.

@github-actions

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the diff: new headless Chromium test runner wired through chromium.mjs, run.mjs, wasm-check.mjs, and the Makefile.

chromium.mjs – path traversal guard in serve()
Lines 37-40: normalize(join(root, path)) + startsWith(root + sep) is correct. new URL().pathname normalizes .. segments before decodeURIComponent is applied, and the sentinel check guards the residual. The guard is sound.

chromium.mjs – time() extra browser launch for version
Lines 78-80: a fresh browser is launched after all 24 sample browsers (3 warmup + 21 measured) just to call browser.version(). The version is available on any of the sample browser handles but all are closed by then. Functionally correct but wasteful; minor.

wasm-check.mjs – median floating-point equality
Line: chromiumRecord.median !== chromiumMs. doc.median is a performance.now() delta written via JSON.stringify and also via console.log. Both V8 paths use the shortest round-trip representation, so the parsed values are bit-identical. The comparison is safe in practice.

run.mjs – executeWasm.toString() injection
executeWasm contains no free variables from outer scope (uses only atob, btoa, Uint8Array, Object.hasOwn, String.fromCharCode, and its two parameters). Serializing and re-executing it in a browser page is correct. Object.hasOwn is available since Chrome 93; Chromium 153 is fine.

run.mjs – wasmCall items vs original resolveItem
Original: store === undefined ? null : files.get(key) ?? null. New code: pre-builds items from files with store/ prefix, then Object.hasOwn check returns null for absent references. Semantically equivalent. ✓

run.mjs – case filtering for chromium surface
named = 'wasm' when surface === 'chromium'; manifest cases filtered by named. Runs exactly the wasm-surface cases in Chromium, as intended. ✓

run.mjs – adapter.close?.() call
Correctly uses optional chaining; wasmAdapter and nativeAdapter return plain functions (no .close), chromiumAdapter attaches one. ✓

Makefile – nested quotes in shell substitution
"$$(cat "$(BINDINGS_OUT)/chromium-median")" — in bash, $(…) opens a new quoting context so the inner double-quotes are valid. Works for any BINDINGS_OUT without spaces. Fine.

No bugs or security issues found.

{"head": "3ccc154d57028b90464d0d0eb598d4165e7d1632", "verdict": "no-findings", "findings": []}

Subject: 1eaaab3...3ccc154, diff digest 95f53c295f10ea936e84f1bf52e4fa3fd75642a950f43d2d01d5315b210a50a2, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus force-pushed the impl/027-inc7-packages branch from 1eaaab3 to 02297d2 Compare October 21, 2026 07:19
@bartekus
bartekus force-pushed the impl/027-inc7-chromium branch from 3ccc154 to a299f00 Compare October 21, 2026 07:20
@github-actions

Copy link
Copy Markdown

AI review (findings)

Reviewing the diff for the headless Chromium conformance runner addition.

Findings

1. undefined → null coercion across page.evaluate (run.mjs)

In wasmCall, the replay case writes undefined when no cap is present:

args: [..., cap === undefined ? undefined : Number(cap)],

When this object is passed as the second argument to page.evaluate((call) => ..., wasmCall(c)), Playwright's JSON serialization bridge converts undefined array elements to null. Inside the browser, executeWasm then calls glue.replay(inputs, bundle, scope, nowMs, null, resolveItem) instead of glue.replay(..., undefined, resolveItem). If the WASM binding checks cap !== undefined (which is idiomatic), this will be treated as a defined (but null) cap in Chromium while being treated as no-cap in Node, breaking the parity the adapter is designed to guarantee.

File: tools/rustev-conformance/js/run.mjs — the case 'replay': block of wasmCall and the chromiumAdapter's page.evaluate call.

2. Unhandled URL parse error in loopback server (chromium.mjs, line ~34)

const path = decodeURIComponent(new URL(req.url, 'http://x').pathname);

new URL(req.url, ...) throws TypeError for malformed request URLs (e.g. bare %). Because this is inside the request handler (not in a try-catch), the exception propagates as an uncaught error on the http.Server instance. In Node, an unhandled 'error' event on a server crashes the process. This is a loopback-only test server, so blast radius is low, but it can abort the entire make bindings run mid-flight if any test page issues a malformed request.

File: tools/rustev-conformance/js/chromium.mjs, line 34.

3. Extra browser launch to retrieve version (chromium.mjs, lines ~83-85)

After all 21 measured samples are complete, time() launches a fresh browser solely to call browser.version():

const browser = await chromium.launch({ headless: true });
const version = browser.version();
await browser.close();

This is the 25th browser launch in that function (3 warm-up + 21 measured + 1 extra). The version is already available on any browser object returned by chromium.launch(), so it could be read from the last sample() call if that function returned it, or retrieved once before the loop. As-is, the extra launch adds noise and latency to CI.

File: tools/rustev-conformance/js/chromium.mjs, lines 83–85.


Finding 1 is the only correctness bug; findings 2 and 3 are robustness and efficiency concerns.

{"head": "a299f0063ae8dd8387ab8e0947a35f93658cb204", "verdict": "findings", "findings": [{"path": "tools/rustev-conformance/js/run.mjs", "line": null, "summary": "In the replay branch of wasmCall, `cap === undefined ? undefined : Number(cap)` produces undefined in the call.args array; Playwright's page.evaluate JSON bridge converts undefined array elements to null, so glue.replay receives null instead of undefined for the cap argument in Chromium, breaking Node/Chromium parity for uncapped replay cases."}, {"path": "tools/rustev-conformance/js/chromium.mjs", "line": 34, "summary": "new URL(req.url, 'http://x') throws TypeError on malformed request URLs inside the HTTP request handler with no surrounding try-catch, which will crash the server process via an unhandled error event."}, {"path": "tools/rustev-conformance/js/chromium.mjs", "line": 83, "summary": "A fresh browser is launched after all 21 samples solely to read browser.version(), adding an unnecessary 25th browser launch; the version could be read from any already-launched browser instance."}]}

Subject: 02297d2...a299f00, diff digest 95f53c295f10ea936e84f1bf52e4fa3fd75642a950f43d2d01d5315b210a50a2, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus had a problem deploying to statecraft-review-exception October 21, 2026 07:24 — with GitHub Actions Error
@bartekus
bartekus force-pushed the impl/027-inc7-packages branch from 02297d2 to 7251222 Compare October 21, 2026 07:47
@bartekus
bartekus force-pushed the impl/027-inc7-chromium branch from a299f00 to ede887b Compare October 21, 2026 07:48
@github-actions

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the diff carefully across all changed files.

chromium.mjs — new loopback server + Chromium timing harness:

  • Path traversal guard (file.startsWith(root + sep)) is correct. resolve always strips trailing separators, normalize(join(...)) collapses .. before the check, and the server only binds to 127.0.0.1.
  • p95: sorted[Math.ceil(0.95 * 21) - 1] = sorted[19] (20th of 21). Correct.
  • readFileSync in the request handler blocks the event loop, but this is a loopback-only test fixture; not a real concern.
  • serve returns close: () => server.close() (synchronous, no await). Same pattern used in adapter.close in run.mjs — server.close() isn't awaited. Connections are already gone (browser closed first), so the process exits cleanly in practice.

run.mjs — wasmCall / executeWasm split:

  • executeWasm.toString() serialization is safe; the function closes over nothing from the outer module — only standard globals (atob, btoa, Uint8Array, Object.hasOwn). Object.hasOwn is available since Chrome 93; Chromium 153 is fine.
  • call.items is only accessed inside if (call.fn === 'replay'), so the absent items key on non-replay calls is harmless.
  • for (const [name, b] of call.inputs) — call.inputs is an array of two-element arrays, which survives Playwright's structured-clone serialization correctly.
  • Structured clone of the call object (via page.evaluate) correctly round-trips arrays-of-arrays, numbers, strings, and null.

wasm-check.mjs — --chromium-record flag:

  • The equality check chromiumRecord.median !== chromiumMs compares a JSON-parsed float against a parseFloat-parsed value taken from console.log of the same float. In Node ≥ 20, both JSON.stringify(n) and console.log(n) emit the shortest decimal representation that round-trips, so parseFloat(JSON.stringify(n)) === n holds for all finite doubles. No practical risk.
  • rest[recordAt + 1] is not bounds-checked: if --chromium-record is the last argument with no value, readFileSync(undefined) throws a TypeError inside the try, which is caught and printed with a reasonable message. Acceptable for a dev tool.

Makefile / package files — no issues found. Pin is exact (1.63.0), npm audit signatures covers it, Chromium download origin is documented in package.json comment.

Nothing rises to the level of a bug or security problem.

{"head": "ede887bc3c81431d0c406ea25359d718f8ea6574", "verdict": "no-findings", "findings": []}

Subject: 7251222...ede887b, diff digest dcc8bd6d644970188588612757769c1c0bfc7db0c842ae48c3214ae87cd65cbf, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus force-pushed the impl/027-inc7-packages branch 2 times, most recently from f5d267b to 92d4d9a Compare October 21, 2026 14:24
Base automatically changed from impl/027-inc7-packages to main October 21, 2026 14:46
@bartekus
bartekus force-pushed the impl/027-inc7-chromium branch from ede887b to 385c040 Compare October 21, 2026 14:58
@github-actions

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the PR, which adds headless Chromium testing for WebAssembly conformance via playwright-core.

tools/rustev-conformance/js/chromium.mjs

  • Path traversal prevention (root + sep guard, URL-normalized pathname) is sound on Linux/macOS.
  • The TYPES map covers only .js, .wasm, .html; other extensions fall back to application/octet-stream. Browsers enforce MIME types for ES module import(). wasm-bindgen's web target emits only the two covered files, so this is fine in practice but would silently break if the output ever included additional .js imports.
  • sample() launches and fully closes a fresh browser process per measurement — correct for "cold" instantiation as the spec defines it.
  • Median at sorted[10] (21 samples) and p95 at sorted[Math.ceil(0.95 * 21) - 1] = sorted[19] are correct.
  • console.log(doc.median) is the only stdout write; Playwright diagnostic output goes to stderr. Shell command substitution strips the trailing newline. No corruption risk.

tools/rustev-conformance/js/run.mjs

  • executeWasm is stringified and injected via addScriptTag. The function body uses only atob, btoa, and Object.hasOwn — all available in Chromium 93+ (Chromium 153 is used). Self-containment claim is accurate.
  • wasmCall's replay case: strips the store prefix when building items, then the resolver looks up by bare reference — matches the original logic exactly.
  • The text helper chunks at 0x8000 = 32768 to avoid spread-induced stack overflow; this is a well-established pattern and safely under V8's argument limit.
  • run.close?.() correctly handles the three adapters: only chromiumAdapter attaches .close.
  • named = surface === 'chromium' ? 'wasm' : surface correctly filters cases by the wasm surface label for Chromium runs.

tools/rustev-conformance/js/wasm-check.mjs

  • chromiumRecord.median !== chromiumMs: chromiumMs is re-parsed via Number(console.log output). JavaScript's shortest-representation toString guarantees Number(String(x)) === x for all finite values, so the strict equality holds. Not a bug, but an implicit assumption.
  • If --chromium-record is given without --chromium-ms, the chromiumMs === null branch triggers an error — intentional.

tools/rustev-conformance/js/package-lock.json

  • playwright-core entry: integrity sha512-rYCsBF/...== is 88 base64 characters (correct for SHA-512). Format is valid SRI. npm ci + npm audit signatures enforce this on install.

Makefile

  • wasm-bindgen install chromium-headless-shell is invoked inside the npm ci step using node_modules/.bin/playwright-core, which is exactly-pinned. ✓
  • The shell $$(cat ...) expands after make's own $ escaping — double-dollar is correct here.

No bugs, security issues, or inconsistencies found.

{"head": "385c0403387a532123d6e10552c14d3c298d7675", "verdict": "no-findings", "findings": []}

Subject: 3556d24...385c040, diff digest dcc8bd6d644970188588612757769c1c0bfc7db0c842ae48c3214ae87cd65cbf, 1 call(s). An AI comment is not an approval.

@github-actions

Copy link
Copy Markdown

AI review (findings)

Reviewing the diff: a new headless Chromium adapter (chromium.mjs), a refactored run.mjs that lifts wasm execution into a serialisable executeWasm function, and plumbing in wasm-check.mjs / Makefile.


1. Double URL-decoding in serve() — chromium.mjs line 33

path = decodeURIComponent(new URL(req.url, 'http://x').pathname);

URL.pathname already leaves %2F (and similar special-character sequences) encoded while normalising .. segments. Calling decodeURIComponent a second time on the already-normalised pathname means %2525 → %25 → %, and %252F → %2F → /. The subsequent traversal guard (normalize(join(root, path)) + startsWith(root + sep)) still blocks escape, so there is no directory-traversal vulnerability, but the double-decode is an inconsistency: a request for /%2e%2e/secret survives URL parsing as /%2e%2e/secret, then decodeURIComponent turns it into /../secret, which after join+normalize correctly stays inside root. Swap the order — parse the URL, then work with the already-safe pathname directly without a second decodeURIComponent — to avoid the surprising double-decode.


2. server.close() without await in adapter.close — run.mjs line ~282

adapter.close = async () => {
  await browser.close();
  server.close();   // ← no await / callback
};

http.Server.close() only stops new connections; it calls no callback here and the caller never knows when the server is actually torn down. In the normal case (browser closed, no in-flight requests) the server idles and the process drains cleanly, but if any connection happens to be pending the process could hang at exit. Passing a callback or wrapping in a Promise keeps the close deterministic:

await new Promise((r) => server.close(r));

No other bugs, security problems, or inconsistencies found. The traversal guard in serve() is correct (URL .. segments are resolved by new URL before decodeURIComponent runs; normalize+startsWith(root + sep) blocks the remaining cases). The executeWasm serialisation approach (base64 throughout, no closure captures, atob/btoa only) is correct. The chromiumRecord.median !== chromiumMs consistency check is safe because console.log and JSON.stringify both use JavaScript's shortest-round-trip number representation. The p95 index sorted[Math.ceil(0.95 * 21) - 1] = sorted[19] is correct for 21 samples.

{"head": "385c0403387a532123d6e10552c14d3c298d7675", "verdict": "findings", "findings": [{"path": "tools/rustev-conformance/js/chromium.mjs", "line": 33, "summary": "URL pathname is decoded twice: `new URL(...).pathname` already normalises percent-sequences, so the subsequent `decodeURIComponent` produces unexpected double-decoding (e.g. `%252F` → `/`); traversal guard still holds, but the behaviour is inconsistent."}, {"path": "tools/rustev-conformance/js/run.mjs", "line": 282, "summary": "`server.close()` is called without a callback or await in `adapter.close`, so teardown is non-deterministic and the process could hang if any connection is still open when the adapter is closed."}]}

Subject: 3556d24...385c040, diff digest dcc8bd6d644970188588612757769c1c0bfc7db0c842ae48c3214ae87cd65cbf, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus had a problem deploying to statecraft-review-exception October 21, 2026 15:04 — with GitHub Actions Error
@bartekus
bartekus enabled auto-merge (squash) October 21, 2026 15:04
@bartekus
bartekus merged commit a99f7bf into main Oct 21, 2026
12 of 13 checks passed
@bartekus
bartekus deleted the impl/027-inc7-chromium branch October 21, 2026 15:17
bartekus added a commit that referenced this pull request Oct 21, 2026
Spec 031 increment 1: the facade crate `rustev`, its boundary rules, and
`rustev-pkg-lodging` and the facade joining the release family.

- `integrations/rustev/` (new, crate `rustev`):
`#![forbid(unsafe_code)]`, no binary. `rustev::contract` and
`rustev::decision_core` always (3.2.1); features `runtime`, `eval`,
`rules`, `remote-http` (the four whose crates are in this release, 3.4),
each `dep:` exactly one optional dependency and gating one module named
after it; `default = []`; documented with module, crate and subset
(3.2.5).
- `tests/public_items.rs`: the source is only those re-exports; each
feature enables exactly its one `dep:`; `default` is empty; every
feature is documented.
- `tests/plan_ids.rs` (3.7): both reference plans compiled through
`rustev::decision_core` from the conformance suite's pinned `plan check`
fixtures equal the plan identities the CLI goldens pin. Passes with no
feature and with all features.
- `tools/rustev-boundaries` (3.3): `FacadeIntegration` (an integration
dependency of the facade that is not optional, not normal, or not
enabled by exactly one feature), `DependsOnFacade` (any workspace crate,
any dependency kind), `FacadeDefault` (non-empty default),
`FacadeFamily` (the facade naming an ecosystem, HTTP or binding family
itself), and the facade's no-feature graph checked transitively like the
pure crates. Integration crates still may not depend on one another.
Eight synthetic-metadata fixtures.
- `tools/rustev-release`:
- `release-set.json`: `rustev-pkg-lodging` in layer 3 (uploading after
the CLI it dev-depends on, as support-routing does); `rustev` alone in a
new last layer, uploading last; lodging's exclusion removed.
- policy: only the facade may declare features, each exactly one
optional normal dependency on a release member (I-3: a feature for a
crate outside the release fails), and a non-empty default fails
(`FacadeFeature`); the facade's layer is the last one and the set
refuses a facade sharing it or not uploading last. Tests for each; three
existing tests that used lodging as their excluded example now use
`rustev-boundaries`.
- `archive-policy.json`: the reviewed file lists of both new archives
(equal to `cargo package --list`, which the existing test checks).
- `packages/rustev-pkg-lodging`: family metadata, `publish =
["crates-io"]`, `include`, `LICENSE`, workspace dependencies (031 amends
008's out-of-scope publication). Its tests pass unchanged.
- Workspace `Cargo.toml`: the two packages as exact-pinned workspace
dependencies.
- Spec 031: `integrations/rustev/` established (no longer planned), an
`extends` edge for lodging's `LICENSE`, implementation record.

Later increments: subset jobs, MSRV and semver checks, SBOMs, the
changelog, the extended dry run and the release workflow.

Local verification (macOS arm64): `cargo test -p rustev` (with no
feature and with `--all-features`), `cargo test -p rustev-boundaries`
(28), `cargo test -p rustev-release` (all pass, manifests 17), `cargo
test -p rustev-pkg-lodging`, `make boundaries`, `cargo clippy
--workspace --all-targets -D warnings` and `-p rustev --all-features`,
`cargo fmt --check`, `make gate`, `bash
scripts/check-authored-content.sh`.

Review round 1 (3 findings: 1 fixed, 2 answered in the diff):
1. "The last-layer test calls `check_manifests`, but the message comes
from `check_set`." `check_manifests` begins with `let mut v =
check_set(set);`, so it carries that verdict; the test passed locally. A
comment at the test now says so.
2. A facade feature naming a crate outside the release produced two
violations (not a member, and not a dependency). Fixed: the membership
violation is the only one (`continue`), and the test now asserts exactly
one violation with `only()`.
3. "`README.md` is not in the facade's or lodging's archive." It is:
Cargo adds the workspace `README.md` that `readme.workspace` names
regardless of `include`, `cargo package --list -p rustev` prints it, and
`tests/archives.rs` (`the_reviewed_lists_equal_cargo_package_list`)
checks the reviewed lists against that output and passes. Both manifests
now say so beside `include`.

Review round 2 (2 findings, fixed):
1. A workspace crate depending on the facade was reported twice
(`DependsOnIntegration`, since the facade lives under `integrations/`,
and `DependsOnFacade`). A dependency on the facade is now
`DependsOnFacade` alone; the fixture uses `rustev-eval` (which no other
rule restricts) and asserts exactly that one violation for normal, dev
and build dependencies. The "integration crates still may not depend on
one another" fixture now has a second integration crate depending on the
remote binding and asserts exactly `DependsOnIntegration`.
2. `every_feature_is_documented` indexed `entries[0]`; a feature
enabling nothing now fails with a message naming it.

Review round 3 (2 findings, fixed): `tests/public_items.rs` no longer
parses `Cargo.toml` by hand; it reads the facade's features from `cargo
metadata --no-deps` (Cargo's own parse), and compares the declared
features with the gated modules as sorted sets, so neither file's order
matters.

Rebased onto `main` after #138 to #141 merged (derived shards
regenerated).

Review round 4 (1 finding, fixed): the facade's archive bounds (128 KiB
compressed, 256 KiB unpacked) were looser than lodging's although the
facade holds less. They are now 64 KiB compressed and 128 KiB unpacked,
the ceilings of the other small library crates: its archive is
`src/lib.rs`, the workspace README and LICENSE (16.5 KB together), the
manifests and a `Cargo.lock` of its all-features graph (about 25 KB).
The release candidate measures every archive against these bounds and
fails on any excess.

This branch was successfully deployed

No deployments
statecraft-review-exception — 385c0403 Deployed Oct 21, 2026 by bartekus via review-exception #960
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant