Thank you, this sounds promising but at the same time I have some doubts. I always thought that CHDK allows to map out all bad pixels it can detect itself, regardless of the Canon map. This helps when the sensor gets older and new ones appear. My experience confirms this. My older Canon shows many hotpixels on JPEGs but CHDK gets rid of them. SX520 had one hotpixel in JPEG from very beginning but CHDK makes all clean.
I'm not sure what you are seeing, but this isn't how the code actually works.
CHDK badpixel.bin only handles pixels the Canon firmware sets to 0. As far as we know, this list is set in the factory, with different maps depending on ISO, temperature etc. badpixel.bin is generated by scanning the entire buffer for 0 valued pixels, and making a list of them (see modules/dng.c raw_init_badpixel_bin). As I mentioned before, this is only done as a speed optimization, because scanning the entire buffer takes a few seconds.
CHDK DNG badpixel.bin does not affect Canon jpeg at all: The Canon jpeg process recognizes 0 value pixels and fixes them automatically.
You can separately generate a text file called badpixel with the coordinates of hot (or otherwise bad) pixels the canon firmware doesn't know about. This can be used to fix hot pixels in both the DNG and Canon jpeg.
If you are processing a DNG, the 0 valued pixels can look "hot" because only one color component is 0 value, giving a pixel that looks saturated with the other colors (e.g. blue is dead, so red+green=yellow pixel)
My RawTherapee cannot work with 1.3 fully for bad pixels, but I think I know how can I solve my problem even without permanently using a map generated with high ISO.
The "hot / dead pixel" option on the raw tab should help quite a bit, but in my experience doesn't totally fix it, especially where there are multiple adjacent bad pixels.
I think that for the photos made with higher ISOs I can have an additional map generated with dcraw and use it for conversions in exceptional situations.
As I mentioned, you can also use chdkptp to fix the bad pixels in the dng file itself, or generate a of pixels for use with raw thereapee.
Another possibility is probably scripting to swap badpixel files of CHDK, but can it work dynamically, or the file is only loaded once at startup?
It's loaded when the DNG 1.1 is enabled, at startup if you have the setting set. It is unloaded when the module is unloaded, which should happen if you turn of DNG completely. You might be able to switch in script with set_config_value, but it wouldn't be very convenient.