Saturday, August 16, 2025

Careful with AI tooling

AI tooling

 Since some period I started working with AI tooling. Mostly Gemini and Co pilot inside Visual Studio. The experience is a bit of mixed feelings about this. Sometimes it has good code completion suggestions. Co pilot's function name suggestion are also very welcome.

 On the other hand the AI is still full of mistakes. Lately I asked Gemini for camera sharpness algorithm. It came up with a good algorithm but the actual OpenCV function calls and parameters were incorrect. I once asked Gemini to get the real sample time from an 'IMediaSample'. It suggest to use the non existing 'GetSampleTime'. There is already a 'GetMediaTime' function but this returns the stream time; i.e. the time since the graph was running and not the time from the start of the video.

 Even worse that sometimes AI tooling can suggest plain bugs. I was implementing a swap of width and height and Co pilot's code complete came up with the following code snippet:

// NOTE: incorrect 
Size sz = ...;
if (sz.GetWidth() < sz.GetHeight())
{
   sz.SetWidth(sz.GetHeight());
   sz.SetHeight(sz.GetWidth());
}

This of course doesn't swap but sets the width and height on the old height value.

 AI tooling can be helpful but are still not on the level to be trusted blindly. They also now help with limited scope; e.g. code blocks; algorithms and functions. I am not aware if they can help in refactoring and extending architecture spanning solutions.

 

No comments:

Post a Comment

Watch out for hypes in ICT

Hypes  ICT has a rich history of hypes where people thought that this would be a panacea for all problems. These hypes lasted for some time ...