Repository navigation
Description
Execution plan for a device session with both an iOS device and an Android device. It settles one question that #147 could not, and on which several of that issue's conclusions depend — those are marked pending there until this reports back.
Reply to this issue with the results. Do not edit #147; it will be updated from what lands here.
1. The question
Upstream Octane hands the Lynx ContextProxy a structured object:
// packages/lynx/src/core/transport.ts:338, :345, :672 (background → main)
// packages/lynx/src/main-thread.ts:659 (main → background)
context.dispatchEvent({ type: LYNX_BACKGROUND_TO_MAIN_EVENT, data: validated });Two facts that both appear to be true, and are not yet reconciled:
- It works.
packages/rspeedy-plugin-octane/examples/{bank-cards,gallery,swiper}/README.mdeach carry a "Verified on device (Lynx Explorer, iOS)" section. bank-cards records a first-screenadoption=adoptedacknowledgement and a background event → state → committed update — the complete dual-thread path, unpatched. - It apparently does not.
Huxpro/lynx-js-framework-benchmarkcannot run Octane on its Android device lane without patching those exact call sites (entries/_patches/octane-bench.patch) toJSON.stringifyin both directions, with the comment "Production Native ContextProxy delivery is only reliable for strings; development test hosts preserve the structured-clone contract."
It is not a regression: git log --all -S "JSON.stringify(validated)" over both files returns no commits, so the object path is the only path upstream has ever had.
Four variables move at once between the two configurations, and nobody has isolated them:
| examples (works) | benchmark (patched) | |
|---|---|---|
| build | rspeedy dev, NODE_ENV unset |
NODE_ENV=production |
| platform | iOS, macOS arm64 | Android 10 (ByteDance aries_10) |
| host | official Lynx Explorer 3.9.x | ByteDance Sandbox Explorer, versionName 1.0, lynxSdkVersion 0.0.1 |
| payload | one tap, a few host writes | create@1000 → a batch over ~7,000 hosts |
A fifth possibility is open: the patch may be unnecessary, and its author may have hit a different failure and attributed it to the value domain.
2. Reproduction coordinates
- Octane entry pinned at upstream
0fc84da02fd05403ac5e36d2aff631b31168d5ac(frameworkVersion0.1.38). Use this commit, not currentmain, so the run is comparable to the recorded one. - Benchmark bundles built by
scripts/build-octane-upstream.mjs, which setsNODE_ENV=productionandBENCH_AUTOROWSper row count. - Recorded failing run:
results/runs/2026-08-17T23-25-11-lynx-native-android-aries_10-10-devtool-direct-recycle5-…-native-matrix-backfill-v2-r1-20260817.json.create@1000= 12,193 ms,create@3000= 103,428 ms,create@5000+timeout at 240 s. Octane getsLONG_WORKLOAD_TIMEOUT_MS240 s; every other entry gets 30 s. - Android automation exists (
packages/runner/adapters/lynx-sandbox-android.mjs). There is no iOS adapter — iOS cells are a manual Explorer +lynx-devtoolpass/fail with console capture, exactly how the examples were verified. Do not fabricate iOS timings; iOS is here to answer does it work, not how fast.
3. Step 0 — the probe (do this first)
The actual unknown is what arrives on the receiving side. Everything else is a control. Add a receive-side probe to the Octane checkout, in both directions:
packages/lynx/src/main-thread.ts, at the inbound handler that currently callsvalidateLynxBackgroundOutboundMessage(event.data)(line ~2489 upstream, ~2492 onnew-lynx);packages/lynx/src/core/transport.ts, at the background inbound handler (line ~1324 upstream).
Per message, log exactly one line:
console.log('__OCTANE_WIRE_PROBE__', JSON.stringify({
dir, // 'bts->mts' | 'mts->bts'
type: typeof event.data, // the load-bearing field
ctor: event.data?.constructor?.name ?? null,
keys: event.data && typeof event.data === 'object' ? Object.keys(event.data).length : null,
strLen: typeof event.data === 'string' ? event.data.length : null,
op: /* message op/kind if cheaply available */ null,
validateMs, // time spent in the validator
validateError: err ? String(err).slice(0, 200) : null,
}));Keep the probe out of the timed comparison — it is a diagnostic build. console.log on device is not free.
This one probe distinguishes the three possibilities that "only reliable for strings" could mean, and they need very different fixes:
- the object arrives intact → the patch is unnecessary and the failure is elsewhere;
- the object arrives mangled (wrong
typeof, lost keys, stringified by the engine,[object Object]) → a real marshalling constraint, and the probe says exactly how it degrades; - the object never arrives → a delivery failure, and the probe on the sending side says whether dispatch itself threw.
4. Step 1 — the 2×2: encoding × platform
Fixed: production build, Octane 0fc84da0, create@1000, probe build.
| object (patch reverted) | string (patch applied) | |
|---|---|---|
| Android (Sandbox Explorer) | A1 | A2 — reproduces the recorded 12,193 ms |
| iOS (official Explorer 3.9.x) | B1 | B2 |
A1 is the single highest-value cell. It needs no new code beyond the probe, changes exactly one variable against a recorded run, and either collapses the whole string-only story or produces a concrete failure with a trace.
5. Step 2 — build-mode control
Only if A1 or B1 fails. Same device, same payload, but a dev build (rspeedy dev-equivalent, NODE_ENV unset), object encoding. If dev-object works where prod-object fails, the discriminator is the build, and the next question is what rspeedy changes about the runtime wrapper or the thread graph between the two modes.
6. Step 3 — payload threshold
Only if object encoding works at some size. Scale BENCH_AUTOROWS / the create workload: 100 → 300 → 1000 → 3000 → 10000. Report the last working and first failing size, with the probe's keys / message count at each. That converts "only reliable" into a number.
7. Step 4 — the superlinearity (independent, and possibly the bigger finding)
In whichever configuration completes, time create at 1000 / 3000 / 5000 on device and report the split between background prepare, dispatch, receive+validate, and PAPI apply. 12.2 s → 103.4 s for 3× the rows is superlinear, and nothing in the value-domain story explains it: encode, decode, clone traversal and the validator walk are all linear. If Step 1 shows the object arrives intact, this becomes the whole issue.
8. What each outcome means
| Outcome | Reading |
|---|---|
| A1 works, A2 works, similar timings | Patch unnecessary. #147 §1 is fully retracted; the 12 s is an Octane algorithmic problem on device. Go to Step 4. |
| A1 fails, B1 works | Not the value domain per se — platform, host build, or Android Sandbox Explorer specifically. Probe output says which. |
| A1 and B1 both fail, dev build works | Production build is the discriminator. Investigate the rspeedy production runtime wrapper / thread graph. |
| A1 fails only above N rows | A size threshold, not a type constraint. The fix is a representation change (delta-protocol v2), and the threshold sizes it. |
| Object arrives mangled anywhere | A real platform constraint. Then upstream owes a fix, and #147 §4 stands: it must live somewhere new-lynx inherits. |
9. Reporting rules
Follow benchmarks/lynx-table/README.md's measurement honesty section and #66 §1:
- A cell that cannot be driven end to end is "not measured", never a number from a degraded run.
- Attach the probe output verbatim for every cell, pass or fail. The probe lines are the finding; the timings are secondary.
- Record device model, OS version, Explorer package version and
lynxSdkVersion, Octane commit, bundle SHA-256, build mode, and whether the patch was applied — for every cell. - One variable per cell. If two moved, it is not a cell.
- Absolute milliseconds are host-bound; only same-device same-session comparisons are claimed.
- A negative result is a result. If A1 simply works, say so plainly — that is the most valuable outcome available here.
10. Definition of done
Steps 0 and 1 complete for all four cells, with probe output, plus whichever of Steps 2–4 the Step 1 outcome selects. Reply to this issue with the table, the probe lines, and a one-paragraph verdict naming which of the five hypotheses survives. If the session runs out before that, reply with the cells that did complete and state exactly which are missing — a partial matrix with honest gaps is useful; a filled-in matrix with guessed cells is not.
Provenance
- An agent produced this plan (
agent-authored)
Activity
Huxpro commentedon Aug 23, 2026
Plan revision — a fifth variable, and it is the most suspicious one
The original plan named four variables and pinned a single commit. Both were wrong in the same way: the commit itself is a variable, and the two configurations are not running the same wire code.
The commit axis
The examples' device evidence is dated
f3c4781d(2026-08-10) — that commit last touched all four example READMEs and their sources, so the verification happened at or before it. The benchmark pins0fc84da0(2026-08-15). Between those five days the Lynx wire changed substantially:f3c4781d→0fc84da0packages/lynx/src/core/host-driver.tspackages/lynx/src/core/protocol.tspackages/lynx/src/core/client-driver.tspackages/lynx/src/main-thread.tspackages/lynx/src/core/transport.tsSeven commits: octanejs#693 (ReactLynx parity), octanejs#700 (accelerate creation after first-screen adoption), octanejs#706 (specialize compact run teardown), octanejs#707 (keep optional worklet runtime cold), octanejs#749 (re-arm compact acknowledgements), octanejs#750 (destroy-run teardown commands, new
2**43request base), octanejs#751 (first-tree capture off the first-paint path).So "the examples work" and "the benchmark needs a patch" are not statements about the same code.
#147's "this is not a regression" line was too narrow — it rested only ongit log -S "JSON.stringify(validated)"returning nothing, which answers "was the string encoding ever present" and not "did the wire regress between 08-10 and 08-15".Conversely, the commit does not matter for the value-domain question
Both files are byte-identical between the pinned commit and today's
upstream/main; the last change to either was octanejs#750 on 08-14, before the pin. Running today'smainto ask "can an object cross the ContextProxy" cannot produce a different answer and would waste device time.Three commit points, for three different purposes
f3c4781d(08-10)0fc84da0(08-15)upstream/mainNew Step 1a — run this before the 2×2
The cheapest cell in the whole plan, and the most likely to end it.
Build the same example app (
packages/rspeedy-plugin-octane/examples/bank-cards, whose README records the fullest device path: first paint →adoption=adopted→ background event → committed update) at bothf3c4781dand0fc84da0, unpatched, same build mode, same device, and run both.Platform, build mode and payload are all held fixed. Only the commit moves.
f3c4781dworks,0fc84da0fails#693, #700, #706, #707, #749, #750, #751— 3 steps). This ends the investigation far more cheaply than the 2×2, and it means upstream owes a fix, not the benchmark.Run Step 1a on both devices if time allows; on iOS first if not, since that is where the recorded evidence lives.
Revised order
bank-cards, unpatched, iOS then Android. (new)upstream/mainas well as the pin, so the effect of perf(lynx): streamline dense clear teardown octanejs/octane#762/perf(lynx): compact first-screen component rows octanejs/octane#765 on device is visible.The reporting rules in §9 apply unchanged, and now also require recording the Octane commit for every cell — which was already listed there but is now load-bearing rather than bookkeeping.
Provenance
agent-authored)Generated by Claude Code
Huxpro commentedon Aug 23, 2026
Result: Step 1a finds a regression; first bad candidate is octanejs#693
I followed the revised order: receive-side probe first, then the unpatched
bank-cardscommit control on iOS.f3c4781dworks end to end, while0fc84da0paints the adopted first screen but drops the first background event → state → committed-update path. Per the revision, I stopped the 2×2 and bisected only the seven named Lynx-wire commits. The first bad candidate is octanejs#693 (01240e694).Fixed environment
iPhone17,1(Sparkling Navigation iOS 18.5), iOS 18.5, UDIDA843BCCF-47DB-4B3B-A76B-A1BB3C780A9A.LynxExplorer-arm64.appfrom the 3.9.0 release; archive SHA-2567790f83f69885c5565d451c8c163b870a0b7570a9eef1e4d59ed0b22266abcfa; bundlecom.lynx.LynxExplorer,CFBundleShortVersionString=1.0, build1. Runtime log reports engine3.9; DevTool client metadata reportssdkVersion=1.4.0(reported verbatim rather than relabelled as the engine version).packages/rspeedy-plugin-octane/examples/bank-cards,rspeedy dev,NODE_ENVunset, same port/URL (http://127.0.0.1:3002/main.lynx.bundle?fullscreen=true).Boc; pass requires the card number to change from4558 … 6767to6222 … 8058, the selection tick to move, and a new committed update to appear in the probe.The first probe bring-up used
performance.now(), which is absent in these Lynx VMs and producedReferenceError: performance is not defined. That run was discarded and is not a cell. I changed only the probe clock toDate.now()identically in every checkout before collecting the valid cells below.Commit control and bisect
f3c4781dd2d8878ed11a6ac5442090653afa2011eb370522884ded1771d1894cead1f9720b73bfd15f1b1944f9cb289944880c9101240e6940c8d76884d32e1f3c9ab1f5523a6983(octanejs#693)b7f85ab1e15ba05f13190df7bb9268208ac3d88b188cf8c1a96755ebe2976f1959a35ae55(octanejs#700)557267cc2a8b9010a654d5ad860707682186e88d8e99aed07b959a2c6f64a5d34a792e39b(octanejs#707)f69a7bc74c441e6ebe920ae7bcddfd051bb666a0ace0be18a118d6e042cab0770fc84da02fd05403ac5e36d2aff631b31168d5ac9b23adf086df5f00b1ecdc9a811a71c483c0d1646165832536c779110f576a26The binary decisions were
#707 bad→#700 bad→#693 bad; withf3c4781dgood, octanejs#693 is the first bad commit among#693/#700/#706/#707/#749/#750/#751. The other four candidate points were not directly run because the three bisect decisions eliminated them.Probe output (verbatim)
f3c4781d(pass, including the post-tapcommit):01240e694/ octanejs#693 (bad):59a35ae55/ octanejs#700 (bad):4a792e39b/ octanejs#707 (bad):0fc84da0(bad):Missing cells
f3good /0fcbad ends the investigation with the seven-commit bisect; I stopped after that conclusive branch.upstream/main: not measured, by the same revised stop condition.Verdict
The surviving hypothesis is the Octane commit axis: a real regression introduced by octanejs#693, not build mode, platform, host, payload size, or evidence that ContextProxy accepts strings only. In every bad row the top-level value demonstrably arrives on the main thread as an object-shaped ContextProxy value (
typeof === "object", constructor nameObject) with four enumerable keys, but the newly failing path rejects it during protocol validation with nativeTypeError: not an objectbefore an operation can be extracted; the backgroundmain-readydirection still validates. Source inspection makes the cross-realm/proxy prototype inspection in the validator a plausible immediate failure point, but that sub-cause is an inference, not a separately measured cell. The benchmark's string patch may therefore work around the regression by reconstructing a local-realm object, but it is not evidence of a general string-only ContextProxy contract; upstream owes the fix beginning at octanejs#693.Provenance
agent-authored)Huxpro commentedon Aug 24, 2026
Follow-up: operation-level ContextProxy type probe on iOS Simulator
Per the latest direction, this is an iOS Simulator cell, not a physical-device result. The requested stop condition is met at the top-level value: on the same
event.data,Object.getOwnPropertyNamessucceeds andReflect.ownKeysthrows.Cell metadata
iPhone17,1(Sparkling Navigation iOS 18.5), iOS 18.5, UDIDA843BCCF-47DB-4B3B-A76B-A1BB3C780A9A.com.lynx.LynxExplorer,CFBundleShortVersionString=1.0, build1; runtime log reports engine 3.9; Lynx DevTool client reportssdkVersion=1.4.0.0fc84da02fd05403ac5e36d2aff631b31168d5ac.packages/rspeedy-plugin-octane/examples/bank-cards,rspeedy dev,NODE_ENVunset.validateLynxBackgroundOutboundMessage(event.data).1f5397cb04dabe6e32cdc763173c6d624e627aa514e2d452d44db17f554d43fb.localhost:8902, session2, URLhttp://127.0.0.1:3002/main.lynx.bundle?fullscreen=true.Answers
a. Does
Reflect.ownKeysthrow? Yes, at the top-level$. The complete thrown string is exactly:It threw identically on the required rerun.
b. Does
Object.getOwnPropertyNamessucceed on that same value? Yes. It returned:Object.keysreturned the same four keys,Object.getOwnPropertySymbolsreturned[], the first property descriptor was an ordinary configurable/enumerable/writable data descriptor, andv.protocolread back as1.c. Top-level or nested? Top-level:
$. Because the failure is already at$, the recursive walk stops there and reruns every operation on$; there is no nested failure path to report.d. What is the failing value? On
$:typeof v→"object"Object.prototype.toString.call(v)→"[object Object]"String(v)→"[object Object]"Array.isArray(v)→falseObject.getPrototypeOf(v)→nullThis is an engine-backed exotic/bridge value, not merely an ordinary foreign-realm object. As a same-engine control, a locally-created
Object.create(null)accepted both operations:{"localNullPrototype":true,"getOwnPropertyNames":{"ok":true,"result":["x"]},"reflectOwnKeys":{"ok":true,"result":["x"]}}One subtlety: the literal probe
Object.getPrototypeOf(Object.getPrototypeOf(v))also throwsTypeError: not an object, because the first call returnednulland the literal second call is thereforeObject.getPrototypeOf(null). This is not the validator's failing operation:hasCrossRealmPlainPrototypeshort-circuits onprototype === null, sorecord()proceeds toReflect.ownKeys, where the actual regression occurs.e. Main-thread engine. Runtime globals identify LepusNG 2.3.0:
{"lepusVersion":"2.3.0","lepusGcType":"function","lepusLynxType":"object"}The active global exposes
lepusng_gc,__lepus_version__,__SetLepusInitData,__LoadLepusChunk, andlepusLynx. The Explorer binary contains PrimJS/QuickJS symbols, so this is the Lynx LepusNG / PrimJS-QuickJS-family main-thread runtime, not a browser/JSC global.Probe output (verbatim, first complete inbound sequence)
The clean load emitted the same top-level main-ready request sequence twice. This is the first complete sequence, including the required rerun, copied verbatim from Lynx DevTool:
Conclusion
The causal chain is closed: native ContextProxy delivers a top-level LepusNG bridge/exotic value that looks object-like, enumerates through the legacy
Object.getOwnPropertyNames/Object.keysAPIs, and exposes ordinary property descriptors and reads, but is rejected byReflect.ownKeyswith the bare nativeTypeError: not an object. octanejs#693 changedrecord()from the supported operation to the unsupported one, so the fix belongs in Octane's protocol validator rather than in the benchmark or a JSON transport shim.Provenance
agent-authored)