Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync to upstream/release/655 #1563

Merged
merged 225 commits into from
Dec 13, 2024
Merged

Sync to upstream/release/655 #1563

merged 225 commits into from
Dec 13, 2024

Conversation

Vighnesh-V
Copy link
Collaborator

@Vighnesh-V Vighnesh-V commented Dec 13, 2024

New Solver

  • Type functions should be able to signal whether or not irreducibility is due to an error
  • Do not generate extra expansion constraint for uninvoked user-defined type functions
  • Print in a user-defined type function reports as an error instead of logging to stdout
  • Many e-graphs bugfixes and performance improvements
  • Many general bugfixes and improvements to the new solver as a whole
  • Fixed issue with used-defined type functions not being able to call each other
  • Infer types of globals under new type solver

Fragment Autocomplete

  • Miscellaneous fixes to make interop with the old solver better

Runtime

  • Support disabling specific built-in functions from being fast-called or constant-evaluated (Closes Disabling built-in functions #1538)
    • New compiler option disabledBuiltins accepts a list of library function names like "tonumber" or "math.cos"
  • Added constant folding for vector arithmetic
  • Added constant propagation and type inference for vector globals (Fixes Indexing a new Vector3 almost anywhere deoptimizes some vector library operations #1511)
    • New compiler option librariesWithKnownMembers accepts a list of libraries for members of which a request for constant value and/or type will be made
    • libraryMemberTypeCb callback is called to get the type of a global, return one of the LuauBytecodeType values. 'boolean', 'number', 'string' and 'vector' type are supported.
    • libraryMemberConstantCb callback is called to setup the constant value of a global. To set a value, C API luau_set_compile_constant_* or C++ API setCompileConstant* functions should be used.

Co-authored-by: Aaron Weiss [email protected]
Co-authored-by: Andy Friesen [email protected]
Co-authored-by: Aviral Goel [email protected]
Co-authored-by: Daniel Angel [email protected]
Co-authored-by: Jonathan Kelaty [email protected]
Co-authored-by: Hunter Goldstein [email protected]
Co-authored-by: Varun Saini [email protected]
Co-authored-by: Vighnesh Vijay [email protected]
Co-authored-by: Vyacheslav Egorov [email protected]

aatxe and others added 30 commits November 3, 2023 12:47
- Add SUBRK and DIVRK bytecode instructions
    - Enables future performance optimizations

Miscellaneous
- Small performance improvements to new non-strict mode
- Introduce more scripts for fuzzing
- Improcements to dataflow analysis
Co-authored-by: Alexander McCord <[email protected]>
Co-authored-by: Andy Friesen <[email protected]>
Co-authored-by: Aviral Goel <[email protected]>
Co-authored-by: David Cope <[email protected]>
Co-authored-by: Lily Brown <[email protected]>
Co-authored-by: Vyacheslav Egorov <[email protected]>
Vighnesh-V and others added 28 commits October 11, 2024 17:16
> What's new?

* Fragment Autocomplete: a new API allows for type checking a small
  fragment of code against an existing file, significantly speeding up
  autocomplete performance in large files.

> New Solver

* E-Graphs have landed: this is an ongoing approach to make the new type solver
  simplify types in a more consistent and principled manner, based on
  similar work (e.g.: https://egraphs-good.github.io/).
* Adds support for exported / local user type functions.
* Fixes a set of bugs in which the new solver will fail to complete
  inference for simple expressions with just literals and operators.

> General

* It is now an explicit runtime error to `require` a path with a ".lua" or
  ".luau" extension, and the error message will suggest removing the extension.
  ```
  require("path/to/mymodule.lua")
  ```
* Fixes a bug in which whether two `Symbol`s are equal depends on
  whether the new solver is enabled.
 ## What's Changed?

* Optimized the vector dot product by up to 24%
* Allow for x/y/z/X/Y/Z vector field access by registering a `vector` metatable
with an `__index` method
* Fixed a bug preventing consistent recovery from parse errors in table types.
* Optimized `k*n` and `k+n` when types are known
* Allow fragment autocomplete to handle cases like the automatic insertion of
parens, keywords, strings, etc., while maintaining a correct relative positioning

 ### New Solver

* Added support for 'thread' and 'buffer' primitive types in Luau user-defined
type functions
* Allow for `nil` assignment to tables and classes with indexers

---------

Co-authored-by: Aaron Weiss <[email protected]>
Co-authored-by: Andy Friesen <[email protected]>
Co-authored-by: Aviral Goel <[email protected]>
Co-authored-by: Hunter Goldstein <[email protected]>
Co-authored-by: Varun Saini <[email protected]>
Co-authored-by: Vighnesh Vijay <[email protected]>
Co-authored-by: Vyacheslav Egorov <[email protected]>
* Luau: support dead store elimination for STORE_VECTOR instruction
* Fixed hang when Luau class declaration props are incorrectly separated
* Provide properties and a metatable for Luau built-in vector type
* Pick the correct global scope based on the solver
* Conversational AI gets all required scripts as context
* Clip LuauRequireCyclesDontAlwaysReturnAny
* Fix Parentheses in Fragment Autocomplete
* Remove write-only locals in `Luau::getDocumentOffsets`
* The lexer can resume parsing from any arbitrary position
* Added support for 'thread' and 'buffer' primitive types in Luau user-defined type functions

---------

Co-authored-by: Andrew Miranti <[email protected]>
Co-authored-by: Andy Friesen <[email protected]>
Co-authored-by: Hunter Goldstein <[email protected]>
Co-authored-by: Shiqi Ai <[email protected]>
Co-authored-by: Vighnesh Vijay <[email protected]>
Co-authored-by: Vyacheslav Egorov <[email protected]>
Co-authored-by: Yohoo Lin <[email protected]>
* General
- Fix the benchmark require wrapper function to work in Lua
- Fix memory leak in the new Luau C API test

* New Solver
- Luau: type functions should be able to signal whether or not irreducibility is due to an error
- Do not generate extra expansion constraint for uninvoked user-defined type functions
- Print in a user-defined type function should be reported as an error
instead of logging to stdout
- Many e-graphs bugfixes and performance improvements
- Many general bugfixes and improvements to the new solver as a whole
- Fixed issue with Luau used-defined type functions not having all environments initialized
- Infer types of globals under new type solver

* Fragment Autocomplete
- Miscellaneous fixes to make interop with the old solver better

* Runtime
- Support disabling specific Luau built-in functions from being
fast-called or constant-evaluated
- Added constant folding for vector arithmetic
- Added constant propagation and type inference for Vector3 globals

----------------------------------------------------------
9 contributors:

Co-authored-by: Aaron Weiss <[email protected]>
Co-authored-by: Andy Friesen <[email protected]>
Co-authored-by: Aviral Goel <[email protected]>
Co-authored-by: Daniel Angel <[email protected]>
Co-authored-by: Jonathan Kelaty <[email protected]>
Co-authored-by: Hunter Goldstein <[email protected]>
Co-authored-by: Varun Saini <[email protected]>
Co-authored-by: Vighnesh Vijay <[email protected]>
Co-authored-by: Vyacheslav Egorov <[email protected]>
@Vighnesh-V Vighnesh-V merged commit 2e6fdd9 into master Dec 13, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet