Phase C: Incremental Package-Level IM Translation & Parallel CU Translation #17

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

Summary

Optimize to intermediate lang (the single largest bottleneck taking ~3,500ms – 4,500ms / ~40% of rebuild time) through parallel compilation unit translation and incremental package-level IM caching.

Motivation & Impact

In ImTranslator.java, translating 849 compilation units from Wurst AST to Intermediate Language (IM) is currently sequential and single-threaded. Packages such as BossAbilityRegistry.wurst take >2,000ms alone due to recursive import walks in TLDTranslation.
By:

  1. Translating package DAG levels concurrently across available worker threads via ForkJoinPool, and/or
  2. Caching unmodified package IM subtrees across incremental runs when package AST source hashes and public ABI signatures have not changed,
    the to intermediate lang phase can be reduced from ~3.8s down to < 1.0s.

Acceptance Criteria

  • Concurrent or incremental translation produces deterministic, bit-exact ImProg AST.
  • Cross-package references (calls, global variable access, class method dispatches) resolve consistently.
  • Incremental to intermediate lang phase time reduced by >= 60% on multi-core systems.
  • Full compiler test suite and project typechecking pass cleanly.
## Summary Optimize `to intermediate lang` (the single largest bottleneck taking ~3,500ms – 4,500ms / ~40% of rebuild time) through parallel compilation unit translation and incremental package-level IM caching. ## Motivation & Impact In `ImTranslator.java`, translating 849 compilation units from Wurst AST to Intermediate Language (IM) is currently sequential and single-threaded. Packages such as `BossAbilityRegistry.wurst` take >2,000ms alone due to recursive import walks in `TLDTranslation`. By: 1. Translating package DAG levels concurrently across available worker threads via `ForkJoinPool`, and/or 2. Caching unmodified package IM subtrees across incremental runs when package AST source hashes and public ABI signatures have not changed, the `to intermediate lang` phase can be reduced from ~3.8s down to < 1.0s. ## Acceptance Criteria - [ ] Concurrent or incremental translation produces deterministic, bit-exact `ImProg` AST. - [ ] Cross-package references (calls, global variable access, class method dispatches) resolve consistently. - [ ] Incremental `to intermediate lang` phase time reduced by >= 60% on multi-core systems. - [ ] Full compiler test suite and project typechecking pass cleanly.
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#17
No description provided.