V0.3.0
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_BLOCKinstruction – execute a compiledNodeComposeas an isolated sub‑workflow in a dedicated child interpreter. Supports reusable or one‑time interpreters.- Lifecycle management –
terminate(),terminate_all(),wait_all(), andwait_all_forks()give you full control over graceful shutdown and parallel execution. - Tree inspection –
parent,top_interpreter,sub_interpreters, andall_sub_interpretersproperties 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 (bypassasyncio.to_thread).DISABLE_EXC_IGNORED– prevent automatic penetration ofInterruptNotice/BreakLoopthroughTRY/CATCH.ALLOW_CALL_NODECOMPOSE– allow direct_call()on aNodeCompose.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 combinesPUSH_STACK+GOTOinto 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, andsearch_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_funcfromhook.matchertohook.fun_typingfor cleaner imports. NodeComposenow rejectsNodeComposeRenderedelements (type safety).- Added
IllegalStateexception for operations on non‑top‑level interpreters or when an interpreter is not running. TRY/CATCHand loop instructions respectDISABLE_EXC_IGNORED.- Fixed a potential deadlock in child interpreter cleanup.
⚠️ Migration Notes
- Backward compatible – existing workflows continue to work unchanged.
- If you used
PUSH_STACKorRET_FARfromamrita_sense.instructions, the import path is unchanged and behaviour is identical. - The
_advance_pointeralias is now fully deprecated (useadvance_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