Computer Program Fixes Old Code Faster Than Expert Engineers
An anonymous reader writes: Less than two weeks after one group of MIT researchers unveiled a system capable of repairing software bugs automatically, a different group has demonstrated another system called Helium, which "revamps and fine-tunes code without ever needing the original source, in a matter of hours or even minutes." The process works like this: "The team started with a simple building block of programming that's nevertheless extremely difficult to analyze: binary code that has been stripped of debug symbols, which represents the only piece of code that is available for proprietary software such as Photoshop. ... With Helium, the researchers are able to lift these kernels from a stripped binary and restructure them as high-level representations that are readable in Halide, a CSAIL-designed programming language geared towards image-processing. ... From there, the Helium system then replaces the original bit-rotted components with the re-optimized ones. The net result: Helium can improve the performance of certain Photoshop filters by 75 percent, and the performance of less optimized programs such as Microsoft Windows' IrfanView by 400 to 500 percent." Their full academic paper (PDF) is available online.
Software fixes bugs! Oh, wait....
Does that mean the program responds in negative time? even before you click the button it's already done what you wanted? Sounds impractical...
So, hopefully you are doing this on stuff so old you don't have to worry about your support contract, hopefully you can figure out how to legally do this without violating someone's copyright (it's a derivative work), and hopefully you don't introduce any new errors or security holes.
This sounds cool, but you're in a gray area in terms of legality I should think.
I guess if it works it's cool, I'm just not clear on how you can prove that the two are 100% the same.
Lost at C:>. Found at C.
I always understood bit-rot to be data degrading on a storage medium. Not sub-optimal cruft code from way back.
This kind of application has been ported to about half a dozen different operating systems. i use it on a regular basis but for those not familiar I find it works best with legacy PHP. the "rm" command (or as its known in windows "del") uses an advanced algorythm to determine the target codes age, total number of lines, and any optimizations that are required in order to make it fully web 4.0 SOAP, ROPE, and DOPE compliant. It then quickly converts the code to the updated version by changing the physical structure of the space it occupies on the disk. My coworkers always seem amazed when they see me break out my legacy optimizer. "What have you done?!" they exclaim, baffled at my efficiency. "holy crap do you know how important that was?!?" they remark in awe
Good people go to bed earlier.
From the paper (final section)
Well shit, if only we had that.
The paper is not about automatic code optimisation in general. This program only fixes image-related algorithms (which most likely involve simple & repetitive modifications).
In fact, there are quite a few references to Adobe in the associated links and the paper is signed by two Adobe guys. Thus, I guess that it is mostly focused on Adobe products, like Photoshop; and might not even be able to deal with any image-processing algorithm.
PS: is it because of the summer-period lack of news or Slashdot is planning to make the move to pure sensationalism? Because a big proportion of the titles lately are quite unclear (to say it softly).
Custom Solvers 2.0 = Alvaro Carballo Garcia = varocarbas.
The article says the problem to address is "bit-rot". So, they only had one copy of the program which degraded due to failure of the storage media and they have to patch it? No. From the context that does not seem to be the case, although that is the only meaning of "bit-rot" that I know.
In any case the article seems to continue with the problem that old code optimized for old hardware has to be patched now and then to improve performance. Helium seems to be a tool for that, working directly on binaries, but it seems to be a very specialized tool, working only on "stencil kernels", which is not clear from the summary.
Violence is the last refuge of the incompetent. Polar Scope Align for iOS
Is that even a thing? How do bits rot?
It's interesting that they can do this to the object code after it's been generated. But it sounds a lot like traditional compiler optimization to me. Or am I missing something?
I would also quibble with the headline. It isn't "fixing" the code; it's generating more efficient instructions to do the same thing.
Most compilers, after code generation (and often after code analysis, while the code is in some machine-independent tree state that sounds much like their invented language here) perform their optimization runs.
This just sounds like its doing that. Sure, its source-language independent. But so is gcc's backend. Basically its taking a "done" excecutable, reconstructing a form similar to the intermediate tree form the GCC backend uses, and then doing another optimization pass like GCC's backend does. What's new and unique here?
Or healthcare.gov?
How do bits rot?
From the head down
“He’s not deformed, he’s just drunk!”
Well its the obvious question isn't it - presumably they've eaten their own dog food and run the program on its own binary , right?
Reoptimizing is not the same thing as fixing a bug. For one thing, the software would need to know the bug is in fact a bug and what the correct behavior was supposed to be. Suppose your algorithm is coded as c = a - b, but it really is supposed to be c = a + b. Obviously that is a bug but how is the software supposed to know that? Or suppose you used an incorrect conversion factor, but the formula is otherwise correct (Didn't NASA have a lander crash because the program used feet instead of meters or something like that?).
Anyway, decompiling a program, which is no smal feat, and then optimizing it is not the same as bug fixing.
This seems to optimize code, as opposed to fixing bugs. It won't detect for example a possibility of referencing nil. Also, I suspect it would need a very strongly typed language which would reduce the human intelligence requirement to zero. One other thing I am wondering is how maintainable the code is after. Does the code make sense or does it look more like it was written by a robot.
Laws are rules for the court, but merely a bottom bar to hit for life. Think beyond laws in your actions always.
In 10 years or less Software Engineers wont be necessary to create Software. Applications will be created by Management based on Business Rules and Data Sets. The only human involvement will be the IA Design and Control of these Rules and Data as well as UI Design for "look and feel" and branding.
If you are in your 20s, you'd better start finding a new career path because your career in Software Development is about over.
When you read the actual paper, it seems to analyse the code, and take advantage of vectorization in modern hardware to do the equivalent act in a more parallel way increasing performance. So it strips off local optimization, analyses the action, then recreates it in a form better suited to the processor its compiled for, resulting in a speedup.
Sort of reminds me of Transmeta, the processor Linus was involved with, that ran microcode, analysed the execution of the x86 code, and did little mini compiles of microcode to simulate that. aka 'Code Morphing',
https://en.wikipedia.org/wiki/Transmeta
It did well on Benchmarks (and filters) because of the repetitive nature of them, it could recreate those loops more efficiently.
Interesting, pity its all full of boastful fluff, and vague bitrot claims, it sounds like a proper paper otherwise. Of course for most software if it has value, it is a competition and its worth re-optimizing for each new platform otherwise you lose market to competitors. So actual programmers would rework those parts of the code rather than a general tool hack.
So this would only be a stopgap for dead end software you're locked into that isn't being maintained.
As you point out, you get to keep the original value (%100 or "1") and ADD the % increase. In other words, you have %100 percent + the increase.
Example 1: if sales tax is 10%, or 0.1, and and item is a dollar, you have 10 cents in tax + the dollar, for 1.10 to get out of the store.
Example 2: A 20% tip on a $10 tab is 1.2 x 10, or $12.
E.g. always add the "1" for the original you are keeping. For the 350% example, you would have 1+3.5 as the multiplier or 4.5 x $22,000 = $99,000.
Does it work when you're not wearing your three wolf moon shirt?
After reading through the paper a bit, it seems interesting, but perhaps a bit overblown. It seemed to have a lot of work to understand the very specific problem domain before this could be applied. It's more like a methodology *enabled* expert engineers to do optimization, not that it did optimization *instead of* expert engineers.
It's also a field with a lot of solid technical high level algorithms, so there was a pretty good space to map things to. Basically it was identifying what inscrutable code was doing as it relates to well known algorithms, enabling them to start fresh to apply the best practice today of said algorithm. If you are not in this sort of space, the strategy doesn't really have a way to help very much.
XML is like violence. If it doesn't solve the problem, use more.
If only they could make automatic system that fixes bugs that computer criminals are searching...
It's practically free. Run the program, wait a bit and your done. A child or a well trained monkey could do it. You OTOH, cost dollars per hour. Seriously, is anyone else scared shirtless that something so abstract and complex as this can be automated? Is any job safe (outside of being a member of the ruling class)?
Hi! I make Firefox Plug-ins. Check 'em out @ https://addons.mozilla.org/en-US/firefox/addon/youtube-mp3-podcaster/
Software decompiles old code, applies modern optimizations, and recompiles.
Read the instructions, loop optimize, branch optimize etc. rinse repeat. It's not novel, I mean we've had JIT optimization and others for a few years now. It does nothing with "code" but with the binaries generated from code.
Harrison's Postulate - "For every action there is an equal and opposite criticism"
Is that even a thing? How do bits rot?
it's only the ones that don't get used as frequently. the zeros are ok
Is that even a thing? How do bits rot?
Yes, it's a thing. An important one, well-known to all software developers with a few years of experience.
Barring some sort of hardware failure the bits themselves don't change, of course. What changes is the context in which the bits are used. The article seems to be focusing mostly on performance, and that's one area of bit rot, a minor one. As hardware changes, the best performance optimization methods change, but the bits don't. Updating the code can improve performance. More important forms of bit rot have to with supporting libraries, or even business context. Causes and effects vary, but at bottom some assumption made by the old code is no longer true. If the assumption was never true, or for some reason the developer should not have expected it to be true, we call this a bug. But sometimes the code did make perfect sense as it was... but no longer. It's a bug now, but was correct previously.
That is bit rot.
Wikipedia has a fairly decent article if you want to read more: https://en.wikipedia.org/wiki/...
Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
Buy our miracle product and your old car will shine like new! Just squeeze some out of the bottle and apply with a clean cloth, wipe it off, and look! Your old car's faded, scratched finish looks like brand new! Only $19.95, call to order now and get this special micro-fiber application cloth for free, a $9.95 value!
That's what this reminds me of. It's something you use on a car you're selling off and want to get a better price for it, not for a car you're keeping, or at least keeping for long. It'll probably work some of the time, but what about when it doesn't work? Does it make things worse? Do you end up with the paint stripped off down to the primer, or worse, all the way down to bare metal? The point is you don't really know what it's going to do. In this case it might even appear to work as advertised.. until some time later when you discover it's completely borqed-up what you ran it on. This is like something some management-type, who knows nothing about doing the work (and doesn't want to know) but who wants to cut his budget (and consequently increase his bonus) would opt to use, instead of paying an actual programmer to fix a problem.
Are YOU using the TOOL, or is the TOOL using YOU? Think about it!
Seems like this could be built into compilers. What am I missing?
Crap coders rejoice! Your strawman application that some how made it into production for years can now be optimized w/o you having to understand what you were thinking at the time! Seriously, the days of going through and optimizing your code for speed are gone, along with the 8086 with a turbo button.
"It's a gas!" -- Doug Benson
From the article (yes, I read the article):
Helium canonicalizes the trees during construc-
tion to cope with the vagaries of instruction selection and ordering.
For example, if the compiler unrolls a loop, it may commute some
but not all of the resulting instructions in the loop body; Helium
sorts the operands of commutative operations so it can recognize
these trees as similar in the next step. It also applies simplification
rules to these trees to account for effects of fix-up loops inserted
by the compiler to handle leftover iterations of the unrolled loop
It's seem as a optimization technique for old machine code generated from compilers. As various people said, this is something that can be implemented into modern compiler's optimization algorithms.
Microsoft Windows' IrfanView
Microsoft (or even "Microsoft Windows") doesn't own IrfanView.
systemd is Roko's Basilisk.
Windows NT 3.51, or Microsoft PowerPoint, or........
I've build Photoshop plug-ins and have gotten paid for it.
2D graphics algorithm performance pretty much completely depends on relatively small inner loops.
Minor improvements in the inner loop can have a major impact on performance.
It's not uncommon manually optimizing the inner loop makes a 2D graphics algorithm several hundred times faster simply by reducing typecasting or doing subexpression elimination.
I'm wondering how well this program optimizes code in other fields. How about optimizing an office application, a compiler or a browser?
Slashdot social media options: AIM, ICQ, Yahoo, Jabber and Mobile Text. Why no MySpace?
In binary software "rot" is an abbreviation for "rotate", if no further specified, then it is to the left.
Like "LROT".
Of course it could be to the right: RROT (a heavier version of mere ROT)
A ROT means ... a well ... most people know and I'm to tired to explain it to the noobs.
Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
I was far more impressed by a Y2K conversion system developed at Queens University in Kingston which would analyze the binaries from several different machine architectures, turn them into flow graphs, and pattern match the flow graphs into re-created C++ code. Unfortunately the startup that was launched to bring that system to market imploded due to legal issues and fights, and never went much further than addressing the needs of a few early adopters.
This system, on the other hand, seems focused on merely identifying known algorithms and patching the code to use optimized implementations of those algorithms. It does not "correct bugs" -- it plugs in replacement routines. Sure the old code may have had "bugs", but more likely it just wasn't as well optimized as the code produced by modern compilers.
There is also no mention of the system in question being able to deal with anything other than Intel-architecture code, which is a very serious limitation when making claims that a system can generically fix bugs, even if you're only dealing with one class of algorithms.
I do not fail; I succeed at finding out what does not work.
If their stuff is that smart, could they please use it to fix the Adobe Flash vulnerabilities for once?
"Thou shalt run lint frequently and study its pronouncements with care, for verily its perception and judgement oft exceed thine."
Technology -- No Place For Wimps! Grateful Dead and Jerry Garcia Chatroom -- http://www.wemissjerry.org