compat test: NaN checks use Suite.check; host: raise LuaJIT trace / mcode limits (opt-out FORMATS_NO_JIT_TUNE)

This commit is contained in:
4DBug committed 2026-10-31 09:07:40 -05:00
1 parent 15b742cada
commit 56f2423e2c
2 files changed
+9 -2

No files matched your search

+7
View File
@@ -39,5 +39,12 @@ elseif name == "luajit" then
else
host = require("@formats/host/Luau")
end
-- LuaJIT (plain or LÖVE): the big decoders (Opus CELT, H.264, ...) outgrow the default 1000 traces / 8 MB of machine
-- code and fall back to the interpreter (CELT runs about 2.5x faster with these limits). Raising the limits only
-- allows more traces; set _G.FORMATS_NO_JIT_TUNE = true before requiring the library to leave them alone.
if G.jit ~= nil and type(G.jit.opt) == "table" and not G.FORMATS_NO_JIT_TUNE then
pcall(G.jit.opt.start, "maxtrace=8000", "maxmcode=65536")
end
local _ = Err
return host
+2 -2
View File
@@ -280,10 +280,10 @@ do -- float reads: NaNs with a payload come back as the canonical NaN (LuaJIT: n
buffer.writeu32(b, 12, 0xfff12345)
local a, i, c = buffer.readf32(b, 0), buffer.readf32(b, 4), buffer.readf64(b, 8)
t:eq(type(a), "number", "f32 NaN payload is a number")
t:ok(a ~= a, "f32 NaN payload reads as NaN")
t:check(a ~= a, "f32 NaN payload reads as NaN")
t:eq(i, math.huge, "f32 +inf")
t:eq(type(c), "number", "f64 NaN payload is a number")
t:ok(c ~= c, "f64 NaN payload reads as NaN")
t:check(c ~= c, "f64 NaN payload reads as NaN")
buffer.writeu32(b, 8, 0)
buffer.writeu32(b, 12, 0xfff00000)
t:eq(buffer.readf64(b, 8), -math.huge, "f64 -inf")