Skip to content

Releases: luau-lang/luau

0.579

02 Jun 19:57
63679f7
Compare
Choose a tag to compare

Analysis Changes

  • When type inference fails to find any matching overload for a function, we were declining to commit any changes to the type graph at all. This was resulting in confusing type errors in certain cases. Now, when a matching overload cannot be found, we always commit to the first overload we tried.

JIT

  • Fix missing variadic register invalidation in FALLBACK_GETVARARGS
  • Add a missing null pointer check for the result of luaT_gettm

0.578

25 May 22:01
271c509
Compare
Choose a tag to compare

Compiler Changes

  • Fixed inlining of functions when they are used to compute their own arguments

Other Changes

  • Fixed gcc warning about uninitialized std::optional

New Type Solver

  • Type families that are not part of a function signature cannot be resolved at instantiation time and will now produce an error. This will be relaxed in the future when we get constraint clauses on function signatures (internally)
  • never type is now comparable
  • Improved typechecking of for..in statements
  • Fixed checks for number type in Add type family
  • Performance was improved, with particularly large gains on large projects

JIT

  • We eliminated the call instruction overhead when native code support is enabled in the VM
  • Small optimizations to arm64 lowering
  • Reworked LOP_GETIMPORT handling to reduce assembly code size
  • Fixed non-deterministic binary output
  • Fixed bad code generation caused by incorrect SSA to VM register links invalidation

0.577

19 May 21:00
721f6e1
Compare
Choose a tag to compare

Analysis Changes

  • Fix a crash that could occur in the presence of a cyclic union. We shouldn't be creating cyclic unions, but we shouldn't be crashing when they arise either.
  • Minor cleanup of luau_precall
  • Internal change to make L->top handling slightly more uniform
  • Optimize SETGLOBAL & GETGLOBAL fallback C functions.
  • Enable compile-time user configuration for LUA_VECTOR_SIZE by @mundusnine in #929

New Type Solver

  • Switch to a greedier but more fallible algorithm for simplifying union and intersection types that are created as part of refinement calculation. This has much better and more predictable performance.
  • Fix a constraint cycle in recursive function calls.
  • Much improved inference of binary addition. Functions like function add(x, y) return x + y end can now be inferred without annotations. We also accurately typecheck calls to functions like this.
  • Many small bugfixes surrounding things like table indexers
  • Add support for indexers on class types. This was previously added to the old solver; we now add it to the new one for feature parity.

JIT

  • Add CodeGen C API by @khvzak in #931
  • Fuse key.value and key.tt loads for CEHCK_SLOT_MATCH in A64
  • Implement remaining aliases of BFM for A64
  • Implement new callinfo flag for A64
  • Add instruction simplification for int->num->int conversion chains
  • Don't even load execdata for X64 calls
  • Treat opcode fallbacks the same as manually written fallbacks

Other Changes

  • The syntax to the luau-reduce commandline tool has changed. It now accepts a script, a command to execute, and an error to search for. It no longer automatically passes the script to the command which makes it a lot more flexible. Also be warned that it edits the script it is passed in place. Do not point it at something that is not in source control!

New Contributors

Full Changelog: 0.576...0.577

0.576

12 May 18:30
97965c7
Compare
Choose a tag to compare

Analysis Changes

  • ClassType can now have an indexer defined on it. This allows custom types to be used in t[x] expressions.
  • Fixed how unification is performed for two optional types a? <: b?, previously it might have unified either 'a' or 'b' with 'nil'. Note that this fix is not enabled by default yet (see the list in ExperimentalFlags.h)

Other Changes

  • Add missing include for integer types by @Jan200101 in #925
  • Use correct globalScope in on demand type checker by @JohnnyMorganz in #923
  • Fixed search for closest executable breakpoint line. Previously, breakpoints might have been skipped in else blocks at the end of a function

New type solver

A concept of 'Type Families' has been introduced.
Type families can be thought of as type aliases with custom type inference/reduction logic included with them.
For example, we can have an Add<T, U> type family that will resolve the type that is the result of adding two values together.
This will help type inference to figure out what 'T' and 'U' might be when explicit type annotations are not provided.
In this update we don't define any type families, but they will be added in the near future.
It is also possible for Luau embedders to define their own type families in the global/environment scope.

Additional type solver changes:

  • Fixed scope used to find out which generic types should be included in the function generic type list
  • Fixed a crash after cyclic bound types were created during unification

