Repository navigation
Closed
Labels
enhancementNew feature or requestjavascriptPull requests that update javascript codepriority:P2Planned next: useful unblocked work or validation after P1 items
Description
User benefit
Let Dart Web apps opt into the bridge's JS-backed model staging to load larger GGUFs on wasm32 and reduce peak WASM linear-memory use on memory64. This is separate from single-thread/no-COOP-COEP core selection in #2090: staging applies to both threaded and single-thread cores.
Verified layers — 2026-11-20
- Owner source: bridge#227, merged63c26fa7845fb834cf249366d74d50ce67b66188; current bridge main03a010c43553d4d2b3b26aadaf09a78d4cb4d2ec also includes fix: align mtmd fallback bitmap ABI #234. All bundle llama.cpp v1.0.0/b1b770d90d94cad9e9ea5b993bdbc383a522fb28. The opt-in jsBackedModelStaging flag uses chunked JS-backed WASMFS staging for model/projector input, with version3 exports, ownership and typed refusal paths.
- Published assets: v0.1.86, dd164fb6fa05276e6a1700c563573842831ea362, predates this feature. No containing immutable asset release yet.
- Local57b8b448, GitHub main5a7e3afe and public core0.20.2 pin86 and do not forward jsBackedModelStaging. No public Dart staging capability is delivered.
- Recorded source matrix: Qwen3-4B Q4_K_M (~2.5GB) loaded on non-isolated wasm32; memory64 GPU peak WASM heap fell from8.01GiB to656MiB on tested Chromium/AppleMetal. Full model data still occupies JS memory temporarily; these are bounded source/device results, not a zero-copy/direct-to-GPU or general-browser promise.
Bounded consumer work
- After a qualified owner asset publication, pin its actual tag/manifest/checksums and mirror core JS interop/worker configuration. Add an explicit opt-in setting through the maintained Web backend API/configuration; leave default behavior unchanged.
- Probe the staging API/version and exports; missing/older assets must refuse explicitly. Preserve typed allocation, mount, transfer-length and wasm32 tensor-size errors across direct and worker routes. Never silently downgrade when explicitly requested.
- Document total WASM plus JS heap, temporary ownership/release, trade-offs, split/projector behavior and platform limits. Update README, support matrix, Web skill, example, changelog and validation capability mapping together.
Dependencies / acceptance
- Containing immutable owner assets include JS/worker/wasm32/memory64 files with verified manifest/digest and staging exports. Resolve or explicitly classify owner #229 resume/native-abort safety and CUDA crash during mmproj/clip image encode on discrete NVIDIA GPU #230–Prepare 0.8.4 release #233 lifecycle/diagnostic/test follow-ups; do not treat CI or source closure as publication.
- Supported, old/missing/version-skew, default-off and explicit-on controls exercise public Dart configuration in direct and worker routes.
- Repeat bounded checksum-pinned small/large GGUF and projector loads on wasm32/memory64; record actual backend/browser/device, WASM and JS heap, output, cancellation, failure/retry and disposal/reuse. CPU/software fallback is not hardware GPU qualification.
- Web: opt-in single-threaded bridge core for non-isolated pages (GGUF without COOP/COEP) #2090 remains independent: it gates the _st core URL/thread policy. This issue does not expand its acceptance or assign either feature to0.20.3.
Triage: enhancement/P2, javascript, blocked-runtime. Useful memory/compatibility improvement, not a demonstrated Dart regression. Preparation only; no speculative asset pin, build dispatch, publication or paid/device execution is authorized by this issue.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestjavascriptPull requests that update javascript codepriority:P2Planned next: useful unblocked work or validation after P1 items
Activity
leehack commentedon Nov 21, 2026
2026-11-21 owner artifact is now published: assets v0.1.87, bridge3cf2aaed/upstreamb1b770d9, contains #227 JS-backed model/projector staging and the new cores. Manifest SHA256922574bd6389f9ec8ce1ba41d291ba80b1d9f50906f860e8c74f7a9997c0edf9. Main3f05a377 consumes87 for #1949, while public0.20.3/local57b8b448 remain86. Publication changes the first dependency checkbox's evidence; it does not complete the consumer acceptance.
Dart still does not pass jsBackedModelStaging. Remove only blocked-runtime; retain enhancement/javascript/P2/open. Next bounded work is explicit configuration and capability/export/version-skew checks, typed direct/worker errors, model/projector ownership/cancel/dispose/reuse controls, docs/examples/skills/coverage and representative WASM+JS heap measurements. Existing owner safety/lifecycle follow-ups must retain their actual source/artifact containment and dispositions; no universal browser/GPU or zero-copy claim. #2090 remains a separate single-thread policy issue; neither is automatically in0.20.4. No implementation, publication or device execution.
Adopt WebGPU bridge v0.1.89 cache and abort recovery (#2141)
leehack commentedon Nov 22, 2026
Status 2026-11-22: llamadart 0.20.5 (published) pins bridge assets
v0.1.90(#2145), which include #227's JS-backed model and projector staging. Dart still doesn't passjsBackedModelStaging. In the 0.20.6 plan #2149, this lane stacks on #2090's branch because both change the bridge config and load paths.leehack commentedon Nov 22, 2026
Blocked on the detection design, 2026-11-22. The pinned bridge
v0.1.90has no public probe forjsBackedModelStaging; its check runs only during a load, and an older JS bridge silently ignores the option. Staging is also on by default on supported WebKit cores, so Dart has to tell an omitted setting apart fromfalse. A planner is choosing between an owner-side probe (possibly in bridgev0.1.91) and Dart-side detection. Plan:llamadart-evidence/release-0.20.6/plan-2115/plan.md.leehack commentedon Nov 22, 2026
Decision 2026-11-22: owner-side probe. Bridge adds a static
supportsJsBackedModelStagingand a matching workerreadyfield, shipping in bridgev0.1.92(v0.1.91 was already published without it). llamadart then pins v0.1.92 and addsbool? jsBackedModelStaging;nullkeeps the WebKit default. The user chose to keep this in 0.20.6. On older bridges, an explicitfalseis forwarded and checked after load (the user's choice: "Allow, verify after load"). Plan:llamadart-evidence/release-0.20.6/plan-2115/plan.md.leehack commentedon Nov 22, 2026
2026-11-22 blocker refinement/triage: owner#320 has now merged as990d40033735753fc4d7fe9b202f5a67744d0c03, adding static supportsJsBackedModelStaging and the worker-ready declaration. Latest published assets91 still binds earlierf266d06c and lacks that probe; publiccore0.20.5/main pin90. Existing staging functionality is published, but the newly selected truthful capability contract is source-only. Re-add only blocked-runtime for this NEW publication dependency; keepP2/enhancement/javascript/open and the maintainer's nullable/default/older-bridge policy unchanged.
Preparation may proceed against the chosen contract; do not merge a speculative92 URL/checksum or publish until an actual containing immutable artifact is verified. Then adopt its manifest/JS/worker/core inventories, wire bool? jsBackedModelStaging/null WebKit-default semantics, explicit-on/false/older/version-skew direct-worker controls, docs/skills/example/capability coverage and bounded real-model memory/lifecycle tests. Owner#325 is a separate P3 durability-test follow-up, not a demonstrated current failure or new release blocker. No source/pin/job changes by this scan.
leehack commentedon Nov 22, 2026
Blocked 2026-11-22 on a bridge-side retry. A worker projector load that fails with
ModelTransferLengthErroris retried (worker restart plus a second load) and ends as a genericErrorwith no code, so Dart can't keep the typed failure. I asked the bridge owner to make these errors non-retryable inv0.1.92. Repro:llamadart-evidence/release-0.20.6/plan-2115/w2115-transfer-repro.mjs.leehack commentedon Nov 23, 2026
2026-11-23 published delivery: #2165 merged99cb4291da4eb304258083ed3fab3a1c61e93006 and first ships in core0.20.6, source55df3a630981db52bf196cae950b0ff62420e8ba. The actual pub archive pins bridge92, manifest SHA2564f2fb82d55a932e9182e703d5265f3fc5875f808d4d9aa0ba18a0585d0d7784b, and exports ModelParams.jsBackedModelStaging. All three Apple companions0.20.6 are published, without a new native ABI.
Remove only the now-stale blocked-runtime label; keep the maintainer's closed status and P2 history. true requires supported staging, false disables it, null preserves the browser default. Missing/old bridge or worker capability, incompatible core and forced-fetch combinations retain typed refusal. The linked PR documents direct/worker Chromium CPU controls and larger-model/projector memory trade-offs—not hardware WebGPU or physical Safari/iOS qualification.
Driver#2171 remains a separate unmerged validation-tooling follow-up, and pre-existing load-cancel behavior #2166 remains open. Main91bdb8dd already moves to bridge93, but public0.20.6 is still92; no further pin/code work is needed merely to use this released staging option.
Add Web JS-backed staging browser driver (#2115 follow-up) (#2171)