/ FUNDAMENT / ARTICLE

What Makes A Good Governance Model?


Last week we announced that we were seeking help with Keystone, our reproducible, capability-based infrastructure for builds and deployments. The project is admittedly not in the shape we wanted for such an announcement - our original timeline was shooting for a fully working MVP in June or July, but the rapid implosion of the NixOS project has forced our hand. It has also forced us to accelerate our development plans, since we were originally using Nix as a temporary content store until we developed our own, but now we will need to build a basic content store for the MVP. Thankfully, the community response has been enormously positive, and we are already working with several nix users to write a proper, up-to-date technical specification for the project.

However, some have raised concerns about what our governance model is going to be, given that Nix is currently imploding precisely because of a massive governance failure. Our initial plan had always been to create something akin to the Linux Foundation to steward the Keystone project itself, which would be separate from whatever commercial applications Fundament Software builds on top of it. This ensures all development funded by Fundament Software would go through the same transparent sponsorship channels as any other company. However, it seems that Nix itself has a very similar governance structure, which is alarming, because it clearly did not work. This suggests that we should do something different, but we are not satisfied with "different", we want a governance structure that's better.

This is particularly difficult because "governance problems" have plagued open-source software for decades. Few projects have any meaningful leadership structure in place beyond someone who acts as the de-facto benevolent dictator, the major contributors, and maybe some moderators. Other projects, like Rust, have multiple organizations with a complex relationship that is ill-defined, resulting in things like the entire mod team resigning. Official ISO standards bodies for languages like C++ and C are often just as dysfunctional, but hide that dysfunction behind a dizzying array of rules, as Jean-Hyde discusses here. Attempts to control a for-profit subsidiary have almost universally failed, as the for-profit subsidiary inevitably consumes its parent corporation almost every time, as seen first with Mozilla, and most recently with OpenAI. You can't simply say your company motto is "Don't Be Evil" and expect this to stop Wall Street from sucking the life out of your products if you are obligated to maximize profits.

One common mistake in new governance structures is that they usually use first-past-the-post voting. This is poor choice because it is vulnerable to the spoiler effect, which can be addressed via Ranked Choice Voting. Quadratic Voting is also an option for things like RFCs, where people need to express priority in addition to preference. Sadly, it is very hard to find any governance models like this in active use, let alone ones actually running into Arrow's Impossibility Theorem.

Unfortunately, most people choosing what governance system to use have never heard of Arrow's Impossibility Theorem, which is very problematic when our society clearly needs to develop better systems of cooperation. Fundament Software is extremely invested in building better ways to collaborate and reach consensus, which is why the company is a Social Purpose Corporation. We do not have a fiscal obligation to maximize profit, only for us to pursue a social or environmental goal. Then again, we can say whatever we want and it doesn't mean a better result will actually happen.

So, what would a better governance structure actually be? What concrete actions can we take in the early stages of this project to ensure it serves the community and doesn't get captured by other interests? This is a difficult question, because the inability for a non-profit to control its for-profit subsidiary is one reason we were initially planning to have a wholly independent foundation, but NixOS has proven that even this level of separation is insufficient. Foundations with elected leadership positions invariably run into the Keys To Power problem, where we want community leaders to be democratically elected (increasing the number of keys to power), but we don't want people who aren't invested in the project to have voting power (decreasing the number of keys to power). Elected leaders are incentivized to minimize the number of voters, and any mechanism used to minimize bad actors could instead be used to minimize voters instead.

We can see this conflict of interest arise in some worker cooperatives, like WinCo Foods. While WinCo is technically a "worker cooperative", the actual voting power that controls the company is concentrated in the managers, which leads to many workers complaining that it feels "clique-ish" and "like a social club". This is obviously not what we wanted out of a worker cooperative, but instead of blaming greed or human nature, we can instead try to design a system that makes it harder to fall into these kinds of power spirals. For example, giving people multiple votes based on company tenure, and then using a quadratic voting system instead. This can still create an incentive to eject people out of the company before they gather too many votes, but this can be partially countered by requiring a supermajority of your own team to eject you, which can only be overridden by a supermajority of the entire company, or something to that effect.

Trying to apply this to an open-source project is harder because the difficulty of any particular change is not reflected in any externally observable metric - lines of code don't matter, and even if we had a good metric, Goodhart's law ensures it would cease being a good metric once it became a target. So we don't have a good way of "forcing" people to be granted votes, and if we create a system that has to "approve" contributors to be given voting status, it will be incentivized to let as few people as possible vote. We could try to force this by requiring X number of voters, but then leaders would be incentivized to reward loyalty instead of competence. Without a good way of measuring competence, most systems collapse into rewarding loyalty instead.

Of course, this doesn't make building a better system impossible, just difficult. It is certainly possible for us to build a system that it at least better than most current open-source governance structures, even if it isn't ideal. A separate non-profit entity seems like the most straightforward option, but it might not even be necessary, since there are low-income subsidiary options as well. Perhaps trying to maintain a separate non-profit entity could be used to mask the involvement of our for-profit company, which was a major problem with NixOS and Eelco's Detsys company. With this in mind, we invite the community to leave suggestions on what governance system they would like to see managing Keystone, but keep in mind that we don't need to make any decisions until we release an MVP and begin accepting donations.

Read More

 Erik McClure on

