The first hint of the looming rebellion came from the lips of Hao Yang, 17, as he practiced ballroom dancing outside Stuyvesant High School on Wednesday morning, the first licks of sunlight casting a long shadow that made a perfect dance partner on the wall behind him.

“It’s Slutty Wednesday,” said Hao, a senior from Brooklyn, who is headed to Carnegie Mellon University to study electrical engineering.

“Today.”

Within minutes, a demonstration materialized on West Street, in Lower Manhattan, opposite the entrance to Stuyvesant, one of New York City’s most prestigious public high schools: Scores of giddy students, who had mostly come up from the nearby subway portals, were massing under a tree.

Some peeled off sweatshirts, revealing tank tops and spaghetti-strap blouses. One boy stepped over to the tree’s trunk, took off his pants and emerged in shorts whose hem he immediately began rolling up along his thigh.