Mozilla & Ubisoft "Clever-Commit" Deep-Learning Code Review

Subject: General Tech | February 12, 2019 - 05:52 PM |
Tagged: Rust, mozilla, deep learning, c++

The basic premise of “deep learning” is that you process big pools of data to try and find “good” and/or “bad” patterns. After you build up a set of trained data, you can compare new data against it to accomplish some goal.

In this case, Mozilla is using it to scan commits to the Firefox codebase as a form of automated code review. The system was originally developed by Ubisoft as Commit Assistant, which they have been using as a form of code analysis. Mozilla has since partnered with them, and will contribute to its ability to scan C++, JavaScript, and Mozilla’s own Rust language.

Other vendors, such as Microsoft and their IntelliCode system, have been using deep learning to assist in software development. It’s an interesting premise that, along with unit tests, static code analysis, and so forth, should increase the quality of code.

Personally, I’m one of those people that regularly use static code analysis (if the platform has a good and affordable solution available). It’s good to follow strong design patterns, but it’s hard to recover from the “broken window theory” once you get a few hundred static code analysis warnings… or a few hundred compiler warnings. Apathy just sets in and I just end up ignoring everything from that feedback level, down. It pushes me to, if I can control a project from scratch, keep it clean of warnings and code analysis issues.

All that is to say – it’ll be interesting to see how Clever-Commit is adopted. Since it’s apparently on a per-commit basis, it shouldn’t be bogged down by past mistakes. I wonder if we can somehow add that theory to other forms of code analysis. I’m curious what sort of data we could gather by scanning from commit to commit… what that would bring in terms of a wholistic view of code quality for various projects.

And then… what will happen when deep learning starts generating code? Hmm.

Source: Ars Technica

Discord Nitro Dips Toes into Game Sale and Distribution

Subject: General Tech | August 10, 2018 - 10:45 PM |
Tagged: pc gaming, discord, Rust, mozilla, steam, GOG

Starting with a slowly-ramping group of ~50,000 Canadians, Discord has begun distributing PC games. Specifically, there will be two services for paying members of the Discord Nitro beta program: a store, where games can be purchased as normal, and a library of other games that are available with the (aforementioned) Discord Nitro subscription.

“It’s kinda like Netflix for games.”

discord-2018-gamestore.png

When talking about subscription services for video games, I am typically hesitant. That said, the previous examples were, like, OnLive, where they planned on making games that ran exclusively on that platform. The concern is that, when those games disappear from the service, they could be gone from our society as a whole work of art. (Consoles and DRM also play into this topic.)

In this case, however, it looks like they are just getting into curated, off-the-shelf PC games. While GoG holds its own, it will be nice to see another contender to Steam in the Win32 (maybe Linux?) games market. (I say Win32 because of the developer certification requirements for Windows Store / UWP.)

Dead horse rant aside, Discord is doing games… including a subscription service. Yay.

One more aspect to this story!

