Skip to content

Phase 4: import hook / proxy for native-only packages #4

@zacharywhitley

Description

@zacharywhitley

Background

Design: docs/native-execution-and-parallelism.md §4.1.
Depends on #1 and #2 (needs a working Tier 1 backend).

Make Tier 1 ergonomic: configured "native-only" packages import as proxy modules
whose calls route over offload.run.

Tasks

  • meta_path finder in the WASM CPython that intercepts configured
    native-only package imports and returns a proxy module.
  • Proxy module: attribute calls serialize (entry, args), invoke
    offload.run, deserialize the result.
  • Configuration of the native-only package set (ties to env-id).
  • numpy as the proof case.

Acceptance

import numpy as np; np.<call>(...) in the WASM interpreter transparently
executes in the Tier 1 backend and returns a correct result, for
call-with-serializable-args.

Out of scope

Transparent live-object proxying (ndarray views, callbacks, __getattr__
chains) — that is Phase 5.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions