LearnNewsExamplesConnect
Frontmatter
assigneesneo-gpt-euclid
createdAtOct 14, 2026, 10:26 AM
updatedAtOct 14, 2026, 12:02 PM
githubUrlhttps://github.com/neomjs/neo/issues/19732
authorneo-gpt-euclid
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtOct 14, 2026, 12:02 PM

Refuse SharedCanvas readiness after renderer module load failure

Closed v13.3.0/archive-v13-3-0-chunk-1 bugaitestingcore
neo-gpt-euclid
neo-gpt-euclid commented on Oct 14, 2026, 10:26 AM

Context

Stage host-integration research reproduced the same failed Canvas admission in development and composed production. The mounted observation checkpoint binds the inputs and loader results. A missing renderer module returns success:false; a module that registers its singleton and then throws also returns success:false, but the current host can still initialize that renderer and publish Canvas readiness.

The Problem

SharedCanvas.initAsync() ignores the returned Canvas.loadModule() outcome. It waits for a namespace stub whether import succeeded or failed. With no stub, later offscreen registration calls initGraph on undefined; with a partially registered or previously available stub, failed admission can appear ready. Teardown likewise reaches a namespace renderer even when this host never initialized its graph.

The older closed #8811/#8950/#8952 work covers transfer, loader placement and worker/stub ordering. Those dispositions do not resolve the current negative-result/foreign-graph ownership cases. Memory hits f957de5a and 6fec004c preserve that history rather than establish a current repair.

The Architectural Reality

src/app/SharedCanvas.mjs owns module/stub admission, graph readiness, sizing and visibility. src/component/Canvas.mjs owns transfer/unregister; src/worker/Canvas.mjs owns the structured loader result. Base.construct() resolves ready() only after initAsync() returns, so throwing on expected admission failure wedges that promise. Renderer namespaces are shared routing addresses, not per-host graph ownership.

Design authority: SharedCanvas's lifecycle JSDoc says it initializes the graph when offscreen canvas is ready; the observed undefined initGraph is a crash, and publishing Canvas ready after an explicit import refusal contradicts that lifecycle.

The Fix

Consume the existing loader outcome before admitting graph work. Use an internal per-host admission/owned-graph guard and the existing isCanvasReady config; do not add a second writable readiness authority. Expected failure settles live host initialization normally and emits an addressed canvasLoadFailed notification. Skip transfer/graph/theme/resize work for refused hosts; unregister only their own transferred canvas if a race already transferred it. Clear only a graph this host actually started, with its captured renderer/window. Fence continuations against destruction and stale captured window identity. Preserve successful delayed-stub and preloaded/no-import-path hosts.

Prescription checked: src/app/SharedCanvas.mjs owns this concern. The ordinary Canvas loader keeps its current return contract. New focused tests belong beside SharedCanvasVisibility.spec.mjs; the mounted Stage fixture supplies the real consumer falsifier.

Contract Ledger

Target surface Authority Result / fallback Docs and evidence
Canvas.loadModule() → SharedCanvas.initAsync() Existing {success,path,error} writer in src/worker/Canvas.mjs Negative or rejected load never admits renderer work; live host ready() settles Loader/host JSDoc; failed-without-stub and failed-with-stub controls
isCanvasReady / canvasReady SharedCanvas graph-init boundary Publish only for successful admission and this live host's graph; preloaded hosts retained Existing config/event JSDoc; delayed-success and mounted controls
canvasLoadFailed SharedCanvas's per-host admission failure One addressed event with host, renderer, configured path and categorical reason; listener failure cannot wedge initialization New event JSDoc; event/ready settlement assertions
Transfer, teardown and sizing Component Canvas maps + SharedCanvas owned-graph boundary Refused or retired host never clears another renderer; own transfer/graph retired once Lifecycle JSDoc; close-during-load and surviving-renderer browser control

Acceptance Criteria

  • Actual negative load with no stub and with a pre-existing/partially registered stub settles live host ready(), emits one failure event, and makes zero initGraph/canvasReady/theme/resize calls.
  • Worker-start/rejected-loader/bounded-missing-stub failures settle without an unhandled rejection; destruction/stale-window continuations publish no readiness or failure event.
  • Successful delayed-stub and preloaded/no-import-path hosts retain normal graph, theme, size and visibility behavior.
  • Closing a refused host retires only its transferred canvas; a healthy renderer continues painting with its registration and measured resources intact.
  • Focused lifecycle units, the existing owning unit checks and full units pass; mounted development and composed-production controls prove the original negative-result readiness failure is removed.
  • Stage research consumes the exact repaired Engine head separately from the installed candidate and records the final remaining bounds.

Out of Scope

Automatic retries, new loader roots/manifests, installed bundle or runtime-extension activation, Base readiness redesign, Sparkline's independent initializer, renderer shader/partial-allocation repair and generic GPU memory reclamation.

Avoided Traps

A namespace stub as admission proof; throwing an expected failure and stranding Base.ready(); clearing a shared renderer the failed host never owned; a second mutable load-status config; claiming the independent Sparkline path fixed.

Decision Record impact: none — correction at the existing SharedCanvas lifecycle owner, no extension-host approval. Structure map: N/A — Body primitive plus an established sibling test directory.

Related

neomjs/neo-stage#58 · neomjs/neo-stage#32. The source-built research and separately installed extension gates remain distinct.

Origin Session ID: 03290248-0760-4e87-b12b-040a5d5dbb14 Retrieval Hint: SharedCanvas negative Canvas load result partial registration false readiness; Stage32 checkpoint6163886671.

Creation sweeps (2026-10-14 08:25:10 UTC): live latest 20 open Engine issues and current 30-row all-state inbox checked, no competing ticket/claim; MC problem query returned the current reproduction plus two historical stub/path entries, no prior decline or current repair. Own-assignment sweep: three open Engine issues, none overlapping this lifecycle result. Related closed predecessor bodies read.

tobiu referenced in commit f12b089 - "feat(canvas): guard renderer admission (#19732) (#19734)" on Oct 14, 2026, 12:02 PM
tobiu closed this issue on Oct 14, 2026, 12:02 PM