Over the last five-or-so years, Mozilla has been talking about upgrading their browser to use a more safe, multi-theaded, functional, job system, via their home-grown programming language, Rust. Turns out: Discord used this language for a lot of the store (and surrounding SDKs). Specifically, the native code for the store, the game SDK (with C, C++, and C# bindings), and the multiplayer network layer are all in Rust. This should make it fast and secure, which were the two design goals for Rust in the first place.

It was intended for web browsers after all...

Source: Discord

A Chunk of Servo Comes to Firefox: Quantum CSS

Subject: General Tech | August 22, 2017 - 10:12 PM |
Tagged: mozilla, firefox, servo, Rust

If you’re on Firefox Nightly, you are able to enable their new CSS engine with an about:config flag, called layout.css.servo.enabled. For a few years now, Mozilla has been working on a separate rendering engine, aided by Samsung, which was called Servo. Browsers are very single-threaded, so there was a lot of room for improvement, especially on devices that can afford more cores than per-core performance, like mobile. It is also more secure, as its programming language, Rust, is more strict with data accesses than C/C++, which is also great for a web browser.

mozilla-rust.png

Eventually, Mozilla decided to, instead of replacing Gecko, replace chunks of it with tech derived from Servo. Up to now, it’s been mostly security-related components, like the parsing of untrusted media headers. This one is about speed. I'm curious to see how it feels to our readers. I know that, personally, going from Firefox 54 to Firefox 55 was a significant difference, although that was due to other changes.

If you’re interested, download Firefox Nightly. I mean, it’s free.

Source: Mozilla

Mozilla to Require Rust (and Dependencies) for Firefox

Subject: General Tech | February 7, 2017 - 02:47 AM |
Tagged: mozilla, firefox, web browser, Rust, llvm

Firefox 52 will be the company’s next Extended Support Release (ESR) branch of their popular web browser. After this release, Mozilla is planning a few changes that will break compatibility, especially if you’re building the browser from source. If you’re an end-user, the major one to look out for is Mozilla disabling NPAPI-based plugins (except Flash) unless you are using Firefox 52 ESR. This change will land in the consumer version of Firefox 52, though. It’s not really clear why they didn’t just wait until Firefox 53, rather than add a soft-kill in Firefox 52 and hard-code it the next version, but that’s their decision. It really does not affect me in the slightest.

mozilla-rust.png

The more interesting change, however, is that Mozilla will begin requiring Rust (and LLVM) in an upcoming version. I’ve seen multiple sources claim Firefox 53, Firefox 54, and Firefox 55 as possible targets for this, but, at some point around those versions, critical components of the browser will be written in Rust. As more of the browser is migrated to this language, it should be progressively faster and more secure, as this language is designed to enforce memory safety and task concurrency.

Firefox 52 is expected in March.

Mozilla to Publish First Rust-based Module in Firefox 48

Subject: General Tech | July 16, 2016 - 05:41 PM |
Tagged: mozilla, Rust, firefox

Mozilla has been working on the Rust language for several years now. It is designed to be extremely fast, memory-safe, and easy to parallelize on multi-core processors, doing so by having a compiler that's not afraid to tell you “Nope.” Mozilla (and others, like Samsung) want a language with those characteristics because it will make an extremely fast, yet secure, web browser (although there's a lot of single-threaded design choices tangled in the Web specifications).

mozilla-rust.png

The first example will arrive next month for Windows, though (64-bit OSX and Linux already had it). Firefox 48 will replace a small portion of the code, originally written in C++, with a Rust-based equivalent. The affected component parses media files, getting values like track id, duration, resolution, and so forth. Because it's written in Rust, this ingestion should be resilient to memory-based vulnerabilities.

This probably will not be noticeable to end-users, but it's a few thousand less lines of code that Mozilla should need to worry about hijacking the browser. Mozilla is also planning on bringing URL parsing to Rust, and has already done so with Servo. You would think that the C++ code has been battle-hardened by now, but, I mean, 15-year-old open-source bugs do exist, hiding in plain sight.

Source: Mozilla

Mozilla Publishes Servo Nightly (for Mac and Linux)

Subject: General Tech | July 1, 2016 - 07:12 PM |
Tagged: web browser, gecko, servo, Rust, mozilla, Samsung

No love for Windows at the moment, but Mozilla is showing previews of their new browser rendering engine, Servo. This one is developed in Rust, which is a highly parallel yet very memory safe language, which are two great features for a web browser, especially on mobile and multi-core desktops. You are currently able to pick it up on Mac and Linux, although it is not ready to be your primary browser yet. Windows and Android builds “should be available soon”.

Basically, Mozilla has been spending the last few years re-thinking how to design a web browser. Most Web standards are based on assumptions that the browser is going through a main loop, and that these items will occur in sequence. Back in 2013, most of the research was to see far a browser could travel into parallelization before compatibility just stops following. Samsung, who is obviously interested in smartphone technology, partnered with them, because it's easier to add more cores onto a mobile SoC than it is to make existing ones faster.

mozilla-architecture.jpg

At the time, they weren't sure whether this research would be used to improve Gecko, the current rendering engine that has been around since Netscape 6, or create a suitable replacement for it. As far as I know, that decision has still not been made, but they also haven't bailed on it yet.

