[Epic] Deterministic Reproducible Builds & Incremental Compilation for Lua Target #1

Open
opened 2026-09-28 12:44:25 +02:00 by Grok · 0 comments
Owner

Overview & Objective

Enable bit-exact, deterministic reproducible compilation and sub-second incremental builds for the WurstScript Lua target (-lua).

Currently, WurstScript runs as a monolithic batch compiler that re-translates and optimizes the entire world on every build, taking up to 30 seconds on large maps like TeveR. Furthermore, non-deterministic file discovery, flawed sorting comparators, sequential symbol mangling, and identity-hash iterations prevent bit-exact reproducible builds across machines and rebuilds.

Architecture Pillars

  1. Bit-Exact Determinism: Guarantee that identical AST inputs yield bit-exact identical war3map.lua outputs across different machines, file system layouts, and build counts.
  2. Incremental Dev Pipeline: Reuse ModelManager's cached AST and partial typechecking, bypassing whole-program optimization in development mode.
  3. Package-Level Modular Lua Chunks: Compile packages into independent, content-addressable Lua chunks cached on disk.
  4. Fast Assembly: Assemble war3map.lua from precompiled chunks in <20ms.

Sub-Issues

  • #2: Deterministic file discovery and compilation unit ordering
  • #3: Deep symbol-aware comparator in ImTranslator.sortEverything & stable TypeId
  • #4: Deterministic qualified name mangling & source-coordinate closure naming
  • #5: Package-level modular Lua compilation & disk chunk cache
  • #6: Integrate ModelManager incremental state into CliBuildMap & ABI interface diffing
  • #7: Bit-exact regression test suite and incremental build benchmarking
## Overview & Objective Enable **bit-exact, deterministic reproducible compilation** and **sub-second incremental builds** for the WurstScript Lua target (`-lua`). Currently, WurstScript runs as a monolithic batch compiler that re-translates and optimizes the entire world on every build, taking up to 30 seconds on large maps like TeveR. Furthermore, non-deterministic file discovery, flawed sorting comparators, sequential symbol mangling, and identity-hash iterations prevent bit-exact reproducible builds across machines and rebuilds. ### Architecture Pillars 1. **Bit-Exact Determinism**: Guarantee that identical AST inputs yield bit-exact identical `war3map.lua` outputs across different machines, file system layouts, and build counts. 2. **Incremental Dev Pipeline**: Reuse `ModelManager`'s cached AST and partial typechecking, bypassing whole-program optimization in development mode. 3. **Package-Level Modular Lua Chunks**: Compile packages into independent, content-addressable Lua chunks cached on disk. 4. **Fast Assembly**: Assemble `war3map.lua` from precompiled chunks in <20ms. ### Sub-Issues - #2: Deterministic file discovery and compilation unit ordering - #3: Deep symbol-aware comparator in `ImTranslator.sortEverything` & stable `TypeId` - #4: Deterministic qualified name mangling & source-coordinate closure naming - #5: Package-level modular Lua compilation & disk chunk cache - #6: Integrate `ModelManager` incremental state into `CliBuildMap` & ABI interface diffing - #7: Bit-exact regression test suite and incremental build benchmarking
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#1
No description provided.