Re: [Hamlib-developer] The use of LLM generated code in Hamlib (long)
Library to control radio transceivers and receivers
Brought to you by:
n0nb
|
From: Mikael N. <mik...@fa...> - 2026-02-28 08:45:29
|
Answering myself with this FSFE article about source code, copyrights and some considerations about AI: Legal Corner: The threshold of originality for copyrightable source code: https://fsfe.org/news/2025/news-20250515-01.en.html This topic is a rabbit hole... 73, Mikael OH3BHX On Sat, Feb 28, 2026, at 01:23, Mikael Nousiainen wrote: > Thanks Nate, enjoy the fine weather and time outside! Here in Finland > spring is still 1-2 months away ... > > I spent some more time reading the Debian mailing list, which has some > good discussion on the genAI topic and found this message, which also > discusses potential accidental plagiarism and code cloning, please have > a look: > > https://lists.debian.org/debian-vote/2026/02/msg00032.html > > More specifically, there are links in that message to the Linux kernel > code generation and assisted coding guidelines: > > - Kernel Guidelines for Tool-Generated Content: > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/generated-content.rst > > - AI Coding Assistants: > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/coding-assistants.rst > > Especially the latter document is rather clearly worded and simple - > and still gives the option for developers to use coding assistants and, > most importantly, emphasizes that contributors must use their best > knowledge and skills to assess the output for potential suspicious code > (regarding cloning/plagiarism/correctness/security/...). > > My personal thoughts about Hamlib and the risk of code cloning and plagiarism: > > Regarding potential license incompatibility and plagiarism caused by AI > code, I think the _vast_ majority of code that should ever end up in > Hamlib is likely to be rather simple in terms of what it does - and > very specific to the "niche" of controlling (ham) radio devices: we're > talking about (mostly) trivial abstraction layers for devices, Hamlib > command parsing, device-specific command generation and response > parsing. Of course, the documentation used for controlling devices must > originate from a freely available/compatible source, but that's what we > trust contributors to do anyway - even if they write all the code > without genAI. > > Anything more advanced - let's say we'd add a custom implementation of > an audio codec for a network rig or maybe a custom, non-trivial > algorithm for doing some data transformations - deserves more attention > and research on the origin of the code and I'd argue it is rather easy > to spot this kind of changes. Here is where the responsibility of the > contributor(s), reviewer(s) and maintainer(s) matters - just like with > any code contribution. > > Additionally, for many cases that need more complex/advanced features, > there are freely available libraries available (ones that have a > compatible license). As an example, FlexRadio rigs seem to support Opus > audio codec in their RX audio streams (in addition to PCM). Here, > instead of trying to "blindly prompt the LLM and generate an Opus > decoder", a good choice would be to add libopus (with MIT-style > license) as an (optional) dependency. The code generated as the result > would only involve calls to libopus, which make the contribution > significantly easier to review. > > What I'm trying to say is that even with code generated by coding > assistants, it's still possible to see whether a piece of code (e.g. a > pull request) consists of what I'd call "trivial" changes and that it > follows Hamlib code conventions/patterns (arguably indicating > negligible risk of license violations or code plagiarism) - or whether > it's a larger or a significantly more complex contribution. > > -> There are ways to use genAI where it's practically impossible to end > up with code output that would cause issues regarding license > compatibility. > > It's also worth thinking for a moment: what can even be interpreted as > plagiarism or a license violation? It has to be something non-trivial > and/or a larger piece of code. I have to admit my knowledge is limited > here. Does anyone here happen to know if there are any reliable sources > for guidelines on what can be considered a "work of art", something > that can be licensed and something that's clearly copyrightable? After > all, source code often contains lots of patterns that are common to > thousands of applications - so simply looking at individual snippets of > code that look similar or even identical doesn't always count. > > Seems I ended up writing here a lot more than I originally intended - > oh well - I'll stop writing/posting now for some days and wait for > everyone to consider their opinions and chime in. > > 73, > Mikael OH3BHX > > On Fri, Feb 27, 2026, at 21:22, Nate Bargmann wrote: >> Thanks, Greg. >> >> I'm not ignoring the discussions! The weather has been too nice and >> with the lengthening of the days, I'm spending more time outside as we >> turn the corner into spring farm work. As an example I need to get back >> outside and put a wheel bearing assembly back together with new bearings >> and seal. >> >> Next week the weather is supposed to be wet so I'll likely have more >> time to sit and collect more thoughts and merge PRs. >> >> 73, Nate >> >> -- >> "The optimist proclaims that we live in the best of all >> possible worlds. The pessimist fears this is true." >> Web: https://www.n0nb.us >> Projects: https://github.com/N0NB >> GPG fingerprint: 82D6 4F6B 0E67 CD41 F689 BBA6 FB2C 5130 D55A 8819 >> >> >> _______________________________________________ >> Hamlib-developer mailing list >> Ham...@li... >> https://lists.sourceforge.net/lists/listinfo/hamlib-developer >> >> Attachments: >> * signature.asc > > > _______________________________________________ > Hamlib-developer mailing list > Ham...@li... > https://lists.sourceforge.net/lists/listinfo/hamlib-developer |