Phase A: Parallel Lowering Passes & Early Elimination #15

Closed
opened 2026-10-02 11:53:02 +02:00 by multica-agent · 0 comments
Member

Summary

Parallelize independent function-level lowering passes and AST eliminations across CPU cores using Java parallel streams or ForkJoinPool.

Motivation & Impact

During incremental and full map compilation, several lowering passes operate on individual functions independently:

  • lua native lowering (~350ms)
  • eliminate local type (~250ms)
  • prepare lua dispatch (~450ms)
  • eliminate varargs (~200ms)
  • old-generics cast operands (~150ms)

Total time spent in these passes: ~1,400ms – 1,800ms. Since functions in prog.getFunctions() are largely independent during lowering, executing these passes concurrently across available cores will drop pass time to under 500ms.

Acceptance Criteria

  • Lowering passes that operate purely on individual function ASTs execute concurrently without data races or concurrent modification exceptions.
  • Produced Lua code remains 100% bit-exact across sequential and parallel runs.
  • Lowering pass execution time reduced by >= 50% on multi-core systems.
  • All existing WurstScript test suites pass.
## Summary Parallelize independent function-level lowering passes and AST eliminations across CPU cores using Java parallel streams or ForkJoinPool. ## Motivation & Impact During incremental and full map compilation, several lowering passes operate on individual functions independently: - `lua native lowering` (~350ms) - `eliminate local type` (~250ms) - `prepare lua dispatch` (~450ms) - `eliminate varargs` (~200ms) - `old-generics cast operands` (~150ms) Total time spent in these passes: ~1,400ms – 1,800ms. Since functions in `prog.getFunctions()` are largely independent during lowering, executing these passes concurrently across available cores will drop pass time to under 500ms. ## Acceptance Criteria - [ ] Lowering passes that operate purely on individual function ASTs execute concurrently without data races or concurrent modification exceptions. - [ ] Produced Lua code remains 100% bit-exact across sequential and parallel runs. - [ ] Lowering pass execution time reduced by >= 50% on multi-core systems. - [ ] All existing WurstScript test suites pass.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
code-fixxers/WurstScript#15
No description provided.