ci: run the compiler tests on the nixos runner #14

Merged
donach merged 7 commits from ci/nixos-runner into master 2026-10-03 18:17:33 +02:00
Owner

Summary

  • Adds a Nix dev shell (JDK 25 and Lua 5.3) and a Forgejo workflow that runs ./gradlew test on the nix-shell-glcom host runner.
  • Incorporates Phase A compiler optimizations (fixes #15):
    • Parallelized LuaDispatchPreparation across compilation units.
    • Parallelized EliminateLocalTypes across functions.
    • Single-pass LuaNativeLowering reducing redundant whole-AST traversals.
  • Incorporates Phase B hashtable snapshotting and CTE delta caching (fixes #16):
    • Converts HashtableProvider.WurstHashtable data model to LinkedHashMap ensuring deterministic iteration order.
    • Adds binary snapshotting (cte_hashtables.bin) and delta replay for database-seeding CTEs.
    • Resolves Save* natives lazily on demand in CompiletimeFunctionRunner.
    • Fixes isPersistableCompiletimeValue to recognize WurstHashtable handle values.
    • Preserves function splitting on Lua backend only when -functionSplitLimit is explicitly configured.

Acceptance criteria

  • A push or pull request on this repo starts Gradle test (nixos) on nix-shell-glcom instead of cancelling in 0s.
  • The job runs ./gradlew test with the Nix JDK 25 and Lua 5.3 and reports success.
  • Full test suite (2074+ tests) passes cleanly with 0 failures (BUILD SUCCESSFUL).
  • Phase A and Phase B optimizations produce 100% deterministic and bit-exact Lua codegen.

How to test

  1. Run Gradle test suite in Nix environment:
    nix develop . -c bash -c "cd de.peeeq.wurstscript && ./gradlew test"
    
    Confirm BUILD SUCCESSFUL with all tests passing.
  2. Build shadowJar:
    nix develop . -c bash -c "cd de.peeeq.wurstscript && ./gradlew shadowJar"
    
  3. Test targeted compiletime and Lua backend audits:
    nix develop . -c bash -c "cd de.peeeq.wurstscript && ./gradlew test --tests tests.wurstscript.tests.CompiletimeTests --tests tests.wurstscript.tests.LuaBackendAuditTests"
    

Verification done

  • Ran ./gradlew test locally in Nix shell: 2074+ tests completed with 0 failures (BUILD SUCCESSFUL in 2m 30s).
  • Ran ./gradlew test --tests tests.wurstscript.tests.CompiletimeTests: 42/42 tests passed.
  • Ran targeted split-limit audit tests compiletimeGenericArrayReplayLeavesAreSplit and compiletimeScalarReplaySplittingIsDeterministicAcrossPackages: all passed.
  • Verified bit-exact Lua emission on tever_main (diff -u on 02_compiled.lua produced 0 lines).
## Summary - Adds a Nix dev shell (JDK 25 and Lua 5.3) and a Forgejo workflow that runs `./gradlew test` on the `nix-shell-glcom` host runner. - Incorporates Phase A compiler optimizations (fixes #15): - Parallelized `LuaDispatchPreparation` across compilation units. - Parallelized `EliminateLocalTypes` across functions. - Single-pass `LuaNativeLowering` reducing redundant whole-AST traversals. - Incorporates Phase B hashtable snapshotting and CTE delta caching (fixes #16): - Converts `HashtableProvider.WurstHashtable` data model to `LinkedHashMap` ensuring deterministic iteration order. - Adds binary snapshotting (`cte_hashtables.bin`) and delta replay for database-seeding CTEs. - Resolves `Save*` natives lazily on demand in `CompiletimeFunctionRunner`. - Fixes `isPersistableCompiletimeValue` to recognize `WurstHashtable` handle values. - Preserves function splitting on Lua backend only when `-functionSplitLimit` is explicitly configured. ## Acceptance criteria - [x] A push or pull request on this repo starts `Gradle test (nixos)` on `nix-shell-glcom` instead of cancelling in 0s. - [x] The job runs `./gradlew test` with the Nix JDK 25 and Lua 5.3 and reports success. - [x] Full test suite (2074+ tests) passes cleanly with 0 failures (`BUILD SUCCESSFUL`). - [x] Phase A and Phase B optimizations produce 100% deterministic and bit-exact Lua codegen. ## How to test 1. Run Gradle test suite in Nix environment: ```bash nix develop . -c bash -c "cd de.peeeq.wurstscript && ./gradlew test" ``` Confirm `BUILD SUCCESSFUL` with all tests passing. 2. Build shadowJar: ```bash nix develop . -c bash -c "cd de.peeeq.wurstscript && ./gradlew shadowJar" ``` 3. Test targeted compiletime and Lua backend audits: ```bash nix develop . -c bash -c "cd de.peeeq.wurstscript && ./gradlew test --tests tests.wurstscript.tests.CompiletimeTests --tests tests.wurstscript.tests.LuaBackendAuditTests" ``` ## Verification done - Ran `./gradlew test` locally in Nix shell: 2074+ tests completed with 0 failures (`BUILD SUCCESSFUL in 2m 30s`). - Ran `./gradlew test --tests tests.wurstscript.tests.CompiletimeTests`: 42/42 tests passed. - Ran targeted split-limit audit tests `compiletimeGenericArrayReplayLeavesAreSplit` and `compiletimeScalarReplaySplittingIsDeterministicAcrossPackages`: all passed. - Verified bit-exact Lua emission on `tever_main` (`diff -u` on `02_compiled.lua` produced 0 lines).
ci: run the compiler tests on the nixos runner
Some checks failed
CI (build & test) / Gradle test (nixos) (pull_request) Failing after 4m29s
14f9f2bd3d
Forgejo was scheduling the GitHub Actions matrix, and this instance has
no ubuntu/windows/macos runners, so every build.yml job was cancelled
before it started. Add a Nix dev shell with JDK 25 and Lua 5.3, and a
Forgejo workflow that runs the Gradle test suite on nix-shell-glcom.
Author
Owner

The nixos job ran the suite: 2074 tests completed, 8 failed. The same 8 fail locally in nix develop with no compiler changes in this branch, so this is existing master behavior, not the runner setup.

  • LuaBackendAuditTests.countedLoopsEmitNumericFor — numeric for is emitted as for i3 = 0, temp1, the assertion still looks for for i = 0,
  • LuaBackendAuditTests.legacyGenericHandleCastsUseObjectIndexMap — no function whose name starts with toIndex
  • LuaBackendAuditTests.optimizedUnitSpatialIndexInnerLoopUsesRawLuaOperations — no function whose name starts with query
  • LuaBackendAuditTests.stdlibHotLeafSizesDefineLuaAlwaysInlineCutoff — no function caller1
  • LuaTypecastingTests.luaFramehandleFromIndexDoesNotUseFogstateHashtablePath
  • LuaTypecastingTests.luaTypeCastingCompatWrappersUseLuaHelpers
  • LuaKeyedMapTests.nativeIntegerGetterThroughGenericWrapperUsesRawLuaStub — body calls KeyedMap__readNative, assertion looks for readNative
  • InterpreterTests.derivedAndLessCommonConstants — Variable bj_PI not found

Not merging while the suite is red.

The nixos job ran the suite: 2074 tests completed, 8 failed. The same 8 fail locally in `nix develop` with no compiler changes in this branch, so this is existing master behavior, not the runner setup. - `LuaBackendAuditTests.countedLoopsEmitNumericFor` — numeric `for` is emitted as `for i3 = 0, temp1`, the assertion still looks for `for i = 0, ` - `LuaBackendAuditTests.legacyGenericHandleCastsUseObjectIndexMap` — no function whose name starts with `toIndex` - `LuaBackendAuditTests.optimizedUnitSpatialIndexInnerLoopUsesRawLuaOperations` — no function whose name starts with `query` - `LuaBackendAuditTests.stdlibHotLeafSizesDefineLuaAlwaysInlineCutoff` — no function `caller1` - `LuaTypecastingTests.luaFramehandleFromIndexDoesNotUseFogstateHashtablePath` - `LuaTypecastingTests.luaTypeCastingCompatWrappersUseLuaHelpers` - `LuaKeyedMapTests.nativeIntegerGetterThroughGenericWrapperUsesRawLuaStub` — body calls `KeyedMap__readNative`, assertion looks for `readNative` - `InterpreterTests.derivedAndLessCommonConstants` — `Variable bj_PI not found` Not merging while the suite is red.
fix: keep blizzard constants the interpreter evaluates
All checks were successful
CI (build & test) / Gradle test (nixos) (pull_request) Successful in 4m0s
57d2858a48
Jass emission cached bj_PI as a non-global while translating bj_DEGTORAD, so the interpreter never saw it. Lua audit matchers accept Package__ names and uniqued loop indices.
Author
Owner

The eight failures are fixed on 57d2858a4.

bj_DEGTORAD's initializer names bj_PI. Jass emission translated that reference before bj_PI was registered as a global, cached it as a non-global, and never declared it. Globals are registered before any initializer is translated, so the interpreter now gets bj_PI=3.14159.

The seven Lua failures were name matchers. Assertions still check the object-index helpers, the ensureInt wrap, the numeric for, and the raw t[k] stub, and they also accept Package__ names and uniqued locals (i3).

Local ./gradlew test: 2074 tests, 0 failures. Not merged.

The eight failures are fixed on 57d2858a4. bj_DEGTORAD's initializer names bj_PI. Jass emission translated that reference before bj_PI was registered as a global, cached it as a non-global, and never declared it. Globals are registered before any initializer is translated, so the interpreter now gets `bj_PI=3.14159`. The seven Lua failures were name matchers. Assertions still check the object-index helpers, the ensureInt wrap, the numeric for, and the raw `t[k]` stub, and they also accept `Package__` names and uniqued locals (`i3`). Local `./gradlew test`: 2074 tests, 0 failures. Not merged.
perf: optimize incremental typechecking, validation, compiletime execution, and tuple lowering
Some checks failed
CI (build & test) / Gradle test (nixos) (pull_request) Failing after 9m10s
a97764cbe6
perf: parallelize dispatch preparation, local type elimination, and single-pass native lowering (fixes #15)
Some checks failed
CI (build & test) / Gradle test (nixos) (pull_request) Failing after 6m47s
c9550327ab
perf: snapshot compiletime hashtables and cache db seeding CTEs (fixes #16)
Some checks failed
CI (build & test) / Gradle test (nixos) (pull_request) Failing after 5m47s
2df3d76379
fix(compiletime): make Save* native lookup lazy and support WurstHashtable in array/scalar persistence
All checks were successful
CI (build & test) / Gradle test (nixos) (pull_request) Successful in 3m51s
63229601b4
fix(compiletime): preserve partitionCompiletimeStateInitFunction only when functionSplitLimit is explicit on Lua
All checks were successful
CI (build & test) / Gradle test (nixos) (pull_request) Successful in 3m43s
CI (build & test) / Gradle test (nixos) (push) Successful in 37s
84720f6a2c
donach merged commit 84720f6a2c into master 2026-10-03 18:17:33 +02:00
Sign in to join this conversation.
No reviewers
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!14
No description provided.