JIT

  • Use of arm64 target on M1 now requires macOS 13
  • Entry into native code has been optimized. This is especially important for coroutine call/pcall performance as they involve going through a C call frame
  • LOP_LOADK(X) translation into IR has been improved to enable type tag/constant propagation
  • arm64 can use integer immediate values to synthesize floating-point values
  • x64 assembler removes duplicate 64bit numbers from the data section to save space
  • Linux perf can now be used to profile native Luau code (when running with --codegen-perf CLI argument)

New Contributors

0.575

05 May 22:50
0014905
Compare
Choose a tag to compare

What's Changed

  • Improve the type for os.date using overloads by @JohnnyMorganz in #874
  • Fix grammar issues by @JohnnyMorganz in #915
  • Luau.Analyze.CLI now has experimental support for concurrent type checking. Use the option -jN where N is the number of threads to spawn.
  • Improve typechecking performance by ~17% by making the function Luau::follow much more efficient.

Full Changelog: 0.574...0.575

New solver

  • Improve the reliability of function overload resolution
  • More work toward supporting parallel type checking
  • Fix a bug in inference of == and ~= which would erroneously infer that the operands were boolean
  • Better error reporting when for...in loops are used incorrectly.

JIT

  • Fix unwind registration when libunwind is used on Linux
  • Fixed replaced IR instruction use count
  • Convert X64 unwind info generation to standard prologue
  • Implement A64 unwind info support for Dwarf2
  • Live in/out data for linear blocks is now created
  • Add side-exit VM register requirements to the IR dump
  • Reuse ConstPropState between block chains
  • Remove redundant base update

0.574

28 Apr 20:03
4b267aa
Compare
Choose a tag to compare

API Changes

  • With work started on read-only and write-only properties, Property::type member variable has been replaced with TypeId type() and setType(TypeId) functions.
  • New LazyType unwrap callback now has a void return type, all that's required from the callback is to write into unwrapped field.

Other Changes

New type solver

  • Work has started to support read-only (#77) and write-only (#79) properties
  • Refinements are no longer applied on l-values, removing some false-positive errors
  • Improved overload resolution against expected result type
  • Frontend::prepareModuleScope now works in the new solver
  • Cofinite strings are now comparable

JIT

  • Fixed MIN_NUM and MAX_NUM constant fold when one of the arguments is NaN
  • Added constant folding for number conversions and bit operations
  • Value spilling and rematerialization is now supported on arm64
  • Improved FASTCALL2K IR generation to support second argument constant
  • Added value numbering and load/store propagation optimizations
  • Added STORE_VECTOR on arm64, completing the IR lowering on this target

0.573

21 Apr 22:50
fe7621e
Compare
Choose a tag to compare

Analysis

  • Work toward affording parallel type checking
    • The interface to LazyType has changed: LazyType now takes a second callback that is passed the LazyType& itself. This new callback is responsible for populating the field TypeId LazyType::unwrapped. Multithreaded implementations should acquire a lock in this callback.
    • Modules now retain their humanReadableNames. This reduces the number of cases where type checking has to call back to a ModuleResolver.
  • Add prefix and name location to AstTypeReference by @JohnnyMorganz in #902
  • Add timing info to the Luau REPL compilation output

New type solver

  • Thread ICEs (Internal Compiler Errors) back to the Frontend properly
  • Refinements are no longer applied to lvalues
  • More miscellaneous stability improvements

JIT

  • Implement register spilling/restore for A64
  • Correct Luau IR value restore location tracking
  • Fixed use-after-free in x86 register allocator spill restore
  • Use btz for bit tests
  • Finish branch assembly support for A64
  • Codesize and performance improvements for A64
  • The bit32 library has been implemented for arm and x64

0.572

14 Apr 18:23
d141a5c
Compare
Choose a tag to compare

Analysis Changes

  • Fixed exported types not being suggested in autocomplete
  • T... is now convertible to ...any #767
  • Fixed issue with T? not being convertible to T | T or T? (sometimes when internal pointer identity is different)
  • Fixed potential crash in missing table key error suggestion to use a similar existing key

API changes

  • Add lua_getuserdatadtor by @petrihakkinen in #870
  • lua_topointer now returns a pointer for strings

For extra notes about internal development, you can read #899

0.571

07 Apr 21:56
ba67fb2
Compare
Choose a tag to compare

What's Changed

  • table.sort was improved further. It now guarentees N*log(N) time complexity in the worst case.
  • Fix #880

Full Changelog: 0.570...0.571

0.570

31 Mar 18:49
1212fda
Compare
Choose a tag to compare

What's Changed