<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: codedokode</title><link>https://news.ycombinator.com/user?id=codedokode</link><description>Hacker News RSS</description><docs>https://hnrss.org/</docs><generator>hnrss v2.1.1</generator><lastBuildDate>Sun, 29 Nov 2026 04:29:35 +0000</lastBuildDate><atom:link href="https://hnrss.org/user?id=codedokode" rel="self" type="application/rss+xml"></atom:link><item><title><![CDATA[New comment by codedokode in "Swapping Jolt's sorted collections to a B+tree"]]></title><description><![CDATA[
<p>If you want to do large updates to B+tree, you better do it with bulk operations. I made a prototype on paper and in Python (unfinished, fails most of the tests) to do it. You provide a sorted list of deleted keys and sorted list of inserts and walk the B+ tree once, skipping unaffected branches and editing modified nodes. Not that difficult, but there are lot of small nuances. My prototype was using an immutable tree which adds some complexity.</p>
]]></description><pubDate>Sat, 28 Nov 2026 13:30:45 +0000</pubDate><link>https://news.ycombinator.com/item?id=50677455</link><dc:creator>codedokode</dc:creator><comments>https://news.ycombinator.com/item?id=50677455</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=50677455</guid></item><item><title><![CDATA[New comment by codedokode in "Advice for the next 100 Rust GUIs"]]></title><description><![CDATA[
<p>The artifacts (that look like extra pixels at the bottom of letters) might be related to "signed distance fields" rendering.</p>
]]></description><pubDate>Thu, 26 Nov 2026 17:16:11 +0000</pubDate><link>https://news.ycombinator.com/item?id=50657304</link><dc:creator>codedokode</dc:creator><comments>https://news.ycombinator.com/item?id=50657304</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=50657304</guid></item><item><title><![CDATA[New comment by codedokode in "Advice for the next 100 Rust GUIs"]]></title><description><![CDATA[
<p>> Also, as you can easily see, your code has 2× overdraw, visiting the whole framebuffer roughly from beginning to end twice:<p>Yes I did it for simplicity, as I wanted to get the estimate of how fast or slow can be CPU rendering. Probably I could clear the buffer by small tiles right before rendering text, so that cleared part stays in L1 cache and can be blended faster.<p>I glanced through your code but it also seems to copy the data from a glyph cache into the buffer, it just has more optimizations to skip some parts.<p>> I've heard there are ways to allocate your memory buffers such that you get zero-copy scanout in the fullscreen case (GBM_BO_USE_SCANOUT | GBM_BO_USE_LINEAR or DRM) but I haven't tried Wayland.<p>Maybe, but a maximized window usually leaves some space for task bars, status bars. Also, on a large monitor you typically do not open windows fullscreen. So the rendering goes through a window buffer in shared memory (on Wayland, and X applications often use SHM extension to achieve the same effect).<p>> In particular, my example, "to scroll the contents of a browser window but not the browser chrome," can be handled by redrawing the browser chrome in a different position over part of the scrolled page. I'm not sure how you would design the graphics API to make this simple, but you can clearly do it.<p>Yes it seems that nobody does it these days, so the best you can do is to have two buffers (for the toolbars and for the content) and ask the display compositor to combine them. Which it will do through a memcpy, but if the buffers are in VRAM, the GPU will do the copying.<p>However, while Wayland supports compositing window from subsurfaces, it doesn't support "scrolling" of a surface (displaying the content of a buffer with an offset and wrapping), so you need to redraw the whole buffer on scrolling.</p>
]]></description><pubDate>Thu, 26 Nov 2026 17:08:31 +0000</pubDate><link>https://news.ycombinator.com/item?id=50657239</link><dc:creator>codedokode</dc:creator><comments>https://news.ycombinator.com/item?id=50657239</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=50657239</guid></item><item><title><![CDATA[New comment by codedokode in "Nvidia Reinstates Jensen Huang as CEO"]]></title><description><![CDATA[
<p>Disgusting but this doesn't prove the wife was aware of anything. Also, note that article says that the daughter had cancelled her trip to Seoul - probably because Korean people take such issues more seriously unlike Americans who only care about dollars.</p>
]]></description><pubDate>Tue, 24 Nov 2026 09:48:43 +0000</pubDate><link>https://news.ycombinator.com/item?id=50625963</link><dc:creator>codedokode</dc:creator><comments>https://news.ycombinator.com/item?id=50625963</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=50625963</guid></item><item><title><![CDATA[New comment by codedokode in "Nvidia Reinstates Jensen Huang as CEO"]]></title><description><![CDATA[
<p>A betrayed wife who have supported him for many years when he was not rich yet?</p>
]]></description><pubDate>Mon, 23 Nov 2026 22:22:28 +0000</pubDate><link>https://news.ycombinator.com/item?id=50620245</link><dc:creator>codedokode</dc:creator><comments>https://news.ycombinator.com/item?id=50620245</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=50620245</guid></item><item><title><![CDATA[New comment by codedokode in "Nvidia Reinstates Jensen Huang as CEO"]]></title><description><![CDATA[
<p>You forgot about the victim. Cheaters should burn in hell, or at least get cancelled so that nobody wants to work with them and not be rewarded for cheating.</p>
]]></description><pubDate>Mon, 23 Nov 2026 21:57:05 +0000</pubDate><link>https://news.ycombinator.com/item?id=50619977</link><dc:creator>codedokode</dc:creator><comments>https://news.ycombinator.com/item?id=50619977</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=50619977</guid></item><item><title><![CDATA[New comment by codedokode in "Nvidia Reinstates Jensen Huang as CEO"]]></title><description><![CDATA[
<p>Ridiculous. Cheaters should be punished, not rewarded by society. Think about the victim. What kind of future will there be with such  incentive system?</p>
]]></description><pubDate>Mon, 23 Nov 2026 15:14:36 +0000</pubDate><link>https://news.ycombinator.com/item?id=50613177</link><dc:creator>codedokode</dc:creator><comments>https://news.ycombinator.com/item?id=50613177</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=50613177</guid></item><item><title><![CDATA[New comment by codedokode in "87% of the Anthropic power will come from gas and 11% from coal in 2028"]]></title><description><![CDATA[
<p>Why not use heat from datacenters to heat homes? Or to produce more electricity? Or to heat greenhouses in winter? Looks like free energy.</p>
]]></description><pubDate>Sun, 22 Nov 2026 20:11:29 +0000</pubDate><link>https://news.ycombinator.com/item?id=50603428</link><dc:creator>codedokode</dc:creator><comments>https://news.ycombinator.com/item?id=50603428</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=50603428</guid></item><item><title><![CDATA[New comment by codedokode in "87% of the Anthropic power will come from gas and 11% from coal in 2028"]]></title><description><![CDATA[
<p>Also Wikipedia claims that China plants lot of trees (reforestation project).</p>
]]></description><pubDate>Sun, 22 Nov 2026 20:05:04 +0000</pubDate><link>https://news.ycombinator.com/item?id=50603362</link><dc:creator>codedokode</dc:creator><comments>https://news.ycombinator.com/item?id=50603362</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=50603362</guid></item><item><title><![CDATA[New comment by codedokode in "Advice for the next 100 Rust GUIs"]]></title><description><![CDATA[
<p>I believe your calculations have errors.<p>First, the data is sent to the monitor from a framebuffer. With compositors like Wayland, every window has its own buffer, and when it is damaged (updated), the compositors copies (memcpy) the damaged part from window buffer into the framebuffer using CPU or GPU. As I understand, this part cannot be skipped and the application renders window content into a window buffer so there always will be a memcpy stage to have it actually displayed.<p>For example, if the button changed its color, the program updates button image in window buffer, reports the damaged rectangle and the compositor copies that change into the framebuffer to become visible.<p>Actually compositors use two buffers to prevent tearing, and switch between them on every update so the things might be more complicated.<p>So with this model in mind, updating one line of text in a window buffer is faster than updating the whole buffer.<p>Furthermore, to render the text you need to memcpy the glyphs from glyph cache into their locations. So rendering whole window of text boils down to lot of small memcpys.<p>Also, you mention AVX-512 but I don't think my CPU has it. And when doing lot of 256-bit SIMD the CPU starts throttling to 1GHz-level speed. Also, you mentioned display lists but that requires extra memory compared to my approach.<p>Also, I decided to try to actually benchmark rendering text from a glyph atlas. Luckily, LLMs can write such code in matter of minutes, so I wrote it: <a href="https://pastebin.com/7baP4tWv" rel="nofollow">https://pastebin.com/7baP4tWv</a><p>Results in a VM without a GPU:<p>Buffer 3840 x 2160 px, grid 295 cols x 90 rows = 26550 letters/frame, 10 runs, avg per frame:     7.832 ms, time per letter:   295.0 ns, letters/second:    3390088, pixels/second:     1059.086 Mpx/s.<p>I also godbolt'ed the hot loop in case you are curious about the assembly - it seems to use 128-bit SIMD and unrolled the single glyph rendering loop: <a href="https://godbolt.org/z/1Gh1McKE8" rel="nofollow">https://godbolt.org/z/1Gh1McKE8</a></p>
]]></description><pubDate>Sun, 22 Nov 2026 18:30:02 +0000</pubDate><link>https://news.ycombinator.com/item?id=50602419</link><dc:creator>codedokode</dc:creator><comments>https://news.ycombinator.com/item?id=50602419</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=50602419</guid></item><item><title><![CDATA[New comment by codedokode in "Advice for the next 100 Rust GUIs"]]></title><description><![CDATA[
<p>I agree we need to minimize programming errors - by designing a good reactive retained mode framework.</p>
]]></description><pubDate>Sun, 22 Nov 2026 17:15:41 +0000</pubDate><link>https://news.ycombinator.com/item?id=50601641</link><dc:creator>codedokode</dc:creator><comments>https://news.ycombinator.com/item?id=50601641</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=50601641</guid></item><item><title><![CDATA[New comment by codedokode in "Advice for the next 100 Rust GUIs"]]></title><description><![CDATA[
<p>Let's say you scroll text. I believe rendering one line of text (that became visible) on each frame, and reusing previously rendered lines is faster than rendering all text on every frame. Text rendering is not an easy task.<p>And as I have written above, you can offload compositing (memcpy) to any GPU from 90s while rendering letters is a harder task. Even with glyph cache you need to manage it, upload updates to GPU etc. So much easier to not use GPU for this.</p>
]]></description><pubDate>Sun, 22 Nov 2026 17:10:19 +0000</pubDate><link>https://news.ycombinator.com/item?id=50601575</link><dc:creator>codedokode</dc:creator><comments>https://news.ycombinator.com/item?id=50601575</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=50601575</guid></item><item><title><![CDATA[New comment by codedokode in "Advice for the next 100 Rust GUIs"]]></title><description><![CDATA[
<p>You should try running 5 instances of egui program in a VM without GPU before saying that it is "fast". I tried running PhotoCraft, and it is laggy.</p>
]]></description><pubDate>Sun, 22 Nov 2026 17:08:31 +0000</pubDate><link>https://news.ycombinator.com/item?id=50601545</link><dc:creator>codedokode</dc:creator><comments>https://news.ycombinator.com/item?id=50601545</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=50601545</guid></item><item><title><![CDATA[New comment by codedokode in "Advice for the next 100 Rust GUIs"]]></title><description><![CDATA[
<p>> you start needing to tell the GPU to composite things from a few different textures,<p>Yes, correct, you need to have two buffers - one for the document, another for the toolbar. In this case you need to do compositing. The good thing is that compositing here is just memcpy, and it can be done on CPU and almost on any GPU starting from 90s, no need for Vulkan support or NVIDIA proprietary driver. And compositing (memcpy) is faster than rendering complicated document from scratch. So instead of sending one large buffer to Wayland, you send two smaller buffers ("send" doesn't imply copying here as Wayland uses shared memory).<p>So in a perfect world, the application updates a small part of a buffer with a document in a shared memory, changes Y offset, and CPU or GPU rebulds the window that was scrolled by combining the document and toolbar buffers. Oh, even better, by copying only the document part into a framebuffer because toolbar did not change.<p>So for example, if you are scrolling a text document, with my approach you need to render only one line of text (that became visible) and you reuse previously drawn lines. But with "immediate mode" approach, all visible lines must be re-rendered every frame.<p>URL works now.</p>
]]></description><pubDate>Sun, 22 Nov 2026 16:51:57 +0000</pubDate><link>https://news.ycombinator.com/item?id=50601353</link><dc:creator>codedokode</dc:creator><comments>https://news.ycombinator.com/item?id=50601353</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=50601353</guid></item><item><title><![CDATA[New comment by codedokode in "Advice for the next 100 Rust GUIs"]]></title><description><![CDATA[
<p>> the error-prone cache-invalidation logic<p>Because writing good code is harder than bad code.<p>Let me give an example. I vide-coded a program that renders white and gray frames and it can do it faster than 60fps on one core in a VM with no GPU. However, VS Code in that VM feels like it is running at 5 fps. The scrolling is slow and laggy. Why is that so? Probably because writing good code is harder. And probably they were thinking like you, that redrawing the whole screen is fast enough except in fact it is not.<p>Every time someone says that their framework is fast, they should test it in a VM without a GPU.</p>
]]></description><pubDate>Sun, 22 Nov 2026 16:37:13 +0000</pubDate><link>https://news.ycombinator.com/item?id=50601176</link><dc:creator>codedokode</dc:creator><comments>https://news.ycombinator.com/item?id=50601176</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=50601176</guid></item><item><title><![CDATA[New comment by codedokode in "Advice for the next 100 Rust GUIs"]]></title><description><![CDATA[
<p>I do not see where I suggested to copy the pixels with CPU. With compositors like Wayland, you have a buffer in memory that stores content of a window. Obviously writing a 6-pixel stripe into that buffer (and updating starting Y offset) is faster than over-writing the whole buffer. Now, if that buffer is directly accessibly by GPU, you do not need to copy nothing. And I assume that even poor discrete GPUs can copy that 6 rows with pixels from system RAM to their memory for compositing.<p>Also your URL shows 404 for me.<p>To scroll the content you do not need to copy anything. You can just tell the compositor: "first render rows 6-1000 from this buffer and after that rows 0-5". That would look like the content has scrolled 6px up without a single copied byte. This trick was used by game consoles on 80s.</p>
]]></description><pubDate>Sun, 22 Nov 2026 16:27:53 +0000</pubDate><link>https://news.ycombinator.com/item?id=50601065</link><dc:creator>codedokode</dc:creator><comments>https://news.ycombinator.com/item?id=50601065</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=50601065</guid></item><item><title><![CDATA[New comment by codedokode in "Advice for the next 100 Rust GUIs"]]></title><description><![CDATA[
<p>> there are generally only a few dozen rectangles<p>Only in a hello world application. Every professional editor like GIMP has tons of tiny widgets. And redrawing one tiny widget on mouse over is faster than running the render function.<p>Also, you are assuming that running render function costs nothing while in real-world apps there will be layout calculations (because you don't want to position widgets manually), array iteration (for example, to display a sum and average of values from a 100K element array), text characters layout, calling helper functions, generating SVG for a 10K points graph, some genius might add reading from a file, etc.<p>Yes, writing good code is harder than bad code, especially for a LLM.<p>And if you are on the stage where you need widgets and layout calculation, why not add a dirty flag and damage rectangles as well, I cannot understand.</p>
]]></description><pubDate>Sun, 22 Nov 2026 16:08:43 +0000</pubDate><link>https://news.ycombinator.com/item?id=50600910</link><dc:creator>codedokode</dc:creator><comments>https://news.ycombinator.com/item?id=50600910</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=50600910</guid></item><item><title><![CDATA[New comment by codedokode in "Advice for the next 100 Rust GUIs"]]></title><description><![CDATA[
<p>Maybe 80 MB is only private pages and excludes memory-mapped files. Then the memory usage is calculated wrong. I wish people were using proper metrics and not random number Task Manager shows.</p>
]]></description><pubDate>Sun, 22 Nov 2026 16:03:17 +0000</pubDate><link>https://news.ycombinator.com/item?id=50600862</link><dc:creator>codedokode</dc:creator><comments>https://news.ycombinator.com/item?id=50600862</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=50600862</guid></item><item><title><![CDATA[New comment by codedokode in "Advice for the next 100 Rust GUIs"]]></title><description><![CDATA[
<p>I glanced though the docs; they seem to use proxies for dependency tracking (Vue-like rather than React-like) but for some reason they invented their own language instead of using Rust.</p>
]]></description><pubDate>Sun, 22 Nov 2026 15:34:38 +0000</pubDate><link>https://news.ycombinator.com/item?id=50600610</link><dc:creator>codedokode</dc:creator><comments>https://news.ycombinator.com/item?id=50600610</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=50600610</guid></item><item><title><![CDATA[New comment by codedokode in "Advice for the next 100 Rust GUIs"]]></title><description><![CDATA[
<p>When using Wayland, you have 2 buffers that you render your window into, and they already contain previous window content so why make a cache? Why not simply skip the parts that did not change?<p>The article you are referring to is interesting, but it looks like adding a hack instead of rewriting the code. They also did not make measurements for an older system without a working GPU.<p>> If rebuilding the UI takes a millisecond at most, how much should we care?<p>Because user runs multiple programs, and rendering UI doesn't always take milliseconds, and battery capacity is not infinite. Also programs using GPU typically use lot of extra memory, require slow shader compilation, GPUs often have buggy drivers.<p>Also it would be better if every program used same UI widgets (for example, GTK) rather than have their own set of widgets with missing features like IME support, different hot keys etc.<p>Also, what is the advantage of immediate mode UI over proper GUI reactive framework with convenient declarative syntax? I see no advantages.</p>
]]></description><pubDate>Sun, 22 Nov 2026 15:14:49 +0000</pubDate><link>https://news.ycombinator.com/item?id=50600424</link><dc:creator>codedokode</dc:creator><comments>https://news.ycombinator.com/item?id=50600424</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=50600424</guid></item></channel></rss>