OK here is the proof that something is going on with how CHDK is focusing on this camera.
I used >manual focus< upto its max to get the clearest image as i could.
AND i used 2 Different SDHC cards one WITH CHDK and One WITHOUT CHDK for this test.
you can see clearly there is a isue with the Focus here
And the image quality is worse to .....
No CHDK used for this image.

Model = Canon PowerShot SX40 HS
Orientation = top/left
Date Time = 2012-04-21 23:57:56
[Camera]
Exposure Time = 1/200"
F Number = F5.8
ISO Speed Ratings = 160
Exif Version = 30, 32, 33, 30
Date Time Original = 2012-04-21 23:57:56
Date Time Digitized = 2012-04-21 23:57:56
Shutter Speed Value = 7.66 TV
Aperture Value = 5.06 AV
Exposure Bias Value = ±0EV
Max Aperture Value = F5.78
Metering Mode = Pattern
Flash = Flash did not fire, compulsory flash mode
Focal Length = 150.5mm
Maker Note = 3786 Byte
User Comment =
Flashpix Version = Version 1.0
Color Space = sRGB
Exif Image Width = 4000
Exif Image Height = 2248
Sensing Method = One-chip color area sensor
File Source = DSC
Custom Rendered = Normal process
Exposure Mode = Auto exposure
White Balance = Auto white balance
Digital Zoom Ratio = 1x
Scene Capture Type = Normal
and for this image i used CHDK for this image.

Model = Canon PowerShot SX40 HS
Orientation = top/left
Date Time = 2012-04-21 23:56:42
[Camera]
Exposure Time = 1/200"
F Number = F5.8
ISO Speed Ratings = 160
Exif Version = 30, 32, 33, 30
Date Time Original = 2012-04-21 23:56:42
Date Time Digitized = 2012-04-21 23:56:42
Shutter Speed Value = 7.66 TV
Aperture Value = 5.06 AV
Exposure Bias Value = ±0EV
Max Aperture Value = F5.78
Metering Mode = Pattern
Flash = Flash did not fire, compulsory flash mode
Focal Length = 150.5mm
Maker Note = 3786 Byte
User Comment =
Flashpix Version = Version 1.0
Color Space = sRGB
Exif Image Width = 4000
Exif Image Height = 2248
Sensing Method = One-chip color area sensor
File Source = DSC
Custom Rendered = Normal process
Exposure Mode = Auto exposure
White Balance = Auto white balance
Digital Zoom Ratio = 1x
Scene Capture Type = Normal