Repository navigation
Description
What this is
A self-contained spec for contributing three things from the new-lynx campaign back to octanejs/octane. It is written to be executed from an environment with upstream PR access and no other context — everything needed is named here. Deliverable 1 is the load-bearing one; 2 and 3 ride behind it. Together they unblock upstream's entire native (LepusNG) story and its featured-Native eligibility in lynx-js-framework-benchmark.
Deliverable 1 — Port the transport codec: the Reflect.ownKeys × LEPUS_REF device crash
The defect, as it stands on upstream main today. ContextProxy transports generic Lynx values. On device, a composite sent through it can arrive in LepusNG as LEPUS_TAG_LEPUS_REF: a host-backed engine value that answers typeof, property reads, spread, and JSON.stringify — but is not an ordinary receiver-realm object. On it, Reflect.ownKeys throws, Object(v) !== v, and the prototype is null. Reproduced on both iOS and Android (evidence archived in #152). Upstream's receive-side today mixes two readers: Object.getOwnPropertyNames (upstream packages/lynx/src/main-thread.ts:248, core/protocol.ts:599, core/worklets.ts:152) — which performs ToObject and accidentally coerces the bridge value into something enumerable, an accident that has been load-bearing for the package's whole native lifetime — and the non-coercing Reflect.ownKeys (core/protocol.ts:472, :768, :797, :1206), which crashes the renderer on device the moment a bridged composite reaches it. The defect was never either call: it is that a bridged value reaches receiver code at all.
The fix, already built and battle-tested on new-lynx. packages/lynx/src/core/transport-codec.ts (landed via #164): composites cross the ContextProxy as encoded text, the receive path decodes before anything reads the payload, and the invariant is one sentence — a LynxValueRef never escapes the transport layer; everything above it sees only LynxStructuredValue. The codec also owns exactly the cases where plain JSON silently changes meaning (undefined keys, NaN/±Infinity, bigint, functions/symbols, __proto__-class keys — each throws or round-trips by design, never silently). The module is self-contained — it was re-integrated wholesale into a heavily diverged tree during the C8–D8 reconciliation without modification, which is the portability proof.
Port checklist:
- Branch from
octanejs/octane@main(do NOT base onnew-lynx; carry nothing program-related). - Bring over:
packages/lynx/src/core/transport-codec.ts; the encode call at the transport send sites and the decode-first block at the top ofreceive()inmain-thread.ts(seenew-lynx'smain-thread.ts— thedecodeLynxTransportValuetry/catch before any payload read, including the recovery path) and the mirror on the background side incore/transport.ts; the test suitespackages/lynx/tests/transport-codec.test.tsandtransport-conformance.test.tsplus thetests/_fixtures/lynx-wire.tsfixture. Adapt upstream tests that dispatch raw objects onto the wire to use thewire()/unwire()fixture (the same adaptationnew-lynxmade; grepdispatchEventin upstream's lynx tests). - Do NOT bring the validation-mode plumbing (
resolveLynxValidationMode, checked/trusted) — that is a separatenew-lynxlayer; the codec alone stops the crash. Both realms ship from one bundle, so there is no wire-format version negotiation to design. - After the port, upstream's remaining direct readers of
event.datacomposites (getOwnPropertyNamessites above) should be reading decodedLynxStructuredValue— audit each and say so in the PR body per site.
PR narrative for upstream maintainers (they need the history to trust it): lead with the repro (#152's iOS+Android evidence), then the accident history — Object.getOwnPropertyNames's ToObject coercion is why the code appears to work, and any migration toward Reflect.ownKeys (already present at four receive-path sites) detonates on device. The codec removes the class, not the instance. Include a before/after: a bridged-composite fixture that throws at protocol.ts:472 before the port and round-trips after.
Deliverable 2 — Standard Lynx pipeline performance entries (#199, executed against upstream)
lynx-js-framework-benchmark reports Native startup from the platform's own pipeline boundary (openTime → totalFcp via Performance.getAllPerformanceEntries) and its methodology records: "Octane's custom renderer does not expose the same pipeline boundary in this Explorer build, so no featured Native Octane metric is reported." Implement #199's spec against upstream main so the whole project gains featured-Native eligibility: find the platform's real marking contract (whether the engine stamps entries around __FlushElementTree-adjacent internals or expects a framework call), map upstream's first-screen boundaries onto it honestly (no invented moments, entries stamped where platform semantics say), and pin one-entry-per-first-screen in a test. Acceptance is the benchmark's Native adapter reading the entries for an Octane bundle in LynxExplorer with enable_perf_metrics. This lands as a second, independent PR — do not couple it to the codec port.
Deliverable 3 — The ART reference-table diagnosis (issue first, fix conditional)
On device, creating ~51,200 elements overflows ART's global reference table (max=51200) and aborts natively (#194 round 1: 5/5 crash at 10k rows × 7 elements; the counting arithmetic and a separating experiment design are in #222). Upstream's first-screen path retains more per element than new-lynx post-D-train (per-node records + ownedNodes + per-node event journal), so it hits the same wall no later and likely earlier. File this as an upstream issue carrying: the crash signature, the ~1-entry-per-created-element arithmetic, the threshold math, the --retain none experiment design, and the ART-table-dump capture protocol from #222 — so upstream goes from "mysterious native crash at scale" to "known cause with a ready experiment". Attach a fix PR only after Huxpro's device round 2 settles whether retention (fixable) or creation (not fixable from JS) drives the table; do not guess ahead of that data.
Validation bar (both PRs)
Upstream's own gates on the port branch: full test run, typecheck, lint/format as octanejs/octane defines them — plus the ported suites green. No behavior change on the web path is expected from Deliverable 1 (the codec is encode/decode symmetric; upstream's web tests are the guard). Keep each PR minimal and independent; the campaign's program/adoption work stays out entirely.
Activity
Huxpro commentedon Aug 28, 2026
D2 audit found a current-state conflict that should be recorded before changing the plan.
The latest #199 device acceptance run already established that LynxExplorer stamped exactly one standard
loadBundlepipeline entry for the cleannew-lynxbundle (openTime,totalFcp,lynxFcp, andpipelineEndwere all present). It also established that this entry was not evidence of a successful Octane first screen: both runtimes failed withReferenceError: MessageChannel is not defined, and the requiredlynx-native-startup-v1two-frame/semantic producer receipt never appeared. The adapter correctly retained the cell as DNF.That changes the premise of D2 in this package:
MessageChannelcrash is specific to the testednew-lynxsnapshot. Currentoctanejs/octane@mainalready guardsMessageChannelinpackages/octane/src/runtime.tsand falls back tosetTimeout, so that failure should not be projected onto upstream without a fresh bundle/device acceptance run.Performance.getAllPerformanceEntriesfor the current Octane entry and falls back to the private receipt path, while its standard path requires both the engine entry and the versioned producer receipt. Thus upstream acceptance needs a fixture/adapter mode that preserves the real black-box query and emits the semantic receipt; a renderer timing patch by itself cannot satisfy the consumer.I will therefore not silently add a speculative
__FlushElementTree-adjacent timing hook. I am continuing D2 as a minimal, independent upstream audit/acceptance change: identify the existing producer fixture and direct vs decline→fallback/adoption paths, add only the missing conformance/receipt coverage supported by the actual platform contract, then run the same LynxExplorer adapter acceptance. If that audit finds no honest upstream code change beyond verification, I will report that rather than manufacture a second timing implementation.This does not affect D1: the codec PR remains independent and already contains no timing/program/adoption changes.
Huxpro commentedon Aug 28, 2026
D2 exact-device acceptance produced a second current-state conflict, so I am recording it before changing any implementation or acceptance plan.
Using the exact bundle from the independent upstream branch/PR (octanejs/octane#886, SHA-256
5f7646aca90fab3a6be72ec756018676f59b13bcf1d7649bb6d782f167b1a015) on leased Lynx Sandbox deviceaic-i18n-bd-fullport.byteintl.net:55864, LynxExplorer did fetch the pinned bytes and created session 2, but the standard startup probe timed out after 240 s with:{ "performanceEntryCount": 0, "pipelineEntries": [], "timingInfo": { "extraTiming": { "container_init_start": 1787921782247, "container_init_end": 1787921782251, "prepare_template_start": 1787921782253, "prepare_template_end": 1787921782253, "open_time": 1787921782247 } } }The required
lynx-native-startup-v1producer receipt was also absent. Error-level Android logs show no application exception; the only errors at teardown are the expected DebugRouter socket closure. This differs from #199, where a failed bundle still yielded exactly oneloadBundlepipeline entry with bothlynxFcpandtotalFcp.I am keeping octanejs#886 in Draft and will not add a speculative Octane-side pipeline marker. Next I am isolating whether this is a fixture/build compatibility problem or a LynxExplorer perf-instrumentation difference on the leased image. Any resulting plan change will be posted here before altering D2.
Huxpro commentedon Aug 28, 2026
The follow-up controls isolate both failures and expose one more D1/D2 integration constraint before I change the acceptance procedure:
vue-vdomrows-0 bundle emitted a validlynx-native-startup-v1receipt (moduleStartMs=1787922125891, first frame1787922125897, second frame1787922125913, correct rows-0 semantic state), whilePerformance.getAllPerformanceEntriesstill returned[]. This confirms the current LynxExplorer image lacks the standard perf entry for every framework, not just Octane.__LYNX_BENCH_SNAPSHOT__as a function and return the correct rows-0 state, with no producer error, butroot.render()never resolves its transport acknowledgement. Therefore no honestcommitAckMsor two-frame receipt can be published.That second observation matches D1's load-bearing defect: D2 is intentionally based on unmodified upstream
main, whose first background-to-main composite can die at theLEPUS_REF/Reflect.ownKeysreceive path before the ACK returns. It also explains why a historical codec-bearing benchmark bundle could report commit acknowledgements while this independent D2 branch cannot.I will keep the PRs independent (no codec commit or source copied into octanejs#886), but change only the device acceptance build to a local integration overlay of the already-published D1 commit plus D2. The acceptance record will identify both commits and will not claim that D2 alone fixes the transport crash. Platform-pipeline acceptance remains unavailable on this device image; a successful producer receipt will prove D2's fixture boundary, not manufacture or substitute the engine entry.
Huxpro commentedon Aug 28, 2026
Correction to my preceding inference: the local D1+D2 integration overlay does not restore the D2 producer acknowledgement.
I built D2 commit
7378d00477a09ed33db28f5578e5c6b674b83f9ewith D1 commit2b2465719eefapplied only in a disposable acceptance checkout. The resulting 492,867-byte bundle (sha256:6cebf2d0bf496f049657a2ca3585385d8f59cb85d8b0efa226ddec5b79a09634) still timed out after 30 s with no startup receipt. Therefore the earlier “D1's LEPUS_REF crash explains the missing ACK” statement was a plausible but falsified hypothesis; it must not be used as the PR rationale.I am reverting the acceptance plan to audit mode, with octanejs#886 remaining Draft. Next controls are the #199 Explorer/package version and a historical Octane bundle known to have produced transport acknowledgements. I will not add codec coupling, program/adoption changes, or an Octane-side timing marker based on this failed overlay.
Huxpro commentedon Aug 28, 2026
Final device controls establish that D2 is blocked by two external/current-main conditions rather than an undiscovered Octane pipeline-mark call:
0fc84da0rows-0 bundle, which previously produced Native ACK evidence, still does so on this exact device:moduleStartMs=1787922635481,commitAckMs=1787922635521, first frame1787922635523, second frame1787922635540. The current device can therefore execute Octane background transport and two-frame instrumentation.vue-vdombundle both receive zeroPerformance.getAllPerformanceEntriesentries on this Explorer install (com.lynx.explorerversionName1.0, versionCode1, installed 2026-08-20). In contrast, Expose the standard Lynx pipeline performance entries so featured Native Octane can exist #199's earlier device image emitted one engine-ownedloadBundleentry even for a crashing app. The standard entry is image/engine supplied, not something current upstream Octane can honestly synthesize.root.render()commit acknowledgement. The historical control proves this is a current-main transport/first-screen regression, but the D1 overlay falsifies the specific codec-crash hypothesis. Fixing it would require a separate renderer investigation and may enter the program/adoption area explicitly out of scope for this contribution package.Accordingly octanejs#886 remains Draft and records the useful independent fixture changes and complete upstream gates, but its device acceptance is honestly failed. I will not call the private receipt a platform entry, add a duplicate marker, or import
new-lynxprogram/adoption work to force the result.Huxpro commentedon Aug 28, 2026
D3's prerequisite has now changed: #194 device round 2 is complete, so the “fix conditional after retention vs creation settles” clause can be resolved before opening the upstream issue.
The exact 10k D-train program cell crashed 5/5 at 20,397–22,029 ms (median 21,156 ms). Every ART dump was dominated by:
com.lynx.tasm.behavior.PaintingContext$am7.wOnly hundreds of
java.lang.Class/DirectByteBufferentries followed. This names Lynx platform UI holders, not an Octane JavaScript container. Following #222's predeclared stop condition, the runner skipped the 6k–8k bisection and all program/direct/retain-none arms: creation itself had already identified the capacity owner, so a JS retention release-point experiment could not change the decision.I will therefore execute D3 as issue only, no conditional fix PR. The upstream issue will preserve the original crash signature, element-count and threshold arithmetic, retain-none design, and ART-dump capture protocol, while clearly recording that round 2 superseded the unrun experiment: this is a platform creation/capacity boundary, not evidence for deleting an Octane retention map. I will not silently carry #232's older “round 2 pending” wording forward.
Huxpro commentedon Aug 28, 2026
D2 correction: the archived 0fc84da control does not by itself prove a current-main renderer regression, because it and octanejs#886 carry materially different fixture patches.
I rebuilt the historical bases after fixing a dependency-isolation bug in my disposable checkouts. The reused package node_modules directory contained a relative @octanejs/lynx symlink, so the first historical builds still resolved to the current checkout. After copying the package-local node_modules layouts, each candidate resolved @octanejs/lynx and octane to its own checkout.
On the same leased device (aic-i18n-bd-fullport.byteintl.net:51306):
The archived bundle includes the benchmark repository's much larger historical Native instrumentation patch (operation measurement, flush hooks, driver surface, and different event-handler shapes); octanejs#886 intentionally carries only the minimum fallback/snapshot/startup-receipt slice. The archived success therefore proves the device and an Octane fixture can ACK, but it does not yet locate the difference in an upstream commit range.
I am withdrawing the earlier claim that the control alone establishes a current-main transport/first-screen regression. octanejs#886 remains Draft. Next I am auditing the remaining fixture-shape difference and whether the successful archived fixture selected a different direct-vs-decline first-screen path. I will not import or modify program/adoption code, and I will post any resulting scope conflict here before changing the PR.
Huxpro commentedon Aug 28, 2026
D2 follow-up: the final orthogonal control isolates a second transport prerequisite, but it still does not produce the standard platform pipeline entry.
On the same leased device (aic-i18n-bd-fullport.byteintl.net:51306):
This explains why the immutable archived 0fc84da bundle succeeds: its preserved patch contains both a production string wire and a repeating readiness request. Current upstream has only a one-shot initial request plus one announcement-triggered resend. If main and background each emit before the peer listener exists, both one-shot messages are lost and the roots wait forever. The repeating correlated request closes that listener-installation race; duplicate IDs are already idempotent on main.
The controls establish two independent prerequisites for a truthful D2 producer receipt:
They do not establish the requested D2 platform contract: Performance.getAllPerformanceEntries remained empty, and the successful observation is still the private producer fallback. I therefore will not silently add the readiness fix to octanejs#886, claim that the private receipt is a platform entry, or call D2 accepted. Adding it now would introduce a second transport bug fix into a pipeline-entry PR and make its device success contingent on a local D1 overlay, contrary to the independent-minimal-PR constraint.
octanejs#886 remains Draft while I preserve this evidence. Any decision to move the readiness race into a separately reviewed transport fix, fold it into D1, or defer D2 until both transport prerequisites land needs an explicit scope decision; it cannot be inferred from #199's pipeline-entry deliverable.
Huxpro commentedon Aug 30, 2026
Readiness follow-up after D1 landed upstream:
The current
maintransport now sends its correlated readiness request after installing the background listener and performs one additional send when it sees main's unsolicited request-0 announcement. On Native, however, those two sends can still both occur before main installs its peer listener. That conflicts with the earlier assumption that D1's listener ordering plus the one-shot announcement retry closed the startup race.Per the newly authorized option 1, I am keeping the correction independent: a minimal readiness-transport PR will repeat the same correlated request id every 16 ms until the correlated reply arrives or the transport closes. It changes no wire keys, capability rungs, first-tree behavior,
getOwnPropertyNamessites, D2 performance-entry code, or program/adoption scope. The liveness semantics follow the already device-verified readiness/presence family in #233, but the implementation is rewritten around upstream's current transport lifecycle and tombstone handling. D2 remains unchanged and its device acceptance stack will bemain(including octanejs#885) + readiness PR + octanejs#886.Validation/status notes that should not be hidden:
pnpm typecheck,pnpm format:check,pnpm sync, andpnpm changeset:checkare green. The package-localpnpm --filter @octanejs/lynx typecheckinvokestscinstead of the root gate'stsgoand is base-red on unchangedmain-thread.ts(adoptionis inferred asstring); no unrelated fix is being folded into this PR.pnpm testattempt exhausted the host's shared/tmpand file-descriptor limits (ENOSPC/EMFILE), cascading into 1,314 suites that never collected. This is environmental rather than a readiness assertion failure. I will rely on the repository's official four-way CI shard plus its dedicated heavy/browser/parity jobs on the PR for the complete upstream gate, rather than change scope or silently describe that local run as green.If upstream CI exposes a semantic conflict rather than an environmental failure, I will report it here before changing the plan.
Huxpro commentedon Aug 30, 2026
Device-stack correction before changing octanejs#909:
The first
main + #909 + #886Native run did not reach D2's startup receipt. LynxExplorer loaded the bundle, but background startup failed with:The device runtime exposes the host timer binding used by the already verified fork implementation, but does not expose it as a
globalThisproperty. This conflicts with my initial upstream rewrite, which qualified the timer asglobalThis.setTimeout/globalThis.clearTimeout. I converted octanejs#909 back to Draft before changing it.Planned correction is intentionally narrow: use the bare host bindings
setTimeoutandclearTimeout, exactly at the two readiness lifecycle call sites. The same-id 16 ms readiness semantics, stop conditions, tests, protocol shape, D2 patch, and PR scope remain unchanged. I will rebuild and rerun the exact device stack after the correction, and report the resulting receipt/error evidence here and on octanejs#886.Huxpro commentedon Aug 30, 2026
Device-stack result after the narrow timer-binding correction in octanejs#909:
setTimeoutas a bare background-thread global. fix(lynx): keep readiness requests alive octanejs/octane#909 now matches that API and the already verified fork implementation; focused protocol tests and source typecheck remain green.0.0.1and evaluates bothglobalThis.setTimeoutand baresetTimeoutas unavailable. It therefore cannot exercise the 16 ms late-listener path or serve as D2's startup-receipt acceptance environment.upstream main (including #885) + #909@9994674bba + #886@7378d00477, the corrected production bundle loads and exposes the expected 1000-row semantic snapshot:{"rowCount":1000,"firstId":1,"secondId":2,"thirdId":3,"row998Id":999,"firstLabel":"pretty red table","selectedId":null}The startup receipt remains
nullon this image, so ACK/two-frame acceptance is not claimed. There is no application error after the correction.This matches the previously stated environment constraint: the readiness semantics remain supported by the compatible-device evidence behind #233, while this Explorer image is missing the timer primitive required to reproduce them. I am not changing octanejs#886 or broadening octanejs#909 to polyfill an old host runtime. octanejs#909 stays a readiness-only PR and will use upstream's complete CI gate; octanejs#886 remains Draft with its exact-device acceptance gap explicit.
Huxpro commentedon Aug 30, 2026
Final readiness-PR gate result:
9994674bbaand remains limited to the readiness transport, two protocol regressions, and one package changeset.main + #909 + #886semantic snapshot are recorded above; ACK/two-frame device acceptance is still not claimed on an Explorer SDK that lacks the documented timer global. No workaround or scope expansion was added.D1 octanejs#885 remains merged, D3 octanejs#888 remains issue-only, and D2 octanejs#886 remains code-identical/Draft pending a compatible device environment.
Huxpro commentedon Aug 30, 2026
Final state-audit correction (no silent PR-state change):
The GitHub API reports octanejs#886 as Ready, not Draft. Its timeline shows maintainer
trueadmchanged it to Ready at2026-08-30T11:26:56Z, after my earlier Draft conversion and before this final audit. The head SHA and three-file patch are unchanged at7378d00477.My immediately preceding comments incorrectly repeated the stale “remains Draft” state. I am not overriding the maintainer's Ready action. The evidence statement is unchanged: the available Explorer image cannot claim ACK/two-frame acceptance, and that limitation is recorded on octanejs#886; octanejs#909 remains an independent Ready PR with green CI. Any decision to convert octanejs#886 back to Draft now belongs to upstream review rather than an unannounced plan mutation.