Skip to content

feat(jit/aot): native OP_PARMAP Cranelift path (ILO-353)#692

Merged
danieljohnmorris merged 1 commit into
feature/par-map-vm-nativefrom
feature/par-map-jit-aot
May 22, 2026
Merged

feat(jit/aot): native OP_PARMAP Cranelift path (ILO-353)#692
danieljohnmorris merged 1 commit into
feature/par-map-vm-nativefrom
feature/par-map-jit-aot

Conversation

@danieljohnmorris
Copy link
Copy Markdown
Collaborator

Summary

  • Adds jit_parmap extern "C" helper that mirrors the VM's OP_PARMAP dispatch arm: resolves FnRef/closure/text callees, fans out over std::thread::scope workers, returns L(R _ t) in input order
  • Wires OP_PARMAP into both Cranelift backends (JIT: jit_cranelift.rs, AOT: compile_cranelift.rs) — par-map no longer falls through to the interpreter on these paths
  • Data word consumed at compile time via skip_next = true (same pattern as OP_POSTH); find_block_leaders updated to skip it as a 2-word instruction; prepass/fixpoint classification loops guarded accordingly

Test plan

  • All 8 op_parmap_* unit tests pass (cargo test --features cranelift op_parmap)
  • Full test suite passes with --features cranelift
  • Builds cleanly: cargo build --features cranelift

Extends ILO-352 (#688) / ILO-67 (#610).

🤖 Generated with Claude Code

Add `jit_parmap` extern "C" helper and wire OP_PARMAP into both the JIT
(jit_cranelift.rs) and AOT (compile_cranelift.rs) Cranelift backends so
par-map no longer falls through to the VM interpreter.

- `jit_parmap(fn_bits, xs_bits, concurrency_or_sentinel) -> result_bits`
  mirrors the VM's OP_PARMAP dispatch arm: resolves FnRef / closure /
  text callees, fans out over scoped worker threads, returns L(R _ t).
- Both HelperFuncs structs gain a `parmap: FuncId` field declared as
  `jit_parmap` with signature (i64, i64, i64) -> i64.
- JIT register helpers table registers the symbol.
- OP_PARMAP arms added to both codegen dispatch loops; data word consumed
  at compile time via `skip_next = true` matching OP_POSTH pattern.
- OP_PARMAP added to `find_block_leaders` 2-word skip list so its data
  word bytes are never mis-decoded as opcode leaders.
- OP_PARMAP added to non_num_write classification lists and the two
  prepass/fixpoint data-word-skip guards in both codegen files.
- All 8 existing op_parmap_* unit tests pass; zero regressions.

Extends ILO-352 (#688) / ILO-67 (#610).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@danieljohnmorris danieljohnmorris merged commit 2596b34 into feature/par-map-vm-native May 22, 2026
@danieljohnmorris danieljohnmorris deleted the feature/par-map-jit-aot branch May 22, 2026 06:44
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