Native codegen failing in studio playtest and live servers

Recently, I noticed that code with the native comment (and attribute) is running at the same speed as interpreted O2.

Code used for testing:

--!optimize 2

local function sumComponentsSlow(v)
	return v.X + v.Y + v.Z
end
local function sumComponentsFast(v: vector)
	return v.X + v.Y + v.Z
end

local N = 10_000_000
x = 1
local v = vector.create(x, x, x)

local t0 = os.clock()
local sumA = 0
for i = 1, N do
	sumA += sumComponentsSlow(v)
end
local slowTime = os.clock() - t0

local t1 = os.clock()
local sumB = 0
for i = 1, N do
	sumB += sumComponentsFast(v)
end
local fastTime = os.clock() - t1

print("untyped", slowTime)
print("typed", fastTime)
print(version())

Plain O2 results

With native hotcomment

Executing via luau.exe (0.729) with --codegen option

System Specs:
OS: Microsoft Windows 11
CPU: AMD Ryzen 7 5800X 8-Core Processor @ 3801 MHz
RAM: 32 GB

5 Likes

yeah im having the same issue in studio

1 Like

I’ve noticed the issue on my end too on the recent studio release!
I tried some of these examples myself and also noticed the same failures

On Hao’s examples:
image

Testing using buffers since they’re known to get a huge boost from native/codegen:

(optimize only)
image
(codegen)
image

System Specs:
OS: Microsoft Windows 10
CPU: Intel Core I3-6100u
RAM: 4 GB

Thank you for the reports.

Unfortunately, we found an issue in codegen which required it to be temporarily disabled.
It will be restored after an update next week.

2 Likes

Oh thanks for the information then, was the issue roblox related only or is it also an issue with the luau release itself?

Just asking since i’ve been making my own edits to my luau package outside of roblox and that native was clearly not disabled in latest releases there

We do not have any direct influence over the fast flag configuration you use in standalone Luau, or any non-Roblox Luau runtime. So, there isn’t a mechanism by which we could dynamically disable it.

1 Like

Was this fixed for release 731, and if not will it be fixed on July 29th? I am not seeing it in the update notes and I am unable to test as I have been busy, but I know it was causing issues for some of my QA testers.

Late response, but it was fixed on July 23rd.

1 Like