Skip to content

Releases: luau-lang/luau

0.611

02 Feb 21:39
67ce75e
Compare
Choose a tag to compare

What's changed?

Native Code Generation

  • Fixed an UAF relating to reusing a hash key after a weak table has undergone some GC.
  • Fixed a bounds check on arm64 to allow access to the last byte of a buffer.

New Type Solver

  • Type states now preserves error-suppression, i.e. local x: any = 5 and x.foo does not error.
  • Made error-suppression logic in subtyping more accurate.
  • Subtyping now knows how to reduce type families.
  • Fixed function call overload resolution so that the return type resolves to the correct overload.
  • Fixed a case where we attempted to reduce irreducible type families a few too many times, leading to duplicate errors.
  • Type checker needs to type check annotations in function signatures to be able to report errors relating to those annotations.
  • Fixed an UAF from a pointer to stack-allocated data in Subtyping's explainReasonings.

Nonstrict Type Checker

  • Fixed a crash when calling a checked function of the form math.abs with an incorrect argument type.
  • Fixed a crash when calling a checked function with a number of arguments that did not exactly match the number of parameters required.

Internal Contributors

Co-authored-by: Aaron Weiss [email protected]
Co-authored-by: Andy Friesen [email protected]
Co-authored-by: Vyacheslav Egorov [email protected]

0.610

27 Jan 03:25
9c588be
Compare
Choose a tag to compare

What's changed?

  • Check interrupt handler inside the pattern match engine to eliminate potential for programs to hang during string library function execution.
  • Allow iteration over table properties to pass the old type solver.

Native Code Generation

  • Use in-place memory operands for math library operations on x64.
  • Replace opaque bools with separate enum classes in IrDump to improve code maintainability.
  • Translate operations on inferred vectors to IR.
  • Enable support for debugging native-compiled functions in Roblox Studio.

New Type Solver

  • Rework type inference for boolean and string literals to introduce bounded free types (bounded below by the singleton type, and above by the primitive type) and reworked primitive type constraint to decide which is the appropriate type for the literal.
  • Introduce FunctionCheckConstraint to handle bidirectional typechecking for function calls, pushing the expected parameter types from the function onto the arguments.
  • Introduce union and intersect type families to compute deferred simplified unions and intersections to be employed by the constraint generation logic in the new solver.
  • Implement support for expanding the domain of local types in Unifier2.
  • Rework type inference for iteration variables bound by for in loops to use local types.
  • Change constraint blocking logic to use a set to prevent accidental re-blocking.
  • Add logic to detect missing return statements in functions.

Internal Contributors

Co-authored-by: Aaron Weiss [email protected]
Co-authored-by: Alexander McCord [email protected]
Co-authored-by: Andy Friesen [email protected]
Co-authored-by: Aviral Goel [email protected]
Co-authored-by: Vyacheslav Egorov [email protected]

0.609

19 Jan 18:43
cdd1a38
Compare
Choose a tag to compare

What's Changed

New Type Solver

  • keyof and rawkeyof type operators have been updated to match final text of the RFC
  • Fixed issues with cyclic type families that were generated for mutable loop variables

Native Code Generation

  • Fixed inference for number / vector operation that caused an unnecessary VM assist

New Contributors

Full Changelog: 0.608...0.609

0.608

12 Jan 22:33
f31232d
Compare
Choose a tag to compare

Old Solver:


  • Fix a bug in the old solver where a user could use the keyword typeof as the name of a type alias.
  • Fix stringification of scientific notation to omit a trailing decimal place when not followed by a digit e.g. 1.e+20 -> 1e+20

