Globally reset/rename all trace net names

A few times in KiCad 9 (currently on 9.0.2-9.0.2-0~ubuntu24.04.1) net names seem to randomly jump to the wrong name, especially when interacting with a pour. While I have never been able to figure out the root cause for the net renaming, fixing the issue has proven very annoying.

EDIT: Found the root cause, I am silly, parts moved, but, still, once net names change, they stay stuck.

This is the aftermath of the issue, where there are traces going to pads to parts, and the traces themselves have the wrong net name associated with them. Note how some of the GND traces connect to GND, but many others connect to the wrong pads.

Is there any way to reset the net names for all traces to let the algorithm that assumes trace net names from the pads they connect to re-run?

Sometimes this happens, apart from whatever bug I am running into, for instance when offsetting traces from parts, where I would rather automatically reassign trace net names… So even if I was able to solve the initial issue, I would want to be able to reset all net names anyway. Is there any way to accomplish this?

The net names have already been determined in the schematic.

Edit: To elaborate, the pads have already been assigned net names from the schematic. The tracks take their net names from the pad when you place them. It will not allow you to connect distinct nets unless you override that guardrail. However if you change the schematic and then update, it’s possible due to a pad net change for a track to end up connecting two distinct nets. This will cause a DRC error. In such a situation, you have to resolve the conflict yourself, by deleting the trace, changing an end, etc. KiCad won’t do this for you, it doesn’t know what the correct resolution is.

Copper Tracks already rename themselves depending to the net names of the pads they connect to. To verify, do this experiment:

  1. Draw a track from an existing pad. (The track has the net name of the pad).
  2. Move another footprint so some other pad is now also on the track (KiCad does not prevent DRC violations during footprint movement).
  3. Move the footprint from the first step away from the track.
  4. The track now has the net name of the pad from the 2nd footprint.

But as long as there is still a DRC violation (I.e pads with different net names connected by copper) then KiCad does now what the net name of the copper should be, and it leaves the old one.In an excerpt from your screenshot, there is a pad with net name GND on the left, and the other with net name Net-(D13-A) on the right.

image

Additionally, Via’s can also have a fixed net name This is done for via stitching, and for example for when a via is placed in an area where multiple zones overlap.