6 ms·
How do you use AI to learn internals of massive repos? Surely the context is too big and/or it requires opening org code up and I'd never get approval for that.
by polymatter 3y ago
How do you use AI to learn internals of massive repos? Surely the context is too big and/or it requires opening org code up and I'd never get approval for that. What LLM do you use?
- pama 3y agoNot GP. Context length for chatGPT enterprise is 128k tokens. By pasting the repo tree and readme file and maybe a couple entry points you can get help from ChatGPT to find out what parts of the codebase are more useful to you, or you can simply paste a lot of it and ask questions.
- LtWorf 3y ago[flagged]
- matheusmoreira 3y agoI used AI to add features to GCC. Would've taken me way too much time to learn the absolutely gigantic repository without it. Talking to the AI was like having an experienced maintainer guiding me towards the proper path to make the changes I wanted to make.
- LtWorf 3y agoPlease include this information when you send the patch.
- matheusmoreira 3y agoWhy? Would you reject my code because I talked to an AI chat bot in order to learn how to write it? That makes no sense.
- LtWorf 3y agoDo include the information and let the maintainers decide. There might be copyright concerns. Same as you should indicate if a patch you're sending isn't actually from you but you found it somewhere online.
- matheusmoreira 3y agoI have no problem with that. If I do manage to turn this into a patch, the resulting code is gonna be GPL anyway. GPL code -> AI -> me -> GPL code. There is no problem with that picture, even if you think the training of AIs is copyright infringement, which I don't.
- LtWorf 3y agoWhat YOU think is not too relevant though. Copilot's license places all the blame for copyright issues on the users… which means microsoft isn't too confident when they assure everyone that it's fair use.
- matheusmoreira 3y agoYour opinions aren't relevant either. Only the judge's opinion really matters. So far nobody really knows what sort of legal precedents will be established. And I'm pretty cynical but my world view is not yet so hopeless that I would even imagine that the FSF would actually drag me to court to answer to a judge for the crime of asking ChatGPT to explain GCC code to me so that I could try to contribute features to one of the most important and strategic projects in all of free software, despite both actions being rights afforded to me by the GPL itself.
- LtWorf 3y agoI didn't give an opinion. I asked you to present all the relevant information to the people making a decision. And I expressed a fact about a license. The problem is not FSF dragging you to court. The issue is that FSF wants to not be dragged to court by some patent troll.
- matheusmoreira 3y agoI just asked the free version of ChatGPT. > How much do you know about GCC internals? > I have a solid understanding of GCC (GNU Compiler Collection) internals, including its architecture, optimization techniques, and various components such as the front end, middle end, and back end. If you have specific questions or need detailed information, feel free to ask! > Can you break down for me what I have to do to add a builtin function that generates some code following a specific calling convention? > To add a built-in function to GCC that generates code following a specific calling convention, you'll typically follow these steps: ... > I've gotten as far as step 4 already. Got stuck because I'm not familiar with the internal data structures and APIs. Can you show me how such a thing could be accomplished with example code? > Certainly! Here's a simplified example of how you might add a built-in function to GCC that generates code following a specific calling convention. This example assumes you're targeting the x86 architecture, but the principles can be adapted for other architectures. First, let's define... And I just kept asking it questions, drilling down into the complexity until I felt like I understood enough to attempt it on my own. It showed me the files I had to modify and introduced me to the internal compiler APIs needed to accomplish my goal. At some points it generated some insane code but it still saved me a ludicrous amount of time and effort. Sadly it was a lot less useful for QEMU: > How extensive is your knowledge of QEMU source code and its internals? > My knowledge of QEMU source code and its internals is limited. While I can provide some general information and insights based on publicly available knowledge up to January 2022, I may not be able to provide in-depth details or specific code-level explanations.
- password4321 3y agoThanks for filling in the details, this sounds like a great use case.