New Solver

  • Continuing work on the New non-strict mode
  • Introduce keyof and rawkeyof type function for acquiring the type of all keys in a table or class (luau-lang/rfcs#16)

Co-authored-by: Aaron Weiss [email protected]
Co-authored-by: Alexander McCord [email protected]
Co-authored-by: Andy Friesen [email protected]
Co-authored-by: Aviral Goel [email protected]
Co-authored-by: Lily Brown [email protected]
Co-authored-by: Vyacheslav Egorov [email protected]
Co-authored-by: Vighnesh Vijay [email protected]

0.607

15 Dec 21:33
ff502f0
Compare
Choose a tag to compare

What's changed?

  • Fix up the std::iterator_traits definitions for some Luau data structures.
  • Replace some of the usages of std::unordered_set and std::unordered_map with Luau-provided data structures to increase performance and reduce overall number of heap allocations.
  • Update some of the documentation links in comments throughout the codebase to correctly point to the moved repository.
  • Expanded JSON encoder for AST to support singleton types.
  • Fixed a bug in luau-analyze where exceptions in the last module being checked during multithreaded analysis would not be rethrown.

New type solver

  • Introduce a refine type family to handle deferred refinements during type inference, replacing the old RefineConstraint.
  • Continued work on the implementation of type states, fixing some known bugs/blockers.
  • Added support for variadic functions in new non-strict mode, enabling broader support for builtins and the Roblox API.

Internal Contributors

Co-authored-by: Aaron Weiss [email protected]
Co-authored-by: Alexander McCord [email protected]
Co-authored-by: Andy Friesen [email protected]
Co-authored-by: Vyacheslav Egorov [email protected]

0.606

08 Dec 22:09
c26d820
Compare
Choose a tag to compare

New Solver

  • Improvements to data flow analysis

Native Code Generation

  • Block limit is now per-function instead of per-module

Full Changelog: 0.605...0.606

0.605

06 Dec 19:43
2ea7193
Compare
Choose a tag to compare

What's Changed

  • Include module name for definitions files by @JohnnyMorganz in #861
  • Add SUBRK and DIVRK bytecode instructions to bytecode v5 by @zeux in #1115
  • Added --vector-lib, --vector-ctor and --vector-type options to luau-compile to support code with vectors
  • Experimental implementation of Require by String with Relative Paths and Require by String with Aliases RFCs with support for paths and aliases arrays in .luaurc file. This implementation is under an experimental flag and will be finalized in the upcoming releases.

New Solver

  • Correctness fixes to subtyping
  • Improvements to dataflow analysis

Native Code Generation

  • Added bytecode analysis pass to predict type tags used in operations
  • Fixed rare cases of numerical loops being generated without an interrupt instruction
  • Restored optimization data propagation into the linear block
  • Duplicate buffer length checks are optimized away

Miscellaneous

  • Small performance improvements to new non-strict mode
  • Introduced more scripts for fuzzing Luau and processing the results, including fuzzer build support for CMake

New Contributors

Full Changelog: 0.604...0.605

0.604

17 Nov 18:51
74c5320
Compare
Choose a tag to compare

What's Changed

New Solver

  • New algorithm for inferring the types of locals that have no annotations. This
    algorithm is very conservative by default, but is augmented with some control
    flow awareness to handle most common scenarios.
  • Fix bugs in type inference of tables
  • Improve performance of by switching out standard C++ containers for DenseHashMap
  • Infrastructure to support clearer error messages in strict mode

Native Code Generation

  • Fix a lowering issue with buffer.writeu8 and 0x80-0xff values: A constant
    argument wasn't truncated to the target type range and that causes an
    assertion failure in build.mov.
  • Store full lightuserdata value in loop iteration protocol lowering

New Contributors

Full Changelog: 0.603...0.604

0.603

10 Nov 21:22
c2ba105
Compare
Choose a tag to compare

What's changed?

  • Record the location of properties for table types (closes #802)
  • Implement stricter UTF-8 validations as per the RFC (luau-lang/rfcs#1)
  • Implement buffer as a new type in both the old and new solvers.
  • Changed errors produced by some buffer builtins to be a bit more generic to avoid platform-dependent error messages.
  • Fixed a bug where Unifier would copy some persistent types, tripping some internal assertions.
  • Type checking rules on relational operators is now a little bit more lax.
  • Improve dead code elimination for some if statements with complex always-false conditions

New type solver

  • Dataflow analysis now generates phi nodes on exit of branches.
  • Dataflow analysis avoids producing a new definition for locals or properties that are not owned by that loop.
  • If a function parameter has been constrained to never, report errors at all uses of that parameter within that function.
  • Switch to using the new Luau::Set to replace std::unordered_set to alleviate some poor allocation characteristics which was negatively affecting overall performance.
  • Subtyping can now report many failing reasons instead of just the first one that we happened to find during the test.
  • Subtyping now also report reasons for type pack mismatches.
  • When visiting if statements or expressions, the resulting context are the common terms in both branches.

Native codegen

  • Implement support for buffer builtins to its IR for x64 and A64.
  • Optimized table.insert by not inserting a table barrier if it is fastcalled with a constant.

0.602

03 Nov 23:54
7105c81
Compare
Choose a tag to compare

What's changed?

  • Fixed a bug in type cloning by maintaining persistent types.
  • We now detect imprecise integer literals and flag the imprecision as a lint warning.
  • Parsing is now up to 10% faster due to improved inlining.

New type solver

  • LValues now take into account the type being assigned during constraint generation.
  • Normalization performance has been improved by 33% by replacing the an internal usage of std::unordered_set with DenseHashMap.
  • Normalization now has a helper to identify types that are equivalent to unknown, which is being used to fix some bugs in subtyping.
  • Uses of the old unifier in the new type solver have been eliminated.
  • Improved error explanations for subtyping errors.

Native code generation

  • Introduce instruction and block count limiters for controlling what bytecode is translated into native code.
  • Implement code generation for bit32.byteswap.
  • Marginally speed up method calls for tables via : in some cases.