@Tullio ******
your old passport is always canceled when you replace it. The us consulate punches holes in ours.
BUT
whether the passport is canceled or not has no bearing on whether a visa is valid. In fact visas from some countries can be valid for years longer than some passports.
I know people who have had a year-long multi-entry Non-Immigrant Type visa in their passport who got a new passport, who had their old passport canceled by their consulate when they picked up the new one AND who traveled with BOTH passports when exiting/entering the country getting stamped in and out on the new passport until the visa in the old one expired.