fix: prevent Qwen 2.5 WASM out-of-memory loads - #18
Merged
Conversation
Adding .gitkeep for PR creation (default mode). This file will be removed when the task is complete. Issue: #17
konard
marked this pull request as ready for review
July 12, 2026 05:26
Contributor
Author
Working session summaryImplemented and finalized PR #18. Key changes:
Verification:
This summary was automatically extracted from the AI working session output. |
Contributor
Author
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
📊 Context and tokens usage:
Total: (281.7K + 10.9M cached) input tokens, 22.6K output tokens, $14.741969 cost 🤖 Models used:
📎 Log file uploaded as Gist (3032KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
Contributor
Author
✅ Ready to mergeThis pull request is now ready to be merged:
Monitored by hive-mind with --auto-restart-until-mergeable flag |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #17.
Qwen2.5 1.5B was advertised as fitting CPU-only Safari because the model selector estimated ONNX runtime memory from download bytes but omitted ONNX Runtime's additional WASM heap/session-construction overhead. Loading the 1.22 GB q4f16 graph then terminated inside Emscripten with the opaque
Aborted()shown in the issue.This PR:
docs/case-studies/issue-17/;Reproduction
Before this fix:
Error: Aborted(). Build with -sASSERTIONS for more info.Original evidence:
Automated regression
web/src/models/models.test.tsnow evaluates the real Qwen2.5 1.5B catalog entry with a CPU-only 2 GiB budget and asserts it istoo-large; the old code returnedtightand allowed the crashing load. A companion assertion verifies q4f16 remains selected with a usable WebGPU adapter.Verification
Passing locally:
npm test --prefix web -- --run— 39 tests./scripts/build-wasm.shnpm run build --prefix web— TypeScript + production Vite buildcargo fmt --checkcargo test— 19 unit/integration tests + 3 doctestscargo clippy --all-targets --all-featuresnode scripts/check-file-size.mjsgit diff --checkKnown repository-wide tooling issue:
npm run lint --prefix webcannot start because ESLint 9 is installed but the repository has noeslint.config.js/mjs/cjs. This predates and is unrelated to the changed files; TypeScript compilation and all configured CI checks remain covered above.Case study
See
docs/case-studies/issue-17/for preserved evidence and the full analysis.