Skip to content

Keep one instance per guest and ask each runtime line once, so Ask is not refused for memory (J8, #176) - #181

Open
afflom wants to merge 9 commits into
mainfrom
claude/project-thread-fcprd9
Open

afflom wants to merge 9 commits into
mainfrom
claude/project-thread-fcprd9

Conversation

@afflom

@afflom afflom commented Nov 16, 2026

Copy link
Copy Markdown
Owner

Main's publish run failed PD-01 on journey J8 ("Talk with my data"): the question was left unanswered. Issue #176.

Cause

Chrome refuses a new WebAssembly instance ("Out of memory: Cannot allocate Wasm memory for new instance") once too many uncollected instances exist. Two places made one instance per request:

  • the generated openGuest in every site/*/guest.mjs;
  • the runtime's runGuest (vendored, locked), reached by every line request from the page. A six-item day arriving makes 253 line requests, 95 of them distinct.

Change

  • generators/guests (LexLean GenGuests): openGuest compiles once and keeps one instance, restoring its memory above the stack to its first state before each request, and dropping the instance if a request throws. All site/*/guest.mjs loaders are regenerated (GN-01 byte-for-byte).
  • site/card.mjs: each distinct runtime line is asked once and its answer kept (lines are pure functions of their text); a line refused for memory is asked again a few times before the failure is shown. The locked runtime is not touched.
  • Two lines trimmed in test/oracle/intent.test.mjs and tools/oracle/gen.py so the hand-written total does not grow (HW-01).

Checked

  • J8 walked 48 times on a local build of this branch: 48 answered (before: about 1 in 8 unanswered).
  • Whole browser suite on the local build, merged with current main: 95 pass, 2 skipped (held DialogBank source and one other skip), QR-05 restart included.
  • HW-01 against origin/main: none added or grown. GN-01, guests check, oracle check, CM-01: pass. App weight 122134 of 122880 bytes.

Not in this change

The runtime's per-request instance is upstream (template). It is reported to the thread that owns template PRs; until it changes, the page-side memo and retry carry it.


Generated by Claude Code

… not refused for memory

J8 (Talk with my data) failed on main's publish run because Ask answered
"No answer: WebAssembly.Instance(): Out of memory: Cannot allocate Wasm
memory for new instance". Two things started an instance per request and
left it for the browser to collect: the generated asynchronous guest
loader (openGuest in every site/*/guest.mjs; only openGuestSync kept one),
and the locked runtime behind the page's line(), 253 times while a
six-item day arrives.

generators/guests now writes openGuest to keep one instance and put its
memory back as first instantiated before each request, as openGuestSync
does. The page asks each distinct line once (the root guest takes no
imports and each request runs alone, so the same line has the same
answer; 253 requests become 95) and asks again, a moment later, a line
the browser refused for memory.

Walking J8's question on a local build, asked six seconds after the day
arrives: 3 of about 30 walks unanswered before, 0 of 48 after.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3QT5NNFBXXmoeroHvT
@github-actions

Copy link
Copy Markdown
Contributor

Merge train notice: the merge train merges this pull request once it is green on current main; don't enable auto-merge.


Generated by Claude Code

@github-actions

Copy link
Copy Markdown
Contributor

Merge train: af2aaed: not merged, because the fast gates or the browser acceptances refuse it merged with main (a507f82) and the pull requests the train takes before it; see run 43915777614. Fix it on this branch (merge main first) and the train tests it again.


Generated by Claude Code

@github-actions

Copy link
Copy Markdown
Contributor

Merge train: 263920e: not merged, because the fast gates or the browser acceptances refuse it merged with main (cfd9a71) and the pull requests the train takes before it; see run 43931417022. Fix it on this branch (merge main first) and the train tests it again.


Generated by Claude Code

@github-actions

Copy link
Copy Markdown
Contributor

Merge train: f17d44f: not merged, because the fast gates or the browser acceptances refuse it merged with main (0c2b4e9) and the pull requests the train takes before it; see run 43955796070. They say: ST-01: 1305 of 2725 requirements of 31 measured standards enforced; 43 standards not yet measured; 56 of 171 parts governed, 2 with no standard, 113 not yet assigned.;GN-01: test/standards/generated/w3c-annotation-model-annotationMusts.json is what annotests writes;GN-01: test/standards/generated/w3c-annotation-model-annotationOptionals.json is what annotests writes;GN-01: test/standards/generated/w3c-annotation-model-annotationsAgentOptionals.json is what annotests writes;GN-01: test/standards/generated/w3c-annotation-model-collectionMusts.json is what annotests writes;GN-01: test/standards/generated/w3c-annotation-model-collectionOptionals.json is what annotests writes;GN-01: test/standards/generated/w3c-annotation-model-pageMusts.json is what annotests writes;GN-01: test/standards/generated/w3c-annotation-model-pageOptionals.json is what annotests writes. Fix it on this branch (merge main first) and the train tests it again.


Generated by Claude Code

@github-actions

Copy link
Copy Markdown
Contributor

Merge train: 446d43b: not merged, because its check "page / gates" ended failure on this head, so it is not green; push to this branch to run it again. Fix it on this branch (merge main first) and the train tests it again.


Generated by Claude Code

This branch has not been deployed

No deployments
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.

2 participants