Perhaps we'll see a new wave of Web technology coming soon? Maybe even break up the Webkit monopoly that seems to be forming, led by iOS and Android devices?

Source: Mozilla

Mozilla to Preview Servo in June

Subject: General Tech | March 18, 2016 - 09:26 PM |
Tagged: mozilla, servo, Rust

Mozilla, the open-source creators of Firefox and Thunderbird, have announced that their Servo project will reach public alpha in June. Nightly builds will be available, presumably around that time, for Linux, OSX, Windows, and Android. Servo is a browser engine that is built in Rust, which emphasizes security and high performance (especially in multi-threaded scenarios).

mozilla-architecture.jpg

The technology is really interesting, although it is still quite early. Web browsers are massively single-threaded by design, which limits their potential performance as CPUs widen in core count but stagnate in per-thread performance. This is especially true in mobile, which is why Samsung has been collaborating on Servo for almost all of its life.

Rust, being so strict about memory access, also has the advantage of security and memory management. It is designed in such a way that it's easier for the compiler to know, at compile time, whether you will be trying to access data that is no longer available. The trade-off is that it's harder to program, because if your code isn't robust enough, the compiler just won't accept it. This is beneficial for web browsers, though, because basically everything they access is untrusted, third-party data. It's better to fight your compiler than to fight people trying to exploit your users.

Again, it's still a way off, though. It might be good for web developers to keep an eye on, though, in case any of their optimizations implement standards either correctly, but differently from other browsers and highlights a bug in your website, or incorrectly, which exposes a bug in Servo. Making a web browser is immensely difficult.

Source: Mozilla

Steam Launches "Item Stores"

Subject: General Tech | November 5, 2015 - 07:01 AM |
Tagged: valve, steam, Rust

Team Fortress 2 switched from a paid game, first seen in The Orange Box bundle, to a free-to-play title. Financially, you could say that it was supported by tips... ... tips of the hat. Some responded with a wag of their finger, but others with a swipe of their credit card. Where was I going with this? Oh right. This game put Valve on the path of microtransactions, which fuels games like DOTA 2 that aren't supported in any other way.

valve-2015-steam-item-store.png

Each of these item payments are done in game however, even Valve games, except for one. Rust has been chosen to introduce Item Stores on Steam. If you go to Rust's store page, you will see a category called “Items available for this game”. Clicking on it brings you to “Rust Item Store”, where you can buy in-game clothing, weapons, and sleeping bags with real money. This feature is not even available on Team Fortress 2 or DOTA 2.

While there has been some parallels drawn between this and the backtracked paid mods initiative, I don't see it. This is not attempting to take third-party content, some of which was plagiarized from free, existing mods, and sell it. This is an attempt to provide a platform for in-game purchases that already exist. If there's a story, I'd say it's how the initiative launched with a third-party game, and not one of Valve's two, popular, free-to-play titles.

Source: PC Gamer

GNU Compiler Collection (GCC) Working on Mozilla's Rust

Subject: General Tech | December 5, 2013 - 03:59 AM |
Tagged: GCC, Rust, mozilla

Rust is an interesting language in that it aims to be safe and concurrent. It was discussed frequently at Mozilla Summit back in early October both on its own and in terms of the experimental HTML5 rendering engine, Servo. From how it was describe to me from other attendees, it prides itself on its task-based architecture. Basically, your application is (or, at least, is often) set up like a bunch of tasks that get scheduled concurrently and pass messages to one another if they want to communicate. This concept allow for efficient multithreading because each task is inherently independent.

mozilla-rust.png

This may remind you of the experiments John Carmack did with Wolfenstein and Haskell.

Apparently at least one developer from the GNU Compiler Collection (GCC) is also paying attention. Philip Herron has been working on the "gccrs" branch to create a GCC front-end for Mozilla's language.

We will need languages like Rust in the near future as processors continue to ramp up in thread count. Just look at the Xeon Phi story from last week: a bootable 288-thread standalone processor based on the Silvermont architecture. If you want this processor to be used efficiently then you better be light on the main thread otherwise your 6 TFLOPs (3 TFLOPs double-precision) will only be quick to behave like an Atom.

Source: Phoronix