Skip to content

V0.3.0

Choose a tag to compare

@JohnRichard4096 JohnRichard4096 released this 07 Jun 03:01

Release Summary – v0.3.0

We’re excited to announce AmritaSense 0.3.0! This release introduces a powerful interpreter tree model, isolated sub‑workflow execution, safe low‑level tuning flags, and several quality‑of‑life improvements.

🚀 Major New Features

Interpreter Tree & Subgraph Isolation

  • fork_interpreter() – create child interpreters that form a tree. Each interpreter has its own lifecycle, middleware, and I/O stream.
  • FUN_BLOCK instruction – execute a compiled NodeCompose as an isolated sub‑workflow in a dedicated child interpreter. Supports reusable or one‑time interpreters.
  • Lifecycle managementterminate(), terminate_all(), wait_all(), and wait_all_forks() give you full control over graceful shutdown and parallel execution.
  • Tree inspectionparent, top_interpreter, sub_interpreters, and all_sub_interpreters properties let you navigate the interpreter tree.

Unsafe Configuration Flags

A new _unsafe.__flags__ module exposes internal engine switches for rare edge cases. Flags are locked after first assignment to ensure predictable behaviour.

  • FORCE_NOT_WRAP_TO_ASYNC – run synchronous nodes on the event loop thread (bypass asyncio.to_thread).
  • DISABLE_EXC_IGNORED – prevent automatic penetration of InterruptNotice / BreakLoop through TRY/CATCH.
  • ALLOW_CALL_NODECOMPOSE – allow direct _call() on a NodeCompose.
  • NO_DEPENDENCY_META_CACHE – re‑resolve dependency metadata on every call.
  • NO_SHARED_MIDDLEWARE – disable automatic middleware inheritance when forking.

Improved Manual Stack Management

  • PUSH_AND_GOTO(from_adr, to_adr) – a convenience instruction that combines PUSH_STACK + GOTO into a single node.

📚 Documentation

  • New guides: Unsafe Features (/guide/advanced/unsafe) and Subgraph Isolation (/guide/practice/subgraph-isolation).
  • Updated manual stack management documentation with PUSH_AND_GOTO.
  • Expanded API reference for the interpreter tree, IllegalState, and search_exceptions().
  • Chinese translations for all new content.

🧪 New Demos & Tests

  • demos/16_subgraph_isolation.py – parallel execution, interpreter tree properties, early termination.
  • demos/17_unsafe_flags.py – flag configuration and locking behaviour.
  • Comprehensive unit & integration tests for FUN_BLOCK, PUSH_AND_GOTO, and interpreter tree APIs.

🔧 Other Changes

  • Moved sign_func from hook.matcher to hook.fun_typing for cleaner imports.
  • NodeCompose now rejects NodeComposeRendered elements (type safety).
  • Added IllegalState exception for operations on non‑top‑level interpreters or when an interpreter is not running.
  • TRY/CATCH and loop instructions respect DISABLE_EXC_IGNORED.
  • Fixed a potential deadlock in child interpreter cleanup.

⚠️ Migration Notes

  • Backward compatible – existing workflows continue to work unchanged.
  • If you used PUSH_STACK or RET_FAR from amrita_sense.instructions, the import path is unchanged and behaviour is identical.
  • The _advance_pointer alias is now fully deprecated (use advance_pointer).

🙏 Acknowledgements

Thanks to all contributors and early testers who helped shape this release.


Upgrade today:
pip install --upgrade amrita-sense

Full Changelog: 0.2.4...0.3.0