test: pin what a mutation audit could break in silence on the default wire #101
No reviewers
Labels
No labels
area:defold
area:docs
area:infra
area:protocol
area:testing
kind:bug
kind:chore
phase:breadth
phase:core
phase:hardening
phase:slice
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
yuris/spacetimedb-defold!101
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "wire-pins"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The schema walker got a mutation audit when it landed; the two modules that actually decode every byte of the default wire had not. Fifty-three single-line bugs, applied one at a time, suite run after each, tree restored and md5-verified between.
stdb/bsatn.luastdb/protocol_v2.luaWhat was actually wrong
f32 tie rounding was unpinned. Replacing
round_evenwith round-half-up, or with a plain floor, passed the entire suite. IEEE 754 rounds half to even, and above 2^24 floats step by 2, so an odd integer sits exactly halfway between two representable values: 16777217 must land on 16777216 and 16777219 on 16777220, both even mantissas. Vectors derived from the format, not read back out of the codec — which is also this test file's stated rule.A test that could not tell two failures apart. Removing the
FixedSize(0)guard does not make that frame decode. It makesfloor(#data / 0)the row count, and the loop appends an empty slice until Lua runs out of table: 23 seconds, then an overflow error, which the bareassert_erroraccepted as a pass. On a device that is a hung frame, not a rejected message. The case now asserts the guard's own text.The hex writer's leading-zero strip. Without it a value padded wider than its type is rejected instead of accepted. The readers never emit that form; a hand-written literal does.
Not a gap
v = floor(v)inWriter:u64is an equivalent mutant:string.chartruncates a non-integer identically on 5.1 and LuaJIT, verified over 22 value/method pairs with zero byte differences. It gets a comment saying what it is for — a 5.3+ host raises instead — rather than a test that cannot fail.Verification
Every new assertion proven failable by the mutation it targets, then reverted green.
11 passed, 0 failed;stylua --check stdb dev/test stdb/spacetimedb.editor_scriptclean. No production behaviour changed: two test files plus one comment.