The randomized Hadamard transform needs its sign flips applied before the
transform. Applied afterwards they cannot spread anything: absmax and a
codebook symmetric about zero are both invariant under a sign flip, so the
reconstruction comes back bit-for-bit identical. The documented decorrelation
step was therefore a no-op, and any block carrying an offset or low-frequency
content stayed collapsed into a single Hadamard coefficient - a constant block
round-tripped at cosine 0.611 with a relative L2 error of 1.27, i.e. worse
than returning zeros.
Also make the test suite runnable (it errored out entirely, because pytest
imports the repository root __init__.py as a top-level module and the relative
imports failed) and stop the attention patch from raising AttributeError on
ComfyUI's attn2 path, which does not coerce a None context the way attn1 does.
Co-authored-by: Vyacheslav-Tomashevskiy <Vyacheslav-Tomashevskiy@users.noreply.github.com>