/ FUNDAMENT / ARTICLE

NLnet Funding for Feather UI!


We are happy to announce that NLnet is providing us with funding via NGI Zero Core to help make Feather UI a reality! Progress has been slow given that many team members were working on this part-time, but now a few core team members will be working full-time to build a proper Feather UI prototype.

Feather is a universal UI library that applies user inputs to application state, and maps application state to an interactive visualization using a custom graphics rendering language capable of compiling to arbitrary GPU code or vectorized CPU code. By building on top of a well-typed graphics abstraction, it is possible to make custom shaders "write once, run anywhere" with confidence and no overhead. This allows the creation of UI Fragments, which no longer need to be built on top of a library of UI widget elements, allowing the creation of arbitrarily complex UI elements that are no longer bound to traditional widget designs. This level of abstraction allows targeting anything from embedded devices to webpages, or even mixed-reality devices.

Feather does not have a dedicated webpage yet, but you can check us out on GitHub, or say hi in the discord server.

Read More

 Erik McClure on

/ FUNDAMENT / ARTICLE

Introducing inNative


Many people are excited about WebAssembly, which lets you use languages other than JavaScript on the web. With WebAssembly, you can run C, C++, Rust, Zig, Go, or pretty much anything that compiles to LLVM in a sandbox running inside your web browser. This has performance costs, but many people are working on highly optimized JIT compilers designed to minimize these costs as much as possible.

I'm not interested in that. I'm interested in a completely different question: How fast can WebAssembly go outside the sandbox?

If you think about it, most of your programs run outside a sandbox. This is why we have anti-virus software and "Run As Administrator", since the kernel doesn't put many restrictions on what programs can do. We just trust that the programs we install will be well behaved. What if we gave WebAssembly this same level of trust? How fast can it go?

The answer is: really fast. inNative is an AOT (Ahead-Of-Time) compiler for WebAssembly using LLVM with a customizable level of sandboxing. You can grab a precompiled SDK from GitHub, or build from source. If you turn off all the isolation and let the LLVM optimizer go crazy, you can almost reach native speeds and nearly recreate the same optimized assembly that a fully optimized C++ compiler would give you, while leveraging all the features of the host CPU. Let's look at some benchmarks, adapted from these C++ benchmarks:

``` inNative v0.1.0 Test Utility

Benchmark C/C++ Debug Strict Sandbox Native

fac 241499 475463 224926 212410 234685

                     1.00        0.51        1.07        1.14        1.03

nbody 1876882 5433721 2458428 2459722 2020208

                     1.00        0.35        0.76        0.76        0.93

fannkuch_redux 1895252 5641177 2451521 2436746 1987114

                     1.00        0.34        0.77        0.78        0.95

```

This is an average benchmark, with times in microseconds, compiled using GCC -O3 --march=native on WSL. We usually see 75% native speed with sandboxing and 95% without. The C++ benchmark is actually run twice - we use the second run, after the cache has had time to warm up. Turning on fastmath for both inNative and GCC makes both go faster, but the relative speed stays the same.

The only reason we haven't already gotten to 99% native speed is because WebAssembly's 32-bit integer indexes break LLVM's vectorization due to pointer aliasing. Once fixed-width SIMD instructions are added, native WebAssembly will close the gap entirely, because this vectorization analysis will have happened before the WebAssembly compilation step.

What a lot of people don't realize is that these benchmarks give the C++ compiler a ridiculous advantage it usually doesn't have: we're using --march=native. Most projects stick to SSE4 instructions, lest they turn out like No Man's Sky. inNative has the same advantage that JIT compilers have, which is that it can always take full advantage of the native processor architecture. At the same time, it can perform expensive brute force optimizations like a traditional AOT compiler, by caching it's compilation result. By compiling on the target machine once, we get the best of both Just-In-Time and Ahead-Of-Time!

Of course, being fast isn't the only thing inNative does, it also allows webassembly modules to interface directly with the operating system. Here is a webassembly module that uses the win32 API to create a GUI:

{{inNative win32 example}}

Unfortunately, this kind of C interop is definitely not supported by the standard yet (but there is a proposal for it). As a result, inNative uses it's own unofficial extension to allow it to pass WebAssembly pointers into C functions. inNative also lets you write C libraries that expose themselves as WebAssembly modules, which would make it possible to build an interop library in C++. Once WebIDL bindings are standardized, it will be a lot easier to compile WebAssembly that binds to C APIs. This opens up a world of tightly integrated WebAssembly plugins for any language that supports calling standard C interfaces, integrated directly into the program.

inNative lays the groundwork needed for us to question the basic tenets of modern software deployment: What if we could ship WebAssembly instead? What if shipping WebAssembly could make our software faster than compiling a version for every architecture? It doesn't need to be platform-independent, only architecture-independent. We could break the stranglehold of i386 on the software industry and free developers to experiment with novel CPU architectures without having to worry about whether our favorite language compiles to it. A WebAssembly application built against POSIX could run on any CPU architecture that implements a POSIX compatible kernel!

WebAssembly isn't just a way to run C++ in a web browser, it's a chance to reinvent how we write programs, and build a radical new foundation for software development. inNative is just a first step towards a new frontier. Check out the many ways you can embed inNative into your program, and join the conversation in our discord chat!

Read More

 Erik McClure on