diff --git a/FIDELITY.md b/FIDELITY.md index 547d2a8..b8a613e 100644 --- a/FIDELITY.md +++ b/FIDELITY.md @@ -18,6 +18,18 @@ The committed PNGs under `testdata/renders/` back every claim here. Reproduce them with the commands at the bottom. The measured-vs-Chrome numbers live in [`bench/REPORT.md`](bench/REPORT.md). +## 2026-11-15 (round 47) — engine#418 narrowed to a specific, reproducible line: i18next's own `resolve()` never calls `getResource` at all, yet still returns the caller's OWN options object as the "resolved" value (investigation, engine#418 — still NOT fixed, root cause not yet isolated) + +User picked this Known-gaps item (open since round 35, narrowed once already in round 36) to investigate next. Round 36 had concluded the i18next+http-backend pipeline was "provably correct... end to end, in isolation" and narrowed the remaining gap to "almost certainly `react-i18next`'s `useTranslation()` ... interacting with this engine's settle-quiescence detection," explicitly deferred for needing "the real `react-dom`/`react-i18next` bundles actually reconciling inside this engine." This round built exactly that, in two stages, and found round 36's own theory does NOT hold — the real mechanism is narrower and lower-level than either round suspected. + +- **Stage 1, synthetic but real**: a genuine `React` + `ReactDOM` + `i18next` + `i18next-http-backend` + `react-i18next` (all real UMD bundles, fetched fresh) reconciling inside this engine, with a `useTranslation()`-driven component and a REAL async backend delay (an `httptest` server, matching GitHub's own loadPath shape). This reproduces the BENIGN, expected i18next behaviour exactly — first render falls back to the bare key ("Help"), then a real post-load re-render correctly shows the loaded value ("AIDE_REAL_VALUE") — **not** the "returned an object" bug. Round 36's own "react-i18next + settle timing" theory is ruled out: the generic mechanism it named works correctly on this engine. +- **Stage 2, decisive**: `Engine.Client`'s `Transport` was overridden with a `RoundTripper` that serves a byte-for-byte copy of GitHub's own real, currently-served `911-fd88881beb259e08c065.js` chunk — patched in a few places with one-line `console.log` probes at exact, verified-unique text anchors — while every OTHER request (CSS, fonts, every other script, the real locale JSON) still goes to the real network. `engine.New().Render(ctx, "https://support.github.com/request/landing", ...)` then renders the REAL page end to end (confirmed matching round 33's own finding: `ContentHeight=842`, the real sign-in UI). This is the first time this investigation observed the ACTUAL, live-served minified code execute with instrumentation, rather than a hand-built synthetic repro. +- **What the probes show, for all 58 real `t()` calls the page makes** (every visible string: "Help", "Sign in with GitHub", "New to GitHub? \Create an account\", …): `translate()`'s own `He` (`res`, read from `this.resolve(j,$).res`) is, every time, an object with EXACTLY the shape of the OPTIONS argument passed to `t()` itself — e.g. for `t('Help', {defaultValue:'Help', ...})`, `He` prints as `{"defaultValue":"Help","lngs":null,"ns":"translation"}`. This is the literal, load-bearing mechanism behind the "key 'X (en)' returned an object instead of string" fallback text — `He` is a real, non-null, non-string object, so i18next's own `isValidLookup`/object-type checks correctly (for THAT value) choose the object-fallback branch; the defect is upstream, in how `He` got to be that object in the first place. +- **Traced one level deeper, with a probe at the exact call site inside `resolve()`** (`for(;le=_e.pop();)ce.isValidLookup($)||(ae=le,$=ce.getResource(ee,j,le,de))`): **zero hits, across all 58 calls.** The real `ResourceStore.getResource` (the function that would actually read the fetched locale JSON) is never invoked. A probe at `resolve()`'s own entry point DOES fire, with sane values (`keys=["Help"]`, `de.lngs=null`, `language="en"`) — so `resolve()` itself runs — but a probe one statement later, logging the computed namespace list and language-resolution hierarchy right after they're assigned, never fires either. By elimination, every nested `forEach` callback inside `resolve()`'s own body is being skipped entirely, for a reason not yet identified: the one condition that could explain it (`resolve()`'s own local, function-scoped `$` accumulator somehow already reading as "valid" from the very first guard check, before any assignment) was tested directly, in isolation — a minimal repro nesting a function that declares its own `var $` inside an outer function whose own `var $` already holds a real object — and goja handles that correctly (the inner `$` is `undefined`, matching the ECMA-262 Function Declaration Instantiation rule; no leakage either direction). That specific, most-likely-looking engine-level theory is now RULED OUT, not just undisproven. +- **Net effect, stated plainly**: this round replaces round 36's own (now-disproven) theory with a much more precise, directly-observed symptom — `resolve()` returns the caller's own options object without ever calling the function that does real resource lookups — but the exact mechanism BY WHICH it does so remains open. Confirming it further needs either tracing `resolve()`'s own `forEach` callback invocations at a finer grain than a same-statement `console.log` probe allows (e.g. a modified local goja build with call-site tracing, out of reach here) or a from-scratch reduction of the real minified code to a minimal standalone repro outside any webpack/engine context — both materially larger than this round's own budget, matching this file's own precedent (rounds 94/103/117, 35, 36) for disclosing a real, substantially narrowed lead rather than forcing an unverified fix. +- No production code changed this round — pure investigation. All scratch probes, patched chunk copies, fetched bundles, and the temporary `scratchprobe/` driver program were deleted after use; `git status --porcelain` confirmed empty before committing this entry. +- `go build`/`go vet`/`gofmt -l`/`govulncheck ./...` clean (nothing to build-break, since nothing in the engine itself changed). + ## 2026-11-15 (round 46) — a descendant's margin collapsing through to the edge of an ISOLATED layout (a table cell, a float) was silently dropped instead of landing inside that box's own height (engine#440) User picked the open "HN title row is ~3px shorter than Chrome's" Known-gaps item (round 149) to investigate. Re-reading round 149's own text first (bibliography-first, this session's own rule): it had ALREADY corrected round 148's "Verdana font-metrics" theory as WRONG, leaving the real cause of the remaining 3px gap genuinely unexplained — a different, narrower question than the Verdana-substitution framing this round started from. @@ -1698,7 +1710,7 @@ byte for byte. A round mentioned below by number (e.g. "round 105", "round ## Known gaps (updated 2026-08-30 — see the note above on why this drifted) - **CLOSED for `document.implementation.createDocument` (round 35, 2026-11-12, engine#418 (partial)) — a minimal detached XML-shaped document (`createElement`/`createElementNS`, an optional root `documentElement`), the same scope `createHTMLDocument` (round 52) already set.** Did not exist at all before this round. Confirmed real trigger: `@azure/core-xml`'s own XML-building helper, bundled into github.com's own Support app, called unconditionally at module-evaluation time — threw and aborted the whole chunk. `createAttribute`/`NamedNodeMap.setNamedItem`/`createCDATASection`, the SAME caller's own deeper helpers, are a separate, not-yet-confirmed-reachable gap (only hit by an actual file-attachment upload), deliberately left open. -- **OPEN, root cause NOT found: every localized string on github.com's own Support app renders as i18next's own literal `key 'X (en)' returned an object instead of string.` fallback text (round 35, 2026-11-12; narrowed further round 36, 2026-11-14; engine#418).** Confirmed NOT the createDocument crash above, NOT a goja JSON.parse bug, NOT plural resolution, NOT the resource shape, NOT `Response.ok`/the http-backend request path, NOT the backend-connector/resourceStore wiring (round 36 — a real, unmodified i18next core + real i18next-http-backend + the real remote locale URL all reproduce correctly on this engine in isolation), and NOT a generic settle/async-timing gap (a slow fetch-then-mutate chain settles correctly). What's left, by elimination: almost certainly `react-i18next`'s own `useTranslation()`/`notReadyT` placeholder path interacting with how this engine's settle-quiescence detection treats a React re-render triggered by i18next's `loaded` event — the same general territory as the react.dev hydration gap below, not confirmed as the same bug but looking like a sibling of it. Confirming this needs the real `react-dom`/`react-i18next` bundles actually reconciling inside this engine — a materially larger investigation than either round's own budget covered. +- **OPEN, root cause NOT found: every localized string on github.com's own Support app renders as i18next's own literal `key 'X (en)' returned an object instead of string.` fallback text (round 35, 2026-11-12; narrowed round 36, 2026-11-14; narrowed FURTHER, and round 36's own theory disproven, round 47, 2026-11-15; engine#418).** Round 36's theory — a `react-i18next`/settle-quiescence interaction — was built and tested directly (real React+ReactDOM+i18next+i18next-http-backend+react-i18next reconciling inside this engine, with a real async backend delay) and did NOT reproduce the bug; that generic mechanism works correctly here. Round 47 instead patched the REAL, currently-served GitHub chunk with `console.log` probes and rendered the real page end to end: for all 58 real `t()` calls, i18next's own `resolve()` returns the CALLER'S OWN OPTIONS OBJECT as the resolved value, without ever calling the real `ResourceStore.getResource` (a probe at that exact call site: zero hits across every call). `resolve()`'s own entry point runs with sane values; every nested `forEach` inside its body appears to be skipped entirely, for a reason not yet found — the most likely engine-level theory (a nested function's own `var` accumulator somehow reading as already-valid from a leaked outer binding) was tested in isolation and ruled out; goja scopes it correctly. Confirming the exact mechanism needs either finer-grained tracing than a same-statement log probe allows, or a from-scratch minimal reduction of the real minified code outside any webpack/engine context — both materially larger than any round's own budget so far. - **PARTIALLY CLOSED for `WebAssembly.compileStreaming`/`instantiateStreaming` and the module-size/linear-memory caps (2026-11-03, engine#341) — see round 189's own entry just below, now updated: both ARE implemented, and both caps are now configurable (`Engine.MaxWasmModuleBytes`/`MaxWasmMemoryBytes`) rather than hardcoded. Everything else round 189 already disclosed as unimplemented (the synchronous `Module`/`Instance` constructors, Table/Global imports/exports, standalone `Memory`/`Table` objects, WASI) remains exactly as disclosed there — this round did not touch any of them.** `compileStreaming`/`instantiateStreaming` are not genuine incremental streaming (this engine's `fetch()` has no streaming body to begin with — see the round's own log entry above), but the JS-facing Promise/Response contract is satisfied exactly, which is what every real caller's own code actually observes. - **CLOSED for `window.postMessage` (round 201, 2026-11-02, engine#340) — a no-op; real cross-window message delivery is not simulated (this engine's single-document model has no second window/frame to deliver to; `MessagePort`'s own `postMessage`, via `MessageChannel`, already delivers for real and is unaffected).** Did not exist as a global at all before this round — only `MessagePort.postMessage` did. Confirmed real trigger: Google's own widely-deployed reCAPTCHA script (`gstatic.com/recaptcha/...`), which calls it unconditionally at load; reproduced live on spotify.com as `ReferenceError: postMessage is not defined`. - **CLOSED for `document.referrer` (round 200, 2026-11-01, engine#339) — always returns the empty string (this engine's single-URL fetch model has no referring-page history to report).** Did not exist at all before this round. Confirmed real trigger: Fathom Analytics' own widely-served `script.js`, whose `trackPageview()` calls `document.referrer.indexOf(hostname)` unconditionally — identically on vuejs.org and astro.build, two otherwise-unrelated sites sharing the same third-party script.