Summary
tests/e2e_test.go is the test asserting that a mod survives reverse → generate unchanged. Its
comparison excludes every float64, so no numeric field is actually checked.
Detail
tests/e2e_test.go:96-99:
ignoreUnpredictable := func(k string, v interface{}) bool {
if _, ok := v.(float64); ok {
return true
}
...
}
cmpopts.IgnoreMapEntries applies this at every nesting level, so positions, rotations, scales, and
colors are all excluded throughout the object tree.
Demonstration
Introducing a deliberate corruption that doubles every object position:
r := roundFloat(f, 3) * 2 // in objects/numbersmoother.go smoothPos
$ go test ./tests/...
ok ModCreator/tests 0.592s
The round trip passes with every object in the mod moved. objects/numbersmoother_test.go does
catch the mutation, so the gap is specifically at integration level — where the lossy rounding
composes with reverse/generate.
Why the exclusion is there
Presumably to tolerate float formatting noise. That's what objects/numbersmoother.go already
exists to eliminate, so the two mechanisms overlap.
Suggested fix
Compare floats with a tolerance rather than skipping them, so rounding noise is tolerated but
actual movement isn't.
Filed from an automated code audit. Each item below was reproduced by running the binary or the test suite unless marked as observation-only.
Summary
tests/e2e_test.gois the test asserting that a mod survives reverse → generate unchanged. Itscomparison excludes every
float64, so no numeric field is actually checked.Detail
tests/e2e_test.go:96-99:cmpopts.IgnoreMapEntriesapplies this at every nesting level, so positions, rotations, scales, andcolors are all excluded throughout the object tree.
Demonstration
Introducing a deliberate corruption that doubles every object position:
The round trip passes with every object in the mod moved.
objects/numbersmoother_test.godoescatch the mutation, so the gap is specifically at integration level — where the lossy rounding
composes with reverse/generate.
Why the exclusion is there
Presumably to tolerate float formatting noise. That's what
objects/numbersmoother.goalreadyexists to eliminate, so the two mechanisms overlap.
Suggested fix
Compare floats with a tolerance rather than skipping them, so rounding noise is tolerated but
actual movement isn't.
Filed from an automated code audit. Each item below was reproduced by running the binary or the test suite unless marked as observation-only.