5 ms·
Is reading the source code reverse engineering?
by petters 1y ago
Is reading the source code reverse engineering?
- bthornbury 1y agoI'm pretty sure it's called "reading the code". That said, it is difficult enough in its own right.
- charles_irl 1y agoHey, one of the authors here! Reductively, software engineering means taking an idea and mapping it into code. So one form of "reverse" engineering would be taking the code and extracting the ideas. That's what we did here. Because the source is public, there's quite a lot to work with from the start -- the warp specializations are named and there are helpful comments in many places. But for many components, we didn't have much. Maybe the clearest case of "reverse engineering" explained in the post is with the cubic approximation for the rational part of the exponentiation. That required staring at some inline assembly and doing math.
- metadat 1y agoI've never heard of this definition of reverse engineering -- when one has the unobfuscated actual source code I'd usually call it: reading the code, or something like summarization. Not trying to be uncharitable, I found your article informative. Reverse engineering has historically been reserved for cases where there is an adversial aspect, as in binaries or server APIs. Anyhow, Cheers and thank you, sincerely.
- Zacharias030 1y agoThat time when I reverse engineered JRR Tolkien‘s Lord of the rings from symbols engraved on dead trees. Took me three summers…
- pests 1y agoHaving the source code and understanding how it works is two different things, especially when running on state of the art hardware. If I had just read the source I would not have gained as much knowledge as this article taught me. Where did this extra info come from? They read the source too, but then they did something more. I wouldn’t call it summarization either, as again any summary I wrote about the code would pale in comparison.
- VBprogrammer 1y agoI think "explained" is a reasonable term for this. If I remember correctly there where books of the form "The Linux Source Code Explained". Certainly I can't get on board with reverse engineered.
- heavyset_go 1y agoYou've never had to reverse engineer the thinking and ideas that went behind code written by someone else/you a year ago?
- greatgib 1y agoNo, because so far you "engineered" nothing. You just studied it, tried to understand it, and explain or teach it. If you had reverse engineered it, you would have tried to "recreate something" that does not exist to do the same. So, if you have a binary code, you recreate the source code that in theory could allow you to recreate the binary. If you have the source code, I guess that would be when you are missing pieces of info that allows you to run this code like it is done by others...
- hackinthebochs 1y agoYou guys are being obtuse. Engineering is turning a spec into a more technical artifact, whether that's source code, machine code, physical hardware or something else. Reverse engineering is then reserving the process of engineering, recovering the semantic artifact from the engineering artifact. That the OP is using the term in the sense of recovering the semantic insights from the cuda kernels is a fine application of the concept.
- heavyset_go 1y agoDisagree that reverse engineering necessarily requires something to be recreated. For example, simple hardware reversing can just be learning what, how and why something works, you don't need to "recreate" anything other than ideas.
- unnah 1y agoThat is the traditional explanation of why it is called reverse engineering. The term originated in hardware engineering. When it was originally applied to software, it was common to create requirements documents and design documents before coding, even if the actual process did not strictly follow the "waterfall" idea. Thus it was natural to call the process of producing design documents from undocumented software "reverse engineering". These days coding without any formal design documents is so common that it seems the original meaning of reverse engineering has become obscured.
- knome 1y agoWhat time period and area did you come across this usage? As I ever saw it used, 'reverse engineering' generally referred to creating docs from executables or watching network protocols rather than from source.
- unnah 1y agoBack in the 1990's. As an example, back then the Rational Rose design software had a feature to generate UML diagrams from existing source code, and it was called "reverse engineering". https://en.wikipedia.org/wiki/IBM_Rational_Rose https://en.wikipedia.org/wiki/IBM_Rational_Rose
- cmrx64 1y agoit’s more properly just software archaeology; recovering design intent from artifacts https://en.m.wikipedia.org/wiki/Software_archaeology https://en.m.wikipedia.org/wiki/Software_archaeology
- varispeed 1y agoI reverse engineered above comment by reading it and extracting the idea.
- billy99k 1y agoIt's the 'hacker' argument all over again.
- saagarjha 1y agoI have to say this is kind of funny given that you also had this in the blog post: > cudnn kernels are closed source, so Jensen only knows what’s going on in there.
- edunteman 1y agoI'd argue that understanding disassembled assembly could be considered reverse engineering, which would logically extend to source code unless we draw the line at compilation
- taneq 1y agoWe kinda... do? Draw the line there, I mean. Reverse engineering, as I've always heard the term used, is taking the final artifact and working backwards to infer the original design, and ideally some of the reasons for the decisions made. If you take a shipped binary, disassemble/decompile it, figure out what the variables mean and how it all works, that's reverse engineering. It's the equivalent of taking a mechanism, pulling it apart, and figuring out the cause and effect of how it works, to the extent that you can duplicate it and even modify the functionality. Starting from high level source code is like starting from engineering drawings or the CAD model. You've already been handed most or all of the info that reverse engineering is attempting to recover.
- hackinthebochs 1y agoSource code doesn't inherently contain the "why" of the operations. Code itself is an engineering artifact, so recovering the why is a kind of reverse engineering.
- LoganDark 1y agoReading the source code is one thing, understanding it is another. Reverse engineering source code can be as simple as figuring out the original meaning/intent behind the code when it isn't immediately obvious or documented.
- lelanthran 1y ago> Reading the source code is one thing, understanding it is another. Reverse engineering source code can be as simple as figuring out the original meaning/intent behind the code when it isn't immediately obvious or documented. I would get some pretty weird looks if I changed my CV to replace "maintained legacy application that I did not write" with "reverse engineering". Similarly, I would get instant hoots of laughter if told my dev managers over the last 28 years that I reversed engineered the legacy application I was hired to work on. I mean, I get what you're saying, but when you use the term "reverse engineering" in the context of software, you're just going to confuse everyone who already knows what it means.
- magicalhippo 1y agoSo, what would you call studying the code for the fast inverse square root[1] in the Quake source code so you truly understand it, to the point you can explain what it does to someone else without invoking words like "magic" or similar? Because I'm pretty sure most devs would not just read the code and go "ah yes, of course". [1]: https://en.wikipedia.org/wiki/Fast_inverse_square_root#Overview_of_the_code https://en.wikipedia.org/wiki/Fast_inverse_square_root#Overv...
- bongodongobob 1y agoReverse engineering has always been without code. I didn't reverse engineer a project at work by reading the code. I literally just read the code. How is reading code you didn't write reverse engineering?
- baq 1y agoCode doesn’t tell you why it is like it is. Code is just the what. Engineering is the why and why not.
- bongodongobob 1y agoThat's just learning the codebase. Reverse engineering is absolutely not that. Why is this even in question.
- quotemstr 1y agoLearning codebases involves a significant amount of reverse engineering! You have to get into the head of the authors and make guesses about why things work the way they do.
- bongodongobob 1y agoYeah, that's just understanding the code. Reverse engineering is figuring out the code when you don't have it.
- SteveJS 1y agoThe content is good. I’m glad i ignored a similar negative reaction to the reverse engineering framing.