]> git.codecow.com Git - nano25519.git/commitdiff
Fix test that looks for specific code strings.
authorChris Duncan <chris@codecow.com>
Fri, 23 Oct 2026 17:54:10 +0000 (10:54 -0700)
committerChris Duncan <chris@codecow.com>
Fri, 23 Oct 2026 17:54:10 +0000 (10:54 -0700)
test/mutants.mjs

index 23eed95ed504e7cc36d7eb9580c4a52354da9150..2dd8fde2e1b74257214456acc84d3cb13947878f 100644 (file)
@@ -48,7 +48,7 @@ const mutants = [
        { guard: FE_ISZERO, from: 'const d = v128.or(t0, t1)', to: 'const d = t0', why: 'tests only the low half' },
        { guard: FE_ISZERO, from: 'const d = v128.or(t0, t1)', to: 'const d = v128.xor(t0, t1)', why: 'combines the halves with xor, so equal bytes 16 apart cancel' },
        { guard: FE_ISZERO, from: 'const d = v128.or(t0, t1)', to: 'const d = v128.and(t0, t1)', why: 'combines the halves with and' },
-       { guard: FE_ISZERO, from: 'v128.load(changetype<usize>(t_u8x32), 16)', to: 'v128.load(changetype<usize>(t_u8x32), 15)', why: 'loads the high half a byte early, so byte 31 is never tested' },
+       { guard: FE_ISZERO, from: 'v128.load(changetype<usize>(t_u8x32), 1 << 4)', to: 'v128.load(changetype<usize>(t_u8x32), 15)', why: 'loads the high half a byte early, so byte 31 is never tested' },
        { guard: FE_ISZERO, from: 'return u8(v128.any_true(d)) ^ 1', to: 'return u8(v128.any_true(d))', why: 'inverts its result' },
        { guard: FE_ISZERO, in: 'fe_reduce', from: 'q = (f9 + q) >> 25', to: 'q = (f9 + q) >> 26', why: 'reduces with a 26-bit shift where the top limb is 25 bits, so loose limbs past 2²⁵⁵ come out wrong' },
 ]