feat: deterministic file discovery and compilation unit ordering #8

Merged
Grok merged 1 commit from feat/deterministic-file-discovery into master 2026-09-28 12:53:55 +02:00
Owner

Resolves #2

Summary

Ensures deterministic ordering of files, compilation units, and packages during compiler ingestion:

  • Lexicographical sorting of file lists in WurstCompilerJassImpl (loadWurstFilesInDir, addDependenciesFromFolder, addLibDir).
  • Lexicographical sorting of file lists in ModelManagerImpl and ImportFile.
  • Stable sorting of compilation units by normalized file path in WurstCompilerJassImpl.mergeCompilationUnits.
  • Stable sorting of package declarations by name in AttrImportedPackage.getPackages.
  • Added unit test compilationUnitAndPackageOrderingIsDeterministic in CompilationUnitTests to verify order invariance across file input permutations.

Testing

  • tests.wurstscript.tests.CompilationUnitTests.compilationUnitAndPackageOrderingIsDeterministic passed.
  • tests.wurstscript.tests.DeterministicChecks passed.
  • tests.wurstscript.tests.LuaTranslationTests.luaOutputIsDeterministicForGenericOverrideSlots passed.
Resolves #2 ### Summary Ensures deterministic ordering of files, compilation units, and packages during compiler ingestion: - Lexicographical sorting of file lists in `WurstCompilerJassImpl` (`loadWurstFilesInDir`, `addDependenciesFromFolder`, `addLibDir`). - Lexicographical sorting of file lists in `ModelManagerImpl` and `ImportFile`. - Stable sorting of compilation units by normalized file path in `WurstCompilerJassImpl.mergeCompilationUnits`. - Stable sorting of package declarations by name in `AttrImportedPackage.getPackages`. - Added unit test `compilationUnitAndPackageOrderingIsDeterministic` in `CompilationUnitTests` to verify order invariance across file input permutations. ### Testing - `tests.wurstscript.tests.CompilationUnitTests.compilationUnitAndPackageOrderingIsDeterministic` passed. - `tests.wurstscript.tests.DeterministicChecks` passed. - `tests.wurstscript.tests.LuaTranslationTests.luaOutputIsDeterministicForGenericOverrideSlots` passed.
feat: deterministic file discovery and compilation unit ordering (#2)
Some checks failed
CI (build & test) / Gradle build on ubuntu-latest (pull_request) Has been cancelled
CI (build & test) / Nightly prerelease (master) (pull_request) Has been cancelled
ec7b6d4d72
- Sort directory listings lexicographically across WurstCompilerJassImpl, ModelManagerImpl, and ImportFile
- Sort compilation units by file path in mergeCompilationUnits
- Sort package discovery by package name in AttrImportedPackage.getPackages
- Add unit test verifying package and compilation unit order stability
Grok merged commit 3089296a2d into master 2026-09-28 12:53:55 +02:00
Grok deleted branch feat/deterministic-file-discovery 2026-09-28 12:53:55 +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!8
No description provided.