More from On Life and Lisp
In 2020, Apple released the M1 with a custom GPU. We got to work reverse-engineering the hardware and porting Linux. Today, you can run Linux on a range of M1 and M2 Macs, with almost all hardware working: wireless, audio, and full graphics acceleration. Our story begins in December 2020, when Hector Martin kicked off Asahi Linux. I was working for Collabora working on Panfrost, the open source Mesa3D driver for Arm Mali GPUs. Hector put out a public call for guidance from upstream open source maintainers, and I bit. I just intended to give some quick pointers. Instead, I bought myself a Christmas present and got to work. In between my university coursework and Collabora work, I poked at the shader instruction set. One thing led to another. Within a few weeks, I drew a triangle. In 3D graphics, once you can draw a triangle, you can do anything. Pretty soon, I started work on a shader compiler. After my final exams that semester, I took a few days off from Collabora to bring up an OpenGL driver capable of spinning gears with my new compiler. Over the next year, I kept reverse-engineering and improving the driver until it could run 3D games on macOS. Meanwhile, Asahi Lina wrote a kernel driver for the Apple GPU. My userspace OpenGL driver ran on macOS, leaving her kernel driver as the missing piece for an open source graphics stack. In December 2022, we shipped graphics acceleration in Asahi Linux. In January 2023, I started my final semester in my Computer Science program at the University of Toronto. For years I juggled my courses with my part-time job and my hobby driver. I faced the same question as my peers: what will I do after graduation? Maybe Panfrost? I started reverse-engineering of the Mali Midgard GPU back in 2017, when I was still in high school. That led to an internship at Collabora in 2019 once I graduated, turning into my job throughout four years of university. During that time, Panfrost grew from a kid’s pet project based on blackbox reverse-engineering, to a professional driver engineered by a team with Arm’s backing and hardware documentation. I did what I set out to do, and the project succeeded beyond my dreams. It was time to move on. What did I want to do next? Finish what I started with the M1. Ship a great driver. Bring full, conformant OpenGL drivers to the M1. Apple’s drivers are not conformant, but we should strive for the industry standard. Bring full, conformant Vulkan to Apple platforms, disproving the myth that Vulkan isn’t suitable for Apple hardware. Bring Proton gaming to Asahi Linux. Thanks to Valve’s work for the Steam Deck, Windows games can run better on Linux than even on Windows. Why not reap those benefits on the M1? Panfrost was my challenge until we “won”. My next challenge? Gaming on Linux on M1. Once I finished my coursework, I started full-time on gaming on Linux. Within a month, we shipped OpenGL 3.1 on Asahi Linux. A few weeks later, we passed official conformance for OpenGL ES 3.1. That put us at feature parity with Panfrost. I wanted to go further. OpenGL (ES) 3.2 requires geometry shaders, a legacy feature not supported by either Arm or Apple hardware. The proprietary OpenGL drivers emulate geometry shaders with compute, but there was no open source prior art to borrow. Even though multiple Mesa drivers need geometry/tessellation emulation, nobody did the work to get there. My early progress on OpenGL was fast thanks to the mature common code in Mesa. It was time to pay it forward. Over the rest of the year, I implemented geometry/tessellation shader emulation. And also the rest of the owl. In January 2024, I passed conformance for the full OpenGL 4.6 specification, finishing up OpenGL. Vulkan wasn’t too bad, either. I polished the OpenGL driver for a few months, but once I started typing a Vulkan driver, I passed 1.3 conformance in a few weeks. What remained was wiring up the geometry/tessellation emulation to my shiny new Vulkan driver, since those are required for Direct3D. Et voilà, Proton games. Along the way, Karol Herbst passed OpenCL 3.0 conformance on the M1, running my compiler atop his “rusticl” frontend. Meanwhile, when the Vulkan 1.4 specification was published, we were ready and shipped a conformant implementation on the same day. After that, I implemented sparse texture support, unlocking Direct3D 12 via Proton. …Now what? Ship a great driver? Check. Conformant OpenGL 4.6, OpenGL ES 3.2, and OpenCL 3.0? Check. Conformant Vulkan 1.4? Check. Proton gaming? Check. That’s a wrap. We’ve succeeded beyond my dreams. The challenges I chased, I have tackled. The drivers are fully upstream in Mesa. Performance isn’t too bad. With the Vulkan on Apple myth busted, conformant Vulkan is now coming to macOS via LunarG’s KosmicKrisp project building on my work. Satisfied, I am now stepping away from the Apple ecosystem. My friends in the Asahi Linux orbit will carry the torch from here. As for me? Onto the next challenge!
English version follows. Aujourd’hui, Khronos Group a sorti la spécification 1.4 de l’API graphique standard Vulkan. Le projet Asahi Linux est fier d’annoncer le premier pilote Vulkan 1.4 pour le matériel d’Apple. En effet, notre pilote graphique Honeykrisp est reconnu par Khronos comme conforme à cette nouvelle version dès aujourd’hui. Ce pilote est déjà disponible dans nos dépôts officiels. Après avoir installé Fedora Asahi Remix, executez dnf upgrade --refresh pour obtenir la dernière version du pilote. Vulkan 1.4 standardise plusieurs fonctionnalités importantes, y compris les horodatages et la lecture locale avec le rendu dynamique. L’industrie suppose que ces fonctionnalités devront être plus courantes, et nous y sommes préparés. Sortir un pilote conforme reflète notre engagement en faveur des standards graphiques et du logiciel libre. Asahi Linux est aussi compatible avec OpenGL 4.6, OpenGL ES 3.2, et OpenCL 3.0, tous conformes aux spécifications pertinentes. D’ailleurs, les nôtres sont les seuls pilotes conformes pour le materiel d’Apple de n’importe quel standard graphique. Même si le pilote est sorti, il faut encore compiler une version expérimentale de Vulkan-Loader pour utiliser la nouvelle version de Vulkan. Toutes les nouvelles fonctionnalités sont néanmoins disponibles comme extensions à notre pilote Vulkan 1.3 pour en profiter tout de suite. Pour plus d’informations, consultez l’article du blog de Khronos. Today, the Khronos Group released the 1.4 specification of Vulkan, the standard graphics API. The Asahi Linux project is proud to announce the first Vulkan 1.4 driver for Apple hardware. Our Honeykrisp driver is Khronos-recognized as conformant to the new version since day one. That driver is already available in our official repositories. After installing Fedora Asahi Remix, run dnf upgrade --refresh to get the latest drivers. Vulkan 1.4 standardizes several important features, including timestamps and dynamic rendering local read. The industry expects that these features will become more common, and we are prepared. Releasing a conformant driver reflects our commitment to graphics standards and software freedom. Asahi Linux is also compatible with OpenGL 4.6, OpenGL ES 3.2, and OpenCL 3.0, all conformant to the relevant specifications. For that matter, ours are the only conformant drivers on Apple hardware for any graphics standard. Although the driver is released, you still need to build an experimental version of Vulkan-Loader to access the new Vulkan version. Nevertheless, you can immediately use all the new features as extensions in our Vulkan 1.3 driver. For more information, see the Khronos blog post.
Gaming on Linux on M1 is here! We’re thrilled to release our Asahi game playing toolkit, which integrates our Vulkan 1.3 drivers with x86 emulation and Windows compatibility. Plus a bonus: conformant OpenCL 3.0. Asahi Linux now ships the only conformant OpenGL®, OpenCL™, and Vulkan® drivers for this hardware. As for gaming… while today’s release is an alpha, Control runs well! Installation First, install Fedora Asahi Remix. Once installed, get the latest drivers with dnf upgrade --refresh && reboot. Then just dnf install steam and play. While all M1/M2-series systems work, most games require 16GB of memory due to emulation overhead. The stack Games are typically x86 Windows binaries rendering with DirectX, while our target is Arm Linux with Vulkan. We need to handle each difference: FEX emulates x86 on Arm. Wine translates Windows to Linux. DXVK and vkd3d-proton translate DirectX to Vulkan. There’s one curveball: page size. Operating systems allocate memory in fixed size “pages”. If an application expects smaller pages than the system uses, they will break due to insufficient alignment of allocations. That’s a problem: x86 expects 4K pages but Apple systems use 16K pages. While Linux can’t mix page sizes between processes, it can virtualize another Arm Linux kernel with a different page size. So we run games inside a tiny virtual machine using muvm, passing through devices like the GPU and game controllers. The hardware is happy because the system is 16K, the game is happy because the virtual machine is 4K, and you’re happy because you can play Fallout 4. Vulkan The final piece is an adult-level Vulkan driver, since translating DirectX requires Vulkan 1.3 with many extensions. Back in April, I wrote Honeykrisp, the only Vulkan 1.3 driver for Apple hardware. I’ve since added DXVK support. Let’s look at some new features. Tessellation Tessellation enables games like The Witcher 3 to generate geometry. The M1 has hardware tessellation, but it is too limited for DirectX, Vulkan, or OpenGL. We must instead tessellate with arcane compute shaders, as detailed in today’s talk at XDC2024. Geometry shaders Geometry shaders are an older, cruder method to generate geometry. Like tessellation, the M1 lacks geometry shader hardware so we emulate with compute. Is that fast? No, but geometry shaders are slow even on desktop GPUs. They don’t need to be fast – just fast enough for games like Ghostrunner. Enhanced robustness “Robustness” permits an application’s shaders to access buffers out-of-bounds without crashing the hardware. In OpenGL and Vulkan, out-of-bounds loads may return arbitrary elements, and out-of-bounds stores may corrupt the buffer. Our OpenGL driver exploits this definition for efficient robustness on the M1. Some games require stronger guarantees. In DirectX, out-of-bounds loads return zero, and out-of-bounds stores are ignored. DXVK therefore requires VK_EXT_robustness2, a Vulkan extension strengthening robustness. Like before, we implement robustness with compare-and-select instructions. A naïve implementation would compare a loaded index with the buffer size and select a zero result if out-of-bounds. However, our GPU loads are vector while arithmetic is scalar. Even if we disabled page faults, we would need up to four compare-and-selects per load. load R, buffer, index * 16 ulesel R[0], index, size, R[0], 0 ulesel R[1], index, size, R[1], 0 ulesel R[2], index, size, R[2], 0 ulesel R[3], index, size, R[3], 0 There’s a trick: reserve 64 gigabytes of zeroes using virtual memory voodoo. Since every 32-bit index multiplied by 16 fits in 64 gigabytes, any index into this region loads zeroes. For out-of-bounds loads, we simply replace the buffer address with the reserved address while preserving the index. Replacing a 64-bit address costs just two 32-bit compare-and-selects. ulesel buffer.lo, index, size, buffer.lo, RESERVED.lo ulesel buffer.hi, index, size, buffer.hi, RESERVED.hi load R, buffer, index * 16 Two instructions, not four. Next steps Sparse texturing is next for Honeykrisp, which will unlock more DX12 games. The alpha already runs DX12 games that don’t require sparse, like Cyberpunk 2077. While many games are playable, newer AAA titles don’t hit 60fps yet. Correctness comes first. Performance improves next. Indie games like Hollow Knight do run full speed. Beyond gaming, we’re adding general purpose x86 emulation based on this stack. For more information, see the FAQ. Today’s alpha is a taste of what’s to come. Not the final form, but enough to enjoy Portal 2 while we work towards “1.0”. Acknowledgements This work has been years in the making with major contributions from… Alyssa Rosenzweig Asahi Lina chaos_princess Davide Cavalca Dougall Johnson Ella Stanforth Faith Ekstrand Janne Grunau Karol Herbst marcan Mary Guillemard Neal Gompa Sergio López TellowKrinkle Teoh Han Hui Rob Clark Ryan Houdek … Plus hundreds of developers whose work we build upon, spanning the Linux, Mesa, Wine, and FEX projects. Today’s release is thanks to the magic of open source. We hope you enjoy the magic. Happy gaming.
u{text-decoration-thickness:0.09em;text-decoration-color:skyblue} Finally, conformant Vulkan for the M1! The new “Honeykrisp” driver is the first conformant Vulkan® for Apple hardware on any operating system, implementing the full 1.3 spec without “portability” waivers. Honeykrisp is not yet released for end users. We’re continuing to add features, improve performance, and port to more hardware. Source code is available for developers. HoloCure running on Honeykrisp ft. DXVK, FEX, and Proton. Honeykrisp is not based on prior M1 Vulkan efforts, but rather Faith Ekstrand’s open source NVK driver for NVIDIA GPUs. In her words: All Vulkan drivers in Mesa trace their lineage to the Intel Vulkan driver and started by copying+pasting from it. My hope is that NVK will eventually become the driver that everyone copies and pastes from. To that end, I’m building NVK with all the best practices we’ve developed for Vulkan drivers over the last 7.5 years and trying to keep the code-base clean and well-organized. Why spend years implementing features from scratch when we can reuse NVK? There will be friction starting out, given NVIDIA’s desktop architecture differs from the M1’s mobile roots. In exchange, we get a modern driver designed for desktop games. We’ll need to pass a half-million tests ensuring correctness, submit the results, and then we’ll become conformant after 30 days of industry review. Starting from NVK and our OpenGL 4.6 driver… can we write a driver passing the Vulkan 1.3 conformance test suite faster than the 30 day review period? It’s unprecedented… Challenge accepted. April 2 It begins with a text. Faith… I think I want to write a Vulkan driver. Her advice? Just start typing. There’s no copy-pasting yet – we just add M1 code to NVK and remove NVIDIA as we go. Since the kernel mediates our access to the hardware, we begin connecting “NVK” to Asahi Lina’s kernel driver using code shared with OpenGL. Then we plug in our shader compiler and hit the hay. April 3 To access resources, GPUs use “descriptors” containing the address, format, and size of a resource. Vulkan bundles descriptors into “sets” per the application’s “descriptor set layout”. When compiling shaders, the driver lowers descriptor accesses to marry the set layout with the hardware’s data structures. As our descriptors differ from NVIDIA’s, our next task is adapting NVK’s descriptor set lowering. We start with a simple but correct approach, deleting far more code than we add. April 4 With working descriptors, we can compile compute shaders. Now we program the fixed-function hardware to dispatch compute. We first add bookkeeping to map Vulkan command buffers to lists of M1 “control streams”, then we generate a compute control stream. We copy that code from our OpenGL driver, translate the GL into Vulkan, and compute works. That’s enough to move on to “copies” of buffers and images. We implement Vulkan’s copies with compute shaders, internally dispatched with Vulkan commands as if we were the application. The first copy test passes. April 5 Fleshing out yesterday’s code, all copy tests pass. April 6 We’re ready to tackle graphics. The novelty is handling graphics state like depth/stencil. That’s straightforward, but there’s a lot of state to handle. Faith’s code collects all “dynamic state” into a single structure, which we translate into hardware control words. As usual, we grab that translation from our OpenGL driver, blend with NVK, and move on. April 7 What makes state “dynamic”? Dynamic state can change without recompiling shaders. By contrast, static state is baked into shader binaries called “pipelines”. If games create all their pipelines during a loading screen, there is no compiler “stutter” during gameplay. The idea hasn’t quite panned out: many game developers don’t know their state ahead-of-time so cannot create pipelines early. In response, Vulkan has made ever more state dynamic, punctuated with the EXT_shader_object extension that makes pipelines optional. We want full dynamic state and shader objects. Unfortunately, the M1 bakes random state into shaders: vertex attributes, fragment outputs, blending, even linked interpolation qualifiers. Like most of the industry in the 2010s, the M1’s designers bet on pipelines. Faced with this hardware, a reasonable driver developer would double-down on pipelines. DXVK would stutter, but we’d pass conformance. I am not reasonable. To eliminate stuttering in OpenGL, we make state dynamic with four strategies: Conditional code. Precompiled variants. Indirection. Prologs and epilogs. Wait, what-a-logs? AMD also bakes state into shaders… with a twist. They divide the hardware binary into three parts: a prolog, the shader, and an epilog. Confining dynamic state to the periphery eliminates shader variants. They compile prologs and epilogs on the fly, but that’s fast and doesn’t stutter. Linking shader parts is a quick concatenation, or long jumps avoid linking altogether. This strategy works for the M1, too. For Honeykrisp, let’s follow NVK’s lead and treat all state as dynamic. No other Vulkan driver has implemented full dynamic state and shader objects this early on, but it avoids refactoring later. Today we add the code to build, compile, and cache prologs and epilogs. Putting it together, we get a (dynamic) triangle: April 8 Guided by the list of failing tests, we wire up the little bits missed along the way, like translating border colours. /* Translate an American VkBorderColor into a Canadian agx_border_colour */ enum agx_border_colour translate_border_color(VkBorderColor color) { switch (color) { case VK_BORDER_COLOR_INT_TRANSPARENT_BLACK: return AGX_BORDER_COLOUR_TRANSPARENT_BLACK; ... } } Test results are getting there. Pass: 149770, Fail: 7741, Crash: 2396 That’s good enough for vkQuake. April 9 Lots of little fixes bring us to a 99.6% pass rate… for Vulkan 1.1. Why stop there? NVK is 1.3 conformant, so let’s claim 1.3 and skip to the finish line. Pass: 255209, Fail: 3818, Crash: 599 98.3% pass rate for 1.3 on our 1 week anniversary. Not bad. April 10 SuperTuxKart has a Vulkan renderer. April 11 Zink works too. April 12 I tracked down some fails to a test bug, where an arbitrary verification threshold was too strict to pass on some devices. I filed a bug report, and it’s resolved within a few weeks. April 16 The tests for “descriptor indexing” revealed a compiler bug affecting subgroup shuffles in non-uniform control flow. The M1’s shuffle instruction is quirky, but it’s easy to workaround. Fixing that fixes the descriptor indexing tests. April 17 A few tests crash inside our register allocator. Their shaders contain a peculiar construction: if (condition) { while (true) { } } condition is always false, but the compiler doesn’t know that. Infinite loops are nominally invalid since shaders must terminate in finite time, but this shader is syntactically valid. “All loops contain a break” seems obvious for a shader, but it’s false. It’s straightforward to fix register allocation, but what a doozy. April 18 Remember copies? They’re slow, and every frame currently requires a copy to get on screen. For “zero copy” rendering, we need enough Linux window system integration to negotiate an efficient surface layout across process boundaries. Linux uses “modifiers” for this purpose, so we implement the EXT_image_drm_format_modifier extension. And by implement, I mean copy. Copies to avoid copies. April 20 “I’d like a 4K x86 Windows Direct3D PC game on a 16K arm64 Linux Vulkan Mac.” … “Ma’am, this is a Wendy’s.” April 22 As bug fixing slows down, we step back and check our driver architecture. Since we treat all state as dynamic, we don’t pre-pack control words during pipeline creation. That adds theoretical CPU overhead. Is that a problem? After some optimization, vkoverhead says we’re pushing 100 million draws per second. I think we’re okay. April 24 Time to light up YCbCr. If we don’t use special YCbCr hardware, this feature is “software-only”. However, it touches a lot of code. It touches so much code that Mohamed Ahmed spent an entire summer adding it to NVK. Which means he spent a summer adding it to Honeykrisp. Thanks, Mohamed ;-) April 25 Query copies are next. In Vulkan, the application can query the number of samples rendered, writing the result into an opaque “query pool”. The result can be copied from the query pool on the CPU or GPU. For the CPU, the driver maps the pool’s internal data structure and copies the result. This may require nontrivial repacking. For the GPU, we need to repack in a compute shader. That’s harder, because we can’t just run C code on the GPU, right? …Actually, we can. A little witchcraft makes GPU query copies as easy as C. void copy_query(struct params *p, int i) { uintptr_t dst = p->dest + i * p->stride; int query = p->first + i; if (p->available[query] || p->partial) { int q = p->index[query]; write_result(dst, p->_64, p->results[q]); } ... } April 26 The final boss: border colours, hard mode. Direct3D lets the application choose an arbitrary border colour when creating a sampler. By contrast, Vulkan only requires three border colours: (0, 0, 0, 0) – transparent black (0, 0, 0, 1) – opaque black (1, 1, 1, 1) – opaque white We handled these on April 8. Unfortunately, there are two problems. First, we need custom border colours for Direct3D compatibility. Both DXVK and vkd3d-proton require the EXT_custom_border_color extension. Second, there’s a subtle problem with our hardware, causing dozens of fails even without custom border colours. To understand the issue, let’s revisit texture descriptors, which contain a pixel format and a component reordering swizzle. Some formats are implicitly reordered. Common “BGRA” formats swap red and blue for historical reasons. The M1 does not directly support these formats. Instead, the driver composes the swizzle with the format’s reordering. If the application uses a BARB swizzle with a BGRA format, the driver uses an RABR swizzle with an RGBA format. There’s a catch: swizzles apply to the border colour, but formats do not. We need to undo the format reordering when programming the border colour for correct results after the hardware applies the composed swizzle. Our OpenGL driver implements border colours this way, because it knows the texture format when creating the sampler. Unfortunately, Vulkan doesn’t give us that information. Without custom border colour support, we “should” be okay. Swapping red and blue doesn’t change anything if the colour is white or black. There’s an even subtler catch. Vulkan mandates support for a packed 16-bit format with 4-bit components. The M1 supports a similar format… but with reversed “endianness”, swapping red and alpha. That still seems okay. For transparent black (all zero) and opaque white (all one), swapping components doesn’t change the result. The problem is opaque black: (0, 0, 0, 1). Swapping red and alpha gives (1, 0, 0, 0). Transparent red? Uh-oh. We’re stuck. No known hardware configuration implements correct Vulkan semantics. Is hope lost? Do we give up? A reasonable person would. I am not reasonable. Let’s jump into the deep end. If we implement custom border colours, opaque black becomes a special case. But how? The M1’s custom border colours entangle the texture format with the sampler. A reasonable person would skip Direct3D support. As you know, I am not reasonable. Although the hardware is unsuitable, we control software. Whenever a shader samples a texture, we’ll inject code to fix up the border colour. This emulation is simple, correct, and slow. We’ll use dirty driver tricks to speed it up later. For now, we eat the cost, advertise full custom border colours, and pass the opaque black tests. April 27 All that’s left is some last minute bug fixing, and… Pass: 686930, Fail: 0 Success. The future The next task is implementing everything that DXVK and vkd3d-proton require to layer Direct3D. That includes esoteric extensions like transform feedback. Then Wine and an open source x86 emulator will run Windows games on Asahi Linux. That’s getting ahead of ourselves. In the mean time, enjoy Linux games with our conformant OpenGL 4.6 drivers… and stay tuned. Baby Storm running on Honeykrisp ft. DXVK, FEX, and Proton.
For years, the M1 has only supported OpenGL 4.1. That changes today – with our release of full OpenGL® 4.6 and OpenGL® ES 3.2! Install Fedora for the latest M1/M2-series drivers. Already installed? Just dnf upgrade --refresh. Unlike the vendor’s non-conformant 4.1 drivers, our open source Linux drivers are conformant to the latest OpenGL versions, finally promising broad compatibility with modern OpenGL workloads, like Blender. Conformant 4.6/3.2 drivers must pass over 100,000 tests to ensure correctness. The official list of conformant drivers now includes our OpenGL 4.6 and ES 3.2. While the vendor doesn’t yet support graphics standards like modern OpenGL, we do. For this Valentine’s Day, we want to profess our love for interoperable open standards. We want to free users and developers from lock-in, enabling applications to run anywhere the heart wants without special ports. For that, we need standards conformance. Six months ago, we became the first conformant driver for any standard graphics API for the M1 with the release of OpenGL ES 3.1 drivers. Today, we’ve finished OpenGL with the full 4.6… and we’re well on the road to Vulkan. Compared to 4.1, OpenGL 4.6 adds dozens of required features, including: Robustness SPIR-V Clip control Cull distance Compute shaders Upgraded transform feedback Regrettably, the M1 doesn’t map well to any graphics standard newer than OpenGL ES 3.1. While Vulkan makes some of these features optional, the missing features are required to layer DirectX and OpenGL on top. No existing solution on M1 gets past the OpenGL 4.1 feature set. How do we break the 4.1 barrier? Without hardware support, new features need new tricks. Geometry shaders, tessellation, and transform feedback become compute shaders. Cull distance becomes a transformed interpolated value. Clip control becomes a vertex shader epilogue. The list goes on. For a taste of the challenges we overcame, let’s look at robustness. Built for gaming, GPUs traditionally prioritize raw performance over safety. Invalid application code, like a shader that reads a buffer out-of-bounds, can trigger undefined behaviour. Drivers exploit that to maximize performance. For applications like web browsers, that trade-off is undesirable. Browsers handle untrusted shaders, which they must sanitize to ensure stability and security. Clicking a malicious link should not crash the browser. While some sanitization is necessary as graphics APIs are not security barriers, reducing undefined behaviour in the API can assist “defence in depth”. “Robustness” features can help. Without robustness, out-of-bounds buffer access in a shader can crash. With robustness, the application can opt for defined out-of-bounds behaviour, trading some performance for less attack surface. All modern cross-vendor APIs include robustness. Many games even (accidentally?) rely on robustness. Strangely, the vendor’s proprietary API omits buffer robustness. We must do better for conformance, correctness, and compatibility. Let’s first define the problem. Different APIs have different definitions of what an out-of-bounds load returns when robustness is enabled: Zero (Direct3D, Vulkan with robustBufferAccess2) Either zero or some data in the buffer (OpenGL, Vulkan with robustBufferAccess) Arbitrary values, but can’t crash (OpenGL ES) OpenGL uses the second definition: return zero or data from the buffer. One approach is to return the last element of the buffer for out-of-bounds access. Given the buffer size, we can calculate the last index. Now consider the minimum of the index being accessed and the last index. That equals the index being accessed if it is valid, and some other valid index otherwise. Loading the minimum index is safe and gives a spec-compliant result. As an example, a uniform buffer load without robustness might look like: load.i32 result, buffer, index Robustness adds a single unsigned minimum (umin) instruction: umin idx, index, last load.i32 result, buffer, idx Is the robust version slower? It can be. The difference should be small percentage-wise, as arithmetic is faster than memory. With thousands of threads running in parallel, the arithmetic cost may even be hidden by the load’s latency. There’s another trick that speeds up robust uniform buffers. Like other GPUs, the M1 supports “preambles”. The idea is simple: instead of calculating the same value in every thread, it’s faster to calculate once and reuse the result. The compiler identifies eligible calculations and moves them to a preamble executed before the main shader. These redundancies are common, so preambles provide a nice speed-up. We usually move uniform buffer loads to the preamble when every thread loads the same index. Since the size of a uniform buffer is fixed, extra robustness arithmetic is also moved to the preamble. The robustness is “free” for the main shader. For robust storage buffers, the clamping might move to the preamble even if the load or store cannot. Armed with robust uniform and storage buffers, let’s consider robust “vertex buffers”. In graphics APIs, the application can set vertex buffers with a base GPU address and a chosen layout of “attributes” within each buffer. Each attribute has an offset and a format, and the buffer has a “stride” indicating the number of bytes per vertex. The vertex shader can then read attributes, implicitly indexing by the vertex. To do so, the shader loads the address: Some hardware implements robust vertex fetch natively. Other hardware has bounds-checked buffers to accelerate robust software vertex fetch. Unfortunately, the M1 has neither. We need to implement vertex fetch with raw memory loads. One instruction set feature helps. In addition to a 64-bit base address, the M1 GPU’s memory loads also take an offset in elements. The hardware shifts the offset and adds to the 64-bit base to determine the address to fetch. Additionally, the M1 has a combined integer multiply-add instruction imad. Together, these features let us implement vertex loads in two instructions. For example, a 32-bit attribute load looks like: imad idx, stride/4, vertex, offset/4 load.i32 result, base, idx The hardware load can perform an additional small shift. Suppose our attribute is a vector of 4 32-bit values, densely packed into a buffer with no offset. We can load that attribute in one instruction: load.v4i32 result, base, vertex << 2 …with the hardware calculating the address: What about robustness? We want to implement robustness with a clamp, like we did for uniform buffers. The problem is that the vertex buffer size is given in bytes, while our optimized load takes an index in “vertices”. A single vertex buffer can contain multiple attributes with different formats and offsets, so we can’t convert the size in bytes to a size in “vertices”. Let’s handle the latter problem. We can rewrite the addressing equation as: That is: one buffer with many attributes at different offsets is equivalent to many buffers with one attribute and no offset. This gives an alternate perspective on the same data layout. Is this an improvement? It avoids an addition in the shader, at the cost of passing more data – addresses are 64-bit while attribute offsets are 16-bit. More importantly, it lets us translate the vertex buffer size in bytes into a size in “vertices” for each vertex attribute. Instead of clamping the offset, we clamp the vertex index. We still make full use of the hardware addressing modes, now with robustness: umin idx, vertex, last valid load.v4i32 result, base, idx << 2 We need to calculate the last valid vertex index ahead-of-time for each attribute. Each attribute has a format with a particular size. Manipulating the addressing equation, we can calculate the last byte accessed in the buffer (plus 1) relative to the base: The load is valid when that value is bounded by the buffer size in bytes. We solve the integer inequality as: The driver calculates the right-hand side and passes it into the shader. One last problem: what if a buffer is too small to load anything? Clamping won’t save us – the code would clamp to a negative index. In that case, the attribute is entirely invalid, so we swap the application’s buffer for a small buffer of zeroes. Since we gave each attribute its own base address, this determination is per-attribute. Then clamping the index to zero correctly loads zeroes. Putting it together, a little driver math gives us robust buffers at the cost of one umin instruction. In addition to buffer robustness, we need image robustness. Like its buffer counterpart, image robustness requires that out-of-bounds image loads return zero. That formalizes a guarantee that reasonable hardware already makes. …But it would be no fun if our hardware was reasonable. Running the conformance tests for image robustness, there is a single test failure affecting “mipmapping”. For background, mipmapped images contain multiple “levels of detail”. The base level is the original image; each successive level is the previous level downscaled. When rendering, the hardware selects the level closest to matching the on-screen size, improving efficiency and visual quality. With robustness, the specifications all agree that image loads return… Zero if the X- or Y-coordinate is out-of-bounds Zero if the level is out-of-bounds Meanwhile, image loads on the M1 GPU return… Zero if the X- or Y-coordinate is out-of-bounds Values from the last level if the level is out-of-bounds Uh-oh. Rather than returning zero for out-of-bounds levels, the hardware clamps the level and returns nonzero values. It’s a mystery why. The vendor does not document their hardware publicly, forcing us to rely on reverse engineering to build drivers. Without documentation, we don’t know if this behaviour is intentional or a hardware bug. Either way, we need a workaround to pass conformance. The obvious workaround is to never load from an invalid level: if (level <= levels) { return imageLoad(x, y, level); } else { return 0; } That involves branching, which is inefficient. Loading an out-of-bounds level doesn’t crash, so we can speculatively load and then use a compare-and-select operation instead of branching: vec4 data = imageLoad(x, y, level); return (level <= levels) ? data : 0; This workaround is okay, but it could be improved. While the M1 GPU has combined compare-and-select instructions, the instruction set is scalar. Each thread processes one value at a time, not a vector of multiple values. However, image loads return a vector of four components (red, green, blue, alpha). While the pseudo-code looks efficient, the resulting assembly is not: image_load R, x, y, level ulesel R[0], level, levels, R[0], 0 ulesel R[1], level, levels, R[1], 0 ulesel R[2], level, levels, R[2], 0 ulesel R[3], level, levels, R[3], 0 Fortunately, the vendor driver has a trick. We know the hardware returns zero if either X or Y is out-of-bounds, so we can force a zero output by setting X or Y out-of-bounds. As the maximum image size is 16384 pixels wide, any X greater than 16384 is out-of-bounds. That justifies an alternate workaround: bool valid = (level <= levels); int x_ = valid ? x : 20000; return imageLoad(x_, y, level); Why is this better? We only change a single scalar, not a whole vector, compiling to compact scalar assembly: ulesel x_, level, levels, x, #20000 image_load R, x_, y, level If we preload the constant to a uniform register, the workaround is a single instruction. That’s optimal – and it passes conformance. Blender “Wanderer” demo by Daniel Bystedt, licensed CC BY-SA.
More in programming
As is often the case recently, it’s been an interesting week on security with the NSA’s advisory, rampant speculation on Twitter, and the excellent writeup from Filippo Valsorda. Behind this specific issue, though, is an even more important theme: the rate of security findings is going to continue accelerating over the next several years, and every engineering organization has to figure out a strategy for navigating that. With the hope that it will be useful, this is my high-level summary of the strategy that we’re taking at Imprint. Diagnosis: what’s changed? Before solving a problem, you have to diagnose what’s going wrong. My diagnosis of the current situation is: Attackers are accelerating, getting more sophisticated, and getting cheaper. Since the Eternal September of last year’s winter break when models finally crossed a threshold of being really, really effective at software tasks, they’ve continued to both get better and get cheaper. Combined with the rise of abliterated models, that means that surprisingly effective attacks are available to anyone who wants them and has even a very modest amount of funds. However fast these attackers are today, we should expect them to be multiple times faster every year for at least the next few years. Attackers can and do search further downstream because the highest-value targets are already under so much pressure. You may be a low-value target, and everyone is a low-value target compared to someone else, but the highest-value targets are already under so much attack volume that it’s surprisingly difficult to attack them in a novel way. The reduction of cost means the highest-value targets are even less interesting for the incremental attacker, and lower-value targets are coming under more load as well. The mathematics behind “best-in-class defenses” is shifting. Many of the techniques for securing software are shifting. They are not shifting overnight, but it seems likely that we will have to rework the algorithms defending our software multiple times over the next few years as advances in mathematics accelerate. The majority of defenders have access to more capital and context than attackers. Even though the attacks are getting much cheaper, defenders can benefit equally from every advantage, and only have to defend one company versus having to scan an infinite number of targets. Defenders generally have substantially more resources than any attacker would (perhaps excluding nation-state actors), and critically have access to the full context of their environment to identify and prevent attacks. Capabilities to identify vulnerabilities are substantially improved. With a combination of vendors (e.g. Wiz, Panther, Claude Security, etc.), you can get an excellent stream of potential issues flowing in to evaluate. These tools are increasingly a combination of what’s always worked (e.g. static analysis, monitoring suspicious patterns in SIEM) and what has newly worked over the past 12 months (e.g. excellent foundation models). Designing out categories of weaknesses is vastly easier than it was even a year ago. This one is a bit counter-intuitive, but my experience is that it’s conceptually easier and faster to design out entire categories of problems than to solve the full volume of one-offs. I’ve added a Designing out categories header below to make this argument in more detail. Throughout this piece, when I talk about “designing categories” out, I’m specifically referring to John Ousterhout’s idea of “defining errors out of existence” that he explores in A Philosophy of Software Design. Policy & Operations: what to do about it? The above issues in the diagnosis are intimidating. However, I believe the best approach to addressing them is both fairly compelling and accessible to even very modestly funded companies. There’s no way to solve security; even the very best security companies will be exposed to breaches over time, but I think this is an effective combination of policy and operations to address our collective circumstances: Standardize on highly funded, security-minded vendors. Access to information about vulnerabilities is being directed to a small number of highly visible companies. If you’re not in one, you largely don’t have access to accurate information about security risks. Standardize on vendors with strong access to the latest findings: they are likely to have fixed particularly serious issues before you are aware of the findings. There are legitimate gripes about whether this is a good way for things to be working, but it’s not particularly clear what an effective alternative to the status quo looks like, and strategy’s goal is to protect our company, not to preserve fair competition in the market. Ensure your harness has comprehensive access to context about your setup. At one point, our Cloudflare configuration was not managed via Terraform. It was, in some ways, more convenient that way. However, it meant that static analysis made assumptions about how Cloudflare’s setup interacted with our backend code. Assumptions are the enemy, generating both false findings and missing gaps. We moved Cloudflare into Terraform, and ensured that our Terraform is equally available to our security scanners along with our backend code, clients (web, iOS, Android), our security scanner itself, and other relevant details. The combination of static analysis along with a frontier-class foundation model (e.g. Claude Mythos) is extremely valuable and works extremely well. However, it only works if you have set up your systems to make the entirety of the relevant context available to it. If not, attackers will have more context about your software than you do via inspection, and that is where weaknesses emerge. Automate detection, triaging, and ticketing. Have findings from your various suspicious pattern detection, automated attacking tools, security findings, and package dependency updates flow automatically–with zero human hands involved–into a centralized bucket of issues, enriched with as much relevant context as possible. Handle reconciling new findings into existing issues here. Automate initial resolution in a centralized harness. I’ve previously discussed our centralized harness, and that harness is a load-bearing part of our strategy here. As new issues are identified, immediately kick off resolution of those issues. Now when they reach a human, there is a proposed solution. Sometimes that solution is good enough to merge after reviewing it. Sometimes it’s misguided. In either case, you’re getting a fully-formed view on the problem and at least one option for addressing it. Automate clustering of problems into categories. Every week, have an automated process run to analyze the new findings, and look at the known categories of issues. Automatically enrich the known categories with new findings, and automatically create new clusters with the related issues. Automatically suggest categories of solutions that might support “designing out.” Assign clusters to experienced engineers to design out. For each cluster of problems, assign it to an experienced engineer to reason about how to close the gap permanently by making it effectively impossible to occur in your software. The next section will go into how to do this in more detail, but here let’s focus on the why. You can, sort of, solve one-offs by simply fixing them very quickly, but that still means you have these issues showing up in your software. If they show up, that’s a vulnerability. Then you can argue that we should be using automated code-review scanners to identify and prevent those issues in code review. I think that’s true-ish, but I don’t find it true in practice for a couple reasons. First, code review is inefficient: giving instructions is the slowest and least reliable way of preventing problems versus adding automated lints that are very quick and deterministic, so it’s quite easy for a code review to miss a particular problem, especially if you provide enough of them. This problem applies equally to non-deterministic approaches to solving this in the harness’ software development loop before code review. (If you say, let’s use deterministic ways to provide feedback, then I would say that we’re fully aligned: that is exactly what I mean by designing out.) Second, repurposing code review to introduce a wide variety of constraints tends to drive down cohesion of changes in a way that reduces quality over time. You’re almost always better off solving the categorical problem in one set of pull requests, and then adding the new functionality in a distinct pull request. Automated code review mechanisms almost always couple both concepts into a single change. You can make the argument that your code review should still be providing this feedback, and then the harness should be taking the feedback to solve the categorical problem and then solve the problem it’s actually focused on. I think directionally that’s right, but usually solving the category is sufficiently interesting that it’s a place where you really do want a human involved. Weekly review of the security operating system. Once you have all the above, perform a weekly deep-dive with the folks working on security looking at how the findings, resolutions, and categorical fixes are flowing through the system. These systems can get bottlenecked in so many places, especially early on. You have to keep reviewing the pipelines and triaging fixes. If you adopt these mechanisms, I think you’ll find yourself in a good place to keep accelerating as changes come. Most importantly, as new categories of problems come up, e.g. moving to post-quantum encryption, that is just a new category of problem to fix. Designing out categories of vulnerabilities Alright, so as the final part of this strategy, it’s important to align on what it means to design out a category of vulnerabilities. As an example, I’ll use a perennial favorite: inadvertently logging sensitive fields. This is a category of problem I’ve been dealing with my entire career. I remember once at Stripe in ~2017 arguing that we needed to move to an approach where every single sensitive value was stored in a specific type (e.g. string.SSN and string.PAN) that every logger knew how to handle. That made sense–everyone agreed we should–but who was going to do that massive project? Well, things are different in 2026: I did exactly this project myself at Imprint as a side project over the course of two weeks. It was a good chunk of work, but now we have complete visibility into the full lifecycle of every sensitive value through our codebase: that is what I mean by designing a category out of existence. My approach to this project was: As our automated findings improved and were ticketed, it became clear that one category was lack of complete lifecycle control over sensitive values in our codebase. For example, if a sensitive value was later added to an object, it was possible for that value to be emitted into a log. I worked a handful of one-off findings with Claude to make sure I really understood the problem as it existed in our codebase. This can feel unnecessary, but I think it’s so easy to misunderstand the underlying problem if you don’t dig into a few concrete examples quite deeply. Solving the wrong problem is a great way to waste time. Brainstorm with Claude how we could wholly eliminate this category of problem. This largely came down to: Banning all functions and logging verbs (e.g. %v) that allowed printed objects, moving all existing usage to an exception comment Adding specific types for each type of sensitive field, which log as expected depending on their type, and providing a mix of strategies depending on the type. For example, most of these write to logs as [REDACTED], but some write with a few pieces of data, e.g. [REDACTED] XXX-1234. Less sensitive types offer a .Digest which provides a value that’s stable within an environment using a shared secret within that environment Orchestrate implementing those capabilities, the initial comment-exceptions of existing cases, and then the slice-by-slice migration of the entire codebase such that all exceptions were removed. This took fewer than 200 pull requests to fully implement: some of them were large, and they were sliced based on what would minimize merge conflicts and maximize reviewability for the areas that had felt risky, mostly regarding where a field might be used downstream in data pipelines. This was only possible because our codebase is so highly visible to our harnesses, and because our central harness is highly usable. For example, I must have had 100+ merge conflicts across this project, but I didn’t even think about any of them; they just automatically got fixed within the centralized harness without me being aware they had occurred. I don’t mean to imply that this was easy; it was a lot of work that required a good amount of thinking, but now our codebase has total control over what is used and logged, and we can statically enforce claims about exactly how each kind of sensitive data is used. Our code review doesn’t even have to think about logging sensitive data accidentally, because that category of error cannot be represented in our codebase.
In honor of the upcoming winter season, I designed a set of five crochet snowflakes that hold their shape fairly well without stiffening, as I don't like to stiffen my crochet objects.1 I originally designed these five snowflakes for fingering weight linen yarn, but I decided later to also ensure they worked well with lace weight yarn and size 10 crochet thread. Please do not claim this pattern as your own or sell, copy, or distribute it outside of linking to the pattern on my site or its Ravelry pattern page. You may sell items made from this pattern if you name the pattern and credit me as the designer: Atria Snowflakes by Liz Denys. Thank you so much for respecting my work! This pattern is also available as a pdf. Materials & tools *Note that estimates for the amount of yarn needed are included later in the pattern for each of the snowflakes. Lace weight snowflakes: Lace weight linen yarn or size 10 cotton crochet thread, some suggestions, including twist direction2 information: Ecobutterfly Entwined: GOTS Organic Linen Yarn in 7/2 (lace)3 (s-twist) Maiwa Honest Yarn Organic Linen in lace weight (s-twist) Euroflax linen lace weight (s-twist) Aunt Lydia's Classic 10 crochet thread4 (z-twist) Scheepjes Maxi Sweet Treat/Maxi Sugar Rush/Maxi5 (z-twist) Laughing Hens Daisy Crochet Cotton, (s-twist) 1.75 mm hook Fingering weight snowflakes: Fingering weight linen yarn, some linen yarn suggestions: Quince Sparrow (s-twist) Flax and Twine Daytime Linen in fingering weight (s-twist) Ecobutterfly Entwined: GOTS Organic Linen Yarn in 7/4 fingering weight (s-twist) Maiwa Honest Yarn Organic Linen in fingering weight (s-twist) 2.5 mm hook Other materials & tools: scissors yarn needle for weaving in ends blocking mats and pins a bit of metallic embroidery or sewing thread for adding a hanging loop, optional Stitches & abbreviations I use US crochet terminology. ch - chain: yarn over and pull through the loop on the hook slst - slip stitch: place hook in stitch and pull through both stitch and the loop on the hook sc - single crochet: place hook in stitch and pull through (2 loops on the hook), yarn over and pull through the loops inc - single crochet increase: 2 sc in the same stitch hdc - half double crochet: yarn over, place hook in stitch and pull through (3 loops on the hook), yarn over and pull through all 3 loops dc - double crochet: yarn over, place hook in stitch and pull through (3 loops on the hook), yarn over and pull through 2 loops (2 loops left on the hook), yarn over and draw through the last 2 loops tr - treble crochet: yarn over twice, place hook in stitch and pull through (4 loops on the hook), yarn over and pull through 2 loops (3 loops left on the hook), yarn over and pull through 2 loops (2 loops left on the hook), yarn over and draw through the last 2 loops ch-2-sc-cluster - ch 2, sc in the front of the 2nd chain from your hook. Note: this stitch will twist the hook around the front of the work as the yarn is pulled through the 2nd chain from the hook during the sc. This is intentional! I've also seen this "cluster" type stitch called a "group" stitch sometimes.6 (...) x $num and * (...) * x $num - repeat instructions in the parenthesis $num times (the asterisks are included in long/split lines for increased legibility) {...} - enclosed stitches are all done in the same stitch in the chain space - work stitches around the entire chain instead of in the loops of the chain; this may involve more or fewer stitches than the number of stitches in the chain in the single-chain space - work stitches around the entire chain stitch instead of inside the loops of the chain (yes, even though it's just a single chain stitch) Atria Snowflake I Lace weight Atria Snowflake I: Roughly 4 yards/3.7 meters of lace weight yarn or size 10 crochet thread 1.75 mm hook Approximate completed size: 1 ⅝ inches by 1 ½ inches/4.1 cm by 3.8 cm7 Fingering weight Atria Snowflake I: Roughly 4.3 yards/4 meters of fingering weight yarn 2.5 mm hook Approximate completed size: 2 ⅛ inches by 1 ⅞ inches/5.4 cm by 4.8 cm Instructions for Atria Snowflake I Foundation & round 1: In magic ring8, ch 8 (first 3 chains count as the 1st dc9), dc, (dc, ch 5, dc) x 5. slst into the 3rd chain of 1st dc to join the round10. (12 dc + 6 chain spaces) Round 2: sk the stitch you slipped into to join the last round, {slst, sc, hdc, ch-2-sc-cluster, dc, ch-2-sc-cluster, dc, ch-2-sc-cluster, hdc, sc, slst} in the chain space, ch-2-sc-cluster, sk, * ( sk, {slst, sc, hdc, ch-2-sc-cluster, dc, ch-2-sc-cluster, dc, ch-2-sc-cluster, hdc, sc, slst} in the chain space, ch-2-sc-cluster, sk ) * x 5. slst into the 1st slst in the first chain space to join the round. (48 stitches + 24 ch-2-sc-clusters) Finishing: Cut yarn and pull through the loop. Weave in ends. Gently slide stitches made in chain spaces to even them out in their chain spaces if needed. Block if desired. Atria Snowflake II Lace weight Atria Snowflake II: Roughly 4.7 yards/4.3 meters of lace weight yarn or size 10 crochet thread 1.75 mm hook Approximate completed size: 1 ¾ inches by 1 ½ inches/4.5 cm by 3.8 cm Fingering weight Atria Snowflake II: Roughly 5.5 yards/4.8 meters of fingering weight yarn 2.5 mm hook Approximate completed size: 2 ⅝ inches by 2 ¼ inches/6.7 cm by 5.7 cm Instructions for Atria Snowflake II Foundation & round 1: In a magic ring, ch 2 (this counts as the 1st dc11), 11 dc. slst into the second ch of 1st dc. (12 dc) Round 2: ch 8 (first 3 chains count as the 1st dc), dc into the same stitch as joined in last round, sk, ({dc, ch 5, dc}, sk) x 5. slst into the 3rd chain of 1st dc to join the round. (12 dc + 6 chain spaces) Round 3: sc into the same stitch as you slipped into to join the last round, {hdc, dc, tr, ch-2-sc-cluster, tr, dc, hdc} in the chain space, sc in the next dc, ch-2-sc-cluster, * ( sc in the next dc, {hdc, dc, tr, ch-2-sc-cluster, tr, dc, hdc} in the chain space, sc in the next dc, ch-2-sc-cluster ) * x 5. slst into the 1st sc to join the round. (48 stitches + 12 ch-2-sc-clusters) Finishing: Cut yarn and pull through the loop. Weave in ends. Gently slide stitches made in chain spaces to even them out in their chain spaces if needed. Block if desired. Atria Snowflake III Lace weight Atria Snowflake III: Roughly 6 yards/5.5 meters of lace weight yarn or size 10 crochet thread 1.75 mm hook Approximate completed size: 2 ¼ inches by 2 inches/5.7 cm by 5.1 cm Fingering weight Atria Snowflake III: Roughly 6.9 yards/6.3 meters of fingering weight yarn 2.5 mm hook Approximate completed size: 2 ¾ inches by 2 ⅜ inches/7.0 cm by 6.0 cm Instructions for Atria Snowflake III Foundation & round 1: In a magic ring, 6 sc. slst into the 1st sc. (6 sc) Round 2: ch 8 (first 3 chains count as the 1st dc), dc into the same stitch as joined in last round, ({dc, ch 5, dc}) x 5. slst into the 3rd chain of 1st dc to join the round. (12 dc + 6 chain spaces) Round 3: sc into the same stitch as you slipped into to join the last round, {hdc, dc, tr, ch 1, tr, dc, hdc} in the chain space, sc in the next dc, * ( sc in the next dc, {hdc, dc, tr, ch 1, tr, dc, hdc} in the chain space, sc in the next dc ) * x 5. slst into the 1st sc to join the round. (48 stitches + 6 single-chain spaces) Round 4: sk the stitch you slipped into to join the last round, slst into the next stitch (this is an hdc), 2 slst, {slst, ch-2-sc-cluster, dc, ch-2-sc-cluster, dc, ch-2-sc-cluster, slst} in the single-chain space12, 3 slst, ch-2-sc-cluster, sk, * ( sk, 3 slst, {slst, ch-2-sc-cluster, dc, ch-2-sc-cluster, dc, ch-2-sc-cluster, slst} in the single-chain space13, 3 slst, ch-2-sc-cluster, sk ) * x 5. slst into the slst14 you made to join the past round (the first stitch that was skipped this round). (60 stitches + 24 ch-2-sc-clusters) Finishing: Cut yarn and pull through the loop. Weave in ends. Gently slide stitches made in chain spaces to even them out in their chain spaces if needed. Block if desired. Atria Snowflake IV Lace weight Atria Snowflake IV: Roughly 9.3 yards/8.5 meters of lace weight yarn or size 10 crochet thread 1.75 mm hook Approximate completed size: 3 inches by 2 ½ inches/7.6 cm by 6.4 cm Fingering weight Atria Snowflake IV: Roughly 11.5 yards/10.5 meters of fingering weight yarn 2.5 mm hook Approximate completed size: 3 ¾ inches by 3 ⅛ inches/9.5 cm by 7.9 cm Instructions for Atria Snowflake IV Foundation & round 1: In a magic ring, 6 sc. slst into the 1st sc. (6 sc) Round 2: ch 2 (this counts as the 1st sc), sc into the same stitch joined in last round, 5 inc. slst into the 2nd chain of 1st sc to join the round. (12 sc) Round 3: ch 6 (first 3 chains count as the 1st dc), dc into the same stitch as joined in last round, sk, ({dc, ch 3, dc}, sk) x 5. slst into the 3rd chain of 1st dc to join the round. (12 dc + 6 chain spaces) Round 4: sc into the same stitch as you slipped into to join the last round, {hdc, dc, ch 3, dc, hdc} in the chain space, sc in the next dc, ch 3, * ( sc in the next dc, {hdc, dc, ch 3, dc, hdc} in the chain space, sc in the next dc, ch 3 ) * x 5. slst into the 1st sc to join the round. (36 stitches + 12 chain spaces) Round 5: sk the stitch as you slipped into to join the last round, sc, hdc, {hdc, dc, tr, ch 1, tr, dc, hdc} in the chain space, hdc, sc, sk, {hdc, ch 1, hdc} in the chain space, * ( sk, sc, hdc, {hdc, dc, tr, ch 1, tr, dc, hdc} in the chain space, hdc, sc, sk, {hdc, ch 1, hdc} in the chain space ) * x 5. slst into the 1st sc of this round (second stitch) to join the round. (72 stitches + 12 single-chain spaces) Round 6: sk the stitch you slipped into to join the last round15, slst into the next stitch (this was the 1st hdc in the previous round), slst, ch-2-sc-cluster, sk, slst, {slst, ch-2-sc-cluster, dc, ch-2-sc-cluster, dc, ch-2-sc-cluster, slst} in the single-chain space16, slst, ch-2-sc-cluster, sk, 4 slst, {slst, ch-2-sc-cluster, slst} the single-chain space17, slst, * ( 3 slst, ch-2-sc-cluster, sk, slst, {slst, ch-2-sc-cluster, dc, ch-2-sc-cluster, dc, ch-2-sc-cluster, slst} in the single-chain space18, slst, ch-2-sc-cluster, sk, 4 slst, {slst, ch-2-sc-cluster, slst} in the single-chain space19, slst ) * x 5. slst into the slst20 you made to join the past round (the first stitch that was skipped this round). (96 stitches + 36 ch-2-sc-clusters) Finishing: Cut yarn and pull through the loop. Weave in ends. Gently slide stitches made in chain spaces to even them out in their chain spaces if needed. Block. Atria Snowflake V Lace weight Atria Snowflake V: Roughly 13.9 yards/12.7 meters of lace weight yarn or size 10 crochet thread 1.75 mm hook Approximate completed size: 3 ¾ inches by 3 ⅛ inches/9.5 cm by 7.9 cm Fingering weight Atria Snowflake V: Roughly 16.8 yards/15.4 meters of fingering weight yarn 2.5 mm hook Approximate completed size: 4 ½ inches by 3 ⅞ inches/11.4 cm by 9.8 cm Instructions for Atria Snowflake V Foundation & round 1: In a magic ring, ch 2 (this counts as the 1st dc21), 11 dc. slst into the second ch of 1st dc. (12 dc) Round 2: ch 8 (first 3 chains count as the 1st dc), dc, (dc, ch 5, dc) x 5. slst into the 3rd chain of 1st dc to join the round. (12 dc + 6 chain spaces) Round 3: sc into the same stitch as you slipped into to join the last round, {hdc, dc, tr, ch 3, tr, dc, hdc} in the chain space, sc in the next dc, * ( sc in the next dc, {hdc, dc, tr, ch 3, tr, dc, hdc} in the chain space, sc in the next dc ) * x 5. slst into the 1st sc to join the round. (48 stitches + 6 chain spaces) Round 4: sc into the same stitch as you slipped into to join the last round, 3 sc, {sc, ch 3, 3 tr, ch 1, 3 tr, ch 3, sc} in the chain space, 4 sc, ch 3, * ( 4 sc, {sc, ch 3, 3 tr, ch 1, 3 tr, ch 3, sc} in the chain space, 4 sc, ch 3 ) * x 5. slst into the 1st sc to join the round. (96 stitches + 18 chain spaces + 6 single-chain spaces) Round 5: sk the stitch you slipped into to join the last round22, slst into the next stitch (this was an sc last round and an hdc the round before that), 3 slst, {slst, ch-2-sc-cluster, slst} in the chain space, ch-2-sc-cluster, sk, 2 slst, {slst, ch-2-sc-cluster, dc, ch-2-sc-cluster, dc, ch-2-sc-cluster, slst} in the single-chain space23, 2 slst, ch-2-sc-cluster, sk, {slst, ch-2-sc-cluster, slst} in the chain space, 5 slst, {slst, ch-2-sc-cluster, dc, ch-2-sc-cluster, dc, ch-2-sc-cluster, slst} in the chain space, * ( 5 slst, {slst, ch-2-sc-cluster, slst} in the chain space, ch-2-sc-cluster, sk, 2 slst, {slst, ch-2-sc-cluster, dc, ch-2-sc-cluster, dc, ch-2-sc-cluster, slst} in the single-chain space24, 2 slst, ch-2-sc-cluster, sk, {slst, ch-2-sc-cluster, slst} in the chain space, 5 slst, {slst, ch-2-sc-cluster, dc, ch-2-sc-cluster, dc, ch-2-sc-cluster, slst} in the chain space ) * x 5. slst into the slst25 you made to join the past round (the first stitch that was skipped this round). (156 stitches + 60 ch-2-sc-clusters) Finishing: Cut yarn and pull through the loop. Weave in ends. Gently slide stitches made in chain spaces to even them out in their chain spaces if needed. Block. Blocking In my experiences, Atria Snowflakes I, II, and III don't necessarily need traditional blocking - you may be able to just pull on opposite corners of the snowflakes to pop the stitches into place. Atria Snowflakes IV and V will need to be blocked to pop into the right shape. To block, run snowflakes under cold water and lightly shake off excess water. With pins at the points, stretch snowflakes into shape and affix to blocking mats. Linen and cotton are both cellulose fibers and become stronger when wet, so it's hard to block too aggressively! Let the snowflakes dry completely before removing them from the mats and pins. Adding a hanging loop (optional) To add a loop for hanging, cut a piece of metallic embroidery thread or a yarn you like that's about 7 inches/17.8 cm. Thread it onto a yarn needle, and pull it through the loop atop any of the ch-2-sc-clusters at the end of one of the 6 main points of the snowflake. Hold both ends of the thread and tie a simple overhand knot. To be clear, there's nothing wrong with stiffening crochet designs - it opens up many additional design possibilities! Unfortunately, the downsides of stiffening are too great for me. Starching or sugaring attracts the kinds of unwanted critters that are already all too common in Brooklyn. Stiffening with diluted PVA or wood glue yellows over time, and yellow snowflakes remind me of the kind of snow I'm not nostalgic for. ↩ s-twist yarn will untwist if you are a right-handed crocheter and stay twisted (actually twist a bit more) if you're left-handed; z-twist will untwist if you are a left-handed crocheter and stay twisted (actually twist a bit more) if you're right-handed. Yarn that untwists as you crochet may be harder to hook due to splitting and results in decreased stitch definition like the linen snowflakes in my examples; yarn that stays twisted is easier to hook and results in increased stitch definition. I love linen yarn for its sheen, durability, and stiffness, and I learned to knit over a decade before I learned to crochet, so I am biased towards using linen yarn - even though I am right-handed and almost all linen yarn is s-twist. It's much more common for crochet thread to be z-twist than plant-based yarns, but not all crochet thread is z-twist. ↩ If you get this in a quantity that doesn't come on a cone, I highly recommend rewinding this yarn onto a cone or, at the very least, inserting a cone-like core like the tube from an empty paper towel or toilet paper roll into the center of the ball. Otherwise, you likely will suffer the same frustrating fate I did until I rewound it onto a toilet paper tube - yarn constantly unraveling from both ends while working. ↩ I use Aunt Lydia's primarily because it's very easy for me to find and because it makes sense for me to pick a z-twist crochet thread as a right-handed crocheter. ↩ From Scheepjes: "Did you know that Scheepjes Maxi, Maxi Sweet Treat and Maxi Sugar Rush are identical yarns? The only difference is the meterage supplied per ball." ↩ In my head, I've come to refer to this particular "cluster" stitch as a "triangle" stitch, since it takes up the same space as a ch 3 picot but in a flatter, more defined triangle shape. My mentally calling it a "triangle" stitch inspired the name of this snowflake since one of the design decisions I kept constant across this set was choosing this stitch for all the points. I briefly considered calling this stitch "triangle" in this pattern, but I figured I'd rather keep the name more descriptive of how it's made to be consistent with my larger internal library of stitches that may or may not appear in future patterns. :) ↩ Aunt Lydia's Classic 10 crochet thread is a little thicker than Ecobutterfly Entwined: GOTS Organic Linen Yarn in 7/2, so my crochet thread snowflakes were a little larger than these sizes, and my lace weight linen yarn snowflakes were a little smaller than these sizes. ↩ I actually do a double magic ring every time because it pre-weaves in more of this end (the tradeoff is that it wastes more yarn to do so). Once Upon a Cheerio's tutorial explains double magic ring fairly well, especially how to tighten it, but I start my double magic rings more similarly to how Sarah Stearns's tutorial depicts it. If you really hate magic ring, you could instead ch 4 then slst in 1st ch to create a ring, but I promise that magic ring is not as hard as some people make it out to be. I am not usually a video person, but I learned how to make a magic ring from MJ Carlos's video tutorial. ↩ You could do standing double crochet for first double crochets instead of chains if you really want, but I don't think the difference between chains and double crochets is noticeable enough to bother. While I usually do ch 2 as the 1st dc in magic ring, I prefer the look of ch 3 next to the chain spaces. ↩ You could do an invisible join instead of slip stitches to join rounds if you really wanted to, but while I think it's worth the effort in a simpler fabric, making slightly subtler joins isn't worth the hassle in designs with varied stitches and shaping like these snowflakes. ↩ While I usually do ch 3 for the 1st dc in a round, I find ch 2 works better for me when it's the first stitch in a magic ring of just double crochets. ↩ This is tight for a single-chain space, but creates the desired shaping for the snowflake - more chains would create a larger hole. If you are really struggling to fit all the stitches, it's ok to drop the last slst as the next slst in the treble crochet from the previous round will ensure the point is secured in place. ↩ See footnote 12. ↩ If you're struggling to get your hook into the slst to create a slst to join, you may have a better time making it with a yarn needle instead. Since it's the last stitch in this snowflake, you won't have to join any yarn. To do make this slst in the target slst, cut the yarn, pull it through the loop at the end of the last stitch, thread the end on a small yarn needle, thread it under under the front loop of the target slst from the front of the piece, continue to thread it through the back loop of the target slst then thread it through the back of the last loop at the end of the last stitch you made. ↩ In this round, this would be a slst if it weren't already slipped into to join the round, and here, the slip to join counts as a stitch. ↩ This is tight for a single-chain space, but creates the desired shaping for the snowflake - more chains would create a larger hole. If you are really struggling to fit all the stitches, it's ok to drop the last slst as the next slst in the treble crochet from the previous round will ensure the point is secured in place. ↩ This is tight for a single-chain space, but creates the desired shaping for the snowflake - more chains would create a larger hole. If you are really struggling to fit all the stitches, it's ok to drop the last slst as the next slst in the half double crochet from the previous round will ensure the point is secured in place. ↩ See footnote 16. ↩ See footnote 17. ↩ If you're struggling to get your hook into the slst to create a slst to join, you may have a better time making it with a yarn needle instead. Since it's the last stitch in this snowflake, you won't have to join any yarn. To do make this slst in the target slst, cut the yarn, pull it through the loop at the end of the last stitch, thread the end on a small yarn needle, thread it under under the front loop of the target slst from the front of the piece, continue to thread it through the back loop of the target slst then thread it through the back of the last loop at the end of the last stitch you made. ↩ While I usually do ch 3 for the 1st dc in a round, I find ch 2 works better for me when it's the first stitch in a magic ring of just double crochets. ↩ In this round, this would be a slst if it weren't already slipped into to join the round, and here, the slip to join counts as a stitch. ↩ This is tight for a single-chain space, but creates the desired shaping for the snowflake - more chains would create a larger hole. If you are really struggling to fit all the stitches, it's ok to drop the last slst as the next slst in the treble crochet from the previous round will ensure the point is secured in place. ↩ See footnote 23. ↩ If you're struggling to get your hook into the slst to create a slst to join, you may have a better time making it with a yarn needle instead. Since it's the last stitch in this snowflake, you won't have to join any yarn. To do make this slst in the target slst, cut the yarn, pull it through the loop at the end of the last stitch, thread the end on a small yarn needle, thread it under under the front loop of the target slst from the front of the piece, continue to thread it through the back loop of the target slst then thread it through the back of the last loop at the end of the last stitch you made. ↩
Business are rarely sold. If you build yours with the intent sell, but nobody buys, what are you left running?
SumatraPDF is a PDF reader for Windows and Mac. New in the pre-release builds: Floating selection toolbar After you select text, a small toolbar appears next to the selection with Copy, Read Aloud, Highlight, Underline, Squiggly and Strike Out. The annotation buttons only appear for documents that support annotations. Turn it off with the SelectionToolbar advanced setting. It was ported from the SumatraPDF Plus fork. Clearer CAD / engineering drawings PDFs of CAD and engineering drawings are easier to read, especially when zoomed out. Very thin lines get a minimum width that depends on zoom, and pale gray lines are darkened. Turn it on with the EngineeringDrawingEnhance advanced setting: auto enhances drawings it detects, on enhances every PDF and off is the default. You can also turn it on or off per document with Toggle Engineering Drawing Enhancement (CmdToggleEngineeringDrawingEnhance) in the command palette. More: changes from July 10, 2026 and the full changelog.