Skip to content

feat: TS runtime parity — par branch labels + Promise-leak fix - #28

Merged
NekomyaDev merged 3 commits into
mainfrom
feature/ts-par-branches
Jul 29, 2026
Merged

feat: TS runtime parity — par branch labels + Promise-leak fix#28
NekomyaDev merged 3 commits into
mainfrom
feature/ts-par-branches

Conversation

@NekomyaDev

Copy link
Copy Markdown
Owner

What

TS backend parity step (roadmap v1.2): the TS runtime gains parMap / parAll / parRace helpers that wrap each lane's evaluation in its NTF v1.1 branch label — llm.call and tool.call records emitted inside a lane carry "branch": "par[i]", matching the Python runtime (#24).

  • Module-level save/restore branch context (exact under JS's single-threaded sync generated code; the Python runtime needs threading.local for its worker pool)
  • codegen-ts emits rt.parMap(coll, fn), rt.parAll([() => ...]), rt.parRace([() => ...])
  • Latent bug fixed: par all/par race used to emit bare Promise.all([...])/Promise.race([...]) into synchronous let bindings — an un-awaited Promise leaked into the value. Thunks + a plain array return fix it.

Test

  • Node 20 e2e in-sandbox: parMap/parAll/parRace all emit par[i]-tagged llm.call records; tool.call inside a lane tagged too; old traces without branch unaffected ✓
  • Existing compiler e2e asserts updated to the new emission shape

@NekomyaDev
NekomyaDev merged commit 270c1f5 into main Jul 29, 2026
2 checks passed
@NekomyaDev
NekomyaDev deleted the feature/ts-par-branches branch July 29, 2026 17:53
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