Skip to content

Sync to upstream/release/713#2308

Merged
hgoldstein merged 14 commits into
masterfrom
merge
Mar 20, 2026
Merged

Sync to upstream/release/713#2308
hgoldstein merged 14 commits into
masterfrom
merge

Conversation

@hgoldstein

@hgoldstein hgoldstein commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

Hey folks! Another week another Luau release 🙂

Analysis

  • InsertionOrderedMap has been moved from the Analysis library to Common.
  • Subtyping has been rewritten to avoid extra allocations: there should be no behavioral change from this effort, only somewhat lower memory pressure.
  • Fixed a bug where analyzing comparing a value that is too complex to type check against nil may cause the type checker to crash.
  • pcall now handles functions that return no values, for example:
local mod = require('mymodule')

-- Previously, we would error claiming that we only expect one value on the left-hand-side.
-- Now, there is no error and `result` is typed as `unknown`.
local success, result = pcall(function()
    mod.dothething()
end)

Compiler

const a = 42
-- The following will now fail to compile.
function a()
end
  • Table literal "shapes" can now encorporate constant values at bytecode compile time. We store the shape of constant tables if all their keys are constants, which allows slightly faster insertion when building said literals (we can preallocate a table in a particular shape). Now, we can also store constant values, making construction a single bytecode. For example:
-- This snippet ...
return { x = 1, y = 2 }
-- ... used to compile to bytecode like ...
DUPTABLE R0 2
LOADN R1 1
SETTABLEKS R1 R0 K0 ['x']
LOADN R1 2
SETTABLEKS R1 R0 K1 ['y']
RETURN R0 1
-- ... and now compiles to something like ...
DUPTABLE R0 4
RETURN R0 1

Runtime

  • Introduced a @debugnoinline attribute behind a debug flag. We do not actively plan to ship this but have added it to help test compiler and runtime optimizations.
  • Fixed a bug where setting a breakpoint in a natively compiled function could crash on ARM64.
  • NCG: The data section of generated code is no longer allocated as executable, preventing a class of potential exploits.

Co-authored-by: Andy Friesen afriesen@roblox.com
Co-authored-by: Ariel Weiss arielweiss@roblox.com
Co-authored-by: David Cope dcope@roblox.com
Co-authored-by: Hunter Goldstein hgoldstein@roblox.com
Co-authored-by: Ilya Rezvov irezvov@roblox.com
Co-authored-by: Tom Schollenberger tschollenberger@roblox.com
Co-authored-by: Vighnesh Vijay vvijay@roblox.com
Co-authored-by: Karim Mouline kmouline@roblox.com

@hgoldstein hgoldstein marked this pull request as ready for review March 20, 2026 20:07
@hgoldstein hgoldstein merged commit b37af21 into master Mar 20, 2026
7 checks passed
@PhoenixWhitefire

Copy link
Copy Markdown
Contributor

lgtm

Autoplay1999 pushed a commit to Autoplay1999/luau that referenced this pull request Jun 30, 2026
Hey folks! Another week another Luau release 🙂 
# Analysis

* `InsertionOrderedMap` has been moved from the `Analysis` library to
`Common`.
* Subtyping has been rewritten to avoid extra allocations: there should
be no behavioral change from this effort, only somewhat lower memory
pressure.
* Fixed a bug where analyzing comparing a value that is too complex to
type check against `nil` may cause the type checker to crash.
* `pcall` now handles functions that return no values, for example:
```luau
local mod = require('mymodule')

-- Previously, we would error claiming that we only expect one value on the left-hand-side.
-- Now, there is no error and `result` is typed as `unknown`.
local success, result = pcall(function()
    mod.dothething()
end)
```

# Compiler

* Fixed a bug in `const` where function statements were excluded from
const checks. Fixes luau-lang#2282
```luau
const a = 42
-- The following will now fail to compile.
function a()
end
```
* Table literal "shapes" can now encorporate constant values at bytecode
compile time. We store the shape of constant tables if all their keys
are constants, which allows slightly faster insertion when building said
literals (we can preallocate a table in a particular shape). Now, we can
also store constant values, making construction a single bytecode. For
example:
```luau
-- This snippet ...
return { x = 1, y = 2 }
```
```luau
-- ... used to compile to bytecode like ...
DUPTABLE R0 2
LOADN R1 1
SETTABLEKS R1 R0 K0 ['x']
LOADN R1 2
SETTABLEKS R1 R0 K1 ['y']
RETURN R0 1
```
```luau
-- ... and now compiles to something like ...
DUPTABLE R0 4
RETURN R0 1
```

# Runtime
* Introduced a `@debugnoinline` attribute behind a debug flag. We do not
actively plan to ship this but have added it to help test compiler and
runtime optimizations.
* Fixed a bug where setting a breakpoint in a natively compiled function
could crash on ARM64.
* NCG: The data section of generated code is no longer allocated as
executable, preventing a class of potential exploits.

---

Co-authored-by: Andy Friesen <afriesen@roblox.com>
Co-authored-by: Ariel Weiss <arielweiss@roblox.com>
Co-authored-by: David Cope <dcope@roblox.com>
Co-authored-by: Hunter Goldstein <hgoldstein@roblox.com>
Co-authored-by: Ilya Rezvov <irezvov@roblox.com>
Co-authored-by: Tom Schollenberger <tschollenberger@roblox.com>
Co-authored-by: Vighnesh Vijay <vvijay@roblox.com>
Co-authored-by: Karim Mouline <kmouline@roblox.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Const bindings can still be mutated

5 participants