On Wed, Oct 08, 2025 at 08:35:39AM +0200, Paolo Bonzini wrote: > In this version, the types were added mostly with the RightTyper tool > (https://github.com/RightTyper/RightTyper), which uses profiling to detect > the types of arguments and return types at run time. However, because > adding type annotations is such a narrow and verifiable task, I also developed > a parallel version using an LLM, to provide some data on topics such as: > > - how much choice/creativity is there in writing type annotations? > Is it closer to writing functional code or to refactoring? > > - how does AI output for such mechanical transformations compare to other > automated tools, whose output is known not to be copyrightable? > > - what is the kind of time saving that the tool can provide? > > - how effective is an LLM for this task? Is the required human help a > pain to provide, or can the human keep the fun part for itself?
Here are my thoughts: - Type annotations are probably not copyrightable. Although I think AI output contributions should be allowed for non-copyrightable work, I understand the slippery slope argument. Also, at QEMU Summit the consensus was to give it some time and then revisit the AI policy next year. I think we should stick to that so that the QEMU community has time to consider other scenarios involving AI. Then we can make a policy change next year that combines the new items that have come up rather than making a series of shifting policy changes over the coming months. That will make it simpler for everyone to understand and follow the policy correctly. - Markus pointed out why generating them automatically may not result in the same quality as manually-written annotations because the AI doesn't have the context that is missing from the code itself. It's the same reason why generating API docs using AI produces something resembling documentation, but it consists of obvious stuff apparent from the code itself and not the context that only the author can communicate about the intended use of the API. The difference between manually-written type hints and AI-generated ones is probably less significant than with API documentation though, so I think they are sufficiently valuable and high quality enough to merge. Stefan
signature.asc
Description: PGP signature
