Surfaced by the CM14 fused-while review (follow-up to #163).
The max-abs-difference "drift" computation is copy-pasted across two of the new fused-while tests:
# test/emily/compiler_while_test.exs:110-111 and :125-126
Enum.zip(Nx.to_flat_list(fused), Nx.to_flat_list(eval))
|> Enum.reduce(0.0, fn {a, b}, acc -> max(acc, abs(a - b)) end)
with only the tolerance varying. Extract a single helper — e.g. drift(a, b) returning the max abs difference, or assert_all_close(a, b, tol) — so the tests read assert drift(fused, eval) <= 1.0e-5. It's also a near-duplicate of the bit-identical check in equiv/2 (test/emily/compiler_while_test.exs:31), which could share the same helper.
Severity: trivial (test cleanup).
Surfaced by the CM14 fused-while review (follow-up to #163).
The max-abs-difference "drift" computation is copy-pasted across two of the new fused-while tests:
with only the tolerance varying. Extract a single helper — e.g.
drift(a, b)returning the max abs difference, orassert_all_close(a, b, tol)— so the tests readassert drift(fused, eval) <= 1.0e-5. It's also a near-duplicate of the bit-identical check inequiv/2(test/emily/compiler_while_test.exs:31), which could share the same helper.Severity: trivial (test cleanup).