Skip to content

enable async file read in compat mode#224

Merged
ngxson merged 2 commits into
masterfrom
xsn/compat_async_file_Read
May 23, 2026
Merged

enable async file read in compat mode#224
ngxson merged 2 commits into
masterfrom
xsn/compat_async_file_Read

Conversation

@ngxson

@ngxson ngxson commented May 23, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Bug Fixes

    • Fixed async file read operations to correctly respect compatibility mode configuration.
  • Documentation

    • Refined documentation describing async file mechanisms (JSPI/Asyncify support).
  • Chores

    • Bumped package version to 3.2.3. Updated CDN asset URLs accordingly.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 23, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

An error occurred during the review process. Please try again later.

📝 Walkthrough

Walkthrough

This PR adds compatibility mode support to async file reading, bumps the package version to 3.2.3, and updates supporting documentation. The core change threads a compat flag through the async file capability check to enable the feature when compatibility mode is active.

Changes

Async File Read Compat and Release

Layer / File(s) Summary
Async file read compat capability
src/utils.ts, src/wllama.ts, src/worker.ts
canUseAsyncFileRead now accepts a compat parameter and returns true when JSPI is supported or compat mode is enabled. The flag is threaded through loadModel and ProxyToWorker to conditionally enable async file reads based on compatibility mode.
Release version and CDN updates
package.json, compat/package.json, src/wasm-from-cdn.ts
Package version bumped from 3.2.2 to 3.2.3 in both manifests, and all CDN-hosted WASM asset URLs updated to reference the new version.
Development guide async file read documentation
README-dev.md
Updated to describe fs.alloc as enabling file reading through JSPI or Asyncify in compatibility mode.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • ngxson/wllama#221: Introduces JSPI/async-file-read and fallback plumbing that this PR builds upon by adding compat mode conditionals.
  • ngxson/wllama#171: Also updates src/wasm-from-cdn.ts by bumping WASM asset URL versions in the same constant values.
  • ngxson/wllama#217: Shares direct changes to src/wasm-from-cdn.ts updating WasmFromCDN.default CDN URL to a new version.

Poem

🐰 A compat mode springs to life,
Threading flags through worker and strife,
JSPI and Asyncify play,
While version three-point-two arrives today,
CDN URLs in step they stay!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'enable async file read in compat mode' directly and accurately summarizes the main purpose of the pull request: enabling async file read functionality specifically when compatibility mode is active.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch xsn/compat_async_file_Read

Comment @coderabbitai help to get the list of available commands and usage tips.

@ngxson ngxson merged commit 88f9d98 into master May 23, 2026
6 checks passed
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.

1 participant