In a LUA_VECTOR_SIZE 3 build, a surplus 4th argument to vector.create affects ==
at -O2 but not at -O0/-O1.
print(vector.create(1, 2, 3) == vector.create(1, 2, 3, 9))
luau -O0 --> true
luau -O1 --> true
luau -O2 --> false
Both sides print 1, 2, 3, and .x/.y/.z compare equal at every level.
Two more observations that may help narrow it:
- At
-O2, == and rawequal disagree on the same pair:
a == b is false while rawequal(a, b) is true.
- It only affects constant-folded operands. With
local function mk(x,y,z) return vector.create(x,y,z) end,
mk(1,2,3) == vector.create(1,2,3,9) is true at -O2.
Rebuilding the same source with LUA_VECTOR_SIZE 4 gives false at all three levels,
which is correct for a 4-wide build. The divergence is 3-wide only.
tests/conformance/vector.luau passes unmodified at -O0/-O1/-O2.
In a
LUA_VECTOR_SIZE 3build, a surplus 4th argument tovector.createaffects==at
-O2but not at-O0/-O1.Both sides print
1, 2, 3, and.x/.y/.zcompare equal at every level.Two more observations that may help narrow it:
-O2,==andrawequaldisagree on the same pair:a == bisfalsewhilerawequal(a, b)istrue.local function mk(x,y,z) return vector.create(x,y,z) end,mk(1,2,3) == vector.create(1,2,3,9)istrueat-O2.Rebuilding the same source with
LUA_VECTOR_SIZE 4givesfalseat all three levels,which is correct for a 4-wide build. The divergence is 3-wide only.
tests/conformance/vector.luaupasses unmodified at-O0/-O1/-O2.