Skip to content

Releases: luau-lang/luau

0.596

22 Sep 19:26
16fbfe9
Compare
Choose a tag to compare

What's Changed

  • Support Control Flow type Refinements for "break" and "continue" statements by @AmberGraceSoftware in #1004
  • The old type unification engine will now report a more fine-grained error at times, indicating that type normalization in particular failed

New Type Solver

  • Refactor of Unifier2, the new unification implementation for Luau
  • Completed MVP of new unification implementation
  • Dramatically simplified overload selection logic
  • Type family reduction can now apply sooner to free types that have been solved
  • Subtyping now supports table indexers
  • Generalization now replaces bad generics with unknown

Native Code Generation

  • Reduce stack spills caused by FINDUPVAL and STORE_TAG
  • Generate SHL/SHR/SAR/rotates with immediate operands in X64
  • Removed redundant case re-check in table lookup fallback

New Contributors

Full Changelog: 0.595...0.596

0.595

15 Sep 17:33
31a017c
Compare
Choose a tag to compare

What's new

  • Rerun clang-format on the code
  • Fix the variance on indexer result subtyping. This fixes some issues with inconsistent error reporting.
  • Fix a bug in the normalization logic for intersections of strings
  • Demo site: case sensitive highlighting by @Someon1e in #1040

New Type Solver

  • New overload selection logic
  • Subtype tests now correctly treat a generic as its upper bound within that generic's scope
  • Semantic subtyping for negation types
  • Semantic subtyping between strings and compatible table types like {lower: (string) -> string}
  • Further work toward finalizing our new subtype test
  • Correctly generalize module-scope symbols

Native Codegen

  • Lowering statistics for assembly
  • Make executable allocation size/limit configurable without a rebuild. Use FInt::LuauCodeGenBlockSize and FInt::LuauCodeGenMaxTotalSize.

New Contributors

Full Changelog: 0.594...0.595

0.594

08 Sep 00:25
c7c986b
Compare
Choose a tag to compare

Analysis Changes

  • Fixed generic variadic function unification succeeding when it should have reported an error

Other Changes

  • Fixed Frontend::markDirty not working on modules that were not typechecked yet
  • Fix build & test conformance issues on mingw32/gcc and mingw64/clang by @jdpatdiscord in #1023
  • Update syntax.md by @zeux in #1035

New Type Solver

  • Implemented semantic subtyping check for function types

Native Code Generation

  • Improved performance of numerical loops with a constant step
  • Simplified IR for bit32.extract calls extracting first/last bits
  • Improved performance of NaN checks

0.593

01 Sep 18:10
551a43c
Compare
Choose a tag to compare

Floor division operator //

Luau now supports floor division operator //; by default it works on numbers and is equivalent to math.floor(a / b), but it can also be overridden for other types using __idiv metamethod. The operator has the same syntax and semantics as // in Lua 5.3; see #832 for full RFC.

