It began as a Tang song sung in seven-character quatrains.
刘禹锡 wrote nine, one of them ending
千淘万漉虽辛苦,
吹尽狂沙始到金 'sifting a thousand times is hard work, but only when the wild sand is blown away do you reach the gold'.
李煜 made it a longer ci form, and
毛泽东 wrote 《
浪淘沙·
北戴河》 (1954) to it. Compare the idiom
大浪淘沙.