Consolidate quantizable-layer variable serialization; add round-trip tests (#23369)