<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Hacker News: exDM69</title><link>https://news.ycombinator.com/user?id=exDM69</link><description>Hacker News RSS</description><docs>https://hnrss.org/</docs><generator>hnrss v2.1.1</generator><lastBuildDate>Thu, 27 Aug 2026 19:50:38 +0000</lastBuildDate><atom:link href="https://hnrss.org/user?id=exDM69" rel="self" type="application/rss+xml"></atom:link><item><title><![CDATA[New comment by exDM69 in "Rust SIMD on the GPU"]]></title><description><![CDATA[
<p>> I wonder how much easier/better the code would have been to write with portable_simd ..<p>I had a quick glance of the code and it seems to use mostly basic arithmetic instructions on fixed width simd vectors using some helper macros like SIMD_MUL(x, y) for _mm_mul_ps, etc. Some explicit simd intrinsics code for stuff like sin.<p>That would've been pretty easy to write with portable_simd in Rust or the equivalent C/C++ language extensions (or maybe C++26 std::simd).<p>You'd just use f32x4 (or add a typedef with attribute in C++) and then use x*y instead of SIMD_MUL.<p>For basic stuff like this, you should get the exact same generated code.<p><a href="https://clang.llvm.org/docs/LanguageExtensions.html#vectors-and-extended-vectors" rel="nofollow">https://clang.llvm.org/docs/LanguageExtensions.html#vectors-...</a></p>
]]></description><pubDate>Mon, 17 Aug 2026 14:56:19 +0000</pubDate><link>https://news.ycombinator.com/item?id=49332102</link><dc:creator>exDM69</dc:creator><comments>https://news.ycombinator.com/item?id=49332102</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=49332102</guid></item><item><title><![CDATA[New comment by exDM69 in "Rust SIMD on the GPU"]]></title><description><![CDATA[
<p>> also think this is a deployment problem, not a build problem ...<p>This I agree with, deploying and running code for the correct cpu is a problem with no established solution.<p>As for actually writing the code, portable_simd is great. You need to adjust simd width and compiler config for the cpu you deploy to and fill in the blanks with intrinsics. Which is much less work per target than writing it all with raw intrinsics if you are deploying to more than one target.</p>
]]></description><pubDate>Wed, 12 Aug 2026 06:58:36 +0000</pubDate><link>https://news.ycombinator.com/item?id=49268734</link><dc:creator>exDM69</dc:creator><comments>https://news.ycombinator.com/item?id=49268734</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=49268734</guid></item><item><title><![CDATA[New comment by exDM69 in "Rust SIMD on the GPU"]]></title><description><![CDATA[
<p>> The second part of the problem is how you find the native vector length, so you can instantiate the generic function. IIRC this isn't even exposed in portable_simd and you have to use a seperate crate to get it.<p>This is trivial (but not pretty!) to do with something like `#[cfg(target_feature = "avx2")] const SIMD_WIDTH: usize = 8`. You need a few lines of ugly cfg logic to configure this.<p>A somewhat orthogonal and much more difficult problem is how to select it at runtime. You would either need to have different binaries built with different compiler options, link object files built with different compiler options to same binary, or dynamically link the correct code at runtime.<p>This is actually one of the (IMO only) cases where intrinsics are more practical: you can use `_mm256_add_ps` from AVX2 intrinsics regardless of whether you've configured your compiler to support AVX2 or not. As long as you check at runtime before calling the code so you don't get illegal instruction exceptions.</p>
]]></description><pubDate>Tue, 11 Aug 2026 09:39:13 +0000</pubDate><link>https://news.ycombinator.com/item?id=49255488</link><dc:creator>exDM69</dc:creator><comments>https://news.ycombinator.com/item?id=49255488</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=49255488</guid></item><item><title><![CDATA[New comment by exDM69 in "Rust SIMD on the GPU"]]></title><description><![CDATA[
<p>I can and I do use this is "actual code" and I've got benchmarks to prove that it's got better throughput (for the particular use case, don't extrapolate from there) and the same applies to AVX2 and AVX512: twice the native vector width has ~20% better throughput (ie. using `f32x32` on AVX-512).<p>I pass in the vector width as a generic parameter like this:<p><pre><code>    fn do_simd_stuff<const N: usize>(x: Simd<f32, N>) { x.mul_add(x+x, x*x); }
</code></pre>
With this I can easily benchmark the same code for any vector width. I can also do some compile time heuristics to choose the vector width based on what's available on the compile target CPU.<p>> you run out of registers and spill all over the place<p>As usual when optimizing SIMD code, you should keep an eye on the generated disassembly and the benchmark results and watch for register pressure and the other usual things.<p>I'm definitely NOT saying that you always get the best perf by using 2x SIMD width, but in this particular case it was so.<p>This is much much easier to do with portable_simd than if you'd write the same with intrinsics, you can change the SIMD width without having to rewrite all your code (e.g. changing from SSE `_mm_add_ps` to AVX `_mm256_add_ps` etc).<p>It's still a partial solution, you still need to drop down to intrinsics for some special instructions every now and then (which is easy), but in my projects this accounts for much less than 1% of the lines of code. Not applicable everywhere of course.</p>
]]></description><pubDate>Tue, 11 Aug 2026 09:03:54 +0000</pubDate><link>https://news.ycombinator.com/item?id=49255217</link><dc:creator>exDM69</dc:creator><comments>https://news.ycombinator.com/item?id=49255217</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=49255217</guid></item><item><title><![CDATA[New comment by exDM69 in "Rust SIMD on the GPU"]]></title><description><![CDATA[
<p>Counter question: why shouldn't it be portable?<p>It's definitely a 80% solution where you occasionally need to drop down to intrinsics (at zero runtime perf cost) for CPU specific instructions.<p>But just having vector types, arithmetic, swizzling, loads and stores will go a long way for basic tasks.<p>And with generics you can write code that is type and width agnostic. No need to rewrite your code of you want to go from SSE to AVX512, just change from f32x4 to f32x16 (or use generics) and you are done.</p>
]]></description><pubDate>Tue, 11 Aug 2026 07:20:06 +0000</pubDate><link>https://news.ycombinator.com/item?id=49254491</link><dc:creator>exDM69</dc:creator><comments>https://news.ycombinator.com/item?id=49254491</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=49254491</guid></item><item><title><![CDATA[New comment by exDM69 in "Rust SIMD on the GPU"]]></title><description><![CDATA[
<p>> They specifies a constant SIMD width so it's non-portable.<p>This is incorrect, you can use vectors wider than native SIMD width and the compiler will break them down to register size of the target cpu.<p>In fact it's sometimes better to used wider than native width, in some applications I see 20% better throughput with f32x16 (512 bits) on an AVX2 CPU (256 bits). It is kinda like loop unrolling it.</p>
]]></description><pubDate>Tue, 11 Aug 2026 07:08:37 +0000</pubDate><link>https://news.ycombinator.com/item?id=49254417</link><dc:creator>exDM69</dc:creator><comments>https://news.ycombinator.com/item?id=49254417</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=49254417</guid></item><item><title><![CDATA[New comment by exDM69 in "Third Drone Shot Down in Three Days in Romanian Territory"]]></title><description><![CDATA[
<p>> misdirect Ukrainian drones toward NATO airspace (which has happened).<p>Claims to such effect has been made in public by reputable persons but they are not very credible nor has any supporting evidence been shown in public.<p>Drones getting lost due to GNSS <i>jamming</i> is happening.<p>But intentional misdirection towards a target would require GNSS <i>spoofing</i> capabilities over an impractically large area and that the drones would be susceptible to simple spoofing. They have satellite navigation, inertial navigation, terrain following cameras and listen to ground based radio sources like cell towers and are designed to operate in hostile RF environment. Just sending a fake GPS signal (several of them) won't make the drone divert to a specific target or direction.<p>I'm not buying the misdirection story until more compelling evidence is made public.</p>
]]></description><pubDate>Sun, 26 Jul 2026 16:16:26 +0000</pubDate><link>https://news.ycombinator.com/item?id=49059601</link><dc:creator>exDM69</dc:creator><comments>https://news.ycombinator.com/item?id=49059601</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=49059601</guid></item><item><title><![CDATA[New comment by exDM69 in "DARPA, U.S. Air Force fly AI-controlled F-16"]]></title><description><![CDATA[
<p>From what I have read (from unreliable sources), Ukrainian fighter pilots tried this a few years back and stopped due to too many losses.<p>To engage a slow flying drone with cannons from a fighter jet, they have to get really close while flying close to stall speed. They had some success in shooting down drones but the explosion and the debris caused several lost fighters.<p>Maybe something like a Embraer Super Tucano turboprop fighter with a gunpod could work. But that has very little other use in the battlefield.</p>
]]></description><pubDate>Fri, 24 Jul 2026 08:34:09 +0000</pubDate><link>https://news.ycombinator.com/item?id=49032805</link><dc:creator>exDM69</dc:creator><comments>https://news.ycombinator.com/item?id=49032805</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=49032805</guid></item><item><title><![CDATA[New comment by exDM69 in "Everyone should know SIMD"]]></title><description><![CDATA[
<p>The example code in this article is using Zig's portable SIMD features. Similar features are available for C/C++ (GCC/Clang extension) [0], (nightly) Rust [1] and C++26 [2].<p>All of these provide a similar set of features and you can use normal arithmetic operations (+, -, *, etc) for SIMD vectors. Together with templates/generics you can also write code that can deal with any vector width. These get compiled to LLVM vector types and will generally give you pretty good generated code.<p>This is a very good way of writing basic SIMD code and has the benefit that your code can be compiled to multiple instruction sets. I've been working on a project that can compile down to SSE2, AVX2, AVX-512 and NEON, with just a change of compiler options. Somewhat surprisingly I get the best performance by using 2x the native vector width (ie. f32x16 = 512 bits on 256 bit AVX2), which is kinda like unrolling the loop once.<p>There are some caveats, though. You will need to keep an eye on the generated assembly code to make sure you're on the happy path. You will inevitably need to drop down to ISA specific intrinsics every now and then (for that fast reciprocal square root with `__mm_rsqrt_ps` etc).<p>As an example I needed to do a gather load from an array of fp16's on AVX2, which does not do 16 bit loads. Rust's `Simd::gather_select` takes 64 bit usize as the index but AVX2 doesn't do 64 bit indices. But as long as I did all the index arithmetic in 32 bits and cast to usize at the last second, the compiler did what I wanted. But you need to kinda know what is available in the ISA to stay on the happy path. Not really an issue with arithmetic.<p>I'm sure that an experienced SIMD programmer can get better performance by writing intrinsics manually (say 5-20% better) but I'm already at 3-6x better than the scalar implementation I started with. And you'd have to write (and benchmark) the code for each ISA separately, meaning that you'd spend at least five times more time with it (and have 5x more code to maintain).<p>[0] <a href="https://gcc.gnu.org/onlinedocs/gcc-4.6.1/gcc/Vector-Extensions.html" rel="nofollow">https://gcc.gnu.org/onlinedocs/gcc-4.6.1/gcc/Vector-Extensio...</a>
[1] <a href="https://doc.rust-lang.org/nightly/std/simd/index.html" rel="nofollow">https://doc.rust-lang.org/nightly/std/simd/index.html</a>
[2] <a href="https://en.cppreference.com/cpp/numeric/simd" rel="nofollow">https://en.cppreference.com/cpp/numeric/simd</a></p>
]]></description><pubDate>Thu, 23 Jul 2026 08:11:02 +0000</pubDate><link>https://news.ycombinator.com/item?id=49018335</link><dc:creator>exDM69</dc:creator><comments>https://news.ycombinator.com/item?id=49018335</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=49018335</guid></item><item><title><![CDATA[New comment by exDM69 in "Everyone should know SIMD"]]></title><description><![CDATA[
<p>> The best SIMD optimizations likely require changing your data format from AoS to SoA.<p>We do have gather load instructions in SIMD instruction sets these days (AVX2 and newer), so AoS vs SoA is not nearly as important as it was once.<p>Scatter stores are also available but only in newer CPUs.</p>
]]></description><pubDate>Thu, 23 Jul 2026 07:42:15 +0000</pubDate><link>https://news.ycombinator.com/item?id=49018132</link><dc:creator>exDM69</dc:creator><comments>https://news.ycombinator.com/item?id=49018132</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=49018132</guid></item><item><title><![CDATA[New comment by exDM69 in "Everyone should know SIMD"]]></title><description><![CDATA[
<p>> Is the `@reduce()` function in the example a special...<p>Yes, it is. In SIMD you can do a reduce for a commutative function in O(log N) steps. Sum, product, min, max, all, any, etc.<p>Although in this case it might be better if you just take the mask (vector of booleans), convert it to a bitmask and check if it is (non-) zero.<p>If the language provides it, you might also use .all() or .any() for a mask.</p>
]]></description><pubDate>Thu, 23 Jul 2026 07:37:25 +0000</pubDate><link>https://news.ycombinator.com/item?id=49018085</link><dc:creator>exDM69</dc:creator><comments>https://news.ycombinator.com/item?id=49018085</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=49018085</guid></item><item><title><![CDATA[New comment by exDM69 in "Airport Simulator"]]></title><description><![CDATA[
<p>Thanks for listening to feedback. Seems like you've made many improvements since yesterday.<p>I played a few more rounds today. Fun!</p>
]]></description><pubDate>Tue, 21 Jul 2026 15:16:56 +0000</pubDate><link>https://news.ycombinator.com/item?id=48993407</link><dc:creator>exDM69</dc:creator><comments>https://news.ycombinator.com/item?id=48993407</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48993407</guid></item><item><title><![CDATA[New comment by exDM69 in "Airport Simulator"]]></title><description><![CDATA[
<p>Absolutely delightful, just played a few rounds.<p>I really love ATC games and the "draw it by hand" aspect makes this kinda funny. Maybe I need to try with a real mouse, kinda slow on a trackpad. For a more serious entrant in this genre (with speeds, altitudes and radio navigation), check out Endless ATC on Steam.<p>I landed some 40 flights and made it near the top of the leaderboard.<p>The scoreboard is taking too much screen space and occluding the planes, would be better to have scores at the top or bottom.</p>
]]></description><pubDate>Mon, 20 Jul 2026 12:41:59 +0000</pubDate><link>https://news.ycombinator.com/item?id=48978062</link><dc:creator>exDM69</dc:creator><comments>https://news.ycombinator.com/item?id=48978062</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48978062</guid></item><item><title><![CDATA[New comment by exDM69 in "MicroUI – A tiny, portable, immediate-mode UI library written in ANSI C"]]></title><description><![CDATA[
<p>That's the whole point!<p>You plug it into <i>your</i> project and it can be rendered on anything that can push pixels and/or triangles to the screen. Events from windowing system go in, list of triangles comes out.<p>This is intended to be used with OpenGL, Vulkan, D3D and other graphics environment and used in cases where integrating a "real" GUI toolkit would be more trouble than it's worth.<p>Other popular libs like Dear Imgui or Egui work the same way.</p>
]]></description><pubDate>Wed, 17 Jun 2026 13:33:52 +0000</pubDate><link>https://news.ycombinator.com/item?id=48570352</link><dc:creator>exDM69</dc:creator><comments>https://news.ycombinator.com/item?id=48570352</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48570352</guid></item><item><title><![CDATA[New comment by exDM69 in "Ask HN: What are you working on? (June 2026)"]]></title><description><![CDATA[
<p>I started writing a software triangle rasterizer. Not sure exactly why, but I just felt like doing it.<p>Like many software rasterizer projects I used Fabian Giesen's software rasterizer blog series [0] as the baseline.<p>For solid color triangles with depth testing my 10+ year old laptop achieve ~3.2 Gpixels/s fill rate, which is above 80% of the available memory bandwidth (~26 GiB/s at 64 bits per pixel), using memset as the baseline comparison.<p>I used Rust and std::simd. The code can be compiled for SSE2, NEON, AVX2 or AVX512 by changing compiler parameters. The inner loop uses 16-wide vectors (512 bits) although my computer only has 8-wide AVX2, but the compiler deals with that. I used generics so I can change vector width easily and have multiple vector widths in the same binary for benchmarking. 16-wide is about 10-20% faster than 8-wide. I was excited to see that AVX masked store instructions get used even though I did not explicitly write masked stores in the code. I spent a lot of time reading the disassembly of the generated code and it's very tight.<p>The performance falls off a cliff (170 Mpixels/s) once I introduce a "shader" in the inner loop because it is not SIMD friendly (one pixel at a time, not 16 pixels). But that is fine, I am intending to use this with visibility buffer style rendering (store integer triangle id's in color buffer) and/or software occlusion culling (depth buffer only). Neither technique need anything more than solid colors and z-buffer.<p>[0] <a href="https://fgiesen.wordpress.com/2013/02/17/optimizing-sw-occlusion-culling-index/" rel="nofollow">https://fgiesen.wordpress.com/2013/02/17/optimizing-sw-occlu...</a></p>
]]></description><pubDate>Mon, 15 Jun 2026 14:36:04 +0000</pubDate><link>https://news.ycombinator.com/item?id=48541933</link><dc:creator>exDM69</dc:creator><comments>https://news.ycombinator.com/item?id=48541933</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48541933</guid></item><item><title><![CDATA[New comment by exDM69 in "How I leared what a decoupling capacitor is for, the hard way"]]></title><description><![CDATA[
<p>Slightly related note, the pictures in the articles show a handheld digital oscillscope. It's an Owon HDS200 series oscilloscope with signal generator and they are amazing and the lower frequency models are quite inexpensive.<p>I got myself one earlier this year and it does what it says on the tin. It can also be controlled from a computer via USB serial connection using a text based protocol (albeit poorly documented and a bit buggy). I used some python scripts to program the signal generator and then capture some measurements from the scope to check the frequency responses of some analog electronics circuits for guitar.<p>There is a small community around, there are a few repos on GitHub for using them and also this very long eevblog thred.<p><a href="https://www.eevblog.com/forum/testgear/owon-hds-200-handheld-oscilloscope-w-builtin-dmmawg/" rel="nofollow">https://www.eevblog.com/forum/testgear/owon-hds-200-handheld...</a></p>
]]></description><pubDate>Tue, 28 Apr 2026 13:05:22 +0000</pubDate><link>https://news.ycombinator.com/item?id=47934019</link><dc:creator>exDM69</dc:creator><comments>https://news.ycombinator.com/item?id=47934019</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47934019</guid></item><item><title><![CDATA[New comment by exDM69 in "Ask HN: Any interesting niche hobbies?"]]></title><description><![CDATA[
<p>> You can play with sensors (acidity, humidity etc)<p>Can you share some useful sensors? Any good pH sensor that can work for some period of time without manual maintenance (cleaning the probes etc)?</p>
]]></description><pubDate>Thu, 09 Apr 2026 09:09:22 +0000</pubDate><link>https://news.ycombinator.com/item?id=47701078</link><dc:creator>exDM69</dc:creator><comments>https://news.ycombinator.com/item?id=47701078</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47701078</guid></item><item><title><![CDATA[New comment by exDM69 in "Ask HN: Any interesting niche hobbies?"]]></title><description><![CDATA[
<p>Great looking instruments.<p>I've built half a dozen similar box guitars, it's such a fun little thing to build.<p>Do I see a piezo disk under the bridge in the 3rd instrument? Do you use some kind of preamp with it?<p>I have been recently experimenting with different kinds of piezo pickups [0] and  preamp electronics for them. I've figured out a pretty nice JFET based circuit for the preamp and ordered tiny 13x13mm PCBs with tiny SMT components assembled and it works pretty well (but needs a second revision). They mount directly on the volume potentiometer and fit in a small space.<p>The one thing I haven't figured out yet is grounding the electronics. In a typical electric guitar you ground the electronics by touching the (grounded) strings, but that doesn't work very well (at all) with slide guitar when your left hand has got a bottle neck slide on it (made of glass or ceramic which is an insulator).<p>Drop a message below if you want to geek out more about home made guitars and/or related electronics. Depending on your location I could also send some preamp PCBs your way.<p>[0] <a href="https://hazeguitars.com/blog/piezo-pickups-evolve" rel="nofollow">https://hazeguitars.com/blog/piezo-pickups-evolve</a>  (not my site)</p>
]]></description><pubDate>Thu, 09 Apr 2026 08:26:38 +0000</pubDate><link>https://news.ycombinator.com/item?id=47700771</link><dc:creator>exDM69</dc:creator><comments>https://news.ycombinator.com/item?id=47700771</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47700771</guid></item><item><title><![CDATA[New comment by exDM69 in "Bubble Sorted Amen Break"]]></title><description><![CDATA[
<p>That's a fun two minutes for any computer scientist drum and bass fan.</p>
]]></description><pubDate>Thu, 12 Mar 2026 17:32:08 +0000</pubDate><link>https://news.ycombinator.com/item?id=47354374</link><dc:creator>exDM69</dc:creator><comments>https://news.ycombinator.com/item?id=47354374</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47354374</guid></item><item><title><![CDATA[New comment by exDM69 in "An interactive intro to quadtrees"]]></title><description><![CDATA[
<p>I have shared the trick in this thread above.</p>
]]></description><pubDate>Sat, 28 Feb 2026 10:31:17 +0000</pubDate><link>https://news.ycombinator.com/item?id=47193376</link><dc:creator>exDM69</dc:creator><comments>https://news.ycombinator.com/item?id=47193376</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47193376</guid></item></channel></rss>