Analysis Changes

  • Autocomplete now shows end within do blocks
  • Restore BraceType when using Lexer::lookahead (fixes #1019)

New Type Solver

  • Enhance subtyping tests to support metatables, string singletons, and class types

Native Codegen

  • Fixed clobbering of non-volatile xmm registers on Windows
  • Optimize redundant table slot lookups
  • Improve value propagation optimizations to work across basic blocks in some cases
  • Implemented IR translation of table.insert builtin
  • Fixed mmap error handling on macOS/Linux

0.592

25 Aug 17:34
ce9414c
Compare
Choose a tag to compare

Analysis Changes

  • Improved parsing error messages
  • Fixed crash on null pointer access in unification (fixes #1017)

Other Changes

  • AST queries at position where function name is will now return AstExprLocal
  • Lexer performance has been slightly improved
  • Fixed incorrect string singleton autocomplete suggestions (fixes #858)
  • Native code support is enabled by default and native=1 (make)/LUAU_NATIVE (CMake)/-DLUA_CUSTOM_EXECUTION configuration is no longer required

New Type Solver

  • New subtyping check can now handle generic functions and tables (including those that contain cycles)

Native Codegen

  • Loops with non-numeric parameters are now handled by VM to streamline native code
  • Array size check can be optimized away in SETLIST
  • On failure, CodeGen::compile returns a reason
  • Fixed clobbering of non-volatile xmm registers on Windows

0.591

18 Aug 18:25
e25b0a6
Compare
Choose a tag to compare

What's Changed

  • LinterConfig.h: add missing stdint.h include by @xgqt in #1010
  • Fix a use-after-free bug in the new type cloning algorithm
  • Tighten up the type of coroutine.wrap. It is now <A..., R...>(f: (A...) -> R...) -> ((A...) -> R...)
  • Break .luaurc out into a separate library target Luau.Config. This makes it easier for applications to reason about config files without also depending on the type inference engine.
  • Move typechecking limits into FrontendOptions. This allows embedders more finely-grained control over autocomplete's internal time limits.
  • Fix a stability issue with debugger debugprotectederror callback allowing break in non-yieldable contexts

New Type Solver

  • Initial work toward Local Type Inference
  • Introduce a new subtyping test. This will be much nicer than the old test because it is completely separate both from actual type inference and from error reporting.

Native Code Generation

  • Added function to compute iterated dominance frontier
  • Optimize barriers in SET_UPVALUE when tag is known
  • Cache lua_State::global in a register on A64
  • Optimize constant stores in A64 lowering
  • Track table array size state to optimize array size checks
  • Add split tag/value store into a VM register
  • Check that spills can outlive the block only in specific conditions

New Contributors

Full Changelog: 0.590...0.591

0.590

11 Aug 15:26
d98256b
Compare
Choose a tag to compare

Analysis Changes

  • Better indentation in multi-line type mismatch error messages
  • Error message clone can no longer cause a stack overflow (when typechecking with retainFullTypeGraphs set to false); fixes #975

Runtime Changes

  • string.format with %s is now ~2x faster on strings smaller than 100 characters

Other Changes

Native Codegen

  • All VM side exits will block return to the native execution of the current function to preserve correctness
  • Fixed executable page allocation on Apple platforms when using hardened runtime
  • Added statistics for code generation (no. of functions compiler, memory used for different areas)
  • Fixed issue with function entry type checks performed more that once in some functions

New Contributors

Full Changelog: 0.589...0.590

0.589

04 Aug 19:46
0b2755f
Compare
Choose a tag to compare

Analysis Changes

  • Progress toward a diffing algorithm for types. We hope that this will be useful for writing clearer error messages.
  • Add a missing recursion limiter in Unifier::tryUnifyTables. This was causing a crash in certain situations.

Runtime Changes

  • Luau heap graph enumeration improvements:
    • Weak references are not reported
    • Added tag as a fallback name of non-string table links
    • Included top Luau function information in thread name to understand where thread might be suspended
  • Constant folding for math.pi and math.huge at -O2
  • Optimize string.format and %*
    • This change makes string interpolation 1.5x-2x faster depending on the number and type of formatted components, assuming a few are using primitive types, and reduces associated GC pressure.

Other changes

New type checker

  • Initial work toward tracking the upper and lower bounds of types accurately.

Native code generation (JIT)

  • Add IrCmd::CHECK_TRUTHY for improved assert fast-calls
  • Do not compute type map for modules without types
  • Capture metatable+readonly state for NEW_TABLE IR instructions
  • Replace JUMP_CMP_ANY with CMP_ANY and existing JUMP_EQ_INT
  • Add support for exits to VM with reentry lock in VmExit

New Contributors

Full Changelog: 0.588...0.589

0.588

28 Jul 15:24
76f67e0
Compare
Choose a tag to compare

Analysis and Autocomplete Changes

  • Luau::autocomplete no longer performs typechecking internally, make sure to run Frontend::check before performing autocomplete requests
  • Autocomplete string suggestions without "" are now only suggested inside the ""
  • Autocomplete suggestions now include function (anonymous autofilled) key with a full suggestion for the function expression (with arguments included) stored in AutocompleteEntry::insertText
  • AutocompleteEntry::indexedWithSelf is provided for function call suggestions made with :
  • Cyclic modules now see each other type exports as any to prevent memory use-after-free (similar to module return type)

Runtime Changes

  • Updated inline/loop unroll cost model to better handle assignments (Fixes #978)
  • math.noise speed was improved by ~30%
  • table.concat speed was improved by ~5-7%
  • tonumber and tostring now have fastcall paths that execute ~1.5x and ~2.5x faster respectively (Fixes #777)
  • Fixed crash in luaL_typename when index refers to a non-existing value
  • Fixed potential out of memory scenario when using string.sub or string.char in a loop
  • Fixed behavior of some fastcall builtins when called without arguments under -O2 to match original functions
  • Support for native code execution in VM is now enabled by default (note: native code still has to be generated explicitly)
  • CodeGen::compile now accepts CodeGen_OnlyNativeModules flag. When set, only modules that have a --!native hot-comment at the top will be compiled to native code

Other Changes

New Type Solver

  • Generic type packs are no longer considered to be variadic during unification
  • Timeout and cancellation now works in new solver
  • Fixed false positive errors around 'table' and 'function' type refinements
  • Table literals now use covariant unification rules. This is sound since literal has no type specified and has no aliases
  • Fixed issues with blocked types escaping the constraint solver
  • Fixed more places where error messages that should've been suppressed were still reported
  • Fixed errors when iterating over a top table type

JIT

  • 'DebugLuauAbortingChecks' flag is now supported on A64
  • LOP_NEWCLOSURE has been translated to IR

New Contributors

0.584

14 Jul 21:22
2181591
Compare
Choose a tag to compare

What's Changed

  • Added support for async typechecking cancellation using a token passed through frontend options
  • Added luaC_enumheap for building debug tools that need a graph of Luau heap

New Type Solver

  • Errors are now suppressed when checking property lookup of error-suppressing unions

JIT

  • Fixed unhandled value type in NOT_ANY lowering
  • Fast-call tag checks will exit to VM on failure, instead of relying on a native fallback
  • Added vector type to the type information
  • Eliminated redundant direct jumps across dead blocks
  • Debugger APIs are now disabled for call frames executing natively
  • Implemented support for unwind registration on macOS 14